explaingit

mohitdabas/malshark

14PythonAudience · researcherComplexity · 3/5Setup · moderate

TLDR

Python MCP server that wraps tshark so AI assistants like Claude or Cursor can analyze network capture files for malware indicators, beaconing, data exfiltration, and suspicious DNS activity using plain-English queries.

Mindmap

mindmap
  root((MalShark))
    Purpose
      AI driven PCAP analysis
      Malware traffic detection
      Plain English queries
    Detection types
      Malicious IPs and domains
      Beaconing intervals
      Data exfiltration
      Cleartext credentials
      DNS tunneling
    Tech stack
      Python asyncio
      tshark wrapper
      MCP server protocol
    Integration
      Claude Desktop
      Cursor IDE
      Any MCP compatible tool
    Performance
      Parallel analysis passes
      87 to 100 percent detection
      Known service whitelist
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Drop a suspicious PCAP file into MalShark and ask your AI assistant in plain English to extract all malicious IPs, domains, and indicators of compromise

USE CASE 2

Detect beaconing behavior in network traffic by asking the AI to check for outbound connections firing at consistent intervals

USE CASE 3

Find cleartext passwords or authentication tokens sent over the network by describing what you are looking for without writing tshark filters by hand

Tech stack

PythontsharkMCPasyncio

Getting it running

Difficulty · moderate Time to first run · 30min

Requires tshark (Wireshark CLI) and Python 3.11+ installed before setup, must be configured as an MCP server in Cursor or Claude Desktop before use.

In plain English

MalShark is a Python tool that helps security analysts investigate suspicious network traffic by letting an AI assistant run packet analysis commands on their behalf. It wraps tshark, which is the command-line version of Wireshark, a widely used network capture analysis program, and exposes its capabilities through the Model Context Protocol. MCP is a standard that lets AI coding assistants like Cursor or Claude Desktop call external tools during a conversation. The practical effect is that you can drop a network capture file into a folder, describe what you want to find in plain English, and the AI figures out which analysis steps to run and in what order. It can extract indicators of compromise such as malicious domain names and IP addresses, check whether a suspicious connection is regularly beaconing home at consistent intervals, look for file downloads or large data transfers that might indicate data theft, find cleartext passwords or authentication tokens sent over the network, and detect unusual DNS activity that might signal data smuggling through DNS queries. The tool runs multiple tshark analysis passes at the same time using Python's async capabilities, so what might take minutes if done one step at a time completes much faster. Detection rules were tuned against real malware captures from a public malware traffic research site rather than invented scenarios, and there is a whitelist of well-known services like content delivery networks and software update servers to keep false alarms low. Benchmark results against several real malware samples are included in the repository, showing detection rates in the 87 to 100 percent range on the tested cases. The project structure is clean and organized, with each analysis type in its own module and benchmark documentation alongside the code. Installation requires Python 3.11 or newer and tshark already installed on your system. The README gives step-by-step setup instructions for both Debian-based Linux and macOS.

Copy-paste prompts

Prompt 1
I have a PCAP file from a suspected malware infection, using MalShark with Claude Desktop, what prompt do I send to extract all suspicious IPs, domains, and IOCs from the capture?
Prompt 2
Set up MalShark in Cursor and analyze my network capture for data exfiltration, specifically large outbound transfers and anything that looks like DNS tunneling
Prompt 3
MalShark flagged a connection as beaconing, how do I tune the detection interval threshold and add a CDN to the whitelist so it stops triggering on known-good traffic?
Prompt 4
Walk me through installing MalShark on macOS: installing tshark via Homebrew, setting up the Python 3.11 virtual environment, and wiring it into Claude Desktop as an MCP server
Open on GitHub → Explain another repo

← mohitdabas on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.