Skip to content

Instantly share code, notes, and snippets.

@SaFiSec
Forked from MalwareTech/emotet_c2_parser.py
Created October 11, 2018 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaFiSec/8b394a8987f2b7792e0daaa47a22a76a to your computer and use it in GitHub Desktop.
Save SaFiSec/8b394a8987f2b7792e0daaa47a22a76a to your computer and use it in GitHub Desktop.
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