-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Srinivas11789/develop
PcapXray 2.0
- Loading branch information
Showing
14 changed files
with
275 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pyc | ||
.DS_Store | ||
*.icloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# PcapXray Project Dockerfile - https://github.com/Srinivas11789/PcapXray | ||
|
||
# Latest ubuntu base image | ||
FROM ubuntu:latest | ||
|
||
# Maintainer | ||
MAINTAINER Srinivas Piskala Ganesh Babu "spg349@nyu.edu" | ||
|
||
# Apt update and install - nginx and git | ||
RUN apt-get update | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get install -y graphviz | ||
RUN apt-get install -y python-tk | ||
RUN apt-get install -y python-pip | ||
RUN apt-get install -y nginx | ||
RUN apt-get install -y git-core | ||
RUN apt-get install -y sudo | ||
RUN apt-get install -y libx11-dev | ||
|
||
# Fetching the latest source code from the github repo of devOps | ||
RUN git clone https://github.com/srinivas11789/PcapXray | ||
|
||
### Master branch changes - srinivas11789/pcapxray | ||
RUN pip install -r PcapXray/requirements.txt | ||
|
||
WORKDIR PcapXray/Source | ||
CMD python main.py | ||
|
||
### Develop/Beta branch changes - srinivas11789/pcapxray-beta | ||
#WORKDIR PcapXray | ||
#RUN git checkout develop | ||
#RUN pip install -r requirements.txt | ||
#WORKDIR Source | ||
#CMD python main.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Sanity or Smoke Test - Test proper functionality of the module | ||
|
||
# Test System Setup | ||
import sys | ||
import os | ||
|
||
if sys.path[0]: | ||
sys.path.insert(0, sys.path[0]+'/../Source/Module/') | ||
else: | ||
sys.path.insert(0,'/../Source/Module/') | ||
|
||
# All the Module imports | ||
|
||
# Report generation module | ||
import reportGen | ||
# 1 - pcapReader Module | ||
import pcapReader | ||
# 2 - communicationDetailsFetch module | ||
import communicationDetailsFetch | ||
# 3 - deviceDetailsFetch module | ||
import deviceDetailsFetch | ||
# 4 - maliciousTrafficIdentifier module | ||
import maliciousTrafficIdentifier | ||
# 5 - plotLanNetwork module | ||
#import plotLanNetwork | ||
# 7 - userInterface module | ||
#import userInterface | ||
# 8 - torTrafficHandle module | ||
import torTrafficHandle | ||
|
||
# End to end Workflow Tests - All tests will be applied to example/test.pcap file | ||
|
||
def test_pcapreader(): | ||
pcapfile = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
if pcapfile.packetDB: | ||
assert True | ||
|
||
def test_communication_details_fetch(): | ||
capture = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
details = communicationDetailsFetch.trafficDetailsFetch(capture.packetDB) | ||
if details.communication_details: | ||
assert True | ||
|
||
def test_device_details_fetch(): | ||
pcapfile = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
for ip in pcapfile.packetDB: | ||
macObj = deviceDetailsFetch.fetchDeviceDetails(pcapfile.packetDB[ip]) | ||
if macObj.oui_identification(): | ||
assert True | ||
|
||
def test_malicious_traffic_identifier(): | ||
malicious_capture = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
dns_details = {} | ||
mal_identify = maliciousTrafficIdentifier.maliciousTrafficIdentifier(malicious_capture.packetDB, dns_details) | ||
if mal_identify.possible_malicious_traffic: | ||
assert True | ||
|
||
#def test_plot_lan_network(): | ||
# pcapfile = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
# details = communicationDetailsFetch.trafficDetailsFetch(pcapfile.packetDB) | ||
# plotLanNetwork.plotLan(pcapfile.packetDB, "network12345", details.communication_details,"HTTPS") | ||
# if os.path.isfile(sys.path[1]+"/../Report/network12345"): | ||
# assert True | ||
|
||
def test_report_gen(): | ||
pcapfile = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
if pcapfile.packetDB: | ||
reportGen.reportGen().packetDetails(pcapfile.packetDB) | ||
if os.path.isfile(sys.path[1]+"/../Report/communicationDetailsReport.txt") and os.path.isfile(sys.path[1]+"/../Report/deviceDetailsReport.txt") and os.path.isfile(sys.path[1]+"/../Report/packetDetailsReport.txt"): | ||
assert True | ||
|
||
# 7 - userInterface module | ||
# Manual Test for now - Sikuli type automation to be implemented soon | ||
# * Look at Travis Integrations for GUI Test | ||
|
||
def test_tor_traffic_handle(): | ||
tor_capture = pcapReader.pcapReader(sys.path[0]+'examples/test.pcap') | ||
tor_identify = torTrafficHandle.torTrafficHandle(tor_capture.packetDB) | ||
if tor_identify: | ||
assert True |
Oops, something went wrong.