btab

Github Release Github Downloads

BTAB (Blue Team Analyisis Box) is a blue team analysis toolbox focused on attack signature analysis and alert triage. It assists security operators with pcap analysis, HTTP message inspection, web access log analysis, attack payload identification, encrypted traffic decryption and more. It ships as a single binary that works out of the box and can be used via the Web UI, the command line, or directly inside Wireshark through the bundled btab.lua plugin.

English - 简体中文

contents

items

Development and compilation instructions

Plug-in module development instructions

Investigation and Analysis Function Description

Wireshark Plugin (btab.lua) Usage

btab蓝队分析工具箱-ali0th-v1.0.pdf

Function

screenshot of functional interface

analyze home

analysis report

analysis tasks

pcap detection

detection result

http deep analysis

payload detection

vulnerability engine overview

nuclei templates

behavior engine overview

behavior detection scripts

pcap list

behinder decryption

shiro key detection

jq

analyse

Get started

Go to releases to download

  1. Pcap analysis requires tshark. Specify its path in config.yaml as follows (common install paths are auto-detected at startup, and it can also be edited online in "System Settings"):
pcapAnalyseConfig:
# tsharkPath: tshark # unix environment
tsharkPath: C:\Program Files\Wireshark\tshark.exe # win environment
  1. (Optional) Use jupyter notebook related dependencies
pip install jupyterlab
pip install grpcio-tools
  1. (Optional) Wireshark integration: copy wireshark/btab.lua into the Wireshark personal plugins directory to analyze captures directly from Wireshark (requires Wireshark >= 4.2). See wireshark/README.md.

Double-click to execute. After startup, visit the local port 8001: http://localhost:8001

Command line usage

# run as a web server (default port 8001)
btab server
btab server -p 8001      # specify the port
btab server --grpc       # grpc only mode

# execute a detection engine
## list the engine names
btab engine -l
## pcap parsing
btab engine -e pcap -f file.pcap

# workflow
## list the workflow templates
btab wf -l
## pcap check workflow (extract HTTP sessions and run SQLi detection on each)
btab wf -t pcapcheck -f xxx.pcap
btab wf -t pc -f xxx.pcap        # pc is an alias of pcapcheck
## SQL injection detection
btab wf -t sqli -c "' and 1+1"

Development and compilation instructions

Front-end development

cd frontend

yarn install

yarn dev
yarn build

The front-end is embedded into the binary via go:embed. Copy the ./frontend/dist/ directory to ./backend/web/dist, then run go build under ./backend/.

Or simply use the one-step packaging script (which builds the front-end, syncs dist and runs go build automatically):

bash backend/pack.sh           # dev mode: incremental build, output to release/btab_dev/
bash backend/pack.sh release   # full build, output to release/btab_windows_amd64.zip

Back-end development

cd ./backend
go mod tidy
go mod vendor
go build

Plug-in module development instructions

Using standard interfaces to implement unified plug-in module specifications, it is convenient to add new plug-in modules in the future. There are currently modules such as jq, pcap and SerializationDumper. As long as there are new scenarios, they can be added.

In addition, these plug-ins can be called by the engine and used as analysis tools in the investigation and analysis process. In theory, the capabilities can be expanded infinitely.

For detailed code, see plugin

Plug-in structure interface

type Plugin interface {
   Init() // Initialization
   Set(key string, value interface{}) // Set the variables required by the plug-in
   Check() error // Check the value of the set variable
   Exec() error // Execute this plug-in
   GetState() int // Get the plug-in task progress
   GetFinalStatus() int // Get the final result
   GetResult() string // Get the output result
}

technology stack

Modules Technology Remarks
front-end framework vue3 + vite
Front-end UI framework naive ui
backend language golang
Backend Web gin
Data storage gorm + sqlite samples, tasks, templates and scripts are all stored in DB
Vulnerability detection engine nuclei v3 load YAML templates to identify attacks in pcap / HTTP messages
Behavior detection engine goja detection scripts written in JavaScript, extensible online
URL detection engine go regexp built-in webloghunter-derived ruleset, managed online
Traffic packet parsing tshark + gopacket tshark path required
Wireshark integration Lua plugin + REST API wireshark/btab.lua, requires Wireshark >= 4.2
Investigation and analysis python grpc / jupyter

Q&A

What is the background of the development of this tool?

Since the author has been engaged in the security industry, he has been focusing on the field of traffic security analysis, and is also interested in software research and development. On the one hand, this project is to share the usual research results and promote exchanges and learning. On the other hand, there is too little communication with the blue team in China. Now there are more red teams. I hope this way can be used to form a blue team. communication group

comminicate

You can join the group chat or add my Ali0th friend to enter the group chat.

 Edge Edge

Update log

v1.1.0

A major version overhaul: the UI is rebuilt and detection evolves from "single-purpose tools" to an "engine + strategy + task" system.

v0.5.x

The first version implements the general framework, but in order to achieve no dependency, the overall packaging is difficult, the volume is large, and the expansion capability is insufficient. The second version needs to be optimized. The analysis capability is increased through DSL syntax and python jupyter, and the expansion capability is achieved through grpc.

v0.3.x

Stargazers over time

Stargazers over time