afrog

package module
v3.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 17 Imported by: 0

README

afrog

A Security Tool for Bug Bounty, Pentest and Red Teaming

English中文

DownloadWikiAfrog PoC 规则编写权威指南

Afrog 官方圈 - 知识星球

本圈专注更新 PoC,不追求数量,只打磨质量。

PoC Contributors

Typora-Logo
不动明王
Typora-Logo
雪山
Typora-Logo
White-hua
Typora-Logo
123456
Typora-Logo
ifofor
Typora-Logo
Air
Typora-Logo
执着
Typora-Logo
purple-WL
Typora-Logo
throat
Typora-Logo
Secx
Typora-Logo
冰河
Typora-Logo
Sheen
Typora-Logo
a16
Typora-Logo
A1
Typora-Logo
rainbow2972
Typora-Logo
wuha0926
Typora-Logo
茄子
Typora-Logo
lei_sec
Typora-Logo
G-H-Z
Typora-Logo
wh1te
Typora-Logo
清月
Typora-Logo
york
Typora-Logo
7eleven.eth
Typora-Logo
Double...
Typora-Logo
ICEY_
Typora-Logo
lazy
Typora-Logo
free2e
Typora-Logo
m4sk
Typora-Logo
沉默树人
Typora-Logo
陈麻子
Typora-Logo
leonardo-o1
Typora-Logo
江湖人称魏...
Typora-Logo
若兮风
Typora-Logo
-sudo
Typora-Logo
Cuerz
Typora-Logo
laohuan12138
Typora-Logo
exp0l0zzz
Typora-Logo
1derian
Typora-Logo
CMDB-M
Typora-Logo
li1u
Typora-Logo
oxsonder
Typora-Logo
Zhiliao
Typora-Logo
Typora-Logo
HuiTaiL
Typora-Logo
Miracles666
Typora-Logo
Observer
Typora-Logo
黑熊
Typora-Logo
TryA9ain
Typora-Logo
fgz00
Typora-Logo
Y3y1ng
Typora-Logo
二大爷
Typora-Logo
Wans
Typora-Logo
海边的小米粥
Typora-Logo
Wen
Typora-Logo
SULAB
Typora-Logo
ZacharyZcR
Typora-Logo
Superhero
Typora-Logo
k5rC85Lma

What is afrog

afrog is a high-performance vulnerability scanner that is fast and stable. It supports user-defined PoC and comes with several built-in types, such as CVE, CNVD, default passwords, information disclosure, fingerprint identification, unauthorized access, arbitrary file reading, and command execution. With afrog, network security professionals can quickly validate and remediate vulnerabilities, which helps to enhance their security defense capabilities.

Features

  • Open source
  • Fast, stable, with low false positives
  • Detailed HTML vulnerability reports
  • Customizable and stably updatable PoCs
  • Port pre-scan (PortScan) for open port discovery
  • Active community exchange group

Installation

Prerequisites

  • Go version 1.24 or higher.

you can install it with:

Binary

$ https://github.com/zan8in/afrog/releases/latest

Github

$ git clone https://github.com/zan8in/afrog.git
$ cd afrog
$ go build cmd/afrog/main.go
$ ./afrog -h

Go

$ go install -v github.com/zan8in/afrog/v3/cmd/afrog@latest

# Confirm Go’s bin path is in your environment
$ ls ~/go/bin/afrog

# Make it runnable from anywhere (add ~/go/bin to PATH)
# Permanently (Bash — add to ~/.bashrc):
$ echo 'export PATH=$PATH:~/go/bin' >> ~/.bashrc
$ source ~/.bashrc

# If you use Zsh:
$ echo 'export PATH=$PATH:~/go/bin' >> ~/.zshrc
$ source ~/.zshrc

Running afrog

By default, afrog scans all built-in PoCs, and if it finds any vulnerabilities, it automatically creates an HTML report with the date of the scan as the filename.

afrog -t https://example.com

Warning occurs when running afrog

If you see an error message saying:

[ERR] ceye reverse service not set: /home/afrog/.config/afrog/afrog-config.yaml

it means you need to modify the configuration file.

To execute a custom PoC directory, you can use the following command:

afrog -t https://example.com -P mypocs/

Use the command -s keyword to perform a fuzzy search on all PoCs and scan the search results. Multiple keywords can be used, separated by commas. For example: -s weblogic,jboss.

afrog -t https://example.com -s weblogic,jboss

Use the command -S keyword to scan vulnerabilities based on their severity level. Severity levels include: info, low, medium, high, and critical. For example, to only scan high and critical vulnerabilities, use the command -S high,critical.

afrog -t https://example.com -S high,critical

You can scan multiple URLs at the same time as well.

afrog -T urls.txt

Port Pre-scan (PortScan)

PortScan runs before PoC scanning to discover open ports. Discovered ports will be appended to the scan target set (as host:port), and subsequent PoCs will run against the updated targets.

# Single-target full port scan
afrog -t 1.2.3.4 -ps -p all

# Network segment scan (host discovery + common port scan)
afrog -t 1.2.3.4/24 -ps

# Skip host discovery (assume target is reachable)
afrog -T targets.txt -ps -Pn

# Scan only specified ports
afrog -t example.com -ps -p 80,443,8080

Common flags:

  • -ps / --portscan: enable port pre-scan
  • -p / --ports: ports definition (e.g. top, full, all, 80,443, 1-1024)
  • -Pn / --ps-skip-discovery: skip host discovery
  • -prate / --ps-rate: portscan rate limit
  • -ptimeout / --ps-timeout-ms: portscan timeout (ms)
  • -ptries / --ps-retries: portscan retries
  • --ps-s4-chunk: chunk size when ports=full

-web Command

The -web command allows for persistently storing vulnerabilities scanned by afrog into an SQLite3 database. Accessing http://x.x.x.x:16868 via a browser provides access to the vulnerability report webpage, where users can conduct simple keyword searches and filter results by vulnerability severity.

afrog -web

Configuration file

The first time you start afrog, it will automatically create a configuration file called afrog-config.yaml, which will be saved in the current user directory under $HOME/.config/afrog/afrog-config.yaml.

Here is an example config file:

reverse:
  ceye:
    api-key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    domain: "xxxxxx.cey2e.io"
  dnslogcn:
    domain: dnslog.cn
  alphalog:
    domain: dnslogxx.sh
    api_url: "http://dnslogxx.sh/"
  xray:
    x_token: "xraytest"
    domain: dnslogxx.sh
    api_url: "http://x.x.0.x:8777"
  revsuit:
    token: "xx"
    dns_domain: "log.xx.com"
    http_url: "http://x.x.x.x/log/"
    api_url: "http://x.x.x.x/helplog"

reverse is a reverse connection platform used to verify command execution vulnerabilities that cannot be echoed back. Currently, only ceye can be used for verification.

Ceye Configuration

To obtain ceye, follow these steps:

  • Go to the ceye.io website and register an account.
  • Log in and go to the personal settings page.
  • Copy the domain and api-key and correctly configure them in the afrog-config.yaml file.

Dnslogcn

No configuration required, but unstable dnslog.cn

Alphalog

Need to build services alphalog

Xray

Need to build services xray

Revsuit

Need to build services RevsuitTutorial

Json Output (For developers)

Json

Optional command: -json -j, Save the scan results to a JSON file. The JSON file includes the following contents by default: target, fulltarget, id, and info. The info field includes the following sub-fields: name, author, severity, description, and reference. If you want to save both request and response contents, please use the -json-all command parameter.

afrog  -t https://example.com -json result.json
afrog  -t https://example.com -j result.json

Warning

The content of the JSON file is updated in real time. However, there is an important note to keep in mind: before the scan is completed, if developers want to parse the file content, they need to add a ']' symbol to the end of the file by themselves, otherwise it will cause parsing errors. Of course, if you wait for the scan to complete before parsing the file, this issue will not occur.

JsonAll

Optional command: -json-all -ja, The only difference between the -json-all and -json commands is that -json-all writes all vulnerability results, including request and response, to a JSON file.

afrog -t https://example.com -json-all result.json
afrog -t https://example.com -ja result.json

Screenshot

As Library

Simple Example

For comprehensive SDK documentation:

More Examples & Documentation

Discussion group

To join the afrog communication group on WeChat, please first add the afrog personal account and mark it as afrog. Then, you will be added to the group by the administrator.

afrog has joined 404Starlink

Disclaimer

This tool is intended only for legally authorized enterprise security construction purposes. If you want to test the functionality of this tool, you should build a target environment by yourself.

To prevent malicious use, all PoCs included in this project are theoretical assessments of vulnerabilities. The tool does not exploit vulnerabilities, launch real attacks or exploits on targets.

When using this tool for vulnerability scanning, it is important to ensure that your behavior complies with local laws and regulations, and that you have obtained sufficient authorization. Do not scan unauthorized targets.

If you engage in any illegal behavior while using this tool, you will be solely responsible for any corresponding consequences, and we will not bear any legal or joint responsibility.

Before installing and using this tool, please read each clause carefully and thoroughly. Restrictions, disclaimers, or other clauses that may significantly affect your rights and interests may be highlighted in bold or underlined to draw your attention. Unless you have fully read, fully understood, and agreed to all the terms of this agreement, do not install or use this tool. Your use of the tool or your acceptance of this agreement in any other express or implied manner will be deemed as your acknowledgment and agreement to be bound by this agreement.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OOBAdapter added in v3.2.0

type OOBAdapter interface {
	IsVaild() bool
}

OOBAdapter 简化的OOB适配器接口

type PortScanResult added in v3.2.9

type PortScanResult struct {
	Host string
	Port int
}

type SDKOptions added in v3.2.0

type SDKOptions struct {
	// ========== 目标配置 ==========
	Targets     []string // 扫描目标列表
	TargetsFile string   // 目标文件路径

	// ========== POC配置 ==========
	PocFile   string   // POC文件或目录路径(必须)
	AppendPoc []string // 附加POC文件或目录路径
	Search    string   // POC搜索关键词
	Severity  string   // 严重程度过滤

	// ========== 性能配置 ==========
	RateLimit          int // 请求速率限制 (默认: 150)
	ReqLimitPerTarget  int
	Concurrency        int // 并发数 (默认: 25)
	Retries            int // 重试次数 (默认: 1)
	Timeout            int // 超时时间秒 (默认: 10)
	MaxHostError       int // 主机最大错误数 (默认: 3)
	Smart              bool
	DisableFingerprint bool

	PortScan        bool
	PSPorts         string
	PSRateLimit     int
	PSTimeout       int
	PSRetries       int
	PSSkipDiscovery bool
	PSS4Chunk       int

	// ========== 网络配置 ==========
	Proxy   string // HTTP/SOCKS5代理
	Headers []string

	// ========== OOB配置 ==========
	EnableOOB  bool   // 是否启用OOB检测 (默认: false)
	OOB        string // OOB适配器类型: ceyeio, dnslogcn, alphalog, xray, revsuit
	OOBKey     string // OOB API密钥
	OOBDomain  string // OOB域名
	OOBApiUrl  string // OOB API地址
	OOBHttpUrl string // OOB HTTP地址

	// ========== 输出配置 ==========
	EnableStream bool // 启用流式输出
}

SDKOptions SDK扫描配置选项(优化版)

func NewSDKOptions added in v3.2.0

func NewSDKOptions() *SDKOptions

NewSDKOptions 创建默认配置

type SDKScanner added in v3.2.0

type SDKScanner struct {

	// 实时结果回调(同步版本)
	OnResult func(*result.Result)

	OnPort func(host string, port int)

	// 实时结果通道(流式版本)
	ResultChan chan *result.Result

	PortChan chan PortScanResult
	// contains filtered or unexported fields
}

SDKScanner SDK版本的扫描器,专为库调用优化

func NewSDKScanner added in v3.2.0

func NewSDKScanner(opts *SDKOptions) (*SDKScanner, error)

NewSDKScanner 创建SDK扫描器实例

func (*SDKScanner) Close added in v3.2.0

func (s *SDKScanner) Close()

Close 关闭扫描器,释放资源

func (*SDKScanner) GetOOBStatus added in v3.2.0

func (s *SDKScanner) GetOOBStatus() (bool, string)

GetOOBStatus 获取OOB状态信息

func (*SDKScanner) GetOpenPorts added in v3.2.9

func (s *SDKScanner) GetOpenPorts() map[string][]int

func (*SDKScanner) GetProgress added in v3.2.0

func (s *SDKScanner) GetProgress() float64

GetProgress 获取扫描进度(0-100)

func (*SDKScanner) GetResults added in v3.2.0

func (s *SDKScanner) GetResults() []*result.Result

GetResults 获取所有扫描结果

func (*SDKScanner) GetStats added in v3.2.0

func (s *SDKScanner) GetStats() ScanStats

GetStats 获取扫描统计信息

func (*SDKScanner) GetVulnerabilityCount added in v3.2.0

func (s *SDKScanner) GetVulnerabilityCount() int

GetVulnerabilityCount 获取漏洞数量

func (*SDKScanner) HasVulnerabilities added in v3.2.0

func (s *SDKScanner) HasVulnerabilities() bool

HasVulnerabilities 检查是否发现漏洞

func (*SDKScanner) IsOOBEnabled added in v3.2.0

func (s *SDKScanner) IsOOBEnabled() bool

IsOOBEnabled 检查是否启用了OOB检测

func (*SDKScanner) IsPaused added in v3.2.7

func (s *SDKScanner) IsPaused() bool

func (*SDKScanner) IsStopping added in v3.2.7

func (s *SDKScanner) IsStopping() bool

func (*SDKScanner) Pause added in v3.2.7

func (s *SDKScanner) Pause()

func (*SDKScanner) Resume added in v3.2.7

func (s *SDKScanner) Resume()

func (*SDKScanner) Run added in v3.2.0

func (s *SDKScanner) Run() error

Run 执行扫描(同步版本)

func (*SDKScanner) RunAsync added in v3.2.0

func (s *SDKScanner) RunAsync() error

RunAsync 执行扫描(异步版本)

func (*SDKScanner) SetConcurrency added in v3.2.0

func (s *SDKScanner) SetConcurrency(concurrency int)

SetConcurrency 动态设置并发数

func (*SDKScanner) SetProxy added in v3.2.0

func (s *SDKScanner) SetProxy(proxy string)

SetProxy 动态设置代理

func (*SDKScanner) SetRateLimit added in v3.2.0

func (s *SDKScanner) SetRateLimit(rateLimit int)

SetRateLimit 动态设置速率限制

func (*SDKScanner) Stop added in v3.2.0

func (s *SDKScanner) Stop()

Stop 停止扫描

type ScanStats added in v3.2.0

type ScanStats struct {
	StartTime      time.Time
	EndTime        time.Time
	TotalTargets   int
	TotalPocs      int
	TotalScans     int
	CompletedScans int32
	FoundVulns     int32
}

ScanStats 扫描统计信息

Directories

Path Synopsis
cmd
afrog command
helper command
regex command
sdk command
examples
async_scan command
basic_scan command
oob_scan command
port_scan command
progress_scan command
sdk_portscan command
vuln_scan command
pkg
config
pkg/config/banner.go
pkg/config/banner.go
db
db/sqlite/cmd command
log
This is a wrapper for the zap framework no SugerLogger, Only Logger @author: 胖胖的ALEX example:
This is a wrapper for the zap framework no SugerLogger, Only Logger @author: 胖胖的ALEX example:
poc
report/cmd command
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL