Developer: Ahmad
GitHub: https://github.com/cys-dexter
Version: 1.0.0
NetForensics is an enterprise-oriented Network Forensics and Digital Forensics & Incident Response (DFIR) investigation suite written in Go (Golang).
It is designed for security analysts, SOC teams, incident responders, and forensic investigators who need to inspect network traffic, analyze PCAP evidence, identify suspicious network behavior, extract transferred artifacts, calculate forensic hashes, and produce structured investigation reports.
NetForensics supports two primary investigation workflows:
- Offline Forensics β analyze previously captured
.pcapand.pcapngfiles. - Live Network Monitoring β capture packets directly from a selected network interface.
The project includes packet parsing, TCP stream reassembly, artifact carving, cryptographic hashing, threat detection, forensic timeline generation, and JSON/CSV export capabilities.
Analyze existing PCAP and PCAPNG captures without performing live packet capture.
./bin/netforensics -r capture.pcapSupported forensic workflows include packet inspection, protocol analysis, stream reconstruction, threat detection, artifact extraction, and timeline generation.
Capture packets directly from a network interface using libpcap.
sudo ./bin/netforensics -i eth0Live capture may require elevated privileges depending on the operating system and network-interface permissions.
NetForensics includes multiple network-threat detection mechanisms, including:
- ARP Poisoning / ARP Cache Poisoning
- Man-in-the-Middle (MITM) indicators
- TCP Port Scanning
- Xmas Tree scans
- NULL scans
- FIN scans
- Rapid port sweeps
- DNS tunneling / suspicious DNS activity
- Possible DNS-based data exfiltration
- Masscan-style TCP fingerprinting
The existing project implementation documents stateful ARP inspection, DNS entropy analysis, and several TCP scanning fingerprints.
NetForensics can reconstruct relevant network streams and extract transferred payloads.
The forensic pipeline includes:
- TCP stream reassembly
- HTTP payload extraction
- FTP transfer correlation
- File-signature / magic-byte detection
- Artifact extraction
- SHA-256 hashing
- MD5 hashing
- Evidence timeline integration
Extracted artifacts are written to:
./extracted_artifacts/
The documented artifact pipeline includes HTTP and FTP extraction as well as magic-byte identification for executables, documents, archives, images, and scripts.
Investigation data can be exported in structured formats suitable for further analysis.
Supported formats include:
- JSON
- CSV
The project documentation specifically describes JSON and RFC 4180 CSV timeline exporters for forensic and SIEM workflows.
NetForensics includes an interactive Terminal User Interface for monitoring:
- Live packets
- Threat alerts
- Carved artifacts
- Evidence timeline
The documented interface provides dedicated views for packet activity, forensic alerts, artifacts, and timeline events.
| Key | Action |
|---|---|
Tab / Shift+Tab |
Cycle between interface panels |
1 |
Focus Live Packets |
2 |
Focus Threat Alerts |
3 / f |
Focus Carved Artifacts |
4 |
Focus Evidence Timeline |
Arrow Keys |
Navigate records |
e |
Open timeline export |
? / F1 |
Open help |
q / Ctrl+C |
Quit gracefully |
These shortcuts are documented by the project's existing TUI specification.
Before installing NetForensics, make sure the following requirements are available.
NetForensics requires:
Go 1.22 or newer
Check your installed version:
go versionExample:
go version go1.22.x linux/amd64
If your installed version is older than 1.22, upgrade Go before building the project.
Live packet capture requires the libpcap development libraries.
Install all required system packages with:
sudo apt update && sudo apt install -y libpcap-dev git build-essentialThe project documentation identifies libpcap development headers as a required dependency.
Do not run go build with sudo.
Avoid:
sudo go build ...Running the Go build as root can create root-owned files and directories inside the project, particularly under:
bin/
This can later cause:
Permission denied
when your normal user attempts to overwrite or remove the generated executable.
Use sudo only when administrative privileges are actually required, such as:
- Installing system packages.
- Capturing packets from a restricted network interface.
- Repairing ownership of files that were previously created by
root.
Run the Go build itself as your normal user.
git clone https://github.com/cys-dexter/NetForensics.gitEnter the project directory:
cd NetForensicsRun:
go mod verifyThis verifies the downloaded Go modules against their expected checksums.
Create a clean bin directory:
rm -rf bin && mkdir -p binDo not use sudo here.
Build the optimized executable:
go build -ldflags="-s -w" -buildvcs=false -o bin/netforensics ./cmd/netforensicsAgain, do not add sudo.
After a successful build, the executable will be:
bin/netforensics
Verify it:
ls -lh bin/netforensicsIf you previously built the project using sudo, your project may contain files owned by root.
Check ownership:
ls -ld .
ls -ld binIf bin or project files are owned by root, repair the ownership:
sudo chown -R "$USER:$USER" .Then recreate the build directory:
rm -rf bin && mkdir -p binFinally rebuild normally:
go build -ldflags="-s -w" -buildvcs=false -o bin/netforensics ./cmd/netforensicsThe preferred solution is:
Fix ownership β clean bin/ β build as normal user
After building the project successfully, verify the command-line interface:
./bin/netforensics --helpThis should be the first command used to inspect the available options supported by the compiled application.
Analyze an existing capture:
./bin/netforensics -r /path/to/capture.pcapExample:
./bin/netforensics -r suspicious_traffic.pcapPCAPNG example:
./bin/netforensics -r suspicious_traffic.pcapngThe documented offline mode uses -r to provide the PCAP input file.
The Offline Forensics mode requires an existing network capture file in either:
.pcap
.pcapng
NetForensics does not create the offline capture file automatically. The file must be obtained from a previous packet capture or generated using a packet-capture tool such as tcpdump or Wireshark.
On Linux, first identify your available network interfaces:
ip linkYou may see interfaces such as:
eth0
ens33
enp0s3
wlan0
You can then create a capture file with:
sudo tcpdump -i any -c 500 -w capture.pcapThis command captures 500 packets and automatically stops when the limit is reached.
You can generate normal network activity while the capture is running, for example by opening websites or using other network applications.
The resulting file will be:
capture.pcap
If you know the interface you want to monitor, replace any with the interface name:
sudo tcpdump -i eth0 -c 500 -w capture.pcapFor a wireless interface:
sudo tcpdump -i wlan0 -c 500 -w capture.pcapReplace eth0 or wlan0 with the interface available on your system.
You can also create a capture using Wireshark:
- Open Wireshark.
- Select the network interface currently being used.
- Start the capture.
- Generate some normal network traffic.
- Stop the capture.
- Select File β Save As.
- Save the capture as:
capture.pcapng
The resulting .pcapng file can then be analyzed by NetForensics.
After creating or obtaining a capture file, run:
./bin/netforensics -r capture.pcapFor a PCAPNG file:
./bin/netforensics -r capture.pcapngYou can also provide an absolute path:
./bin/netforensics -r /path/to/capture.pcapExample:
./bin/netforensics -r ~/captures/suspicious_traffic.pcapThe capture file is read locally by NetForensics and analyzed without performing live packet capture.
Existing PCAP / PCAPNG
β
βΌ
./bin/netforensics -r capture.pcap
β
βΌ
Packet Parsing
β
ββββΊ Protocol Analysis
ββββΊ Threat Detection
ββββΊ TCP Stream Analysis
ββββΊ Artifact Analysis
ββββΊ Hash Calculation
ββββΊ Forensic Timeline
Offline analysis does not require sudo merely to read a normal PCAP file:
./bin/netforensics -r capture.pcapAdministrative privileges are generally associated with creating live captures, not analyzing an existing capture file.
If you do not already have a PCAP or PCAPNG file, create one first using tcpdump or Wireshark as described above.
To capture packets from a network interface:
sudo ./bin/netforensics -i eth0Replace eth0 with the interface available on your system.
List interfaces on Linux:
ip linkPossible interfaces include:
eth0
ens33
enp0s3
wlan0
Example:
sudo ./bin/netforensics -i wlan0Live capture is the scenario where elevated privileges may be required. The project's documented usage also invokes the binary with sudo for live sniffing.
NetForensics supports Berkeley Packet Filter expressions for narrowing live capture traffic.
Example:
sudo ./bin/netforensics -i eth0 -bpf "port 80 or port 53 or port 21"This limits captured traffic to the specified ports.
Another example:
sudo ./bin/netforensics -i eth0 -bpf "tcp port 80 or udp port 53"BPF filtering is designed to reduce unnecessary traffic and focus the investigation on relevant flows.
NetForensics provides a non-interactive mode using:
-headless
This is useful for automation, scripts, containers, and SOC ingestion pipelines.
Example:
./bin/netforensics \
-r capture.pcapng \
-headless \
-timeline evidence.json \
-o json \
-out-dir ./extracted_artifactsThe documented headless workflow combines PCAP input with timeline output, an output format, and an artifact directory.
Generate a JSON forensic timeline:
./bin/netforensics \
-r capture.pcapng \
-headless \
-timeline evidence.json \
-o json \
-out-dir ./extracted_artifactsExport the timeline as CSV:
./bin/netforensics \
-r compromise.pcap \
-headless \
-timeline evidence_report.csv \
-o csvThe project documentation describes the CSV exporter as RFC 4180 compatible and intended for structured forensic/SIEM workflows.
Run the complete test suite:
go test -v -race ./...| Option | Purpose |
|---|---|
-v |
Verbose test output |
-race |
Enable Go race detection |
./... |
Test all packages |
Do not use sudo for normal unit testing.
For a new user, the simplest workflow is:
sudo apt update && sudo apt install -y libpcap-dev git build-essentialgit clone https://github.com/cys-dexter/NetForensics.git
cd NetForensicsgo mod verifyrm -rf bin && mkdir -p bin
go build -ldflags="-s -w" -buildvcs=false -o bin/netforensics ./cmd/netforensics./bin/netforensics --help./bin/netforensics -r capture.pcapsudo ./bin/netforensics -i eth0go test -v -race ./...The documented project follows a modular Go architecture:
NetForensics/
βββ cmd/
β βββ netforensics/
β βββ main.go
β
βββ pkg/
β βββ capture/
β β βββ capture.go
β β βββ stats.go
β β
β βββ reassembly/
β β βββ stream.go
β β βββ carver.go
β β βββ ftp.go
β β
β βββ forensics/
β β βββ engine.go
β β βββ models.go
β β βββ hasher.go
β β βββ dns_tunnel.go
β β βββ arp_poison.go
β β βββ port_scan.go
β β βββ forensics_test.go
β β
β βββ protocols/
β β βββ parser.go
β β βββ types.go
β β βββ dns.go
β β βββ arp.go
β β βββ http.go
β β βββ protocols_test.go
β β
β βββ reporter/
β β βββ timeline.go
β β βββ export_json.go
β β βββ export_csv.go
β β βββ reporter_test.go
β β
β βββ ui/
β βββ tui.go
β βββ views.go
β βββ keybindings.go
β
βββ testdata/
β βββ generate_pcaps.go
β βββ forensic_sample.pcap
β
βββ bin/
β βββ netforensics
β
βββ extracted_artifacts/
βββ go.mod
βββ go.sum
βββ README.md
The existing project documentation identifies cmd/netforensics/main.go as the CLI entry point and separates capture, reassembly, forensics, protocols, reporting, and TUI functionality into dedicated packages.
A typical investigation can be performed as follows:
PCAP / Live Interface
β
βΌ
Packet Capture / Parsing
β
ββββΊ Protocol Analysis
β
ββββΊ Threat Detection
β βββ ARP Poisoning
β βββ Port Scanning
β βββ DNS Tunneling
β
ββββΊ TCP Stream Reassembly
β
ββββΊ Artifact Carving
β
ββββΊ SHA-256 / MD5 Hashing
β
βΌ
Forensic Timeline
β
ββββΊ JSON
ββββΊ CSV
This reflects the documented separation between packet ingestion, threat detection, artifact extraction, hashing, timeline generation, and reporting.
Offline PCAP analysis normally does not require root privileges:
./bin/netforensics -r capture.pcapLive capture may require elevated privileges:
sudo ./bin/netforensics -i eth0Do not build as root:
go build ...not:
sudo go build ...If you previously used sudo during development:
sudo chown -R "$USER:$USER" .Then clean and rebuild:
rm -rf bin && mkdir -p bin
go build -ldflags="-s -w" -buildvcs=false -o bin/netforensics ./cmd/netforensicsDeveloper: Ahmad
GitHub:
https://github.com/cys-dexter
Project:
NetForensics
Version:
1.0.0
NetForensics is distributed under the MIT License.
See the LICENSE file in the repository for the complete license text.
NetForensics is intended for authorized security monitoring, network troubleshooting, digital forensics, and incident-response investigations.
Only capture or analyze network traffic on systems and networks for which you have appropriate authorization.
NetForensics integrates automated binary reputation verification into the forensic artifact-analysis workflow.
NetForensics can query the CIRCL Hashlookup database in real time for carved binaries and executable artifacts.
This allows the forensic pipeline to verify whether an extracted executable is already known and associated with trusted software.
For carved binary artifacts, NetForensics uses the calculated SHA-256 hash to perform reputation verification against known binary repositories.
The verification workflow helps distinguish known legitimate software from previously unknown or suspicious binaries.
When a carved binary matches a known legitimate software entry in the Hashlookup database, NetForensics can automatically reduce the associated threat classification.
This helps minimize false positives during forensic investigations while preserving the original artifact and its forensic metadata.
If the SHA-256 hash of a carved binary matches a trusted known binary, its threat indicator is automatically downgraded to:
LevelSafe
This allows known legitimate software to be separated from suspicious or unknown artifacts without removing it from the investigation results.
The automated reputation-verification workflow can be represented as:
Network Traffic / PCAP
β
βΌ
TCP Stream Reassembly
β
βΌ
Artifact Carving
β
βΌ
Executable Detected
β
βΌ
SHA-256 Calculation
β
βΌ
CIRCL Hashlookup Query
β
ββββΊ Trusted Known Binary
β β
β βΌ
β LevelSafe
β
ββββΊ No Trusted Match
β
βΌ
Continue Threat Analysis
This integration adds an additional reputation-verification layer to the existing artifact carving, hashing, threat detection, and forensic reporting workflow.