# 80,443 - Pentesting Web Methodology {{#include ../../banners/hacktricks-training.md}} ## 基本信息 Web服务是最**常见和广泛的服务**,并且存在许多**不同类型的漏洞**。 **默认端口:** 80 (HTTP),443(HTTPS) ```bash PORT STATE SERVICE 80/tcp open http 443/tcp open ssl/https ``` ```bash nc -v domain.com 80 # GET / HTTP/1.0 openssl s_client -connect domain.com:443 # GET / HTTP/1.0 ``` ### Web API Guidance {{#ref}} web-api-pentesting.md {{#endref}} ## Methodology summary > 在这个方法论中,我们假设你将攻击一个域(或子域),仅此而已。因此,你应该将此方法论应用于每个发现的域、子域或具有不确定网络服务器的IP。 - [ ] 首先**识别**网络服务器使用的**技术**。如果你能成功识别技术,请寻找**技巧**以便在测试的其余部分中记住。 - [ ] 该技术版本是否有任何**已知漏洞**? - [ ] 使用任何**知名技术**吗?有没有**有用的技巧**来提取更多信息? - [ ] 有任何**专业扫描器**可以运行(如wpscan)吗? - [ ] 启动**通用扫描器**。你永远不知道它们是否会发现某些东西或找到一些有趣的信息。 - [ ] 从**初始检查**开始:**robots**、**sitemap**、**404**错误和**SSL/TLS扫描**(如果是HTTPS)。 - [ ] 开始**爬取**网页:是时候**查找**所有可能的**文件、文件夹**和**使用的参数**。同时,检查**特殊发现**。 - [ ] _注意,在暴力破解或爬取过程中发现新目录时,应进行爬取。_ - [ ] **目录暴力破解**:尝试暴力破解所有发现的文件夹,寻找新的**文件**和**目录**。 - [ ] _注意,在暴力破解或爬取过程中发现新目录时,应进行暴力破解。_ - [ ] **备份检查**:测试是否可以通过附加常见备份扩展名找到**发现的文件**的**备份**。 - [ ] **暴力破解参数**:尝试**查找隐藏参数**。 - [ ] 一旦你**识别**了所有可能接受**用户输入**的**端点**,检查与之相关的所有类型的**漏洞**。 - [ ] [遵循此检查清单](../../pentesting-web/web-vulnerabilities-methodology.md) ## Server Version (Vulnerable?) ### Identify 检查运行的服务器**版本**是否有**已知漏洞**。\ **HTTP响应的头部和cookie**可能非常有用,以**识别**所使用的**技术**和/或**版本**。**Nmap扫描**可以识别服务器版本,但工具[**whatweb**](https://github.com/urbanadventurer/WhatWeb)**、**[**webtech**](https://github.com/ShielderSec/webtech)或[**https://builtwith.com/**](https://builtwith.com)**也可能有用:** ```bash whatweb -a 1 #Stealthy whatweb -a 3 #Aggresive webtech -u webanalyze -host https://google.com -crawl 2 ``` 搜索 **web 应用程序的漏洞版本** [**vulnerabilities of the web application version**](../../generic-hacking/search-exploits.md) ### **检查是否有 WAF** - [**https://github.com/EnableSecurity/wafw00f**](https://github.com/EnableSecurity/wafw00f) - [**https://github.com/Ekultek/WhatWaf.git**](https://github.com/Ekultek/WhatWaf.git) - [**https://nmap.org/nsedoc/scripts/http-waf-detect.html**](https://nmap.org/nsedoc/scripts/http-waf-detect.html) ### Web 技术技巧 一些 **寻找漏洞** 的 **技巧**,适用于不同的知名 **技术**: - [**AEM - Adobe Experience Cloud**](aem-adobe-experience-cloud.md) - [**Apache**](apache.md) - [**Artifactory**](artifactory-hacking-guide.md) - [**Buckets**](buckets/index.html) - [**CGI**](cgi.md) - [**Drupal**](drupal/index.html) - [**Flask**](flask.md) - [**Git**](git.md) - [**Golang**](golang.md) - [**GraphQL**](graphql.md) - [**H2 - Java SQL database**](h2-java-sql-database.md) - [**IIS tricks**](iis-internet-information-services.md) - [**Microsoft SharePoint**](microsoft-sharepoint.md) - [**JBOSS**](jboss.md) - [**Jenkins**](<[https:/github.com/carlospolop/hacktricks/blob/master/network-services-pentesting/pentesting-web/broken-reference/README.md](https:/github.com/HackTricks-wiki/hacktricks-cloud/tree/master/pentesting-ci-cd/jenkins-security)/>) - [**Jira**](jira.md) - [**Joomla**](joomla.md) - [**JSP**](jsp.md) - [**Laravel**](laravel.md) - [**Moodle**](moodle.md) - [**Nginx**](nginx.md) - [**PHP (php 有很多有趣的技巧可以被利用)**](php-tricks-esp/index.html) - [**Python**](python.md) - [**Spring Actuators**](spring-actuators.md) - [**Symphony**](symphony.md) - [**Tomcat**](tomcat/index.html) - [**VMWare**](vmware-esx-vcenter....md) - [**Web API Pentesting**](web-api-pentesting.md) - [**WebDav**](put-method-webdav.md) - [**Werkzeug**](werkzeug.md) - [**Wordpress**](wordpress.md) - [**Electron Desktop (XSS 到 RCE)**](electron-desktop-apps/index.html) _请注意,**同一域**可能在不同的 **端口**、**文件夹**和 **子域**中使用 **不同的技术**。_\ 如果 web 应用程序使用了之前列出的任何知名 **技术/平台** 或 **其他**,请不要忘记 **在互联网上搜索** 新的技巧(并告诉我!)。 ### 源代码审查 如果应用程序的 **源代码** 在 **github** 上可用,除了进行 **自己的白盒测试** 外,还有 **一些信息** 可能对当前的 **黑盒测试** **有用**: - 是否有 **变更日志或自述文件或版本** 文件或任何可以通过网络访问的 **版本信息**? - **凭据** 是如何保存的?是否有任何(可访问的?) **文件** 包含凭据(用户名或密码)? - **密码** 是 **明文**、**加密** 还是使用了哪种 **哈希算法**? - 是否使用了任何 **主密钥** 来加密某些内容?使用了哪种 **算法**? - 你能否通过利用某个漏洞 **访问这些文件**? - 在 **github** 上是否有任何 **有趣的信息**(已解决和未解决的) **问题**?或者在 **提交历史** 中(也许某个 **密码在旧提交中引入**)? {{#ref}} code-review-tools.md {{#endref}} ### 自动扫描器 #### 通用自动扫描器 ```bash nikto -h whatweb -a 4 wapiti -u W3af zaproxy #You can use an API nuclei -ut && nuclei -target # https://github.com/ignis-sec/puff (client side vulns fuzzer) node puff.js -w ./wordlist-examples/xss.txt -u "http://www.xssgame.com/f/m4KKGHi2rVUN/?query=FUZZ" ``` #### CMS 扫描器 如果使用了 CMS,别忘了 **运行扫描器**,也许会发现一些有价值的信息: [**Clusterd**](https://github.com/hatRiot/clusterd)**:** [**JBoss**](jboss.md)**, ColdFusion, WebLogic,** [**Tomcat**](tomcat/index.html)**, Railo, Axis2, Glassfish**\ [**CMSScan**](https://github.com/ajinabraham/CMSScan): [**WordPress**](wordpress.md), [**Drupal**](drupal/index.html), **Joomla**, **vBulletin** 网站的安全问题。 (GUI)\ [**VulnX**](https://github.com/anouarbensaad/vulnx)**:** [**Joomla**](joomla.md)**,** [**Wordpress**](wordpress.md)**,** [**Drupal**](drupal/index.html)**, PrestaShop, Opencart**\ **CMSMap**: [**(W)ordpress**](wordpress.md)**,** [**(J)oomla**](joomla.md)**,** [**(D)rupal**](drupal/index.html) **或** [**(M)oodle**](moodle.md)\ [**droopscan**](https://github.com/droope/droopescan)**:** [**Drupal**](drupal/index.html)**,** [**Joomla**](joomla.md)**,** [**Moodle**](moodle.md)**, Silverstripe,** [**Wordpress**](wordpress.md) ```bash cmsmap [-f W] -F -d wpscan --force update -e --url joomscan --ec -u joomlavs.rb #https://github.com/rastating/joomlavs ``` > 在这一点上,您应该已经获得了一些关于客户端使用的网络服务器的信息(如果提供了任何数据)以及在测试期间需要记住的一些技巧。如果您运气好,您甚至找到了一个CMS并运行了一些扫描器。 ## 逐步Web应用程序发现 > 从这一点开始,我们将开始与Web应用程序进行交互。 ### 初始检查 **包含有趣信息的默认页面:** - /robots.txt - /sitemap.xml - /crossdomain.xml - /clientaccesspolicy.xml - /.well-known/ - 还要检查主页面和次页面中的评论。 **强制错误** 当向Web服务器发送奇怪的数据时,可能会**表现出意外行为**。这可能会打开**漏洞**或**泄露敏感信息**。 - 访问**假页面**如 /whatever_fake.php (.aspx,.html,.etc) - 在**cookie值**和**参数**值中**添加 "\[]", "]]", 和 "\[\["**以创建错误 - 通过在**URL**的**末尾**提供输入为**`/~randomthing/%s`**来生成错误 - 尝试**不同的HTTP动词**如 PATCH、DEBUG 或错误的如 FAKE #### **检查您是否可以上传文件(**[**PUT动词,WebDav**](put-method-webdav.md)**)** 如果您发现**WebDav**已**启用**但您没有足够的权限在根文件夹中**上传文件**,请尝试: - **暴力破解**凭据 - 通过WebDav向**网页内找到的其他文件夹**上传文件。您可能有权限在其他文件夹中上传文件。 ### **SSL/TLS漏洞** - 如果应用程序在任何部分**不强制用户使用HTTPS**,那么它**容易受到中间人攻击(MitM)** - 如果应用程序**使用HTTP发送敏感数据(密码)**,那么这是一个高风险漏洞。 使用[**testssl.sh**](https://github.com/drwetter/testssl.sh)检查**漏洞**(在漏洞赏金计划中,这类漏洞可能不会被接受),并使用[**a2sv**](https://github.com/hahwul/a2sv)重新检查漏洞: ```bash ./testssl.sh [--htmlfile] 10.10.10.10:443 #Use the --htmlfile to save the output inside an htmlfile also # You can also use other tools, by testssl.sh at this momment is the best one (I think) sslscan sslyze --regular ``` 关于SSL/TLS漏洞的信息: - [https://www.gracefulsecurity.com/tls-ssl-vulnerabilities/](https://www.gracefulsecurity.com/tls-ssl-vulnerabilities/) - [https://www.acunetix.com/blog/articles/tls-vulnerabilities-attacks-final-part/](https://www.acunetix.com/blog/articles/tls-vulnerabilities-attacks-final-part/) ### 爬虫 在网络中启动某种**爬虫**。爬虫的目标是**尽可能多地找到**被测试应用程序的路径。因此,应使用网络爬虫和外部资源来找到尽可能多的有效路径。 - [**gospider**](https://github.com/jaeles-project/gospider) (go): HTML爬虫,JS文件中的LinkFinder和外部资源(Archive.org, CommonCrawl.org, VirusTotal.com, AlienVault.com)。 - [**hakrawler**](https://github.com/hakluke/hakrawler) (go): HML爬虫,带有JS文件的LinkFinder和Archive.org作为外部资源。 - [**dirhunt**](https://github.com/Nekmo/dirhunt) (python): HTML爬虫,也指示“美味文件”。 - [**evine** ](https://github.com/saeeddhqan/evine)(go): 交互式CLI HTML爬虫。它还在Archive.org中搜索。 - [**meg**](https://github.com/tomnomnom/meg) (go): 该工具不是爬虫,但可能有用。您只需指示一个包含主机的文件和一个包含路径的文件,meg将获取每个主机上的每个路径并保存响应。 - [**urlgrab**](https://github.com/IAmStoxe/urlgrab) (go): 带有JS渲染功能的HTML爬虫。然而,它似乎没有维护,预编译版本较旧,当前代码无法编译。 - [**gau**](https://github.com/lc/gau) (go): 使用外部提供者(wayback, otx, commoncrawl)的HTML爬虫。 - [**ParamSpider**](https://github.com/devanshbatham/ParamSpider): 该脚本将找到带参数的URL并列出它们。 - [**galer**](https://github.com/dwisiswant0/galer) (go): 带有JS渲染功能的HTML爬虫。 - [**LinkFinder**](https://github.com/GerbenJavado/LinkFinder) (python): HTML爬虫,具有JS美化功能,能够在JS文件中搜索新路径。查看[JSScanner](https://github.com/dark-warlord14/JSScanner)也可能值得,它是LinkFinder的一个包装器。 - [**goLinkFinder**](https://github.com/0xsha/GoLinkFinder) (go): 提取HTML源和嵌入的JavaScript文件中的端点。对漏洞猎人、红队员、信息安全专家有用。 - [**JSParser**](https://github.com/nahamsec/JSParser) (python2.7): 一个使用Tornado和JSBeautifier解析JavaScript文件中相对URL的Python 2.7脚本。对轻松发现AJAX请求很有用。看起来没有维护。 - [**relative-url-extractor**](https://github.com/jobertabma/relative-url-extractor) (ruby): 给定一个文件(HTML),它将使用巧妙的正则表达式从丑陋(压缩)文件中提取相对URL。 - [**JSFScan**](https://github.com/KathanP19/JSFScan.sh) (bash, 多个工具): 使用多个工具从JS文件中收集有趣的信息。 - [**subjs**](https://github.com/lc/subjs) (go): 查找JS文件。 - [**page-fetch**](https://github.com/detectify/page-fetch) (go): 在无头浏览器中加载页面并打印出加载页面的所有URL。 - [**Feroxbuster**](https://github.com/epi052/feroxbuster) (rust): 内容发现工具,结合了之前工具的多个选项。 - [**Javascript Parsing**](https://github.com/xnl-h4ck3r/burp-extensions): 一个Burp扩展,用于查找JS文件中的路径和参数。 - [**Sourcemapper**](https://github.com/denandz/sourcemapper): 一个工具,给定.js.map URL将获取美化的JS代码。 - [**xnLinkFinder**](https://github.com/xnl-h4ck3r/xnLinkFinder): 这是一个用于发现给定目标的端点的工具。 - [**waymore**](https://github.com/xnl-h4ck3r/waymore)**:** 从时光机发现链接(还下载时光机中的响应并寻找更多链接)。 - [**HTTPLoot**](https://github.com/redhuntlabs/HTTPLoot) (go): 爬取(甚至通过填写表单)并使用特定正则表达式查找敏感信息。 - [**SpiderSuite**](https://github.com/3nock/SpiderSuite): Spider Suite是一个高级多功能GUI网络安全爬虫/蜘蛛,专为网络安全专业人员设计。 - [**jsluice**](https://github.com/BishopFox/jsluice) (go): 这是一个Go包和[命令行工具](https://github.com/BishopFox/jsluice/blob/main/cmd/jsluice),用于从JavaScript源代码中提取URL、路径、秘密和其他有趣的数据。 - [**ParaForge**](https://github.com/Anof-cyber/ParaForge): ParaForge是一个简单的**Burp Suite扩展**,用于**提取请求中的参数和端点**,以创建自定义字典进行模糊测试和枚举。 - [**katana**](https://github.com/projectdiscovery/katana) (go): 这个工具很棒。 - [**Crawley**](https://github.com/s0rg/crawley) (go): 打印它能够找到的每个链接。 ### 暴力破解目录和文件 从根文件夹开始**暴力破解**,确保使用**此方法**暴力破解**所有**找到的**目录**以及通过**爬虫**发现的所有目录(您可以递归地进行此暴力破解,并在使用的字典开头附加找到的目录名称)。\ 工具: - **Dirb** / **Dirbuster** - 包含在Kali中,**旧**(和**慢**)但功能正常。允许自动签名证书和递归搜索。与其他选项相比太慢。 - [**Dirsearch**](https://github.com/maurosoria/dirsearch) (python)**: 它不允许自动签名证书,但**允许递归搜索。 - [**Gobuster**](https://github.com/OJ/gobuster) (go): 它允许自动签名证书,**不**具有**递归**搜索。 - [**Feroxbuster**](https://github.com/epi052/feroxbuster) **- 快速,支持递归搜索。** - [**wfuzz**](https://github.com/xmendez/wfuzz) `wfuzz -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt https://domain.com/api/FUZZ` - [**ffuf** ](https://github.com/ffuf/ffuf)- 快速: `ffuf -c -w /usr/share/wordlists/dirb/big.txt -u http://10.10.10.10/FUZZ` - [**uro**](https://github.com/s0md3v/uro) (python): 这不是一个爬虫,而是一个工具,给定找到的URL列表,将删除“重复”的URL。 - [**Scavenger**](https://github.com/0xDexter0us/Scavenger): Burp扩展,从不同页面的burp历史中创建目录列表。 - [**TrashCompactor**](https://github.com/michael1026/trashcompactor): 删除具有重复功能的URL(基于js导入)。 - [**Chamaleon**](https://github.com/iustin24/chameleon): 它使用wapalyzer检测使用的技术并选择要使用的字典。 **推荐字典:** - [https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/bf_directories.txt](https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/bf_directories.txt) - [**Dirsearch** 包含的字典](https://github.com/maurosoria/dirsearch/blob/master/db/dicc.txt) - [http://gist.github.com/jhaddix/b80ea67d85c13206125806f0828f4d10](http://gist.github.com/jhaddix/b80ea67d85c13206125806f0828f4d10) - [Assetnote字典](https://wordlists.assetnote.io) - [https://github.com/danielmiessler/SecLists/tree/master/Discovery/Web-Content](https://github.com/danielmiessler/SecLists/tree/master/Discovery/Web-Content) - raft-large-directories-lowercase.txt - directory-list-2.3-medium.txt - RobotsDisallowed/top10000.txt - [https://github.com/random-robbie/bruteforce-lists](https://github.com/random-robbie/bruteforce-lists) - [https://github.com/google/fuzzing/tree/master/dictionaries](https://github.com/google/fuzzing/tree/master/dictionaries) - [https://github.com/six2dez/OneListForAll](https://github.com/six2dez/OneListForAll) - [https://github.com/random-robbie/bruteforce-lists](https://github.com/random-robbie/bruteforce-lists) - [https://github.com/ayoubfathi/leaky-paths](https://github.com/ayoubfathi/leaky-paths) - _/usr/share/wordlists/dirb/common.txt_ - _/usr/share/wordlists/dirb/big.txt_ - _/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt_ _注意,在暴力破解或爬虫过程中发现新目录时,应进行暴力破解。_ ### 检查每个找到的文件 - [**Broken link checker**](https://github.com/stevenvachon/broken-link-checker): 查找HTML中的断链,可能容易被接管。 - **文件备份**: 一旦找到所有文件,查找所有可执行文件的备份("_.php_", "_.aspx_"...)。备份命名的常见变体有:_file.ext\~, #file.ext#, \~file.ext, file.ext.bak, file.ext.tmp, file.ext.old, file.bak, file.tmp 和 file.old._ 您还可以使用工具[**bfac**](https://github.com/mazen160/bfac) **或** [**backup-gen**](https://github.com/Nishantbhagat57/backup-gen)**.** - **发现新参数**: 您可以使用像[**Arjun**](https://github.com/s0md3v/Arjun)**,** [**parameth**](https://github.com/maK-/parameth)**,** [**x8**](https://github.com/sh1yo/x8) **和** [**Param Miner**](https://github.com/PortSwigger/param-miner) **来发现隐藏参数。如果可以,您可以尝试在每个可执行的Web文件中搜索**隐藏参数。 - _Arjun所有默认字典:_ [https://github.com/s0md3v/Arjun/tree/master/arjun/db](https://github.com/s0md3v/Arjun/tree/master/arjun/db) - _Param-miner “params” :_ [https://github.com/PortSwigger/param-miner/blob/master/resources/params](https://github.com/PortSwigger/param-miner/blob/master/resources/params) - _Assetnote “parameters_top_1m”:_ [https://wordlists.assetnote.io/](https://wordlists.assetnote.io) - _nullenc0de “params.txt”:_ [https://gist.github.com/nullenc0de/9cb36260207924f8e1787279a05eb773](https://gist.github.com/nullenc0de/9cb36260207924f8e1787279a05eb773) - **评论:** 检查所有文件的评论,您可以找到**凭据**或**隐藏功能**。 - 如果您在**CTF**中,"常见"的技巧是**隐藏** **信息**在页面的**右侧**的评论中(使用**数百个** **空格**,以便在使用浏览器打开源代码时看不到数据)。另一种可能性是在网页的**底部**使用**多个新行**并在评论中**隐藏信息**。 - **API密钥**: 如果您**找到任何API密钥**,有指南指示如何使用不同平台的API密钥:[**keyhacks**](https://github.com/streaak/keyhacks)**,** [**zile**](https://github.com/xyele/zile.git)**,** [**truffleHog**](https://github.com/trufflesecurity/truffleHog)**,** [**SecretFinder**](https://github.com/m4ll0k/SecretFinder)**,** [**RegHex**]()**,** [**DumpsterDive**](https://github.com/securing/DumpsterDiver)**,** [**EarlyBird**](https://github.com/americanexpress/earlybird) - Google API密钥: 如果您找到任何看起来像**AIza**SyA-qLheq6xjDiEIRisP_ujUseYLQCHUjik的API密钥,您可以使用项目[**gmapapiscanner**](https://github.com/ozguralp/gmapsapiscanner)来检查该密钥可以访问哪些API。 - **S3存储桶**: 在爬虫时查看是否有任何**子域**或任何**链接**与某些**S3存储桶**相关。在这种情况下,[**检查**存储桶的**权限**](buckets/index.html)。 ### 特殊发现 **在**执行**爬虫**和**暴力破解**时,您可能会发现**有趣**的**事物**,您需要**注意**。 **有趣的文件** - 查找**CSS**文件中指向其他文件的**链接**。 - [如果您找到一个_**.git**_文件,可以提取一些信息](git.md) - 如果您找到一个_**.env**_,可以找到诸如API密钥、数据库密码和其他信息。 - 如果您找到**API端点**,您[也应该测试它们](web-api-pentesting.md)。这些不是文件,但可能“看起来像”它们。 - **JS文件**: 在爬虫部分提到了一些可以从JS文件中提取路径的工具。此外,监控每个找到的JS文件也很有趣,因为在某些情况下,变化可能表明代码中引入了潜在的漏洞。您可以使用例如[**JSMon**](https://github.com/robre/jsmon)**.** - 您还应该使用[**RetireJS**](https://github.com/retirejs/retire.js/)或[**JSHole**](https://github.com/callforpapers-source/jshole)检查发现的JS文件,以查找是否存在漏洞。 - **JavaScript去混淆和解包器:** [https://lelinhtinh.github.io/de4js/](https://lelinhtinh.github.io/de4js/), [https://www.dcode.fr/javascript-unobfuscator](https://www.dcode.fr/javascript-unobfuscator) - **JavaScript美化器:** [http://jsbeautifier.org/](https://beautifier.io), [http://jsnice.org/](http://jsnice.org) - **JsFuck去混淆** (javascript with chars:"\[]!+" [https://enkhee-osiris.github.io/Decoder-JSFuck/](https://enkhee-osiris.github.io/Decoder-JSFuck/)) - [**TrainFuck**](https://github.com/taco-c/trainfuck)**:** `+72.+29.+7..+3.-67.-12.+55.+24.+3.-6.-8.-67.-23.` - 在多个场合,您需要**理解使用的正则表达式**。这将很有用:[https://regex101.com/](https://regex101.com)或[https://pythonium.net/regex](https://pythonium.net/regex) - 您还可以**监控检测到表单的文件**,因为参数的变化或新表单的出现可能表明潜在的新漏洞功能。 **403 Forbidden/Basic Authentication/401 Unauthorized (绕过)** {{#ref}} 403-and-401-bypasses.md {{#endref}} **502 Proxy Error** 如果任何页面**响应**该**代码**,则可能是**配置错误的代理**。**如果您发送HTTP请求,如:`GET https://google.com HTTP/1.1`**(带有主机头和其他常见头),**代理**将尝试**访问** _**google.com**_ **,您将发现一个** SSRF。 **NTLM认证 - 信息泄露** 如果运行的服务器要求身份验证是**Windows**或您发现一个登录要求您的**凭据**(并要求**域名**),您可以引发**信息泄露**。\ **发送**头:`“Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=”`,由于**NTLM认证的工作方式**,服务器将响应内部信息(IIS版本、Windows版本...)在“WWW-Authenticate”头中。\ 您可以使用**nmap插件** "_http-ntlm-info.nse_" 来自动化此过程。 **HTTP重定向(CTF)** 可以在**重定向**中**放置内容**。这些内容**不会显示给用户**(因为浏览器将执行重定向),但其中可能**隐藏**某些内容。 ### 网络漏洞检查 现在已经对Web应用程序进行了全面的枚举,是时候检查许多可能的漏洞。您可以在这里找到检查清单: {{#ref}} ../../pentesting-web/web-vulnerabilities-methodology.md {{#endref}} 有关Web漏洞的更多信息,请访问: - [https://six2dez.gitbook.io/pentest-book/others/web-checklist](https://six2dez.gitbook.io/pentest-book/others/web-checklist) - [https://kennel209.gitbooks.io/owasp-testing-guide-v4/content/en/web_application_security_testing/configuration_and_deployment_management_testing.html](https://kennel209.gitbooks.io/owasp-testing-guide-v4/content/en/web_application_security_testing/configuration_and_deployment_management_testing.html) - [https://owasp-skf.gitbook.io/asvs-write-ups/kbid-111-client-side-template-injection](https://owasp-skf.gitbook.io/asvs-write-ups/kbid-111-client-side-template-injection) ### 监控页面变化 您可以使用像[https://github.com/dgtlmoon/changedetection.io](https://github.com/dgtlmoon/changedetection.io)这样的工具来监控页面的修改,这可能会插入漏洞。 ### HackTricks自动命令 ``` Protocol_Name: Web #Protocol Abbreviation if there is one. Port_Number: 80,443 #Comma separated if there is more than one. Protocol_Description: Web #Protocol Abbreviation Spelled out Entry_1: Name: Notes Description: Notes for Web Note: | https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-web/index.html Entry_2: Name: Quick Web Scan Description: Nikto and GoBuster Command: nikto -host {Web_Proto}://{IP}:{Web_Port} &&&& gobuster dir -w {Small_Dirlist} -u {Web_Proto}://{IP}:{Web_Port} && gobuster dir -w {Big_Dirlist} -u {Web_Proto}://{IP}:{Web_Port} Entry_3: Name: Nikto Description: Basic Site Info via Nikto Command: nikto -host {Web_Proto}://{IP}:{Web_Port} Entry_4: Name: WhatWeb Description: General purpose auto scanner Command: whatweb -a 4 {IP} Entry_5: Name: Directory Brute Force Non-Recursive Description: Non-Recursive Directory Brute Force Command: gobuster dir -w {Big_Dirlist} -u {Web_Proto}://{IP}:{Web_Port} Entry_6: Name: Directory Brute Force Recursive Description: Recursive Directory Brute Force Command: python3 {Tool_Dir}dirsearch/dirsearch.py -w {Small_Dirlist} -e php,exe,sh,py,html,pl -f -t 20 -u {Web_Proto}://{IP}:{Web_Port} -r 10 Entry_7: Name: Directory Brute Force CGI Description: Common Gateway Interface Brute Force Command: gobuster dir -u {Web_Proto}://{IP}:{Web_Port}/ -w /usr/share/seclists/Discovery/Web-Content/CGIs.txt -s 200 Entry_8: Name: Nmap Web Vuln Scan Description: Tailored Nmap Scan for web Vulnerabilities Command: nmap -vv --reason -Pn -sV -p {Web_Port} --script=`banner,(http* or ssl*) and not (brute or broadcast or dos or external or http-slowloris* or fuzzer)` {IP} Entry_9: Name: Drupal Description: Drupal Enumeration Notes Note: | git clone https://github.com/immunIT/drupwn.git for low hanging fruit and git clone https://github.com/droope/droopescan.git for deeper enumeration Entry_10: Name: WordPress Description: WordPress Enumeration with WPScan Command: | ?What is the location of the wp-login.php? Example: /Yeet/cannon/wp-login.php wpscan --url {Web_Proto}://{IP}{1} --enumerate ap,at,cb,dbe && wpscan --url {Web_Proto}://{IP}{1} --enumerate u,tt,t,vp --passwords {Big_Passwordlist} -e Entry_11: Name: WordPress Hydra Brute Force Description: Need User (admin is default) Command: hydra -l admin -P {Big_Passwordlist} {IP} -V http-form-post '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log In&testcookie=1:S=Location' Entry_12: Name: Ffuf Vhost Description: Simple Scan with Ffuf for discovering additional vhosts Command: ffuf -w {Subdomain_List}:FUZZ -u {Web_Proto}://{Domain_Name} -H "Host:FUZZ.{Domain_Name}" -c -mc all {Ffuf_Filters} ``` {{#include ../../banners/hacktricks-training.md}}