Wednesday 15 July 2015

php - Execute a binary string with a "Program execution Functions" (exec, system, etc ...) -



php - Execute a binary string with a "Program execution Functions" (exec, system, etc ...) -

is possible execute binary string "program execution functions" (exec, system, etc ...) ?

http://php.net/manual/en/ref.exec.php

for example, next file php script binary "hello, world" program. written in c:

<?php $file = fopen(__file__, 'rb'); fseek($file, __compiler_halt_offset__); $lastlinefromresult = exec(stream_get_contents($file), $output, $returnvar); print_r([$lastlinefromresult, $output, $returnvar]); __halt_compiler(); elf\00\00\00\00\00\00\00\00\00\00>\00\00\00\00@\00\00\00\00\00@\00\00\00\00\00\00\00\a8\00\00\00\00\00\00\00\00\00\00@\008\00\00@\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00@\00@\00\00\00\00\00@\00@\00\00\00\00\00\c0\00\00\00\00\00\00\c0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00@\00\00\00\00\00\dc\00\00\00\00\00\00\dc\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\e0\00\00\00\00\00\00\e0`\00\00\00\00\00\e0`\00\00\00\00\000\00\00\00\00\00\008\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\f8\00\00\00\00\00\00\f8`\00\00\00\00\00\f8`\00\00\00\00\00\d0\00\00\00\00\00\00\d0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00@\00\00\00\00\00d\00\00\00\00\00\00\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00p\e5td\00\00\00\b4\00\00\00\00\00\00\b4@\00\00\00\00\00\b4@\00\00\00\00\004\00\00\00\00\00\00\004\00\00\00\00\00\00\00\00\00\00\00\00\00\00q\e5td\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00/lib64/ld-linux-x86-64.so.2\00\00\00\00\00\00\00\00\00\00gnu\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00gnu\00\91pd;4t\a3\9f\df-\b68lf&u\8e\f3\c1\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00$\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00libc.so.6\00printf\00__libc_start_main\00__gmon_start__\00glibc_2.2.5\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00ui \00\00\003\00\00\00\00\00\00\00\c8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00h\83\ech\8b \00h\85\c0t\e8c\00\00\00h\83\c4\c3\00\00\00\00\00\00\00\00\00\00\00\00\00\00\ff5 \00\ff% \00@\00\ff% \00h\00\00\00\00\e9\e0\ff\ff\ff\ff%\fa \00h\00\00\00\e9\d0\ff\ff\ff\ff%\f2 \00h\00\00\00\e9\c0\ff\ff\ff1\edi\89\d1^h\89\e2h\83\e4\f0pti\c7\c0\90@\00h\c7\c1 @\00h\c7\c7@\00\e8\b7\ff\ff\ff\f4fd\00\00\b8 `\00uh- `\00h\83\f8h\89\e5v\b8\00\00\00\00h\85\c0t]\bf `\00\ff\e0f\84\00\00\00\00\00]\c3fffff.\84\00\00\00\00\00\be `\00uh\81\ee `\00h\c1\feh\89\e5h\89\f0h\c1\e8?h\c6h\d1\fet\b8\00\00\00\00h\85\c0t]\bf `\00\ff\e0\00]\c3fd\00\00\80=i \00\00uuh\89\e5\e8n\ff\ff\ff]\c66 \00\f3\c3@\00\bf\f0`\00h\83?\00u\eb\93\00\b8\00\00\00\00h\85\c0t\f1uh\89\e5\ff\d0]\e9z\ff\ff\ffuh\89忤@\00\b8\00\00\00\00\e8\c7\fe\ff\ff\b8\00\00\00\00]\c3awa\89\ffavi\89\f6aui\89\d5atl\8d%\a8 \00uh\8d-\a8 \00sl)\e51\dbh\c1\fdh\83\ec\e8u\fe\ff\ffh\85\edt\84\00\00\00\00\00l\89\eal\89\f6d\89\ffa\ff\dch\83\c3h9\ebu\eah\83\c4[]a\a]a^a_\c3ff.\84\00\00\00\00\00\f3\c3\00\00h\83\ech\83\c4\c3\00\00\00\00\00hello, world\00\00\00\00;0\00\00\00\00\00\00\fe\ff\ff|\00\00\00\\fe\ff\ffl\00\00\00r\ff\ff\ff\a4\00\00\00l\ff\ff\ff\c4\00\00\00\dc\ff\ff\ff\00\00\00\00\00\00\00\00\00zr\00x\90\00\00\00\00\00\00\fe\ff\ff*\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00zr\00x\90\00\00$\00\00\00\00\00\00\98\fd\ff\ff@\00\00\00\00fjw\80\00?;*3$"\00\00\00\00\00\00\00d\00\00\00\a6\fe\ff\ff\00\00\00\00a\86c u\00\00\00d\00\00\00d\00\00\00\a0\fe\ff\ffe\00\00\00\00b\8fe\8ee \8de(\8ch0\86h8\83m@l8a0a(b bbb\00\00\00\00\ac\00\00\00\c8\fe\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e0@\00\00\00\00\00\c0@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a8@\00\00\00\00\00 \00\00\00\00\00\00\00\94@\00\00\00\00\00\00\00\00\00\00\00\00\e0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f5\fe\ffo\00\00\00\00`@\00\00\00\00\00\00\00\00\00\00\00\00\e0@\00\00\00\00\00\00\00\00\00\00\00\00\80@\00\00\00\00\00 \00\00\00\00\00\00\00?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\d0`\00\00\00\00\00\00\00\00\00\00\00\00h\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00`@\00\00\00\00\00\00\00\00\00\00\00\00h@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\fe\ff\ffo\00\00\00\00(@\00\00\00\00\00\ff\ff\ffo\00\00\00\00\00\00\00\00\00\00\00\f0\ff\ffo\00\00\00\00 @\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e6@\00\00\00\00\00\f6@\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00gcc: (debian 4.9.1-19) 4.9.1\00gcc: (debian 4.8.3-13) 4.8.3\00\00.symtab\00.strtab\00.shstrtab\00.interp\00.note.abi-tag\00.note.gnu.build-id\00.gnu.hash\00.dynsym\00.dynstr\00.gnu.version\00.gnu.version_r\00.rela.dyn\00.rela.plt\00.init\00.text\00.fini\00.rodata\00.eh_frame_hdr\00.eh_frame\00.init_array\00.fini_array\00.jcr\00.dynamic\00.got\00.got.plt\00.data\00.bss\00.comment\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00<@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00`@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\80@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e0@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 @\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00(@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00h@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00`@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a8@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\d0@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\94@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\b4@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e8@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\c8`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\d0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f1\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00@@\00\00\00\00\00\00\00\00\00\00\00\00\00.\00\00\00\00 \00\80@\00\00\00\00\00\00\00\00\00\00\00\00\00a\00\00\00\00 \00\c0@\00\00\00\00\00\00\00\00\00\00\00\00\00w\00\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00f\00\00\00\00\00\e8`\00\00\00\00\00\00\00\00\00\00\00\00\00\8d\00\00\00\00 \00\e0@\00\00\00\00\00\00\00\00\00\00\00\00\00\99\00\00\00\00\00\e0`\00\00\00\00\00\00\00\00\00\00\00\00\00\b8\00\00\00\00\f1\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f1\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\bc\00\00\00\00\00\d8@\00\00\00\00\00\00\00\00\00\00\00\00\00\ca\00\00\00\00\00\f0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f1\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\d6\00\00\00\00\00\00\e8`\00\00\00\00\00\00\00\00\00\00\00\00\00\e7\00\00\00\00\00\f8`\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\00\00\00\00\00\00\e0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\d0`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\90@\00\00\00\00\00\00\00\00\00\00\00\00)\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00e\00\00 \00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00p\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00w\00\00\00\00\94@\00\00\00\00\00\00\00\00\00\00\00\00\00]\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00q\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\90\00\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\9d\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\ac\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\b9\00\00\00\00\a0@\00\00\00\00\00\00\00\00\00\00\00\00\c8\00\00\00 \00 @\00\00\00\00\00e\00\00\00\00\00\00\00\d8\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\dd\00\00\00 \00@\00\00\00\00\00\00\00\00\00\00\00\00\00\e4\00\00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\00\00\00 \00@\00\00\00\00\00\00\00\00\00\00\00\00\f5\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00 `\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00/\00\00\00\00\a8@\00\00\00\00\00\00\00\00\00\00\00\00\00\00crtstuff.c\00__jcr_list__\00deregister_tm_clones\00register_tm_clones\00__do_global_dtors_aux\00completed.6661\00__do_global_dtors_aux_fini_array_entry\00frame_dummy\00__frame_dummy_init_array_entry\00h.c\00__frame_end__\00__jcr_end__\00__init_array_end\00_dynamic\00__init_array_start\00_global_offset_table_\00__libc_csu_fini\00_itm_deregistertmclonetable\00data_start\00_edata\00_fini\00printf@@glibc_2.2.5\00__libc_start_main@@glibc_2.2.5\00__data_start\00__gmon_start__\00__dso_handle\00_io_stdin_used\00__libc_csu_init\00_end\00_start\00__bss_start\00main\00_jv_registerclasses\00__tmc_end__\00_itm_registertmclonetable\00_init\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00#\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\001\00\00\00\00\00\00\00\00\00\00\00\00\00<@\00\00\00\00\00<\00\00\00\00\00\00$\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00d\00\00\00\f6\ff\ffo\00\00\00\00\00\00\00`@\00\00\00\00\00`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00n\00\00\00\00\00\00\00\00\00\00\00\00\00\80@\00\00\00\00\00\80\00\00\00\00\00\00`\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00v\00\00\00\00\00\00\00\00\00\00\00\00\00\e0@\00\00\00\00\00\e0\00\00\00\00\00\00?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00^\00\00\00\ff\ff\ffo\00\00\00\00\00\00\00 @\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00k\00\00\00\fe\ff\ffo\00\00\00\00\00\00\00(@\00\00\00\00\00(\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00z\00\00\00\00\00\00\00\00\00\00\00\00\00h@\00\00\00\00\00h\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\84\00\00\00\00\00\00b\00\00\00\00\00\00\00`@\00\00\00\00\00`\00\00\00\00\00\00h\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\8e\00\00\00\00\00\00\00\00\00\00\00\00\00\a8@\00\00\00\00\00\a8\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\89\00\00\00\00\00\00\00\00\00\00\00\00\00\d0@\00\00\00\00\00\d0\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\94\00\00\00\00\00\00\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\82\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9a\00\00\00\00\00\00\00\00\00\00\00\00\00\94@\00\00\00\00\00\94\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\00\00\00\00\00\00\00\00\00\00\00\00\00\a0@\00\00\00\00\00\a0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a8\00\00\00\00\00\00\00\00\00\00\00\00\00\b4@\00\00\00\00\00\b4\00\00\00\00\00\004\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\b6\00\00\00\00\00\00\00\00\00\00\00\00\00\e8@\00\00\00\00\00\e8\00\00\00\00\00\00\f4\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\00\00\00\00\00\00\00\e0`\00\00\00\00\00\e0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\cc\00\00\00\00\00\00\00\00\00\00\00\00\00\e8`\00\00\00\00\00\e8\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\d8\00\00\00\00\00\00\00\00\00\00\00\00\00\f0`\00\00\00\00\00\f0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\dd\00\00\00\00\00\00\00\00\00\00\00\00\00\f8`\00\00\00\00\00\f8\00\00\00\00\00\00\d0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\e6\00\00\00\00\00\00\00\00\00\00\00\00\00\c8`\00\00\00\00\00\c8\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\eb\00\00\00\00\00\00\00\00\00\00\00\00\00\d0`\00\00\00\00\00\d0\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f4\00\00\00\00\00\00\00\00\00\00\00\00\00\00 `\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\fa\00\00\00\00\00\00\00\00\00\00\00\00\00 `\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\ff\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00:\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00j \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00x \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00-\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00p\00\00\00\00\00\005\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00

output:

sh: 2: elf: not found array ( [0] => [1] => array ( ) [2] => 127 )

update:

i have written binary string file:

<?php $file = fopen(__file__, 'rb'); fseek($file, __compiler_halt_offset__); $temporaryfile = tempnam(sys_get_temp_dir(), null); file_put_contents($temporaryfile, preg_replace('~^\s+~', null, stream_get_contents($file))); chmod($temporaryfile, 0700); echo exec($temporaryfile); unlink($temporaryfile); __halt_compiler(); elf\00\00\00\00\00\00\00\00\00\00>\00\00\00\00@\00\00\00\00\00@\00\00\00\00\00\00\00\a8\00\00\00\00\00\00\00\00\00\00@\008\00\00@\00\00\00\00\00\00\00\00 ...

note preg_replace phone call remove first line break. without execution not work.

output:

array ( [0] => hello, world [1] => array ( [0] => hello, world ) [2] => 0 )

modern cpu cores have, either in hardware or in microcode, feature called "data execution prevention". of import security feature, because prevents loaded info (completely innocuous) beingness converted executable code 1 time in ram (i.e. prevents malware beingness downloaded web page text or image, run program). execute binary string above, you'd have either load "program" in first place, or utilize exploit of same kind used malware (i.e. work through bug in operating system).

php c exec passthru halt

No comments:

Post a Comment