Here is a simple python client to play with the C&C server:
Code: Select all#!/usr/bin/env python
import argparse
import socket
def send(s, args):
s.send('snd')
s.send(args.domain.ljust(128))
s.send(args.msg)
def read(s, args):
s.send('rcv')
s.send(args.domain.ljust(128))
ret = s.recv(2048)
print ret
def status(s, args):
s.send('vic')
s.send(args.domain.ljust(128))
ret = s.recv(64)
print ret
def main(args):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((args.host, args.port))
try:
args.action(s, args)
finally:
s.close()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="CTB-locker client")
parser.add_argument("-i", "--host", dest="host", type=str, default="95.215.45.203", help="C&C payment server")
parser.add_argument("-p", "--port", dest="port", type=int, default=9338, help="C&C payment server")
subparsers = parser.add_subparsers(title='subcommands', description='Action to perform')
status_parser = subparsers.add_parser('status')
status_parser.set_defaults(action=status)
status_parser.add_argument(dest="domain", type=str, help="Victim domain to check")
send_parser = subparsers.add_parser('send')
send_parser.set_defaults(action=send)
send_parser.add_argument(dest="domain", type=str, help="Victim domain to check")
send_parser.add_argument(dest="msg", type=str, help="Message to send")
read_parser = subparsers.add_parser('read')
read_parser.set_defaults(action=read)
read_parser.add_argument(dest="domain", type=str, help="Victim domain to check")
args = parser.parse_args()
main(args)