Ejemplo n.º 1
0
def test_loot_reset():
    Loot.loot["Test"] = "Testing"

    assert len(Loot.loot.keys()) > 0

    Loot.reset()

    assert len(Loot.loot.keys()) == 0
def test_non_https():
    cert_extract = SSLCertificateExtractor()

    hostname = "httpforever.com"
    port = 80

    Loot.reset()
    Loot.loot[hostname] = {}

    cert_extract.execute(hostname, port)

    port = str(port)

    assert port not in Loot.loot[hostname]
Ejemplo n.º 3
0
def test_get_banner_timeout():
    banner = FTPBanner()
    Loot.reset()

    hostname = "1.1.1.1"
    port = 21

    banner.execute(hostname, port)

    port = str(port)

    assert Loot.loot[hostname] is not None
    assert Loot.loot[hostname][port] is not None
    assert Loot.loot[hostname][port][banner.loot_name] is not None
Ejemplo n.º 4
0
def test_get_banner_invalid():
    banner = FTPBanner()
    Loot.reset()

    hostname = "256.128.63.32"
    port = 21

    banner.execute(hostname, port)

    port = str(port)

    assert Loot.loot[hostname] is not None
    assert Loot.loot[hostname][port] is not None
    assert Loot.loot[hostname][port][banner.loot_name] is not None
Ejemplo n.º 5
0
def test_get_banner_unreachable():
    banner = FTPBanner()
    Loot.reset()

    hostname = "127.0.0.1"
    port = 2121

    banner.execute(hostname, port)

    port = str(port)

    assert Loot.loot[hostname] is not None
    assert Loot.loot[hostname][port] is not None
    assert Loot.loot[hostname][port][banner.loot_name] is not None
    assert "Banner" not in Loot.loot[hostname][port][banner.loot_name]
Ejemplo n.º 6
0
def test_create_loot():
    module = create_module()

    Loot.reset()

    ip = "127.0.0.1"
    port = 0

    module.create_loot_space(ip, port)

    port = str(0)

    assert Loot.loot[ip] is not None
    assert Loot.loot[ip][port] is not None
    assert Loot.loot[ip][port][module.loot_name] is not None
Ejemplo n.º 7
0
def test_invalid_target():
    module = FTPAnonymousAccess()
    Loot.reset()

    hostname = "1.1.1.1"
    port = 21

    module.execute(hostname, port)

    port = str(port)

    assert Loot.loot[hostname] is not None
    assert Loot.loot[hostname][port] is not None
    assert Loot.loot[hostname][port][module.loot_name] is not None
    assert "Downloaded Files" not in Loot.loot[hostname][port][module.loot_name]
    assert "Files" not in Loot.loot[hostname][port][module.loot_name]