Created
September 20, 2018 23:03
-
-
Save MalwareTech/c61184f2517f4eb13571f3cc1e7ec6b8 to your computer and use it in GitHub Desktop.
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
import socket | |
import struct | |
def dump_c2_list(c2_list): | |
for i in range(0xFFFFFF): | |
ip = Dword(c2_list + (i*8)) | |
if ip == 0: | |
break; | |
ip = struct.pack('>L', ip) | |
ip = socket.inet_ntoa(str(ip)) | |
port = Word(c2_list + 4 + (i*8)) | |
print('{}:{}'.format(ip, port)) | |
if __name__ == '__main__': | |
c2_ref = FindBinary(0, SEARCH_DOWN, "83 3C C5") | |
c2_list = Dword(c2_ref + 3) | |
dump_c2_list(c2_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment