diff --git a/README b/README index 10a2f6a..bed66e8 100644 --- a/README +++ b/README @@ -5,14 +5,16 @@ Key features: * Deep packet analysis using specialized plugins * Robust stream reassembly * IPv4 and IPv6 support -* Custom output handlers +* Multiple user-selectable output formats and the ability to create custom output handlers * Chainable plugins +* Parallel processing option to divide the handling of data source into separate Python processes +* Enables development of external plugin packs to share and install new externally developed plugins without overlapping the core Dshell plugin directories ## Requirements -* Linux (developed on Red Hat Enterprise Linux 6.7) -* Python 3 (developed with Python 3.6.2) +* Linux (developed on Ubuntu 20.04 LTS) +* Python 3 (developed with Python 3.8.10) * [pypacker](https://gitlab.com/mike01/pypacker) -* [pcapy](https://github.com/helpsystems/pcapy) +* [pcapy-ng](https://github.com/stamparm/pcapy-ng/) * [pyOpenSSL](https://github.com/pyca/pyopenssl) * [geoip2](https://github.com/maxmind/GeoIP2-python) * [MaxMind GeoIP2 datasets](https://dev.maxmind.com/geoip/geoip2/geolite2/) @@ -27,37 +29,11 @@ Key features: * [pyJA3](https://github.com/salesforce/ja3/tree/master/python) * used in the tls plugin -## Major Changes Since Previous Release -* This is a major framework update to Dshell. Plugins written for the previous version are not compatible with this version, and vice versa. -* Uses Python 3 - * Rewritten in Python 3 from the ground up. Python 2 language deprecated on [1 JAN 2020](https://www.python.org/doc/sunset-python-2/) - * By extension, dpkt and pypcap have been replaced with Python3-friendly pypacker and pcapy (respectively). -* Is a Python package - * Converted into a single package, removing the need for the shell to set several environment variables. - * Allows easier use of Dshell plugins in other Python scripts -* Changed "decoders" to "plugins" - * Primarily a word-swap, to clarify that "decoders" can do more than simply decode traffic, and to put Dshell more in line with the terminology of other frameworks. -* Significant reduction in camelCase functions, replaced with more Pythonic snake\_case functions. - * Notable examples include blobHandler->blob\_handler, rawHandler->raw\_handler, connectionInitHandler->connection\_init\_handler, etc. -* All plugins are now chainable - * To accommodate this, handler functions in plugins must now use return statements indicating whether a packet, connection, or similar will continue to the next plugin. The type of object(s) to return depends on the type of handler, but will generally match the types of the handler's input. Dshell will display a warning if it's not the right type. -* Plugins can now use all output modules\* available to the command line switch, -O - * That does not mean every output module will be _useful_ to every plugin (e.g. using netflow output for a plugin that looks at individual packets), but they are available. - * alert(), write(), and dump() are now the same function: write() - * Output modules can be listed with a new flag in decode.py, --list-output or --lo - * Arguments for output modules are now passed with the --oargs command-line argument - * \* pcapout is (currently) the exception to this rule. A method has yet to arise that allows it to work with connection-based plugins -* No more dObj declaration - * decode.py just looks for the class named DshellPlugin and creates an instance of that -* Improved error handling - * Dshell handles more of the most common exceptions during everyday use -* Enables development of external plugin packs, allowing the sharing and installation of new, externally-developed plugins without overlapping the core Dshell libraries. - ## Installation 1. Install Dshell with pip - * `sudo python3 -m pip install Dshell/` OR `sudo python3 -m pip install ` -2. Configure geoip2 by moving the MaxMind data files (GeoLite2-ASN.mmdb, GeoLite2-City.mmdb, GeoLite2-Country.mmdb) to <install-location>/data/GeoIP/ + * `python3 -m pip install Dshell/` OR `python3 -m pip install ` +2. Configure geoip2 by moving the MaxMind data files (GeoLite2-ASN.mmdb, GeoLite2-City.mmdb, GeoLite2-Country.mmdb) to [...]/site-packages/dshell/data/GeoIP/ 3. Run `dshell`. This should drop you into a `Dshell> ` prompt. ## Basic Usage @@ -69,7 +45,7 @@ Key features: * `decode -p ` * Display information about a plugin, including available command line flags * `decode -p ` - * Run the selected plugin on a pcap file + * Run the selected plugin on a pcap or pcapng file * `decode -p + ` * Chain two (or more) plugins together and run them on a pcap file * `decode -p -i ` @@ -79,7 +55,7 @@ Key features: Showing DNS lookups in [sample traffic](http://wiki.wireshark.org/SampleCaptures#General_.2F_Unsorted) ``` -Dshell> decode -p dns ~/pcap/dns.cap |sort +Dshell> decode -p dns ~/pcap/dns.cap | sort [DNS] 2005-03-30 03:47:46 192.168.170.8:32795 -- 192.168.170.20:53 ** ID: 4146, TXT? google.com., TXT: b'\x0fv=spf1 ptr ?all' ** [DNS] 2005-03-30 03:47:50 192.168.170.8:32795 -- 192.168.170.20:53 ** ID: 63343, MX? google.com., MX: b'\x00(\x05smtp4\xc0\x0c', MX: b'\x00\n\x05smtp5\xc0\x0c', MX: b'\x00\n\x05smtp6\xc0\x0c', MX: b'\x00\n\x05smtp1\xc0\x0c', MX: b'\x00\n\x05smtp2\xc0\x0c', MX: b'\x00(\x05smtp3\xc0\x0c' ** [DNS] 2005-03-30 03:47:59 192.168.170.8:32795 -- 192.168.170.20:53 ** ID: 18849, LOC? google.com. ** @@ -165,8 +141,8 @@ Dshell> decode -p country+netflow --country_code=JP ~/pcap/SkypeIRC.cap Collecting DNS traffic from several files and storing it in a new pcap file. ``` -Dshell> decode -p dns+pcapwriter --pcapwriter_outfile=test.pcap ~/pcap/*.cap >/dev/null -Dshell> tcpdump -nnr test.pcap |head +Dshell> decode -p dns+pcapwriter --pcapwriter_outfile=test.pcap ~/pcap/*.cap > /dev/null +Dshell> tcpdump -nnr test.pcap | head reading from file test.pcap, link-type EN10MB (Ethernet) 15:36:08.670569 IP 192.168.1.2.2131 > 192.168.1.1.53: 40209+ A? ui.skype.com. (30) 15:36:08.670687 IP 192.168.1.2.2131 > 192.168.1.1.53: 40210+ AAAA? ui.skype.com. (30) @@ -184,8 +160,8 @@ Collecting TFTP data and converting alerts to JSON format using [sample traffic] ``` Dshell> decode -p tftp -O jsonout ~/pcap/tftp_*.pcap -{"dport": 3445, "dip": "192.168.0.10", "data": "read rfc1350.txt (24599 bytes) ", "sport": 50618, "readwrite": "read", "sip": "192.168.0.253", "plugin": "tftp", "ts": 1367411051.972852, "filename": "rfc1350.txt"} -{"dport": 2087, "dip": "192.168.0.13", "data": "write rfc1350.txt (24599 bytes) ", "sport": 57509, "readwrite": "write", "sip": "192.168.0.1", "plugin": "tftp", "ts": 1367053679.45274, "filename": "rfc1350.txt"} +{"ts": 1367411051.972852, "sip": "192.168.0.253", "sport": 50618, "dip": "192.168.0.10", "dport": 3445, "readwrite": "read", "filename": "rfc1350.txt", "plugin": "tftp", "pcapfile": "/home/pcap/tftp_rrq.pcap", "data": "read rfc1350.txt (24599 bytes) "} +{"ts": 1367053679.45274, "sip": "192.168.0.1", "sport": 57509, "dip": "192.168.0.13", "dport": 2087, "readwrite": "write", "filename": "rfc1350.txt", "plugin": "tftp", "pcapfile": "/home/pcap/tftp_wrq.pcap", "data": "write rfc1350.txt (24599 bytes) "} ``` Running a plugin within a separate Python script using [sample traffic](https://wiki.wireshark.org/SampleCaptures#TFTP)