mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
412 lines
46 KiB
Markdown
412 lines
46 KiB
Markdown
# 80,443 - Pentesting Web Methodology
|
|
|
|
{{#include ../../banners/hacktricks-training.md}}
|
|
|
|
## Basic Info
|
|
|
|
वेब सेवा सबसे **सामान्य और व्यापक सेवा** है और कई **विभिन्न प्रकार की कमजोरियाँ** मौजूद हैं।
|
|
|
|
**डिफ़ॉल्ट पोर्ट:** 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)?
|
|
- [ ] **सामान्य प्रयोजन स्कैनर** लॉन्च करें। आप कभी नहीं जानते कि वे कुछ खोजने जा रहे हैं या कुछ दिलचस्प जानकारी खोजने जा रहे हैं।
|
|
- [ ] **प्रारंभिक जांच** से शुरू करें: **रोबोट**, **साइटमैप**, **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
|
|
|
|
कुछ **tricks** विभिन्न प्रसिद्ध **technologies** में **vulnerabilities** खोजने के लिए:
|
|
|
|
- [**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)
|
|
- [**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 has a lot of interesting tricks that could be exploited)**](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)
|
|
|
|
_ध्यान में रखें कि **same domain** विभिन्न **ports**, **folders** और **subdomains** में **different technologies** का उपयोग कर सकता है._\
|
|
यदि वेब एप्लिकेशन किसी प्रसिद्ध **tech/platform listed before** या **कोई अन्य** का उपयोग कर रहा है, तो **Internet** पर नए **tricks** खोजने के लिए मत भूलें (और मुझे बताएं!)।
|
|
|
|
### Source Code Review
|
|
|
|
यदि एप्लिकेशन का **source code** **github** में उपलब्ध है, तो एप्लिकेशन का **White box test** करने के अलावा, वर्तमान **Black-Box testing** के लिए **कुछ जानकारी** जो **useful** हो सकती है:
|
|
|
|
- क्या कोई **Change-log या Readme या Version** फ़ाइल है या कुछ भी जिसमें **version info accessible** वेब के माध्यम से है?
|
|
- **Credentials** कैसे और कहाँ सहेजे जाते हैं? क्या कोई (accessible?) **file** है जिसमें credentials (usernames या passwords) हैं?
|
|
- क्या **passwords** **plain text**, **encrypted** हैं या कौन सा **hashing algorithm** उपयोग किया गया है?
|
|
- क्या यह कुछ encrypt करने के लिए कोई **master key** का उपयोग कर रहा है? कौन सा **algorithm** उपयोग किया गया है?
|
|
- क्या आप किसी **vulnerability** का फायदा उठाकर **इन फ़ाइलों** में से किसी तक पहुँच सकते हैं?
|
|
- क्या **github** में कोई **interesting information** है (solved और not solved) **issues** में? या **commit history** में (शायद कुछ **password जो एक पुराने commit में डाला गया**)?
|
|
|
|
{{#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,.etc)
|
|
- **त्रुटियाँ उत्पन्न करने के लिए** **कुकी मान** और **पैरामीटर** मानों में **"\[]", "]]", और "\[\["** जोड़ें
|
|
- **URL** के **अंत** में **`/~randomthing/%s`** के रूप में इनपुट देकर त्रुटि उत्पन्न करें
|
|
- **PATCH, DEBUG** या गलत जैसे **FAKE** जैसे **विभिन्न HTTP क्रियाएँ** आज़माएँ
|
|
|
|
#### **जांचें कि क्या आप फ़ाइलें अपलोड कर सकते हैं (**[**PUT verb, 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 फ़ाइलों के लिए LinkFider और बाहरी स्रोत के रूप में 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): यह उपकरण एक स्पाइडर नहीं है लेकिन यह उपयोगी हो सकता है। आप बस एक फ़ाइल निर्दिष्ट कर सकते हैं जिसमें होस्ट और एक फ़ाइल जिसमें पथ हैं और मेग प्रत्येक होस्ट पर प्रत्येक पथ को लाएगा और प्रतिक्रिया को सहेजेगा।
|
|
- [**urlgrab**](https://github.com/IAmStoxe/urlgrab) (go): JS रेंडरिंग क्षमताओं के साथ HTML स्पाइडर। हालाँकि, ऐसा लगता है कि इसे बनाए नहीं रखा गया है, पूर्व-निर्मित संस्करण पुराना है और वर्तमान कोड संकलित नहीं होता है।
|
|
- [**gau**](https://github.com/lc/gau) (go): HTML स्पाइडर जो बाहरी प्रदाताओं (wayback, otx, commoncrawl) का उपयोग करता है।
|
|
- [**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 स्रोत और एम्बेडेड जावास्क्रिप्ट फ़ाइलों में एंडपॉइंट्स को निकालने के लिए। बग हंटर्स, रेड टीमर्स, इन्फोसेक निन्जाओं के लिए उपयोगी।
|
|
- [**JSParser**](https://github.com/nahamsec/JSParser) (python2.7): एक पायथन 2.7 स्क्रिप्ट जो Tornado और JSBeautifier का उपयोग करके जावास्क्रिप्ट फ़ाइलों से सापेक्ष URL को पार्स करती है। AJAX अनुरोधों को आसानी से खोजने के लिए उपयोगी। ऐसा लगता है कि इसे बनाए नहीं रखा गया है।
|
|
- [**relative-url-extractor**](https://github.com/jobertabma/relative-url-extractor) (ruby): एक फ़ाइल (HTML) दी गई है, यह निफ्टी नियमित अभिव्यक्ति का उपयोग करके URL को निकालता है ताकि बदसूरत (मिनिफाई) फ़ाइलों से सापेक्ष 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)**:** वेबैक मशीन से लिंक खोजें (जवाबों को वेबैक में डाउनलोड करते हुए और अधिक लिंक की तलाश करते हुए)।
|
|
- [**HTTPLoot**](https://github.com/redhuntlabs/HTTPLoot) (go): क्रॉल करें (यहां तक कि फ़ॉर्म भरकर) और विशिष्ट regexes का उपयोग करके संवेदनशील जानकारी भी खोजें।
|
|
- [**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) है जो जावास्क्रिप्ट स्रोत कोड से 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** - काली में शामिल, **पुराना** (और **धीमा**) लेकिन कार्यात्मक। स्वचालित-हस्ताक्षरित प्रमाणपत्रों और पुनरावर्ती खोज की अनुमति देता है। अन्य विकल्पों की तुलना में बहुत धीमा।
|
|
- [**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): विभिन्न पृष्ठों के बर्प इतिहास से डायरेक्टरीज़ की एक सूची बनाने के लिए बर्प एक्सटेंशन।
|
|
- [**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) **जैसे उपकरणों का उपयोग कर सकते हैं। यदि आप कर सकते हैं, तो आप प्रत्येक निष्पादन योग्य वेब फ़ाइल पर छिपे हुए पैरामीटर खोजने का प्रयास कर सकते हैं।**
|
|
- _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 कुंजी: यदि आप कोई API कुंजी पाते हैं जो **AIza**SyA-qLheq6xjDiEIRisP_ujUseYLQCHUjik की तरह दिखती है, तो आप यह जांचने के लिए प्रोजेक्ट [**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 फ़ाइलों की भी जांच करनी चाहिए कि क्या यह कमजोर है।
|
|
- **जावास्क्रिप्ट डिओबफस्केटर और अनपैकर:** [https://lelinhtinh.github.io/de4js/](https://lelinhtinh.github.io/de4js/), [https://www.dcode.fr/javascript-unobfuscator](https://www.dcode.fr/javascript-unobfuscator)
|
|
- **जावास्क्रिप्ट ब्यूटीफायर:** [http://jsbeautifier.org/](https://beautifier.io), [http://jsnice.org/](http://jsnice.org)
|
|
- **JsFuck डिओबफस्केशन** (जावास्क्रिप्ट के साथ अक्षर: "\[]!+" [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 निषिद्ध/बुनियादी प्रमाणीकरण/401 अनधिकृत (बायपास)**
|
|
|
|
{{#ref}}
|
|
403-and-401-bypasses.md
|
|
{{#endref}}
|
|
|
|
**502 प्रॉक्सी त्रुटि**
|
|
|
|
यदि कोई पृष्ठ **उस कोड** के साथ **प्रतिक्रिया** करता है, तो यह शायद एक **खराब कॉन्फ़िगर की गई प्रॉक्सी** है। **यदि आप एक HTTP अनुरोध भेजते हैं जैसे: `GET https://google.com HTTP/1.1`** (होस्ट हेडर और अन्य सामान्य हेडर के साथ), तो **प्रॉक्सी** _**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.xyz/pentesting/pentesting-web
|
|
|
|
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}}
|