Ejemplo n.º 1
0
def main():
    # draw example
    pcapfile = pcapReader.pcapReader('lanExample.pcap')
    print "Reading Done...."
    details = communicationDetailsFetch.trafficDetailsFetch(pcapfile.packetDB)
    network = plotLan(pcapfile.packetDB, "network12345",
                      details.communication_details, "HTTPS")
Ejemplo n.º 2
0
def main():
    malicious_capture = pcapReader.pcapReader("torexample.pcapng")
    print malicious_capture.packetDB
    dns_details = {}
    mal_identify = maliciousTrafficIdentifier(malicious_capture.packetDB,
                                              dns_details)
    print mal_identify.possible_malicious_traffic
def test_tor_packets_to_be_read():
    # Reading a tor capture traffic
    torpcapfile = pcapReader.pcapReader(sys.path[0] +
                                        'examples/torExample.pcap')
    # Checking if the packet db is created without any hassle
    if torpcapfile.packetDB:
        assert True
def test_malicious_packets_to_be_read():
    # Reading malicious capture traffic
    maliciouspcapfile = pcapReader.pcapReader(sys.path[0] +
                                              'examples/maliciousTraffic.pcap')
    # Checking if the packet db is created without any hassle
    if maliciouspcapfile.packetDB:
        assert True
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
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
Ejemplo n.º 7
0
def main():
    filename = "test.pcap"
    pcapfile = pcapReader.pcapReader('test.pcap')
    for ip in pcapfile.packetDB:
        macObj = fetchDeviceDetails(pcapfile.packetDB[ip])
        print(macObj.oui_identification())
Ejemplo n.º 8
0
def main():
    tor_capture = pcapReader.pcapReader("torexample.pcapng")
    print(tor_capture.packetDB)
    tor_identify = torTrafficHandle(tor_capture.packetDB)
    print(tor_identify.possible_tor_traffic)
def main():
    capture = pcapReader.pcapReader("lanExample.pcap")
    print("read")
    details = trafficDetailsFetch(capture.packetDB)
    print(details.communication_details)
    print("\n")
Ejemplo n.º 10
0
def test_pcapreader():
    pcapfile = pcapReader.pcapReader(sys.path[0] + 'examples/test.pcap')
    if pcapfile.packetDB:
        assert True
Ejemplo n.º 11
0
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
Ejemplo n.º 12
0
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
Ejemplo n.º 13
0
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