一、前言碎语
1、采用Github上的Actions进行部署。
2、采用Nuclei+Paramspider进行结合
二、环境准备
1、ParamSpider
git clone https://github.com/0xKayala/ParamSpider.git
2、Nuclei
git clone https://github.com/projectdiscovery/nuclei.git
3、Templates
git clone https://github.com/projectdiscovery/fuzzing-templates.git
4、一个可以输出结果的output的文件夹(里面放个output.txt vuln.txt的文本)
5、一个可以输入需要fuzz的域名(domain.txt)
6、采用python进行联合的调用(你也可以采用其他的语言脚本)
三、整体架构
四、核心
代码
name: Incloud_Github_Fuzzing
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Setup Dependencies
run: sudo apt-get install libpcap-dev
- name: Cache Go
id: cache-go
uses: actions/cache@v2
with:
path: /home/runner/go
key: ${{ runner.os }}-go
- name: Setting up ProjectDiscovery tools
if: steps.cache-go.outputs.cache-hit != 'true'
env:
GO111MODULE: on
run: |
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
shell: bash
- name: Running ParamSpider
shell: bash
run: |
pip3 install -r ParamSpider/requirements.txt
chmod +x run.py
python3 run.py
- name: Running nuclei-fuzzing scaning
run: |
nuclei -l output/output.txt -rl 300 -bs 35 -c 30 -mhe 10 -ni -t fuzzing-templates/ -stats -silent -severity critical,medium,high,low -o output/vuln.txt | tee output/vuln.txt
shell: bash
- name: Sorting the output results
run: |
find output -type f -exec sort {} -o {} ;
shell: bash
- name: Create local changes
run: |
git add output/vuln.txt
shell: bash
- name: Sorting the output results
run: |
find output -type f -exec sort {} -o {} ;
shell: bash
- name: Create local changes
run: |
git add output/vuln.txt
- name: Commit results to Github
run: |
git config --local user.email "[email protected]"
git config --global user.name "xxx"
git commit -m "Nuclei Report" -a --allow-empty
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
注:git config 的email与name需要修改成自己的
#run.py代码
import os
with open('domain.txt','r') as file:
hosts = [line.strip() for line in file.readlines()]
for host in hosts:
os.system("python3 ParamSpider/paramspider.py --domain "+host+" --output output/output.txt")
五、效果展示
六、利益分析
利:可以有效的减少自己服务器的暴露
害:Github Actions每个月有额度限制
害:每个Actions的最长运行时间是6小时
(起码我是这样的,有比我时间长的,我低头学习)
七、扩展
可进行子域名自动收集+nuclei自动扫描
(目前已完成,但不公开。自己部署去,有手就行。)
★
原文始发于微信公众号(渗透安全团队):Github上部署漏洞扫描(防溯源)
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论