User Tools

Site Tools


docker:pcap_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker:pcap_analysis [2018/02/26 18:48] – [How to analyze large PCAP dumps using the free TrisulNSM Docker] vivekdocker:pcap_analysis [2018/03/02 17:27] (current) – [Instructions : How to run the Docker image over PCAPs] veera
Line 1: Line 1:
-====== How to analyze large PCAP dumps using the free TrisulNSM Docker ======+====== How to analyze large PCAP files using TrisulNSM Docker ======
  
-While live traffic capture is the predominant mode of Network Security Monitoring, it is also crucial to be able to load packet capture (PCAP) dumps.  The requirements are +While live traffic capture is the predominant mode of Network Security Monitoring, it is also crucial to be able to load packet capture (PCAP) dumps.  A couple of key requirements for the **PCAP import process**  
  
-  - adjlkas +  - The results should be **as if** the analysis was done as a live traffic capture  
-  - adasda +  - **Timestamps** must reflect the PCAP time and not the import time 
-  - +  - **Clock** - The import process should be clocked off the packet timestamps. This means that if a PCAP file contained 10 hours of traffic, the import process should not require 10 hours. This means a tcpreplay based rig , even if the timestamp issues are solved, will not be optimal for large timeframes.  
 +  - **Encrichment and intel** feeds such as Geo-IP, Blacklists, Domain Databases, may  reflect current time, rather than PCAP time. This is for practical reasons.  
 +  - **Search vs Streaming** import PCAP is a bit harder for streaming pipelines like Trisul compared to Elastic Search backends. This is due to the possibility of the streaming window closing before all the events come in. 
  
 +===== Tools =====
  
  
-  * Wireshark : Just keep the PCAP dumps around, in case you need to you can carve small pieces of them and load them into Wireshark +Here are some of the tools in the NSM ecosystem that generate various types of data that need to be orchestrated
-  * Argus or SiLK : Try to index them from a flow perspectiveArgus or SiLK can do this.  +
-  * Bro : turn the PCAPs into bro logs, which record  flows, dns, files, http request, and a number of other things +
-  * Suricata / Snort : Run an IDS ruleset over the PCAPs.  +
-  * Security Onion : Play the PCAPs using TCP Replay and get all of the above. +
-  * Moloch : Index the packets for fast recall +
-  * TrisulNSM : Traffic metrics tool at its core, but does flows, index packets, extracts metadata, and other NSM tasks +
  
 +  * **Argus or SiLK** : Try to index them from a flow perspective. Argus or SiLK can do this. 
 +  * **Bro** : turn the PCAPs into bro logs, which record  flows, dns, files, http request, and a number of other things
 +  * **Suricata / Snort** : Run an IDS ruleset over the PCAPs. 
 +  * **Security Onion** : The NSM distro that packages everything you need. The latest version of Security Onion includes a script to automate this process.The backend storage and reporting is now Elastic Search.
 +  * **Moloch** : Index raw packets for fast recall. Also stores into Elastic Search.
 +  * **NTOP** : Traffic monitoring 
 +  * **Wireshark/NetworkMiner** : The ultimate destination for bit level protocol analysis. 
 +  * **TrisulNSM** : Traffic metrics at its core, but also  does flows, packet indexiing, metadata extraction, and other NSM functions. Trisul uses Stream Processing instead of Search as its backend. The free license allows you to import any number of PCAPs as long each PCAP isnt longer than 3 days. 
  
-We just released a free [[https://github.com/trisulnsm/docker|Trisul Docker Image]] that lets you do these easily in both online and pcap-file modesHere is the blog post [[https://www.trisul.org/blog/docker/post.html|"Announcing TrisulNSM Docker"]] +This article explains how the new [[https://github.com/trisulnsm/docker|Trisul Docker Image]] can help you analyze PCAPs offline.
  
 ===== Instructions : How to run the Docker image over PCAPs ===== ===== Instructions : How to run the Docker image over PCAPs =====
  
-<note>  +Put the PCAP dump into the shared docker volume so that the container can read the PCAP.
-We are assuming here that you have a Linux system with Docker installed. +
-</note> +
- +
-First you need to create a //root volume//, say ''/opt/trisul6_root'' that will map into the Docker instance. Then put the PCAP dump into the trisul root volume so that the docker image can read it.+
  
 <code> <code>
-mkdir /opt/trisul6_root +mkdir /opt/trisulroot 
-cp myhugeCapture.pcap /opt/trisul6_root +cp myhugeCapture.pcap /opt/trisulroot 
 </code> </code>
  
  
- +Run the trisul6 docker image on the PCAP 
-Run the free trisul6 docker image on the PCAP like so+
  
 <code bash> <code bash>
 +
 docker run --privileged=true \ docker run --privileged=true \
    --name trisul1a \    --name trisul1a \
-     --net=host +    --net=host 
-       -v /trisulroot:/trisulroot \ +      -v /opt/trisulroot:/trisulroot \ 
-         -d trisulnsm/trisul6 \ +       -d trisulnsm/trisul6 \ 
-           --pcap botnet-capture-20110810-neris.pcap \ +        --fine-resolution \ 
-              --fine-resolution+         --pcap myhugeCapture.pcap 
 </code> </code>
  
  
-Now wait for the import to complete. Trisul is a streaming analytics platform, the time taken to complete the import is not proportional to the size of the PCAP, but to the duration of the PCAP. If your PCAP has two days traffic, then expect the import process to take up to 10-20 minutes.  This also depends on the speed of the hard drive.+Now wait for the import to complete. The time taken to complete the import is not proportional to the size of the PCAP, but to the duration of the PCAP. If your PCAP has two days traffic, then expect the import process to take up to 10-20 minutes.  
  
-To check on progress you can dowhen the import completes you will get a message asking you to login !+To check on progress , tail the log and wait for confirmation message!
  
 <code> <code>
Line 67: Line 68:
 <code bash> <code bash>
 docker run  --name trisul1a --net=host \ docker run  --name trisul1a --net=host \
-   -v /opt/trisul6_root:/trisulroot \ +   -v /opt/trisulroot:/trisulroot \ 
      -d trisulnsm/trisul6 \      -d trisulnsm/trisul6 \
         --pcap BSidesDE2017_PvJCTF.pcap \         --pcap BSidesDE2017_PvJCTF.pcap \
           --no-ids           --no-ids
 </code> </code>
 +
 +
 +==== Analysis ====
 +
 +Once loaded you need to point your browser to ip:3000 and select the newly created context for the run.
 +
 +{{:docker:contextselect.png?600|}}
 +
 +After you login here are some suggested steps 
 +
 +  - Go to Retro Counters to get details metrics and toppers across 40+ counter groups
 +  - Use the "PCAP Totals"  Trisul APP to get the drilldown dashboard shown below
 +  - Tools > Explore to query flows. 
 +
 +{{:docker:pcaptotals.png?600|}}
  
  
docker/pcap_analysis.1519651088.txt.gz · Last modified: 2018/02/26 18:48 by vivek