Nsniffer is a multifunctional network tool designed to capture and analyze network traffic, perform Man-in-the-Middle (MITM) attacks, scan devices on the network, and carry out other tasks related to network security and auditing. It is particularly aimed at educational purposes and penetration testing in controlled environments.
Important: This software is intended for ethical and educational use. Make sure you have the necessary permissions before using it.
- Real-time traffic capture using TShark.
- Saving captures in
.pcap
or.pcapng
format. - Extraction of data in hexadecimal format and conversion to readable text.
- ARP spoofing attacks and Man-in-the-Middle capabilities.
- Scanning of devices on the local network.
- Analysis of capture files.
- Listing available network interfaces.
- Interval-based capture and logging of extracted data.
- Automated dependency installation (on supported systems).
In this update, nsniffer
uses subcommands instead of a single command with multiple flags.
The general usage is:
nsniffer <subcommand> [options]
Where <subcommand>
can be one of the following:
- capture: Capture traffic with TShark.
- analyze: Analyze a
.pcap
file. - mitm: Perform a MITM attack between two targets.
- arp: Carry out simple ARP spoofing between a target and a victim.
- scan: Scan devices on the local network.
- list: List available network interfaces.
- extract: Extract hexadecimal data and convert it into readable text from a pcap file.
- log: Capture traffic at defined intervals and save the extracted data into a log file.
- setup: Install or verify necessary dependencies.
- help: Show the tool’s help information.
To see a description and available options for each subcommand, you can run:
nsniffer help
- Linux operating system.
- Superuser (root) privileges to perform most sniffing and spoofing operations.
- Necessary dependencies:
- TShark
- arpspoof (included in the dsniff suite)
- arp-scan
To install or verify dependencies on supported distributions (Debian, RedHat, Arch), run:
nsniffer setup
This will attempt to install any missing dependencies.
- Clone this repository:
git clone https://github.com/vorosdev/Nsniffer.git cd Nsniffer
- Grant execution permissions:
chmod +x nsniffer
- (Optional) Add it to your PATH so you can use it from anywhere:
sudo cp nsniffer /usr/local/bin/nsniffer
nsniffer capture -i <interface> [-o <file.pcap>] [-f <filter>] [--live]
- -i, --interface: Network interface, e.g.,
eth0
. - -o, --output: Output file. Defaults to
output.pcap
. - -f, --filter: TShark filter (e.g.,
"host 172.10.23.111 and port 2222 and tcp"
). - --live: Displays captured packets in real-time (
-x
in TShark).
Example:
nsniffer capture -i eth0 -o capture.pcap -f "port 443 and tcp" --live
nsniffer analyze <file.pcap>
Outputs a textual analysis of the specified file.
Example:
nsniffer analyze capture.pcap
nsniffer mitm <interface> <target_IP1> <target_IP2>
Enables IP forwarding and runs arpspoof
for both addresses.
Example:
nsniffer mitm eth0 192.168.0.10 192.168.0.20
nsniffer arp <interface> <target_IP> <victim_IP>
Starts arpspoof
from one target to a specific victim, without full MITM.
Example:
nsniffer arp eth0 192.168.0.1 192.168.0.50
nsniffer scan <interface>
Performs an ARP scan using arp-scan
.
Example:
nsniffer scan eth0
nsniffer list
Displays the network interfaces available on the system.
nsniffer extract <file.pcap>
Looks for frames larger than 100 bytes and converts hexadecimal data to readable text.
Example:
nsniffer extract capture.pcap
nsniffer log <interface> <log_file> [interval_in_seconds=5]
Starts a capture loop: every specified interval (5s by default), it stops the capture, extracts hex data, and writes it to log_file
.
Example:
nsniffer log eth0 mycapture.log 10
Every 10 seconds, it temporarily stops the capture, extracts data, and saves it to mycapture.log
, then restarts.
nsniffer setup
Checks and installs required dependencies (TShark, arpspoof, arp-scan) if the operating system is supported.
nsniffer help
Displays a general description of all subcommands and their usage.
nsniffer scan eth0
Finds active hosts in the subnet assigned to eth0
using arp-scan
.
nsniffer mitm eth0 192.168.1.10 192.168.1.20
Attacks the communication between IP 192.168.1.10 and 192.168.1.20 via the eth0
interface.
nsniffer log eth0 capture.log
Every 5 seconds (by default), it stops the capture, extracts hexadecimal data, and appends it to capture.log
.
Press Enter to restart the cycle or Ctrl+C to exit.
Warning
- Use this software only on networks under your control or with explicit authorization.
- Malicious use of this tool can be illegal and may lead to serious consequences.
This project is licensed under the MIT license. See the LICENSE file for more information.
This project is intended for educational and ethical purposes only. The author is not responsible for any misuse of this tool. For more information, see the DISCLAIMER.md file.