type
status
date
slug
summary
tags
category
icon
password
Catagory
Materials
Retired
Retired
Due date
Jan 16, 2024 05:31 AM
Status
Belong in
Burp Suite Overview
- Java-based 的 framework,主要設計來做網頁及APPs滲透測試用
- 透過proxy的方式來攔截http/https流量,並可修改封包
- 主要版本
- Community
- Professional
- 自動化的vulnerability scanner.
- fuzzer/brute-forcer沒有速度限制
- 可以儲存專案以供未來使用及報告產出
- 提供api以供整合其他工具
- Unrestricted access to add new extensions for greater functionality.
- 存取 Burp Suite Collaborator (effectively providing a unique request catcher self-hosted or running on a Portswigger-owned server).
- Enterprise
- 此版本介於comunity跟professional之間,主要是用來提供企業持續性自動化掃描網站來發現潛在的弱點很像Nessus。
Burp Suite Components
- Proxy:用來擷取在client瀏覽器及server間的封包
- Repeater:可以將proxy擷取到的封包修改、重送相同的request,這個功能最好用的地方是可以
- Intruder:通常用於fuzzer/brute forcing,透過建立payloads,向目標spraying requests
- Decoder:用來做資料轉換,不管是用來解碼相關擷取到的封包資料或是拿來加密payloads。
- Comparer:用來比較2段不同的資料,比對word或是bytes的不同
- Sequencer:用來評估token的隨機性,像是cookies或是應該隨機產生的資料,若演算法缺乏隨機性可能會變成其中一項漏洞
- Organizer:用來儲存和註解http request副本,以供後續使用。此feature好用的地方在於可以整理自己的紀錄,不管是做報告也好還是記錄整個流程都是很好用的工具。
- Extender:可以自己撰寫相關的功能並上傳到BApp Store,擴充別人寫好的extensions在burp suite framework上。
Burp Suite GUI
Dashborad
- Tasks:此控制板允許執行背景程序。在community版本中的預設「Live Passive Crawl」會自動記錄每個已爬過頁面;而在professional版本則額外提供on-demand scans。
- Event log:此控制板針對每個在burp執行的動作提供更詳細的資訊,例如啟用proxy功能時,會列出詳細的connections資訊。
- Issue Activity:只在professional版本才有,呈現由自動掃描器所掃描出來的弱點、嚴重程度等等資訊
- Advisory:提供更多弱點的細節包含參考連結及建議的補救措施,並可匯出報告。Community版本可能不會提供此項。
Navigation
detach to other window
shortcut for tab
Burp Suite Configuration
- Global Settings:當開啟burp時會套用此組態,提供一個基礎設定值給burp環境
- Project Settings:針對特定的專案的session去設定組態,影響範圍只會在目前的session
community不支援儲存專案,所以所有的project settings將會隨著關閉目前專案而消失。
Questions
In which category can you find a reference to a "Cookie jar"?
In which base category can you find the "Updates" sub-category, which controls the Burp Suite update behaviour?
What is the name of the sub-category which allows you to change the keybindings for shortcuts in Burp Suite?
If we have uploaded Client-Side TLS certificates, can we override these on a per-project basis (yea/nay)?
yea
Proxy
- Web socket support
- Log and history:http history and websockets history are logging
- Response Interception:proxy settings中,預設Proxy是不會攔截server的ressponse除非有特定的需求才會設定,可根據下圖位置自訂規則
- 支援regex:proxy settings中,”Match and Replace”可使用正規化表示法來修改incoming跟outgoing的request。此功能允許動態變動像是user agent、cookies等headers
Open browser
burp suite裡面包含chromium browser,若是在linux環境中使用root權限去開啟內建瀏覽器可能會出現錯誤,可使用下列方式解決
- Smart Option:重新建立一個低權限帳號去執行burp
- Easy Option:勾選”Allow Burp's browser to run without a sandbox”
Intercept https flow
Target
- Sitemap
- 當proxy攔截過的每一層頁面,可mapping出網頁的目錄結構,在professional版本中可以自動去爬網頁目錄,不用一個一個按。
- Issue definitions
- 提供弱點資訊供參考
- Scope Settings
- 允許控制要呈現的範圍,可以設定須包含或排除那些特定的domain或ip。
Challenge
Scoping and Targeting
啟用proxy攔截的範圍,可以更聚焦在我們想要的目標網址、ip或api上
XSS Attack using Burp Example
Repeater
- Request List
- Request Controls
- Request & Response View
- Layout Options
- Inspector
- Target
在proxy tab中可以右鍵Send to Repeater或使用
Ctrl+R
將封包傳到reapeater tabInspector
- Request Query Parameters:用來調整GET request的參數,例如https://admin.tryhackme.com/?redirect=false,redirect參數的值為false
- Request Body Parameters:針對post request調整參數值
- Request Cookies:包含每個request所有的cookies
- Request Headers:可以修改每次request的header值
- Response Headers:呈現server response回來的header值
Challenges
Add the Request header
Access the page is not on the server
SQLi
Intruder
fuzzing tool允許自動request不同的參數值類似的工具有wfuzz 及ffuf
- positions:允許我們選擇要修改的payload位置,以供將payload值帶進此位置,可設定不同的attack type來進行不同的攻擊手法
- payloads:可將payload的值帶進上述的Positions tab中我們所選擇的欄位位置,並可選擇新增prefix或suffix、執行match and replace或是基於預先定義的regex跳過payload執行
- resource pool:community版本不是那麼有效,在professional版本中此功能允許在不同的threads中分配資源
- settings:設定攻擊行為,舉例我們可以設定request中包含哪些特定文字,以及定義burp's response重導致3xx開頭的回應
Payloads
- Payload sets:
- attack type設定Sniper或Battering Ram僅能設定一組wordlist
- attack type設定Pitchfork或Battering Ram,則可以設定多組wordlist,以供將payload設定在對應的位置
帶進的payload對應位置會是由上而下、由左而右的的順序進行。舉例
username=§pentester§&password=§Expl01ted§
則payload set中第一個值會帶進username位置;第二個值會帶進password值- Payload settings
- 用來設定每組payloadset的wordlist內容
- Payload processing
- 定義payload處理的規則,舉例可設定每個字元大寫、當符合所設定的regex時跳過、套用其他的變形(transformations)或是filtering
- Payload encoding
- 預設是 url encode,可以修改成自己想要的encoding方式
Payload Type
Attack Type
假設目前payload position假設有2個位置分別是
username
、password
Sniper
常用情境主要fuzzing endpoints或是password brute forcing。舉例如下:
假設有2個位置分別是
username
、password
,而wordlist有三個值分別是burp
、suite
、intruder
,則會分別產生下列的queryRequest Number | Request Body |
1 | username=burp&password=Expl01ted |
2 | username=suite&password=Expl01ted |
3 | username=intruder&password=Expl01ted |
4 | username=pentester&password=burp |
5 | username=pentester&password=suite |
6 | username=pentester&password=intruder |
Q:If you were using Sniper to fuzz three parameters in a request with a wordlist containing 100 words, how many requests would Burp Suite need to send to complete the attack?
3*100=300
Q:How many sets of payloads will Sniper accept for conducting an attack?
1
Battering Ram
會將payload帶進每個position中,舉例如下:
假設有2個位置分別是
username
、password
,而wordlist有三個值分別是burp
、suite
、intruder
,則會分別產生下列的queryRequest Number | Request Body |
1 | username=burp&password=burp |
2 | username=suite&password=suite |
3 | username=intruder&password=intruder |
Q:If you have a wordlist with two words in it (admin
andGuest
) and the positions in the request template look like this:
username=§pentester§&password=§Expl01ted§
What would the body parameters of the first request that Burp Suite sends be?
username=admin&password=admin
Pitchfork
針對每個position使用一組wordlist(最多20個position),並同時跌代所有位置。舉例如下:
假設有2個位置分別是
username
、password
,而wordlist則有2組分別為- 第一組wordlist:
joel
、hariet
、alex
- 第二組wordlist:
J03l
、Emma1815
、Sk1ll
Request Number | Request Body |
1 | username=joel&password=J03l |
2 | username=hariet&password=Emma1815 |
3 | username=alex&password=Sk1ll |
一旦其中一個wordlist用完時,intruder會停止測試,故較長的wordlist剩餘word不會測試到
What is the maximum number of payload sets we can load into Intruder in Pitchfork mode?
20
Cluster Bomb
針對每個position使用一組wordlist(最多20個position),每個position會獨立測試每組wordlist,故與pitchfork最大不同的地方在於可以測試到所有組合。舉例如下:
- 第一組wordlist:
joel
、hariet
、alex
- 第二組wordlist:
J03l
、Emma1815
、Sk1ll
Request Number | Request Body |
1 | username=joel&password=J03l |
2 | username=joel&password=Emma1815 |
3 | username=joel&password=Sk1ll |
4 | username=hariet&password=J03l |
5 | username=hariet&password=Emma1815 |
6 | username=hariet&password=Sk1ll |
7 | username=alex&password=J03l |
8 | username=alex&password=Emma1815 |
9 | username=alex&password=Sk1ll |
Community版本有速率限制,執行cluster bomb要花很久的時間
Q:We have three payload sets. The first set contains 100 lines, the second contains 2 lines, and the third contains 30 lines.How many requests will Intruder make using these payload sets in a Cluster bomb attack?
100*2*30=6000
Practical Example - Credential Stuffing 憑證填充
Practice 1
What username and password combination indicates a successful login attempt? The answer format is "username:password".
Practice 2
承 Practice 1,可以使用
m.rivera:letmein1
登入網址結構為
http://<ip>/support/ticket/<number>
的格式上述可能有2種情況:
- Access Control:endpoint可能繫結到的是某個user,在此狀況下我們只能查看跟目前登入使用者有關的ticket
- IDOR(Insecure Direct Object) Vulnerability:endpoint缺乏適當的存取控制,故我們可以透過存取別人的ticket來獲取他人的權限。此漏洞稱為IDOR漏洞
Q:Which attack type is best suited for this task?
Sniper
Q:What is the flag?
產出1-100序列wordlist
Practice 3
CSRF/XSRF (Cross-Site Request Forgery)/one-click attack/session riding
此範例我們需要取得每次response的loginToken跟session cookie,這邊”recursive grep”因是重導到其他網址,在這邊無法起到作用,因此需要建立macro
settings > macros > add
定義macro
新增session handling rules - scope
新增session handling rules - Details
此例應該要得到302 status的response,若是得到403表示session過期了,重新攔截得到新的cookie跟session值即可
What username and password combination indicates a successful login attempt? The answer format is "username:password".
o.bennett:bella1
Decoder
其他功能類似的網站:Cyberchef
Challenges
Base64 encode the phrase: Let's Start Simple
.
What is the base64 encoded version of this text?
URL Decode this data: %4e%65%78%74%3a%20%44%65%63%6f%64%69%6e%67
.
What is the plaintext returned?
Use Smart decode to decode this data: %34%37
What is the decoded text?
Encode this phrase: Encoding Challenge
.
Start with base64 encoding. Take the output of this and convert it into ASCII Hex. Finally, encode the hex string into octal.
What is the final string?
Using Decoder, what is the SHA-256 hashsum of the phrase: Let's get Hashing!
?
Convert this into an ASCII Hex string for the answer to this question.
Generate an MD4 hashsum of the phrase: Insecure Algorithms
.
Encode this as base64 (not ASCII Hex) before submitting.
"Some joker has messed with my SSH key! There are four keys in the directory, and I have no idea which is the real one. The MD5 hashsum for my key is 3166226048d6ad776370dc105d40d9f8
— could you find it for me?"
What is the correct key name?
Comparer
first, comparing the invalid credential response
second, the valid credential response
Sequencer
用來評估tokens的熵(ㄕㄤ)或是隨機性,分析session cookie或是為防止CSRF所產生的token
有2種方式使用sequencer評估token:
- Live Capture:登入頁面的傳遞post request傳遞給sequencer,server會回傳帶有token的response,啟用sequencer的live capture,會自動傳遞上千個一樣的request到server,並儲存其response樣本,當我們收集到足夠的樣本時,就可以關閉live capture,並分析token的pattern。
- Manual Load:允許載入事先準備好的token 清單至sequencer進行分析
Live Capture
- Overall result:呈現分析之token的安全度
- Effective entropy:測量token的隨機性,有效的熵(ㄕㄤ)具有117bits,相對來說算高,較可抵禦預測(prediction)或brute force攻擊
- Reliability:顯著性為1%表示具有99%的可信度
- Sample:提供分析過程中的細節,包含token數量及特徵
Q:What is the overall quality of randomness estimated to be?
excellent
Organizer
Extensions
BApp Store
Jython
如果要使用python撰寫的模組,必須要先安裝Jython(java寫的python interpreter)。
- 下載Jython
- 在burp中設定jython
APIs
可以整合burp裡面的APIs來撰寫自己的擴充套件或是設計modules的行為模式,支援的語言有下列,可參考官方document
- Java
- Python(via jython)
- Ruby(via Ruby)
Reference
- 作者:ji3g4gp
- 連結:https://gpblog.vercel.app//article/Burp-Suite-Fundamental
- 著作權:本文採用 CC BY-NC-SA 4.0 許可協議,轉載請註明出處。