Exemplo n.º 1
0
 def __init__(self):
     """
     Pull all variables from config.py file.
     """
     self.player = Player()
     self.database = config.database
     self.Max_point_tournament = config.Max_point_tournament
     self.BotNet_update = config.BotNet_update
     self.joinTournament = config.joinTournament
     self.tournament_potator = config.tournament_potator
     self.booster = config.booster
     self.Use_netcoins = config.Use_netcoins
     self.attacks_normal = config.attacks_normal
     self.updates = config.updates
     self.updatecount = config.updatecount
     self.maxanti_normal = config.maxanti_normal
     self.active_cluster_protection = config.active_cluster_protection
     self.mode = config.mode
     self.stat = "0"
     self.wait_load = config.wait_load
     self.c = Console(self.player.username, self.player.password)
     self.u = Update(self.player.username, self.player.password)
     self.b = Botnet(self.player)
     self.ddos = ddos.Ddos()
     self.init()
Exemplo n.º 2
0
    def __init__(self):
        """
        Pull all variables from config.py file.
        """

        self.player = Player()
        self.database = config.database
        self.Max_point_tournament = config.Max_point_tournament
        self.BotNet_update = config.BotNet_update
        self.joinTournament = config.joinTournament
        self.tournament_potator = config.tournament_potator
        self.booster = config.booster
        self.Use_netcoins = config.Use_netcoins
        self.attacks_normal = config.attacks_normal
        self.updates = config.updates
        self.updatecount = config.updatecount
        self.maxanti_normal = config.maxanti_normal
        self.active_cluster_protection = config.active_cluster_protection
        self.mode = config.mode
        self.number_task = config.number_task
        self.min_energy_botnet = config.minimal_energy_botnet_upgrade
        self.stat = "0"
        self.wait_load = config.wait_load
        self.c = Console(self.player)
        self.u = Update(self.player)
        # disable botnet for > api v13
        self.b = Botnet(self.player)
        self.ddos = ddos.Ddos(self.player)
        self.m = Mails(self.player)
        self.init()
Exemplo n.º 3
0
    def __init__(self, network, gamma=0.9):
        Botnet.__init__(self, network, gamma)

        self.q_value = dict()                     # Maps (state, action) to its Q*-value
        self.best_value = dict()                  # Maps a state s to max_a Q*(s,a)
        self.best_actions = dict()                # Maps a state to its best actions

        self.type = "QStar"

        # Initialization for the full state (infinite horizon)
        self.best_value[State.full_state(network.size)] = self.network.final_reward(gamma)
Exemplo n.º 4
0
    def clear(self, all=False):
        """
        Clears internal storage.
        :param all: whether to clear also computed Q*-values
        :return:
        """
        Botnet.clear(self)

        if all:
            self.q_value = dict()
            self.best_value = dict()
            self.best_actions = dict()
Exemplo n.º 5
0
def get_model_botnet(args,
                     word_emb,
                     w2id,
                     course2id,
                     trained=False,
                     path_model=None):
    args.iS = 300
    model = Botnet(word_emb, w2id, course2id, args.tf_emb_size, args.lS_lstm,
                   args.dr, args.nb_tf_en, args.hidden_tf_en, args.nb_tf_de,
                   args.hidden_tf_de, args.heads, args.max_len, args.sig_class)
    model = model.to(device)

    if trained:
        assert path_model != None

        if torch.cuda.is_available():
            res = torch.load(path_model)
        else:
            res = torch.load(path_model, map_location='cpu')

        model.load_state_dict(res['model_botnet'])

    return model
Exemplo n.º 6
0
def main():
    options = get_arguments()
    print("""
Author : Goutham R
GitHub : https://github.com/G0uth4m
	
	- This is a simple tool handy for linux administrators 
	in schools, colleges, etc where all the systems used by students
	in the lab or elsewhere have same usernames and passwords.

	- Future releases will be having a choice to input different usernames
	and passwords via a file.

	- This code was tested on a bunch metasploitable 2 servers.

	- Using this tool for illegal stuff is highly not recommended.

	- 'sudo' is unsupported. You can use root as username for superuser access.

	 _         _           _              _   
 ___ ___| |__     | |__   ___ | |_ _ __   ___| |_ 
/ __/ __| '_ \    | '_ \ / _ \| __| '_ \ / _ \ __|
\__ \__ \ | | |   | |_) | (_) | |_| | | |  __/ |_ 
|___/___/_| |_|___|_.__/ \___/ \__|_| |_|\___|\__|
             |_____|                              
""")

    interface = options.interface
    user = options.user
    password = options.password

    myip = os.popen("ifconfig " + interface +
                    " | grep \"inet \" | awk \'{print $2}\'").read().replace(
                        "\n", "")
    ssh_servers = getSshServers(myip)
    listSshServers(ssh_servers)

    choice = raw_input("Continue adding bots to the botnet?[Y/n] ")
    print("\n")
    if (choice in ["n", "N", "no"]):
        exit()

    botnet = Botnet()
    for i, j in ssh_servers.items():
        botnet.addBot(i, user, password, j)

    while True:
        strr = colored('ssh@botnet:~$ ', 'red', None, ['bold'])
        a = raw_input(strr)

        if a == "exit()" or a == "exit":
            botnet.f.close()
            print("\n[*] History of commands stored in logs.txt")
            break
        else:
            botnet.sendCommandsToBots(a)
Exemplo n.º 7
0
# Enter Amount of Attacks in tournament
attacks_tournament = 100

# Enter Updates (inet, hdd, cpu, ram, fw, av, sdk, ipsp, spam, scan, adw)
#updates = ["ipsp", "adw", "fw", "scan", "sdk", "av"]
updates = ["ipsp", "scan", "sdk", "av"]
#updates = ["ipsp",  "sdk"]
#Do you want to attack during tournament [True, False]
joinTournament = True
#Time to wait between each cycle in seconds
wait = round(uniform(0, 1), 2)
wait_load = round(uniform(1, 5), 2)

c = Console(api)
u = Update(api)
b = Botnet(api)
updatecount = 0
attackneeded = False

while True:
    attackneeded = False

    stat = "0"
    while "0" in stat:
        stat = u.startTask(updates[updatecount])
        if "0" in stat:
            print "updating " + updates[updatecount] + " level +1"
            #print "Started Update
            print "Waiting... in update"
            #u.useBooster()
            time.sleep(wait_load)
Exemplo n.º 8
0
class run:
    def __init__(self):
        """
        Pull all variables from config.py file.
        """
        self.player = Player()
        self.database = config.database
        self.Max_point_tournament = config.Max_point_tournament
        self.BotNet_update = config.BotNet_update
        self.joinTournament = config.joinTournament
        self.tournament_potator = config.tournament_potator
        self.booster = config.booster
        self.Use_netcoins = config.Use_netcoins
        self.attacks_normal = config.attacks_normal
        self.updates = config.updates
        self.updatecount = config.updatecount
        self.maxanti_normal = config.maxanti_normal
        self.active_cluster_protection = config.active_cluster_protection
        self.mode = config.mode
        self.stat = "0"
        self.wait_load = config.wait_load
        self.c = Console(self.player.username, self.player.password)
        self.u = Update(self.player.username, self.player.password)
        self.b = Botnet(self.player)
        self.ddos = ddos.Ddos()
        self.init()

    def init(self):
        while True:
            # update the player

            time.sleep(self.wait_load)
            stat = "0"
            # prepare account
            self.get_max_update = int(self.u.infoUpdate("ram", "new"))
            self.running_all = self.u.runningtasks()
            print("your are running " + str(self.running_all) + "/" +
                  str(self.get_max_update) + " tasks")

            if int(self.running_all) < int(self.get_max_update):
                while "0" in stat or "3" in stat:

                    try:
                        moneyforupdate = int(
                            self.u.infoUpdate(self.updates[self.updatecount]))
                    except IndexError:
                        print("reset")
                        self.updatecount = 0
                        moneyforupdate = int(
                            self.u.infoUpdate(self.updates[self.updatecount]))

                    time.sleep(self.wait_load)
                    mymoney = int(json.loads(self.c.myinfo())["money"])

                    if mymoney < moneyforupdate:
                        self.updatecount += 1

                        try:
                            print "require " + str(
                                moneyforupdate
                            ) + "$ for update " + self.updates[
                                self.updatecount] + " your money " + str(
                                    mymoney) + "$"
                        except IndexError:
                            stat = "1"

                        totaltask = int(self.u.runningtasks()) + int(
                            self.updatecount)
                        time.sleep(self.wait_load)
                        if int(totaltask) == int(self.get_max_update):
                            stat = "1"
                    else:
                        time.sleep(self.wait_load)
                        stat = self.u.startTask(self.updates[self.updatecount])
                        if "3" in stat:
                            print "updating " + self.updates[
                                self.updatecount] + " level +1"
                            #print "Started Update
                            print "Waiting... in update"
                            #u.useBooster()
                            time.sleep(self.wait_load)
                            self.updatecount += 1
                            totaltask = int(self.u.runningtasks()) + int(
                                self.updatecount)
                            if int(totaltask) == int(self.get_max_update):
                                stat = "1"

            # recheck running ask for boost and netcoins
            self.running_all = self.u.runningtasks()

            self.ddos.run_ddos()
            if self.BotNet_update:
                self.b.upgradebotnet()
            # attack botnet
            self.b.attack()
            if self.joinTournament and self.c.getTournament():
                self.mode = "Potator"
                print "** Force Mode to 'Potator' for Tournament **"
            # task = self.u.doTasks(self.wait_load)
            if self.booster and self.running_all > 1:
                try:
                    # usebooster = self.u.getTasks()
                    usebooster = None
                    json_data = json.loads(usebooster)
                    while len(json_data["data"]) > 1:
                        if int(json_data["boost"]) > 5:
                            self.u.useBooster()
                            print "Using booster on rest " + str(
                                int(json_data["boost"]) - 1)
                        # UPDATE Value
                        else:
                            print "you have < 5 boost."
                            break
                        # usebooster = self.u.getTasks()
                        usebooster = None
                        json_data = json.loads(usebooster)
                except Exception as e:
                    print "Connection Error try again...{0}".format(e)
                    pass
            if self.Use_netcoins:
                time.sleep(2)
                if self.player.netcoins > 1 and self.running_all > 1:
                    self.u.finishAll()
                    self.player.refreshinfo()  # update player info
                    print "I used Netcoins for finish all task."
            # attack players
            self.c.attack(self)
Exemplo n.º 9
0
class run:
    def __init__(self):
        """
        Pull all variables from config.py file.
        """
        self.player = Player()
        self.database = config.database
        self.Max_point_tournament = config.Max_point_tournament
        self.BotNet_update = config.BotNet_update
        self.joinTournament = config.joinTournament
        self.tournament_potator = config.tournament_potator
        self.booster = config.booster
        self.Use_netcoins = config.Use_netcoins
        self.attacks_normal = config.attacks_normal
        self.updates = config.updates
        self.updatecount = config.updatecount
        self.maxanti_normal = config.maxanti_normal
        self.active_cluster_protection = config.active_cluster_protection
        self.mode = config.mode
        self.min_energy_botnet = config.minimal_energy_botnet_upgrade
        self.stat = "0"
        self.wait_load = config.wait_load
        self.c = Console(self.player)
        self.u = Update(self.player)
        # disable botnet for > api v13
        self.b = Botnet(self.player)
        self.ddos = ddos.Ddos(self.player)
        self.m = Mails(self.player)
        self.init()

    def init(self):
        logger.info(
            "Welcome to ZeusBot v2.2 (Patch 1) for 'vHackXT 1.66' (API Version 16) by ATVG-Studios and OlympicCode!"
        )
        while True:
            # update the player
            time.sleep(self.wait_load)
            stat = "0"
            # prepare account
            self.get_max_update = int(self.u.infoUpdate("ram", "new")) - 1
            self.running_all = self.u.runningtasks()
            logger.info("You have {} of {} tasks running.".format(
                self.running_all, self.get_max_update))

            if int(self.running_all) < int(self.get_max_update):
                while "0" in stat or "3" in stat:
                    if int(self.u.runningtasks()) < int(
                            self.u.infoUpdate("ram", "new")) - 1:
                        try:
                            moneyforupdate = int(
                                self.u.infoUpdate(
                                    self.updates[self.updatecount]))
                        except IndexError:
                            logger.info("reset")
                            self.updatecount = 0
                            moneyforupdate = int(
                                self.u.infoUpdate(
                                    self.updates[self.updatecount]))
                            stat = "1"
                        mymoney = int(json.loads(self.c.myinfo())["money"])

                        if mymoney < moneyforupdate:
                            self.updatecount += 1

                            try:
                                logger.info(
                                    "You neeed {}$ for the update '{}', but you only have {}$"
                                    .format(moneyforupdate,
                                            self.updates[self.updatecount],
                                            mymoney))
                            except IndexError:
                                stat = "1"

                            totaltask = int(self.u.runningtasks()) + int(
                                self.updatecount)
                            if int(totaltask) == int(self.get_max_update):
                                stat = "1"
                        else:
                            (stat, levelupdates) = self.u.startTask(
                                self.updates[self.updatecount])
                            if "3" in stat or "0" in stat:
                                logger.info(
                                    "I am updating '{}' to level {}".format(
                                        self.updates[self.updatecount],
                                        int(levelupdates) + 1))
                                # print "Started Update
                                logger.info("Waiting! Doing updates..")
                                # u.useBooster()
                                self.updatecount += 1
                                totaltask = int(self.u.runningtasks()) + int(
                                    self.updatecount)
                                if int(totaltask) == int(self.get_max_update):
                                    stat = "1"
                    else:
                        break

            # recheck running ask for boost and netcoins
            self.running_all = self.u.runningtasks()

            self.ddos.run_ddos()
            if self.BotNet_update:
                botnet = json.loads(self.b._botnetInfo())
                if int(botnet['count']) > 0 and int(
                        botnet['energy']) > self.min_energy_botnet:
                    for count, i in enumerate(botnet['data']):
                        self.b.upgradebotnet(i['hostname'], int(i['running']),
                                             count)
                else:
                    if int(botnet['count']) == 0:
                        logger.info("You don't have a botnet!")

                    if int(botnet['energy']) == 0:
                        logger.info(
                            "You don't have enough energy to update you'r botnet!"
                        )
                    else:
                        logger.info("Your botnet energy (" +
                                    str(botnet['energy']) + ") is less than " +
                                    str(self.min_energy_botnet) +
                                    "! Please wait for regeneration..")

            # attack botnet
            #number_botnet = json.loads(self.b._botnetInfo())
            #if int(number_botnet['count']) > 0:
            #    self.b.attack()

            if self.joinTournament and self.c.getTournament():
                self.mode = "Potator"
                logger.info("** Force Mode to 'Potator' for Tournament **")
            # task = self.u.doTasks(self.wait_load)
            if self.booster and self.running_all > 1:
                try:
                    vtasks = self.u.getrunningtasks()
                    json_data = json.loads(vtasks)
                    while len(json_data["data"]) > 1:
                        if int(json_data["boost"]) > 5:
                            json_data = json.loads(self.u.useBooster())
                            logger.info("Using booster on rest {}".format(
                                json_data["boost"]))
                            if int(json_data['fAllCosts']) < 50:
                                break
                        # UPDATE Value
                        else:
                            logger.info("You have less than 5 boost's.")
                            break
                except Exception as e:
                    logger.error("Connection Error try again.. {0}".format(e))
                    pass
            if self.Use_netcoins:
                time.sleep(2)
                if self.player.netcoins > 1 and self.running_all > 1:
                    self.u.finishAll()
                    self.player.refreshinfo()  # update player info
                    logger.info("I used Netcoins for finish all you'r task.")
            if self.player.email > 0:
                time.sleep(self.wait_load)
                logger.info('Reading mails..')
                self.m.read_mails()

            # attack players
            self.c.attack(self)
Exemplo n.º 10
0
class run:
    def __init__(self):
        """
        Pull all variables from config.py file.
        """
        self.player = Player()
        self.database = config.database
        self.Max_point_tournament = config.Max_point_tournament
        self.BotNet_update = config.BotNet_update
        self.joinTournament = config.joinTournament
        self.tournament_potator = config.tournament_potator
        self.booster = config.booster
        self.Use_netcoins = config.Use_netcoins
        self.attacks_normal = config.attacks_normal
        self.updates = config.updates
        self.updatecount = config.updatecount
        self.maxanti_normal = config.maxanti_normal
        self.active_cluster_protection = config.active_cluster_protection
        self.mode = config.mode
        self.stat = "0"
        self.wait_load = config.wait_load
        self.c = Console(self.player)
        self.u = Update(self.player)
        self.b = Botnet(self.player)
        self.ddos = ddos.Ddos(self.player)
        self.init()

    def init(self):
        while True:
            # update the player

            time.sleep(self.wait_load)
            stat = "0"
            # prepare account
            self.get_max_update = int(self.u.infoUpdate("ram", "new")) - 1
            self.running_all = self.u.runningtasks()
            logger.info("you are running {}/{} tasks".format(self.running_all, self.get_max_update))

            if int(self.running_all) < int(self.get_max_update):
                while "0" in stat or "3" in stat:
                    if int(self.u.runningtasks()) < int(self.u.infoUpdate("ram", "new")) - 1:
                        try:
                            moneyforupdate = int(self.u.infoUpdate(self.updates[self.updatecount]))
                        except IndexError:
                            logger.info("reset")
                            self.updatecount = 0
                            moneyforupdate = int(self.u.infoUpdate(self.updates[self.updatecount]))
                            stat = "1"
                        mymoney = int(json.loads(self.c.myinfo())["money"])

                        if mymoney < moneyforupdate:
                            self.updatecount += 1

                            try:
                                logger.info("require {}$ for update {} your money {}$".format(moneyforupdate, self.updates[self.updatecount], mymoney))
                            except IndexError:
                                stat = "1"

                            totaltask = int(self.u.runningtasks()) + int(self.updatecount)
                            if int(totaltask) == int(self.get_max_update):
                                stat = "1"
                        else:
                            stat = self.u.startTask(self.updates[self.updatecount])
                            if "3" in stat or "0" in stat:
                                logger.info("updating {} level +1".format(self.updates[self.updatecount]))
                                # print "Started Update
                                logger.info("Waiting... in update")
                                # u.useBooster()
                                self.updatecount += 1
                                totaltask = int(self.u.runningtasks()) + int(self.updatecount)
                                if int(totaltask) == int(self.get_max_update):
                                    stat = "1"
                    else:
                        break

            # recheck running ask for boost and netcoins
            self.running_all = self.u.runningtasks()

            self.ddos.run_ddos()
            if self.BotNet_update:
                self.b.upgradebotnet()
            # attack botnet
            self.b.attack()
            if self.joinTournament and self.c.getTournament():
                self.mode = "Potator"
                logger.info("** Force Mode to 'Potator' for Tournament **")
            # task = self.u.doTasks(self.wait_load)
            if self.booster and self.running_all > 1:
                try:
                    vtasks = self.u.getrunningtasks()
                    json_data = json.loads(vtasks)
                    while len(json_data["data"]) > 1:
                        if int(json_data["boost"]) > 5:
                            json_data = json.loads(self.u.useBooster())
                            logger.info("Using booster on rest {}".format(json_data["boost"]))
                            if int(json_data['fAllCosts']) < 50:
                                break
                        # UPDATE Value
                        else:
                            logger.info("you have < 5 boost.")
                            break
                except Exception as e:
                    logger.error("Connection Error try again...{0}".format(e))
                    pass
            if self.Use_netcoins:
                time.sleep(2)
                if self.player.netcoins > 1 and self.running_all > 1:
                    self.u.finishAll()
                    self.player.refreshinfo()  # update player info
                    logger.info("I used Netcoins for finish all task.")
            # attack players
            self.c.attack(self)