使用n8n達成自動化賞金獵人(無程式碼撰寫)-4個模板
BB Tip Harvestor

流程說明:
- 觸發器:每 4 小時跑一次
- 設定
hoursInterval: 4 - 意思是:每 4 小時觸發一次整個流程
- 只要 Workflow 啟用(active=true),就會一直定時跑
Schedule Trigger(scheduleTrigger)- 呼叫 Twitter API:搜尋最新推文
GET https://api.twitterapi.io/twitter/tweet/advanced_searchquery = "(#bugbountytips OR #bugbounty OR #bugbountytip) -Writeups -discount -phishing -fuck"(#bugbountytips OR #bugbounty OR #bugbountytip):找包含這些 hashtag 的推文Writeups -discount -phishing -fuck:排除包含這些字的推文(減少雜訊)queryType = "Latest":偏向拿「最新」結果- 使用
httpHeaderAuth(HTTP Header Auth)
HTTP Request(httpRequest)- Code 節點:把 API 回傳資料整理成「一筆筆推文」的格式
- 如果 API 回傳長這樣:
$input.item.json.tweets是陣列(多筆)- 就會
map每一筆 tweet,轉成 n8n 的 item 格式{ json: {...} } - 否則當作單筆 tweet(直接從
$input.item.json抽欄位) tweetIdurlcontent(tweet text)likeCountretweetCountreplyCountquoteCountviewCountcreatedAt(格式化後的字串)"July 7, 2025 at 04:43 AM"
Code(code node, JavaScript)A. 同時支援「多筆推文」和「單筆推文」兩種回傳格式
B. 抽出的欄位
C. createdAt 會被格式化成人看的字串
toLocaleString('en-US', ...) 產生像這種:console.log 一些 debug 訊息(只影響 log,不影響資料流)- Google Sheets:寫入或更新(用 TweetID 去重)
- 不是單純 append(一直加新列)
- 而是:如果 matchingColumns 找到已存在的列,就更新;找不到就新增
- 設定:
"matchingColumns": ["TweetID"]- 意思是:同一個 TweetID 只會有一列
- 這樣就算每 4 小時抓到重複的推文,也不會一直重複新增
Created At={{$json.createdAt}}(人類可讀字串)TweetID={{$json.tweetId}}Content={{$json.content}}Url={{$json.url}}Date= 一段 n8n expression,把Created At再轉成可排序的時間字串(YYYY-MM-DD HH:MM:SS)- 把月份英文轉成數字月
- 把 AM/PM 轉 24 小時
- 組出類似:
2025-07-07 04:43:00
Append or update row in sheet(googleSheets)A. 寫入模式:appendOrUpdate
B. 去重方式:matchingColumns = TweetID
C. 寫入欄位 mapping(你表格需要這些欄位)
Date 欄位在幹嘛?
Created At 是 "July 7, 2025 at 04:43 AM" 這種字串,排序不一定好用。中文化json檔案:
H1 reports

流程說明:
- 入口:Chat Trigger(聊天介面 / webhook)
public: true:這個聊天 webhook 是公開可用的(等於你可以分享連結給別人使用)。initialMessages:使用者一進來看到的開場白:customCss:那段 CSS 是用來把聊天 UI 做成偏「pentester theme」的樣式(字型、配色、code block 外觀、視窗大小等)。- 使用者在聊天輸入框貼一段文字(預期是 H1 report URL)
- 這段文字會在後面以
$json.chatInput的形式交給 AI agent
When chat message received@n8n/n8n-nodes-langchain.chatTrigger"Hey! Send your report's link down below"- LLM:Google Gemini Chat Model
modelName: models/gemini-2.5-pro- 使用
googlePalmApi憑證(你在 n8n 裡配置的 Gemini/PaLM API Key)
Google Gemini Chat ModellmChatGoogleGemini- 工具:HTTP Request Tool(抓 HackerOne 報告 JSON)
- 用 GET 去抓:
https://hackerone.com/reports/<id>.json url是動態的:
GET H1 reporthttpRequestTool={{ $fromAI('URL', ``, 'string') }}前面 sticky note 寫的「No hardcoded credentials」也符合這裡:它只是做公開 JSON 的 GET,不需要把帳密硬寫在裡面。
- 核心:AI Agent(負責協調 + 產出格式)
text: ={{ $json.chatInput }}systemMessage裡有非常關鍵的規則(你寫得很嚴格):- 在寫任何東西之前
- 必須先呼叫工具
GET H1 report一次且只能一次,並把使用者給的完整 URL 傳進去 - 解析回來的 JSON,從報告內容萃取「高價值技術洞察」
- 不要寫背景知識、不要一般性摘要,要偏 advanced hunter 角度
- Summary(1–2 句 BLUF)
- Techniques(每條包含 Name / Context / Technique / Impact,且 Technique 會偏 payload/steps/code)
- Pro Tip(可選)
H1 report summarizer@n8n/n8n-nodes-langchain.agent它怎麼運作?
輸出格式被你固定成:
- 連線關係(connections)代表什麼
When chat message received→(main)→H1 report summarizerGoogle Gemini Chat Model→(ai_languageModel)→H1 report summarizerGET H1 report→(ai_tool)→H1 report summarizer
中文化json檔案:
etxNuclei Template Generator

流程說明:
- 表單入口:收集 CVE / 描述 / PoC 檔
- 會產生一個表單頁面(有自訂 CSS)
- 表單欄位:
- CVE ID(必填)
- CVE description(必填)
- POC(必填檔案,上傳
.py/.txt/.sh)

formTrigger)使用者填完送出後,才會觸發後續流程。
- 讀取 PoC 檔案內容(把檔案變成文字)
operation: "text"binaryPropertyName: "POC"- 意思是:把使用者上傳的 PoC 檔(binary)轉成文字內容,輸出到
$json.data
extractFromFile)- 整理成固定欄位:cve_id / cve_description / poc
cve_id← 表單的CVE IDcve_description← 表單的CVE descriptionpoc←$json.data(剛剛抽出的 PoC 文字)
set)- 核心:AI Agent 產生 Nuclei YAML
- CVE ID
- CVE description
- PoC(包在 code block 裡)
- 只輸出有效 YAML(不能有 markdown、不能有解釋)
metadata.verified: false必須永遠存在- 用 Nuclei 的現代語法、placeholder(
[[BaseURL]]/[[Hostname]]…) - 對多 payload 要選對
clusterbomb/pitchfork/batteringram - matcher 要盡量降低誤報
- 甚至包含「baseline + exploit」兩段 request 的建議模式等
OpenAI Model (Fallback):gpt-4o(temperature 0.2)Google Gemini AI Model:gemini-2.0-flash-exp
langchain.agent)systemMessage 規則,要求 LLM:模型配置(Primary + Fallback)
needsFallback: true- 把 Agent 的輸出欄位抽出來
template = {{$json.output}}
set)template 這個欄位,方便後續處理。- 清理 + 基本校驗 + 生成「可上傳的 YAML 檔案」
- 去掉可能出現的 ```yaml code fence(有些模型會不小心包 markdown)
- 修常見符號錯誤:把
[[]]替換成{{}}(避免模板語法混亂) - 從內容抓
CVE-YYYY-NNNNN當檔名:例如CVE-2025-12345.yaml - 把 YAML 字串轉成 base64 binary,讓 n8n 能當「檔案」處理(mimeType:
text/yaml) json: cveId / filename / message / timestampbinary.data: 真正要上傳的檔案內容
code)- 發送:上傳檔案到 Slack
- resource:
file - 上傳到指定 channel:
C08HWT4RHGV - 使用你設定的 Slack Bot 憑證
slack).yaml 檔。The_Warden_CVE_Shoten

流程說明:
- 定時觸發:每小時跑一次
- 設定是
field: hours(沒有指定間隔數字時,通常代表每 1 小時) - 作用:每小時自動啟動整條流程
- 從 NIST NVD API 抓「最近一小時」新發布的 CVE
- 打的是 NVD 的 CVE 2.0 API:
- Query 參數:
pubStartDate = 現在時間 - 1 小時pubEndDate = 現在時間resultsPerPage = 20(每次最多抓 20 筆)startIndex = 0
https://services.nvd.nist.gov/rest/json/cves/2.0- 把回傳的 CVE 清單拆成「一筆一筆」方便後面處理
fieldToSplitOut: vulnerabilities- NVD API 回傳通常是一包資料,裡面有
vulnerabilities: [...] - 這步會把陣列拆開,變成 n8n 裡的多個 items:一個 item = 一個 CVE
- 萃取重點欄位並格式化
cve:CVE ID(例如 CVE-2025-12345)published:把cve.published轉成 UTC 的可讀時間字串(en-GB 格式 +(UTC))cve_descriptions:拿第一段描述descriptions[0].valueseverity:依序嘗試 CVSS v4.0 → v3.1 → v3.0 → v2references:取第一個 reference URL
HIGH (8.8),找不到就 Unknown- AI 分析:判斷「對 bug bounty 值不值得做」並輸出 Slack 格式
- 使用
Google Gemini Chat Model:gemini-2.5-pro - 你在 system prompt 裡規定它要:
- 以「菁英 bug bounty hunter」角度評估
- 只講能幫你決策、能直接測試的內容
- 不要科普
- 輸出必須是 Slack-ready(含 Slack hyperlink
<url|text>、總長不超過 5 行) - 一定要包含原始 CVE 描述
- 給一條可執行的策略(例如掃哪些端點、找哪些 pattern)
- CVE
- Severity
- Published
- Description
- Ref
CVE:* <link|CVE-ID> | *Severity:* ...🎯 Bug Bounty Relevance: HIGH/MEDIUM/LOW/NONE- 1-2 行精準原因
Strategy:* ...
- 把 AI 產出的評估送到 Slack 指定頻道
text = {{$json.output}}(直接把 AI 的輸出送出)channelId目前是空的(你需要填你的目標 Slack 頻道)includeLinkToWorkflow: false(不附上 workflow 連結)
中文化json檔案:
The_Warden_etxHackerone_Scope_Monitor

流程說明:
- 排程:每 20 分鐘跑一次同步
- 每 20 分鐘觸發一次整條資料同步與比對流程。
- 抓 HackerOne 計畫清單(GraphQL + 分頁批次)
- 先產生
numbers = [100, 200, 300] - 再把 numbers 拆成多筆 item,當作分頁用的
fromoffset - 兩個 HTTP POST 都打
https://hackerone.com/graphql - 用
DiscoveryQuery去抓 offers_bounties=true 的計畫,並排除Engagements::Assessment - 每次
size = 100,所以總共大概抓 0–399 這四頁(最多約 400 個計畫,依排序 launched_at DESC) - 把多頁結果合併
- 抽出每個計畫的
handle,最後得到一個 handles 陣列
Pagination Setup (100–300) → Split Pagination Values
Parallel Fetch Programs(from=0)+ Fetch HackerOne Programs(from=100/200/300)
Merge Program Data → Extract Program Handles
- 取得每個計畫的「最新 scope version」
- 把 handles 拆成一個 handle 一筆
- 用 GraphQL
ScopeVersionQuery查: team(handle).structured_scope_versions(first:1).edges[0].node.id- 有設定 batching:每批 25 個、每 5 秒一批(避免一次打太猛)
- 把結果整理成
{ handle, latest_scope_version_id } - 去重,避免重複 handle 造成後面比對干擾
Split Program Handles → Get Scope Versions(批次 batching)
Extract Scope Versions → Remove Duplicates
- 與 Supabase 資料庫比對:找「新計畫」與「scope 版本更新」
- 從 Supabase 的
hackerone-programs撈出已存的紀錄 - 整理欄位成
{ handle, latest_scope_version_id }方便比對 - Create New Program:寫入 Supabase(program_name + latest_scope_version_id)
- Format New Program Alert1 → Discord New Program Alert:發 Discord「🗽 NEW Program ADDED」通知
- Update Scope Version:更新 Supabase 該計畫的
latest_scope_version_id - Program Scope Update → Discord SCOPE-VERSION Alert:發 Discord「㊙️ SCOPE-VERSION Changed」通知
- 接著進入「scope 內容差異」的深入比對(下一段)
Get Existing Programs → Prepare DB Data
Compare with Database(compareDatasets)
A) 新計畫(DB 沒有)
B) 既有計畫但 scope version 變了
- scope 內容差異比對:抓新 scope、跟舊 scope 對照,列出新增項
- 從比對結果取出 handle,準備查 scope 細節
- 用
getProgramScopes查structured_scopes(first: 100, archived:false)的 scope 清單 - 取出每個 asset 的:
- asset_identifier、eligible_for_bounty、eligible_for_submission、max_severity、instruction…
- 注意:這裡是
first:100,沒有做 after 分頁的迴圈,所以 scope 超過 100 筆的計畫可能會被截斷。 - 從資料庫讀出舊的
inscope/outofscope清單,整理成可比對格式 - 把剛抓到的 scope 轉成:
inscope:eligible_for_bounty === true的 asset_identifieroutofscope:其他的 asset_identifier- 變成
{ handle, inscope: [...], outofscope: [...] } - 把新舊 scope 清單做 dataset compare
- 若有差異:
- Update Program Scope:把新的 inscope/outofscope 寫回 Supabase(讓 DB 永遠跟線上同步)
- 用 code node 做字串 normalize(去掉奇怪空白、引號、大小寫差異等)
- 只挑「新增的項目」(added),如果沒新增就靜默不通知
- 有新增才發 Discord「🛡️ Program Updated」訊息,列出:
- 🟢 In-Scope Added
- 🔴 Out-of-Scope Added
Extract Handle for Lookup
Fetch Updated Scope Details(GraphQL)
Get Previous Scope(Supabase)→ Prepare Previous Scope
Format Scope Update Data
Compare Scope Changes → Update Program Scope
Process Scope Changes → Discord In-Scope Update Alert
中文化json檔案:

No Code Bug Bounty Automation Using n8n
Sign up for Hostinger's Black Friday Sale 👉 https://hostinger.com/nahamsec gland get 10% off using the code nahamsec LIKE and SUBSCRIBE with NOTIFICATIONS ON if you enjoyed the video! 👍 📚 If you want to learn bug bounty hunting from me: https://bugbounty.nahamsec.training 💻 If you want to practice some of my free labs and challenges: https://app.hackinghub.io 💵 FREE $200 DigitalOcean Credit: https://m.do.co/c/3236319b9d0b 🔗 LINKS: 📖 MY FAVORITE BOOKS: Bug Bounty Bootcamp: The Guide to Finding and Reporting Web Vulnerabilities -https://amzn.to/3Re8Pa2 Hacking APIs: Breaking Web Application Programming Interfaces - https://amzn.to/45g4bOr Black Hat GraphQL: Attacking Next Generation APIs - https://amzn.to/455F9l3 🍿 WATCH NEXT: If I Started Bug Bounty Hunting in 2024, I'd Do this - https://youtu.be/z6O6McIDYhU 2023 How to Bug Bounty - https://youtu.be/FDeuOhE5MhU Bug Bounty Hunting Full Time - https://youtu.be/watch?v=ukb79vAgRiY Hacking An Online Casino - https://youtu.be/watch?v=2eIDxVrk4a8 WebApp Pentesting/Hacking Roadmap - https://youtu.be/watch?v=doFo0I_KU0o MY OTHER SOCIALS: 🌍 My website - https://www.nahamsec.com/ 👨💻 My free labs - https://app.hackinghub.io/ 🐦 Twitter - https://twitter.com/NahamSec 📸 Instagram - https://instagram.com/NahamSec 👨💻 Linkedin - https://www.linkedin.com/in/nahamsec/ WHO AM I? If we haven't met before, hey 👋! I'm Ben, most people online know me online as NahamSec. I'm a hacker turned content creator. Through my videos on this channel, I share my experience as a top hacker and bug bounty hunter to help you become a better and more efficient hacker. FYI: Some of the links I have in the description are affiliate links that I get a a percentage from.
Previous
考試資源
Next
AI基礎篇_Agent