Created
November 3, 2021 12:37
-
-
Save droberson/f1283a8204aace067ae499ba38d053b6 to your computer and use it in GitHub Desktop.
ConnectBack shellcode configuration extractor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Extract IP address and port from "ConnectBack" shellcode used in Gitlab intrusions | |
# https://bazaar.abuse.ch/browse/tag/ConnectBack/ | |
import sys | |
import struct | |
import socket | |
with open(sys.argv[1], "rb") as fp: | |
data = fp.read() | |
print("%s:%d" % (socket.inet_ntoa(struct.pack("<L", int.from_bytes(data[0xb2:0xb6], "little"))), socket.htons(int.from_bytes(data[0xb0:0xb2], "little")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment