PHP file execution — Video

PHP File Execution [youtube=http://www.youtube.com/watch?v=oJmZJlLF2yo&hl=en_US&fs=1&rel=0] Explanation The files addition/subtraction .php was executed after making it executable using chmod command and adding #!/usr/bin/php as the first line of each files.

subtraction using PHP

subtraction #!/usr/bin/php # Author : Jeffrin # jeffrin@rocketmail.com # License GNU GPL V3 # usage : php subtraction.php <?php $f=’1′; $s=’1′; echo $f – $s ; echo “\n”; ?> output Like $./subtraction.php # Author : Jeffrin # jeffrin@rocketmail.com # License GNU GPL V3 # usage : php subtraction.php 0 $

SUB – Subtract

| SUB instruction | (gdb) disass Dump of assembler code for function *__GI___poll: 0x00007fc50ab670b0 : sub $0x28,%rsp 0x00007fc50ab670b4 : mov 0x29c52e(%rip),%eax # 0x7fc50ae035e8 0x00007fc50ab670ba : test %eax,%eax 0x00007fc50ab670bc : jne 0x7fc50ab670d5 0x00007fc50ab670be : movslq %edx,%rdx 0x00007fc50ab670c1 : mov $0x7,%eax 0x00007fc50ab670c6 : syscall => 0x00007fc50ab670c8 : cmp $0xfffffffffffff000,%rax 0x00007fc50ab670ce : ja 0x7fc50ab67121 0x00007fc50ab670d0 : add $0x28,%rsp …

What is a SYSENTER instruction ?

ABOUT sysenter instruction The SYSENTER instruction is part of the “Fast System Call” facility introduced on the Pentium(R) II processor. The SYSENTER instruction is optimized to provide the maximum performance for transitions to protection ring 0 (CPL 0). The SYSENTER instruction sets the following registers according to values specified by the operating system in certain …

SYSENTER instruction.. Pentium II..

| sysenter instruction | (gdb) disass Dump of assembler code for function __kernel_vsyscall: 0xb780b414 : push %ecx 0xb780b415 : push %edx 0xb780b416 : push %ebp 0xb780b417 : mov %esp,%ebp 0xb780b419 : sysenter 0xb780b41b : nop 0xb780b41c : nop 0xb780b41d : nop 0xb780b41e : nop 0xb780b41f : nop 0xb780b420 : nop 0xb780b421 : nop 0xb780b422 : …

NOP machine instruction

| Cracking | (gdb) disass Dump of assembler code for function main: 0x0000000000400494 : push %rbp 0x0000000000400495 : mov %rsp,%rbp 0x0000000000400498 : nop => 0x0000000000400499 : jmp 0x400498 End of assembler dump. (gdb) #include<stdio.h> main () { while (1) asm(“nop”); } NOPs are often involved when cracking software that checks for serial numbers, specific hardware …