File: test-r_core.php

package info (click to toggle)
radare2 0.9.6-3.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 17,496 kB
  • ctags: 45,959
  • sloc: ansic: 240,999; sh: 3,645; makefile: 2,520; python: 1,212; asm: 312; ruby: 214; awk: 209; perl: 188; lisp: 169; java: 23; xml: 17; php: 6
file content (18 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
// PHP security model doesnt allow to require php files in current directory
// but.. /tmp is in path.. and well.. /home looks legit too.
// looks like a good security model :D</ironic>
//
// PHP Warning:  include(): open_basedir restriction in effect. File(...) is
// not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/)
// in /opt/prg/radare2/r2-bindings/php5/test-r_core.php on line 3

// Use system() as long as it's not banned by the default security restrictions
// like copy() does :D
system ("cp r_core.php /tmp");
require "/tmp/r_core.php";
print "[[  PHP-Radare shell  ]]\n";
$c = new RCore ();
$c->file_open ("/bin/ls", 0, 0);
$c->prompt_loop ();
?>