2014-12-10 13:55:00 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# This tool is designed to be an easy way to test exfiltrating data
|
|
|
|
# from the network you are currently plugged into. Used for red or
|
|
|
|
# blue teams that want to test network boundary egress detection
|
|
|
|
# capabilities.
|
|
|
|
|
|
|
|
|
2015-01-13 15:17:40 +00:00
|
|
|
import logging
|
2014-12-10 13:55:00 +00:00
|
|
|
import sys
|
2014-12-24 13:37:31 +00:00
|
|
|
from common import helpers
|
|
|
|
from common import orchestra
|
2014-12-10 13:55:00 +00:00
|
|
|
|
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
if __name__ == "__main__":
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2015-01-13 15:17:40 +00:00
|
|
|
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
|
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
helpers.title_screen()
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
cli_parsed = helpers.cli_parser()
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
the_conductor = orchestra.Conductor()
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
# Check if only listing supported server/client protocols or datatypes
|
|
|
|
if cli_parsed.list_servers:
|
|
|
|
print "[*] Supported server protocols: \n"
|
|
|
|
the_conductor.load_server_protocols(cli_parsed)
|
|
|
|
for name, server_module in the_conductor.server_protocols.iteritems():
|
|
|
|
print "[+] " + server_module.protocol
|
|
|
|
print
|
2014-12-15 23:42:50 +00:00
|
|
|
sys.exit()
|
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
elif cli_parsed.list_clients:
|
|
|
|
print "[*] Supported client protocols: \n"
|
|
|
|
the_conductor.load_client_protocols(cli_parsed)
|
|
|
|
for name, client_module in the_conductor.client_protocols.iteritems():
|
|
|
|
print "[+] " + client_module.protocol
|
|
|
|
print
|
2014-12-10 13:55:00 +00:00
|
|
|
sys.exit()
|
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
elif cli_parsed.list_datatypes:
|
|
|
|
print "[*] Supported data types: \n"
|
|
|
|
the_conductor.load_datatypes(cli_parsed)
|
|
|
|
for name, datatype_module in the_conductor.datatypes.iteritems():
|
|
|
|
print "[+] " + datatype_module.cli + " - (" +\
|
|
|
|
datatype_module.description + ")"
|
|
|
|
print
|
2014-12-10 13:55:00 +00:00
|
|
|
sys.exit()
|
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
if cli_parsed.server is not None:
|
|
|
|
the_conductor.load_server_protocols(cli_parsed)
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
for full_path, server in the_conductor.server_protocols.iteritems():
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
if server.protocol == cli_parsed.server.lower():
|
|
|
|
server.serve()
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
elif cli_parsed.client is not None:
|
|
|
|
# load up all supported client protocols and datatypes
|
|
|
|
the_conductor.load_client_protocols(cli_parsed)
|
|
|
|
the_conductor.load_datatypes(cli_parsed)
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2015-05-16 02:11:21 +00:00
|
|
|
if cli_parsed.file is None:
|
|
|
|
# Loop through and find the requested datatype
|
|
|
|
for name, datatype_module in the_conductor.datatypes.iteritems():
|
|
|
|
if datatype_module.cli == cli_parsed.datatype.lower():
|
|
|
|
generated_data = datatype_module.generate_data()
|
|
|
|
|
|
|
|
# Once data has been generated, transmit it using the
|
|
|
|
# protocol requested by the user
|
|
|
|
for proto_name, proto_module in the_conductor.client_protocols.iteritems():
|
|
|
|
if proto_module.protocol == cli_parsed.client.lower():
|
|
|
|
proto_module.transmit(generated_data)
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
else:
|
|
|
|
with open(cli_parsed.file, 'rb') as file_data_handle:
|
|
|
|
file_data = file_data_handle.read()
|
|
|
|
|
|
|
|
for proto_name, proto_module in the_conductor.client_protocols.iteritems():
|
|
|
|
if proto_module.protocol == cli_parsed.client.lower():
|
|
|
|
proto_module.transmit(file_data)
|
|
|
|
sys.exit()
|
2014-12-10 13:55:00 +00:00
|
|
|
|
2014-12-24 13:37:31 +00:00
|
|
|
print "[*] Error: You either didn't provide a valid datatype or client protocol to use."
|
|
|
|
print "[*] Error: Re-run and use --list-datatypes or --list-clients to see possible options."
|
2014-12-10 13:55:00 +00:00
|
|
|
sys.exit()
|