mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
416 lines
33 KiB
Markdown
416 lines
33 KiB
Markdown
# 80,443 - Pentesting Web Methodology
|
||
|
||
{{#include ../../banners/hacktricks-training.md}}
|
||
|
||
## 基本情報
|
||
|
||
ウェブサービスは最も**一般的で広範なサービス**であり、多くの**異なる種類の脆弱性**が存在します。
|
||
|
||
**デフォルトポート:** 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ヘッダーとレスポンスのクッキー**は、使用されている**技術**や**バージョン**を**特定**するのに非常に役立ちます。**Nmapスキャン**はサーバーバージョンを特定できますが、[**whatweb**](https://github.com/urbanadventurer/WhatWeb)**、**[**webtech**](https://github.com/ShielderSec/webtech)や[**https://builtwith.com/**](https://builtwith.com)**のツールも役立ちます:
|
||
```bash
|
||
whatweb -a 1 <URL> #Stealthy
|
||
whatweb -a 3 <URL> #Aggresive
|
||
webtech -u <URL>
|
||
webanalyze -host https://google.com -crawl 2
|
||
```
|
||
Search **for** [**vulnerabilities of the web application** **version**](../../generic-hacking/search-exploits.md)
|
||
|
||
### **Check if any 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 tech tricks
|
||
|
||
異なるよく知られた**技術**での**脆弱性**を見つけるための**トリック**:
|
||
|
||
- [**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 to RCE)**](electron-desktop-apps/index.html)
|
||
|
||
_同じドメインが異なる**ポート**、**フォルダ**、および**サブドメイン**で**異なる技術**を使用している可能性があることに注意してください。_\
|
||
ウェブアプリケーションが前述の**技術/プラットフォーム**や**その他の技術**を使用している場合は、**インターネットで新しいトリックを検索する**ことを忘れないでください(そして教えてください!)。
|
||
|
||
### Source Code Review
|
||
|
||
アプリケーションの**ソースコード**が**github**で利用可能な場合、アプリケーションの**ホワイトボックステスト**を自分で行うことに加えて、現在の**ブラックボックステスト**に役立つ**情報**がいくつかあります:
|
||
|
||
- **Change-log**や**Readme**、**Version**ファイル、または**バージョン情報にアクセス可能な**ものはありますか?
|
||
- **資格情報**はどのように、どこに保存されていますか?資格情報(ユーザー名やパスワード)が含まれる(アクセス可能な?)**ファイル**はありますか?
|
||
- **パスワード**は**プレーンテキスト**、**暗号化**されていますか、それともどの**ハッシュアルゴリズム**が使用されていますか?
|
||
- 何かを暗号化するための**マスターキー**を使用していますか?どの**アルゴリズム**が使用されていますか?
|
||
- 脆弱性を悪用して**これらのファイルのいずれかにアクセス**できますか?
|
||
- **github**に**興味深い情報**(解決済みおよび未解決の)**問題**はありますか?または**コミット履歴**に(古いコミット内に**導入されたパスワード**があるかもしれません)?
|
||
|
||
{{#ref}}
|
||
code-review-tools.md
|
||
{{#endref}}
|
||
|
||
### Automatic scanners
|
||
|
||
#### General purpose automatic scanners
|
||
```bash
|
||
nikto -h <URL>
|
||
whatweb -a 4 <URL>
|
||
wapiti -u <URL>
|
||
W3af
|
||
zaproxy #You can use an API
|
||
nuclei -ut && nuclei -target <URL>
|
||
|
||
# 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 <URL>
|
||
wpscan --force update -e --url <URL>
|
||
joomscan --ec -u <URL>
|
||
joomlavs.rb #https://github.com/rastating/joomlavs
|
||
```
|
||
> この時点で、クライアントが使用しているウェブサーバーに関する情報(もしデータが提供されていれば)や、テスト中に留意すべきいくつかのトリックを持っているはずです。運が良ければ、CMSを見つけてスキャナーを実行したかもしれません。
|
||
|
||
## ステップバイステップのウェブアプリケーション発見
|
||
|
||
> この時点から、ウェブアプリケーションとのインタラクションを開始します。
|
||
|
||
### 初期チェック
|
||
|
||
**興味深い情報を含むデフォルトページ:**
|
||
|
||
- /robots.txt
|
||
- /sitemap.xml
|
||
- /crossdomain.xml
|
||
- /clientaccesspolicy.xml
|
||
- /.well-known/
|
||
- メインページおよびサブページのコメントも確認してください。
|
||
|
||
**エラーの強制**
|
||
|
||
ウェブサーバーは、奇妙なデータが送信されると**予期しない動作**をすることがあります。これにより、**脆弱性**や**機密情報の開示**が発生する可能性があります。
|
||
|
||
- /whatever_fake.php(.aspx、.html、など)のような**偽ページ**にアクセスする
|
||
- **クッキー値**や**パラメータ**値に**"\[]", "]]", および "\[\["**を追加してエラーを作成する
|
||
- **URL**の**最後**に**`/~randomthing/%s`**として入力を与えてエラーを生成する
|
||
- PATCH、DEBUG、またはFAKEのような**異なるHTTP動詞**を試す
|
||
|
||
#### **ファイルをアップロードできるか確認する(**[**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 <host:port>
|
||
sslyze --regular <ip:port>
|
||
```
|
||
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ビューティファイ機能を持っています。LinkFinderのラッパーである[JSScanner](https://github.com/dark-warlord14/JSScanner)も見る価値があります。
|
||
- [**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): JSファイル内のパスとパラメータを見つけるためのBurp拡張機能。
|
||
- [**Sourcemapper**](https://github.com/denandz/sourcemapper): .js.map URLを与えると、ビューティファイドJSコードを取得します。
|
||
- [**xnLinkFinder**](https://github.com/xnl-h4ck3r/xnLinkFinder): 特定のターゲットのエンドポイントを発見するために使用されるツールです。
|
||
- [**waymore**](https://github.com/xnl-h4ck3r/waymore)**:** Waybackマシンからリンクを発見します(応答をダウンロードし、さらにリンクを探します)。
|
||
- [**HTTPLoot**](https://github.com/redhuntlabs/HTTPLoot) (go): フォームを埋めることによるクローリングや、特定の正規表現を使用して機密情報を見つけます。
|
||
- [**SpiderSuite**](https://github.com/3nock/SpiderSuite): Spider Suiteは、サイバーセキュリティ専門家向けに設計された高度なマルチ機能GUIウェブセキュリティクローラー/スパイダーです。
|
||
- [**jsluice**](https://github.com/BishopFox/jsluice) (go): URL、パス、シークレット、その他の興味深いデータをJavaScriptソースコードから抽出するためのGoパッケージおよび[コマンドラインツール](https://github.com/BishopFox/jsluice/blob/main/cmd/jsluice)です。
|
||
- [**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): JSインポートに基づいて重複機能を持つURLを削除します。
|
||
- [**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) **を使用して隠れたパラメータを発見できます。可能であれば、各実行可能ウェブファイルで隠れたパラメータを検索してみてください。**
|
||
- _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**](<https://github.com/l4yton/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キー、DBパスワード、その他の情報が見つかる可能性があります。
|
||
- **APIエンドポイント**を見つけた場合、[それらをテストする必要があります](web-api-pentesting.md)。これらはファイルではありませんが、おそらく「ファイルのように見える」でしょう。
|
||
- **JSファイル**: スパイダーリングセクションで、JSファイルからパスを抽出できるいくつかのツールが言及されました。また、見つかった各JSファイルを**監視する**ことも興味深いでしょう。場合によっては、変更がコードに潜在的な脆弱性が導入されたことを示すかもしれません。たとえば、[**JSMon**](https://github.com/robre/jsmon)**を使用できます。**
|
||
- 発見されたJSファイルを[**RetireJS**](https://github.com/retirejs/retire.js/)または[**JSHole**](https://github.com/callforpapers-source/jshole)で確認して、脆弱性があるかどうかを確認してください。
|
||
- **Javascript Deobfuscator and Unpacker:** [https://lelinhtinh.github.io/de4js/](https://lelinhtinh.github.io/de4js/)、[https://www.dcode.fr/javascript-unobfuscator](https://www.dcode.fr/javascript-unobfuscator)
|
||
- **Javascript Beautifier:** [http://jsbeautifier.org/](https://beautifier.io)、[http://jsnice.org/](http://jsnice.org)
|
||
- **JsFuckのデオブフスケーション** (文字でのjavascript:"\[]!+" [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**
|
||
|
||
ページが**そのコード**で**応答**する場合、**不適切に構成されたプロキシ**の可能性があります。**`GET https://google.com HTTP/1.1`**のようなHTTPリクエストを送信すると(ホストヘッダーや他の一般的なヘッダーを含む)、**プロキシ**は_**google.com**_に**アクセス**しようとし、**SSRF**を見つけることになります。
|
||
|
||
**NTLM認証 - 情報漏洩**
|
||
|
||
認証を要求しているサーバーが**Windows**であるか、**資格情報**(および**ドメイン名**)を要求するログインを見つけた場合、**情報漏洩**を引き起こすことができます。\
|
||
**ヘッダーを送信します**: `“Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=”` そして、**NTLM認証の動作**により、サーバーはヘッダー「WWW-Authenticate」内に内部情報(IISバージョン、Windowsバージョン...)を応答します。\
|
||
これを**自動化**するには、**nmapプラグイン**"_http-ntlm-info.nse_"を使用できます。
|
||
|
||
**HTTPリダイレクト (CTF)**
|
||
|
||
**リダイレクション**内に**コンテンツ**を**挿入**することが可能です。このコンテンツは**ユーザーに表示されません**(ブラウザがリダイレクションを実行するため)が、そこに**隠されている**ものがあるかもしれません。
|
||
|
||
### ウェブ脆弱性のチェック
|
||
|
||
ウェブアプリケーションの包括的な列挙が行われたので、多くの可能性のある脆弱性をチェックする時が来ました。チェックリストはここにあります:
|
||
|
||
|
||
{{#ref}}
|
||
../../pentesting-web/web-vulnerabilities-methodology.md
|
||
{{#endref}}
|
||
|
||
ウェブ脆弱性に関する詳細情報は次のリンクで見つけることができます:
|
||
|
||
- [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}}
|