├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── Windows ├── Readme.md └── config.ini ├── botnet.py ├── chat.py ├── classes.py ├── client.py ├── config.py ├── console.py ├── console_windows_source.py ├── ddos.py ├── getdatabase.py ├── install-ubuntu.sh ├── mails.py ├── main.py ├── ocr.py ├── player.py ├── requirements.txt ├── update.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.pyc -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | os: linux 3 | dist: Fedora 4 | language: python 5 | 6 | python: 7 | - "2.7.13" 8 | 9 | Configured Distribution: 10 | - Distribution Name: Fedora 11 | - Release: 25 12 | - Architecture: amd64 13 | - Package System: rpm 14 | 15 | 16 | # command to install dependencies 17 | before_install: 18 | #composer install --dev 19 | - sudo apt-get update -qq 20 | - sudo apt-get install python-imaging 21 | - sudo apt-get install tesseract-ocr 22 | 23 | 24 | install: 25 | - pip install -r requirements.txt 26 | 27 | # command to run tests 28 | script: python main.py 29 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at olympiccode@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | thanx for Checkium, WookieNZ, and oher FrNathan 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 OlympicCode 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vHackXTBot-Python 2 | vHackXT Bot written in Python 2.7. 3 | 4 | [![Discord](https://img.shields.io/badge/Chat-%20on%20Discord-738bd7.svg?style=flat-square)](https://discord.gg/EZNjh7t) 5 | [![GITHUB issue](https://img.shields.io/github/issues/OlympicCode/vHackAPI-Python.svg?style=flat-square&raw=true)](https://github.com/OlympicCode/vHackAPI-Python/issues) 6 | [![TRAVIS CI](https://travis-ci.org/OlympicCode/vHackXTBot-Python.svg?branch=master)](https://travis-ci.org/OlympicCode/vHackXTBot-Python) 7 | 8 | [![DiscordBig](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRqIgbcCpiwO-V04gZWfGRZl-qrmIbgKXZtHCDjhV9nF_l3tD0g9w)](https://discord.gg/EZNjh7t) 9 | 10 | #### Thanx to FluffySteamCat who recorded the bot 11 | [![vHackBot video here](https://img.youtube.com/vi/7Ot4xqhh4T8/1.jpg)](https://www.youtube.com/watch?v=ccWs7Fa9GUI&feature=youtu.be) [![vHackBot video here](https://img.youtube.com/vi/vNp_T7h990s/1.jpg)](https://www.youtube.com/watch?v=vNp_T7h990s&feature=youtu.be) [![vHackBot video here](https://img.youtube.com/vi/eTw3DOeJjWw/1.jpg)](https://www.youtube.com/watch?v=eTw3DOeJjWw) [![vHackBot video here](https://img.youtube.com/vi/xI5IFJ9qMeY/1.jpg)](https://www.youtube.com/watch?v=xI5IFJ9qMeY) 12 | 13 | [Linux version . . . Windows Version and Android version for vHackXT ] 14 | 15 | [Official Database OlympicCode ](https://vhack.olympiccode.ga/) 16 | thanx to [@checkium](https://github.com/checkium) ....................... 17 | 18 | Minimal Configuration required 19 | 20 | - CPU i3, i5, ARM64, 4 thread Minimum or (4 core for amd). 21 | - Ram 128Mo. 22 | - OS: Windows 7, Win10, Linux ALL version, Android 4.4 or Higher. 23 | - Network speed: ADSL Minimal (100ko/s for download). 24 | 25 | 26 | Function 27 | - Update your Account Firewall / IPSP / CPU / Ram ect... 28 | - Remove Spyware if detecting in the account 29 | - Attack the with botnet 30 | - Attack for console Target and detect for FBI 31 | - Help for tournament to get first place 32 | - Run in Multi-Processing for more stability and fast (Linux) / Windows is scalable 33 | - Two attack modes, Patator or Secure 34 | - it's the number 1 bot for vHackXT 35 | - detected if you are blocked on the api vHackXT and waiting (~5 Minutes) 36 | - Auto update Botnet 37 | - Chat resolve cluster name (execute : python chat.py in linux and just run chat.exe for windows) 38 | (Windows no support all charset in the chat :( ) 39 | 40 | The app is dev mode. 41 | No return exactly great output thanx 42 | 43 | Edit main.py line 17 44 | Replace username and password for your login details. 45 | 46 | Linux Exclusive Database and multiprocessing **(file database is database.txt in your directory)** 47 | 48 | External dependencies you'll need include: 49 | - requests 50 | - Pillow 51 | 52 | 53 | 54 | To install these on Linux: 55 | 56 | For centos/redhat 57 | >$ pip install requests 58 | >$ pip install futures 59 | >$ pip install Pillow 60 | 61 | Install Pillow on Android 6.x 62 | >$ pkg install python python-dev libjpeg-turbo-dev ndk-sysroot clang 63 | >$ python -m pip install wheel 64 | >$ LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" python -m pip install pillow 65 | >$ python -m pip install request 66 | >$ python -m pip install futures 67 | 68 | start for Android 6.x 69 | >$ python main.py 70 | 71 | Install Pillow on Android 7.x 72 | >$ pkg install python python2-dev libjpeg-turbo-dev ndk-sysroot clang 73 | >$ python2 -m pip install wheel 74 | >$ LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" python2 -m pip install pillow 75 | >$ python2 -m pip install request 76 | >$ python2 -m pip install futures 77 | 78 | start for 7.x 79 | >$ python2 main.py 80 | 81 | ### You can find installation scripts at [vHackBot-Install](https://github.com/AtjonTV/vHackBot-install) 82 | 83 | **New Mode Available !** 84 | "**Potator**" or "**Secure**" on line 39 in main.py (edit line) 85 | 86 | **Potator** 87 | ``` 88 | Potator mode It will not examine firewall or stealth mode it will attack anything 89 | that can with any criteria perfect for tournaments 90 | ``` 91 | 92 | **Secure** 93 | ``` 94 | Protects against attack back or you tell yourself 95 | the least to secure it verifying that you are 96 | ``` 97 | 98 | Result: 99 | ![](http://www.cuby-hebergs.com/dl/vhack.png) 100 | 101 | donation for the project 102 | [![Donation for project](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=support%40cuby%2dhebergs%2ecom&lc=US&item_name=vBlackOut%20Coder&no_note=0&cn=about%20more%20information%20for%20your%20donation&no_shipping=2¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted) 103 | 104 | Thanx to [@flatt3rn](https://github.com/flatt3rn) ;), [@WookieNZ](https://github.com/WookieNZ), [@JasonKhew96](https://github.com/JasonKhew96) 105 | -------------------------------------------------------------------------------- /Windows/Readme.md: -------------------------------------------------------------------------------- 1 | i removed but the script python run for multi platform 2 | -------------------------------------------------------------------------------- /Windows/config.ini: -------------------------------------------------------------------------------- 1 | [Config] 2 | username: your_username 3 | password: your_password 4 | maxanti_normal: 3000 5 | active_cluster_protection: True 6 | booster: False 7 | Use_netcoins: True 8 | maxanti_tournament: 3000 9 | attacks_normal:3 10 | attacks_tournament: 2 11 | mode: Secure 12 | BotNet_update: False 13 | ddos_cluster: False 14 | tournament_potator: True 15 | AttackTournamentDB: False 16 | Max_point_tournament: 1300 17 | updates: ipsp,adw,fw,scan,sdk,av 18 | joinTournament: False 19 | wait: 2 20 | wait_load: 2 21 | updatecount: 0 22 | attackneeded: False 23 | database: database.db 24 | anon: True -------------------------------------------------------------------------------- /botnet.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | # -*- coding: utf-8 3 | 4 | from utils import Utils 5 | 6 | import json 7 | import logging 8 | import random 9 | import config 10 | logger = logging.getLogger(__name__) 11 | 12 | 13 | class Botnet: 14 | ut = Utils() 15 | 16 | def __init__(self, player): 17 | self.username = player.username 18 | self.password = player.password 19 | self.uhash = player.uhash 20 | self.botNetServers = 3 21 | self.botnet = [] 22 | self.p = player 23 | self.ofwhat = config.BotNet_updates 24 | self.energy = 0 25 | self._initbot() 26 | 27 | def _initbot(self): 28 | """ 29 | Grab the amount of bots in the botnet 30 | and populate and array of Bot class 31 | :return: none 32 | """ 33 | if(self.ofwhat == "ALL"): 34 | self.ofwhat = ["fw", "av", "smash", "mwk"] 35 | data = self._botnetInfo() 36 | bots = json.loads(data) 37 | self.botnet = [] 38 | if int(bots['count']) > 0: 39 | for i in bots['data']: 40 | bot = Bot(i['running'], self.ofwhat[random.randint(0,len(self.ofwhat)-1)], self.energy, i['hostname'], self.username, self.password, self.uhash) 41 | self.botnet.append(bot) 42 | 43 | def printbots(self): 44 | """ 45 | Print a list of player PCs in the botnet 46 | :return: None 47 | """ 48 | for bot in self.botnet: 49 | logger.info(bot) 50 | 51 | def getbotnetdata(self): 52 | """ 53 | Return an array of bot class. 54 | Contains all the bots in the botnet. 55 | :return: list of bot class 56 | """ 57 | return self.botnet 58 | 59 | def getInfo(self): 60 | """ 61 | Get info about the entire botnet. 62 | Including if you can attack bot net servers etc. 63 | Also botnet PC info. 64 | :return: list of vHack serves that can be hacked. 65 | ['1','2','1']. '1' = can be hacked, '2' time not elapsed. 66 | """ 67 | response = self.ut.requestString(self.username, self.password, self.uhash, "vh_botnetInfo.php") 68 | response = json.loads(response) 69 | return response 70 | 71 | def attack(self): 72 | """ 73 | Check if vHack server botnet is attackable, 74 | then attack if can. 75 | :return: none 76 | """ 77 | self._initbot() 78 | logger.info("Trying Bot Net") 79 | cinfo = self.getInfo() 80 | 81 | for i in range(1, self.botNetServers + 1): 82 | if cinfo[i - 1] == '1': 83 | logger.debug('I am attacking #{}'.format(i)) 84 | if i == 1: 85 | response = self.ut.requestString(self.username, self.password, self.uhash, "vh_attackCompany.php", company=str(i)) 86 | else: 87 | response = self.ut.requestString(self.username, self.password, self.uhash, "vh_attackCompany" + str(i) + ".php", company=str(i)) 88 | logger.debug('I attacked #{} with response {}'.format(i, response)) 89 | if response == '0': 90 | logger.info('#{} Netcoins gained'.format(i)) 91 | else: 92 | logger.info('#{} Failed! No netcoins...'.format(i)) 93 | else: 94 | logger.info("Botnet #{} not hackable yet".format(i)) 95 | 96 | def upgradebotnet(self, hostname, running, count): 97 | """ 98 | Check if there is enough money to upgrade a botnet PC. 99 | Cycle through and upgrade until no money. 100 | :return: None 101 | """ 102 | ofwhat = self.ofwhat[random.randint(0,len(self.ofwhat)-1)] 103 | logger.info("Prepare attempting to upgrade bot net PC '"+ hostname +"'") 104 | get_infobot = self.getInfo() 105 | 106 | if (int(get_infobot['data'][count]['strength']) == 1120 and int(get_infobot['data'][count]['stars']) == 4): 107 | logger.info("Bot '"+hostname+"' has max strength [1120] for level " + str(get_infobot['data'][count]['stars'])) 108 | return False 109 | 110 | elif (int(get_infobot['data'][count]['strength']) == 840 and int(get_infobot['data'][count]['stars']) == 3): 111 | logger.info("Bot '"+hostname+"' has max strength [840] for level " + str(get_infobot['data'][count]['stars'])) 112 | return False 113 | 114 | elif (int(get_infobot['data'][count]['strength']) == 600 and int(get_infobot['data'][count]['stars']) == 2): 115 | logger.info("Bot '"+hostname+"' has max strength [600] for level " + str(get_infobot['data'][count]['stars'])) 116 | return False 117 | 118 | elif (int(get_infobot['data'][count]['strength']) == 400 and int(get_infobot['data'][count]['stars']) == 1): 119 | logger.info("Bot '"+hostname+"' has max strength [400] for level " + str(get_infobot['data'][count]['stars'])) 120 | return False 121 | 122 | elif (int(get_infobot['data'][count]['strength']) == 3000 and int(get_infobot['data'][count]['stars']) == 0): 123 | logger.info("Bot '"+hostname+"' has max strength [3000] for level " + str(get_infobot['data'][count]['stars'])) 124 | return False 125 | 126 | if (int(get_infobot['data'][count]['running']) == 0 and int(get_infobot['energy']) > 0): 127 | 128 | if int(get_infobot['data'][count]['stars']) > 0: 129 | maxofwhat = 20 + (5*int(get_infobot['data'][count]['stars'])) 130 | 131 | elif int(get_infobot['data'][count]['stars']) == 0: 132 | maxofwhat = 250 133 | 134 | remove = 0 135 | 136 | for a, i in enumerate(xrange(0, len(self.ofwhat)-1)): 137 | if int(get_infobot['data'][count][unicode(self.ofwhat[i-remove])]) == int(maxofwhat): 138 | self.ofwhat.remove(self.ofwhat[i-remove]) 139 | remove = remove + 1 140 | if i == 3: 141 | break 142 | 143 | ofwhat = self.ofwhat[random.randint(0,(len(self.ofwhat)-1))] 144 | 145 | new_bal = self.upgradesinglebot(hostname, ofwhat) 146 | if new_bal: 147 | logger.info("Waiting! Doing updates for bot '" + hostname + "', [" + ofwhat + "]") 148 | return True 149 | 150 | elif (int(get_infobot['energy']) == 0): 151 | logger.info("You don't have enough energy to upgrade '" + hostname + "'! :(") 152 | return False 153 | 154 | elif (int(get_infobot['data'][count]['running']) == 1): 155 | logger.info("Waiting! Doing updates for bot '" + hostname + "', [" + ofwhat + "]") 156 | return False 157 | 158 | logger.debug("The bot '{}' is not upgradeable".format(hostname)) 159 | return False 160 | 161 | def _botnetInfo(self): 162 | """ 163 | Get the botnet information including vHack servers and PC data. 164 | :return: string 165 | '{"count":"14", 166 | "data":[{"bID":"1","bLVL":"100","bSTR":"100","bPRICE":"10000000"}, 167 | {"bID":"2","bLVL":"100","bSTR":"100","bPRICE":"10000000"}], 168 | "strength":23,"resethours1":"","resetminutes1":"14","resethours2":"4","resetminutes2":"15", 169 | "resethours3":"3","resetminutes3":"15", 170 | "canAtt1":"2","canAtt2":"2","canAtt3":"2"}' 171 | """ 172 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_botnetInfo.php") 173 | return temp 174 | 175 | def upgradesinglebot(self, hostname, ofwhat): 176 | """ 177 | Pass in bot class object and call upgrade function based on bot ID. 178 | details : 179 | {u'strength': u'22', u'old': u'30', u'mm': u'68359859', 180 | u'money': u'66259859', u'costs': u'2100000', 181 | u'lvl': u'21', u'new': u'22'} 182 | current lvl, bot number, x, x, upgrade cost, lvl, next lvl 183 | :return: None 184 | """ 185 | response = self.ut.requestString(self.username, self.password, self.uhash, "vh_upgradePC.php", hostname=hostname, ofwhat=ofwhat, inst="0", much="1") 186 | jsons = json.loads(response) 187 | if int(jsons['result']) == 0: 188 | return True 189 | else: 190 | logger.error("Upgrades on " + hostname + " Failed !") 191 | return False 192 | 193 | def __repr__(self): 194 | return "Botnet details: vHackServers: {0}, Bot Net PC's: {1}".format(self.botNetServers, self.botnet) 195 | 196 | 197 | class Bot: 198 | ut = Utils() 199 | 200 | def __init__(self, running, ofwhat, energy, hostname, username, password, uhash): 201 | self.username = username 202 | self.uhash = uhash 203 | self.password = password 204 | self.running = int(running) 205 | self.ofwhat = ofwhat 206 | self.energy = energy 207 | self.hostname = hostname 208 | 209 | def botupgradable(self, running): 210 | """ 211 | Determine if botnet PC is at max level or not. 212 | :return: Bool 213 | """ 214 | if running == 0: 215 | return True 216 | else: 217 | return False 218 | 219 | def nextlevelcostenergy(self): 220 | """ 221 | Return the cost of upgrading bot to the next level 222 | :return:int 223 | """ 224 | return self.energy 225 | 226 | def parse_json_stream(self, stream): 227 | decoder = json.JSONDecoder() 228 | while stream: 229 | obj, idx = decoder.raw_decode(stream) 230 | yield obj 231 | stream = stream[idx:].lstrip() 232 | 233 | def upgradesinglebot(self, hostname, ofwhat): 234 | """ 235 | Pass in bot class object and call upgrade function based on bot ID. 236 | details : 237 | {u'strength': u'22', u'old': u'30', u'mm': u'68359859', 238 | u'money': u'66259859', u'costs': u'2100000', 239 | u'lvl': u'21', u'new': u'22'} 240 | current lvl, bot number, x, x, upgrade cost, lvl, next lvl 241 | :return: None 242 | """ 243 | response = self.ut.requestString(self.username, self.password, self.uhash, "vh_upgradePC.php", hostname=hostname, ofwhat=ofwhat) 244 | #response = response.split('}{')[0] + '}' 245 | #jsons = json.loads(response) 246 | #logger.info(jsons) 247 | return True 248 | 249 | 250 | def __repr__(self): 251 | 252 | return "Bot details: running: {0}, energy: {1}, upgrade: {2}, botname: {3}".format(self.running, self.energy, self.ofwhat, self.hostname) 253 | -------------------------------------------------------------------------------- /chat.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | from random import randint 3 | import asyncore 4 | import collections 5 | import socket 6 | 7 | 8 | MAX_MESSAGE_LENGTH = 4096 9 | 10 | 11 | class RemoteClient(asyncore.dispatcher): 12 | 13 | """Wraps a remote client socket.""" 14 | 15 | def __init__(self, host, socket, address): 16 | asyncore.dispatcher.__init__(self, socket) 17 | self.host = host 18 | self.outbox = collections.deque() 19 | 20 | def say(self, message): 21 | self.outbox.append(message) 22 | 23 | def handle_read(self): 24 | client_message = self.recv(MAX_MESSAGE_LENGTH) 25 | self.host.broadcast(client_message) 26 | 27 | def handle_write(self): 28 | if not self.outbox: 29 | return 30 | message = self.outbox.popleft() 31 | if len(message) > MAX_MESSAGE_LENGTH: 32 | raise ValueError('Message too long') 33 | self.send(message) 34 | 35 | 36 | class Client(asyncore.dispatcher): 37 | 38 | def __init__(self, host_address, name): 39 | asyncore.dispatcher.__init__(self) 40 | print ('definition your user : (%7s)' % name) 41 | self.create_socket(socket.AF_INET, socket.SOCK_STREAM) 42 | self.name = name 43 | print('Connecting to host at server...') 44 | self.connect(host_address) 45 | self.outbox = collections.deque() 46 | 47 | def handle_error(self): 48 | print("Server is down.") 49 | exit() 50 | 51 | def handle_write(self): 52 | if not self.outbox: 53 | return 54 | message = self.outbox.popleft() 55 | if len(message) > MAX_MESSAGE_LENGTH: 56 | raise ValueError('Message too long') 57 | self.send(message) 58 | 59 | def handle_read(self): 60 | 61 | message = self.recv(MAX_MESSAGE_LENGTH) 62 | 63 | if ["MODE", "JOIN", "QUIT", ".IP", ":v[", ":vHackXTGuard", 64 | "ip.vhack.biz", "#vHackXT", "PING"] in message: 65 | 66 | message = message.split(" ") 67 | 68 | correcte = ['MODE', "JOIN", "QUIT", ".IP", ":v[", 69 | "admin.vhack.biz", "mod.vhack.biz", ":vHackXTGuard", 70 | "#vHackXT", ":Ping", "PING", ":chat.vhackxt.com", 71 | ":chat.vhackxt.com\r\n", "timeout:", "seconds\r\n", 72 | "vip.vhack.biz", "ip.vhack.biz", ":Read", "error"] 73 | 74 | for i, list_word in enumerate(message): 75 | for list_match in correcte: 76 | if list_match in list_word: 77 | message.remove(message[i]) 78 | 79 | if "## Cluster" in message: 80 | message = message.replace("##", "\r\n ##") 81 | 82 | print(' '.join(message)) 83 | 84 | else: 85 | print(message) 86 | 87 | 88 | if __name__ == '__main__': 89 | print('Creating clients') 90 | client = Client(("164.132.9.247", 15000), 'User_' + str(randint(0, 500))) 91 | asyncore.loop() 92 | -------------------------------------------------------------------------------- /classes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | # -*- coding: utf-8 3 | 4 | 5 | class Passwords: 6 | def getImage1(self): 7 | return self.img1 8 | 9 | def __init__(self, arr): 10 | if len(arr) == 5: 11 | self.img1 = arr[0].split(":")[1] 12 | else: 13 | self.img1 = "null" 14 | 15 | 16 | class IP: 17 | def getIP(self): 18 | return self.ip 19 | 20 | def getFirewallLevel(self): 21 | return self.firewallLevel 22 | 23 | def getAttacked(self): 24 | return self.attacked 25 | 26 | def __init__(self, arr): 27 | if len(arr) == 3: 28 | self.ip = arr[0].split(":")[1] 29 | self.firewallLevel = int(arr[1].split(":")[1]) 30 | self.attacked = int(arr[2].split(":")[1]) 31 | else: 32 | self.ip = "" 33 | self.firewallLevel = 0 34 | self.attacked = 0 35 | -------------------------------------------------------------------------------- /client.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import sys 3 | 4 | # Create a TCP/IP socket 5 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 6 | 7 | # Connect the socket to the port where the server is listening 8 | server_address = ('localhost', 14000) 9 | print >>sys.stderr, 'connecting to %s port %s' % server_address 10 | sock.connect(server_address) 11 | try: 12 | # Send data 13 | message = sys.argv[1] 14 | # print >>sys.stderr, 'sending "%s"' % message 15 | sock.sendall(message) 16 | 17 | # Look for the response 18 | amount_received = 0 19 | amount_expected = len(message) 20 | 21 | while amount_received < amount_expected: 22 | data = sock.recv(4096) 23 | amount_received += len(data) 24 | # print >>sys.stderr, 'received "%s"' % data 25 | 26 | finally: 27 | # print >>sys.stderr, 'closing socket' 28 | sock.close() 29 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | from random import uniform 2 | 3 | user = "" 4 | password = "" 5 | 6 | # Enter Max Antivir to attack in normal mode 7 | maxanti_normal = 3000 8 | 9 | # Active or not the protection for cluster ( don't attack if you are ddos your cluster) 10 | active_cluster_protection = True 11 | 12 | # Use booster 13 | booster = True 14 | 15 | # define number task update 16 | number_task = 30 17 | 18 | # Finish all task by netcoins 19 | Use_netcoins = False 20 | 21 | # Enter Max Antivir to attack tournament 22 | maxanti_tournament = 3000 23 | 24 | # Enter the minimal energy for update botnet 25 | minimal_energy_botnet_upgrade = 0 26 | 27 | # Enter Amount of Attacks normal 28 | attacks_normal = 2 29 | 30 | # Enter Amount of Attacks in tournament 31 | attacks_tournament = 30 32 | 33 | # define the initial mode 34 | mode = "Secure" 35 | 36 | # update botnet auto 37 | BotNet_update = True 38 | 39 | # Enter Updates (fw, av, smash, mwk) 40 | BotNet_updates = ["fw", "av", "smash", "mwk"] 41 | #BotNet_updates = "ALL" # Makes all updates 42 | 43 | # check list of more player in tournament and ddos the cluster. 44 | ddos_cluster = False 45 | 46 | # change auto mode Potator for tournament 47 | tournament_potator = False 48 | 49 | AttackTournamentDB = False 50 | Max_point_tournament = 1300 51 | # Enter Updates (inet, hdd, cpu, ram, fw, av, sdk, ipsp, spam, scan, adw) 52 | updates = ["ipsp", "fw", "scan", "sdk", "av"] 53 | #updates = "ALL" # Makes all updates 54 | 55 | # Do you want to attack during tournament [True, False] 56 | joinTournament = False 57 | 58 | # Time to wait between each cycle in seconds 59 | wait = round(uniform(0, 1), 2) 60 | wait_load = round(uniform(0, 3), 2) 61 | updatecount = 0 62 | attackneeded = False 63 | database = 'database.db' 64 | 65 | # check attack anonymous 66 | anon = True 67 | -------------------------------------------------------------------------------- /console.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | # -*- coding: utf-8 3 | 4 | from classes import Passwords 5 | from utils import Utils 6 | import time 7 | import json 8 | from PIL import Image 9 | import base64 10 | import requests 11 | import re 12 | import concurrent.futures 13 | import random 14 | import sys 15 | import signal 16 | import io 17 | import logging 18 | logger = logging.getLogger(__name__) 19 | 20 | original_sigint = None 21 | DATABASE_ENDPOINT = "https://vhack.olympiccode.ga/database/submit.php" 22 | 23 | 24 | class Console: 25 | ut = Utils() 26 | 27 | def __init__(self, player): 28 | global original_sigint 29 | self.username = player.username 30 | self.password = player.password 31 | self.uhash = player.uhash 32 | original_sigint = signal.getsignal(signal.SIGINT) 33 | signal.signal(signal.SIGINT, self.exit_gracefully) 34 | 35 | def myinfo(self): 36 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_update.php", gcm="eW7lxzLY9bE:APA91bEO2sZd6aibQerL3Uy-wSp3gM7zLs93Xwoj4zIhnyNO8FLyfcODkIRC1dc7kkDymiWxy_dTQ-bXxUUPIhN6jCUBVvGqoNXkeHhRvEtqAtFuYJbknovB_0gItoXiTev7Lc5LJgP2") 37 | return temp 38 | 39 | def requestPassword(self, ip): 40 | arr = self.ut.requestArray(self.username, self.password, "vh_vulnScan.php", target=ip) 41 | imgs = Passwords(arr) 42 | return imgs 43 | 44 | def enterPassword(self, target, passwd): 45 | passwd = passwd.split("p") 46 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_trTransfer.php", target=str(target), port="0") # passwd[1].strip() 47 | result = json.loads(temp) 48 | if str(result["result"]) == "0": 49 | return temp 50 | else: 51 | return False 52 | 53 | def check_Cluster(self): 54 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_ClusterData.php") 55 | return temp 56 | 57 | def scanUser(self): 58 | arr = self.ut.requestArray(self.username, self.password, self.uhash, "vh_scanHost.php") 59 | return arr 60 | 61 | def GetTournamentPosition(self): 62 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_tournamentData.php") 63 | return temp 64 | 65 | def AttackCluster(self, tag): 66 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_startDDoS.php", ctag=str(tag)) 67 | return temp 68 | 69 | def ScanCluster(self, tag): 70 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_scanTag.php") 71 | return temp 72 | 73 | def transferMoney(self, ip): 74 | arr = self.ut.requestArray(self.username, self.password, self.uhash, "vh_trTransfer.php", target=ip) 75 | return arr 76 | 77 | def clearLog(self, ip): 78 | s = self.ut.requestString(self.username, self.password, self.uhash, "vh_clearAccessLogs.php", target=ip) 79 | if s == "0": 80 | return True 81 | else: 82 | return False 83 | 84 | def uploadSpyware(self, ip): 85 | s = self.ut.requestString(self.username, self.password, self.uhash, "vh_spywareUpload.php", target=ip) 86 | if s == "0": 87 | return True 88 | else: 89 | return False 90 | 91 | def getTournament(self): 92 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_update.php") 93 | if "tournamentActive" in temp: 94 | if "2" not in temp.split('tournamentActive":"')[1].split('"')[0]: 95 | return True 96 | else: 97 | return False 98 | 99 | def returncrawler(fd, lineexec): 100 | fd.write('{0}\n'.format(lineexec.result())) 101 | fd.flush() 102 | 103 | def get_main_color(self, image_data): 104 | img = Image.open(io.BytesIO(image_data)) 105 | colors = img.getcolors(256) # put a higher value if there are many colors in your image 106 | max_occurence, most_present = 0, 0 107 | try: 108 | for c in colors: 109 | if c[1][0] == 136: 110 | FBI = True 111 | return FBI 112 | 113 | except TypeError: 114 | raise Exception("Too many colors in the image") 115 | 116 | def calc_img(self, ut, imgstring, uhash, hostname, mode): 117 | # pic = cStringIO.StringIO() 118 | # image_string = cStringIO.StringIO(base64.b64decode(imgstring)) 119 | # image = Image.open(image_string) 120 | 121 | # Overlay on white background, see http://stackoverflow.com/a/7911663/1703216 122 | # bg = Image.new("RGB", image.size, (255,255,255)) 123 | # bg.paste(image,image) 124 | 125 | imgdata = base64.b64decode(imgstring) 126 | image = self.get_main_color(imgdata) 127 | 128 | if image: 129 | logger.info("Matched FBI") 130 | return 1, hostname 131 | 132 | else: 133 | try: 134 | # if int(firewall[2].strip()) < max: 135 | try: 136 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_scanHost.php", hostname=str(hostname)) 137 | 138 | jsons = json.loads(temp) 139 | if ".vHack.cc" not in str(jsons['ipaddress']): 140 | result = self.attackIP(jsons['ipaddress'], mode) 141 | 142 | # remove spyware 143 | spyware = self.ut.requestArray(self.username, self.password, self.uhash, "vh_spywareInfo.php") 144 | if int(spyware[0].split(":")[-1]) > 0 and not int(spyware[0].split(":")[-1]) == 0: 145 | self.ut.requestArray(self.username, self.password, self.uhash, "vh_removeSpyware.php") 146 | logger.info("I will remove {} Spyware for your account.".format(str(spyware[0].split(":")[-1]))) 147 | return result, jsons['ipaddress'] 148 | 149 | # else: 150 | # temp = self.ut.requestString("user::::pass::::uhash::::hostname", self.username + "::::" + self.password + "::::" + str(uhash) + "::::" + jsons['ipaddress'], "vh_scanHost.php") 151 | # if not ".vHack.cc" in str(jsons['ipaddress']) and int(jsons['vuln']) == 1: 152 | # time.sleep(1) 153 | # self.attackIP(jsons['ipaddress'], max, mode) 154 | 155 | except TypeError as e: 156 | logger.error(e) 157 | return 0, 0, "type error" + e 158 | # else: 159 | # print "Firewall level is to High" 160 | # return 0, 0 161 | 162 | except ValueError as e: 163 | logger.error(e) 164 | return 0, 0, "value error" 165 | 166 | def getIP(self, blank, max, mode, active_protecte_cluster_ddos): 167 | stat_cluster = self.check_Cluster() 168 | stat_cluster = json.loads(stat_cluster) 169 | try: 170 | stat_cluter_blocked = stat_cluster['blocked'] 171 | except: 172 | stat_cluter_blocked = "" 173 | 174 | if "Your Cluster is blocked" in stat_cluter_blocked and active_protecte_cluster_ddos: 175 | logger.info("wait 2 minutes {}".format(stat_cluter_blocked)) 176 | time.sleep(120) 177 | else: 178 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_getImg.php", by=str(random.randint(0, 1))) 179 | jsons = json.loads(temp) 180 | list_image = [] 181 | list_hostname = [] 182 | 183 | for i in range(0, len(jsons["data"])): 184 | hostname = str(jsons["data"][i]["hostname"]) 185 | imgstring = 'data: image/png;base64,' + jsons["data"][i]['img'] 186 | imgstring = imgstring.split('base64,')[-1].strip() 187 | list_image.append(imgstring) 188 | list_hostname.append(hostname) 189 | 190 | logger.info("Packing IP list {}".format(len(list_image))) 191 | # fd = open("database.txt", "a") 192 | 193 | with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor: 194 | for i, image in enumerate(list_image): 195 | wait_for = executor.submit(self.calc_img, self.ut, list_image[i], self.uhash, list_hostname[i], mode) 196 | 197 | try: 198 | result, ip = wait_for.result() 199 | 200 | except TypeError: 201 | result = False 202 | except ValueError: 203 | result = False 204 | 205 | except ValueError: 206 | result = False 207 | 208 | if result: 209 | with open("database.text", "a") as f: 210 | f.write(ip + "\n") 211 | 212 | def send2DB(ip, username, money, ipsplevel, fwlevel, avlevel): 213 | logger.info("send to database") 214 | try: 215 | s = requests.session() 216 | if ip == username: 217 | s.get(DATABASE_ENDPOINT + "?IP={}&MONEY={}&IPSP={}&FW={}&AV={}".format(ip, money, ipsplevel, fwlevel, avlevel), timeout=15) 218 | else: 219 | s.get(DATABASE_ENDPOINT + "?IP={}&USR={}&MONEY={}&IPSP={}&FW={}&AV={}".format(ip, username, money, ipsplevel, fwlevel, avlevel), timeout=15) 220 | s.close() 221 | except Exception as e: 222 | logger.error(e) 223 | s.close() 224 | 225 | def attackIP(self, ip, mode): 226 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_loadRemoteData.php", target=ip) 227 | jsons = json.loads(temp) 228 | 229 | # o = OCR() 230 | # imgs = o.getSolution(str(temp)) 231 | imgs = True 232 | if imgs is not None: 233 | try: 234 | # user = jsons['username'] 235 | winchance = jsons['winchance'] 236 | except TypeError: 237 | logger.error("error") 238 | return False 239 | 240 | try: 241 | if winchance: 242 | fwlevel = jsons['fw'] 243 | avlevel = jsons['av'] 244 | # spamlevel = jsons['spam'] 245 | sdklevel = jsons['sdk'] 246 | # ipsplevel = jsons['ipsp'] 247 | money = jsons['money'] 248 | saving = jsons['savings'] 249 | anonymous = jsons['anonymous'] 250 | username = jsons['username'] 251 | # winlo = jsons['winelo'] 252 | winchance = jsons['winchance'] 253 | # spywarelevel = jsons['spyware'] 254 | else: 255 | avlevel = "????" 256 | winchance = 0 257 | logger.info("no scan username") 258 | return False 259 | 260 | except TypeError: 261 | fwlevel = jsons['fw'] 262 | avlevel = jsons['av'] 263 | # spamlevel = jsons['spam'] 264 | sdklevel = jsons['sdk'] 265 | # ipsplevel = jsons['ipsp'] 266 | money = jsons['money'] 267 | saving = jsons['savings'] 268 | anonymous = jsons['anonymous'] 269 | username = jsons['username'] 270 | # winlo = jsons['winelo'] 271 | winchance = jsons['winchance'] 272 | # spywarelevel = jsons['spyware'] 273 | 274 | if type(winchance) == "str": 275 | if "?" in winchance: 276 | winchance = 0 277 | logger.info("no chance") 278 | return False 279 | 280 | if mode == "Potator": 281 | if winchance > 20: 282 | password = self.enterPassword(ip, self.uhash) 283 | jsons = json.loads(password) 284 | if int(jsons["result"]) == 0: 285 | try: 286 | if "?" not in str(money) and str(jsons['result']) == 0: 287 | logger.info("\nYour Money: {:11,}$\n[TargetIP: {}]\n\nMade {:11,}$ and {:2d}Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}$\n YourWinChance: {} Anonymous: {} username: {} saving: {}\n".format( 288 | jsons['newmoney'], ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 289 | try: 290 | ip = re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', username).group() 291 | except AttributeError: 292 | pass 293 | # print ip, type(ip), username, type(username) 294 | # self.send2DB(ip, username, money, ipsplevel, fwlevel, avlevel) 295 | else: 296 | logger.info("\nYour Money: {:11,}$\n[TargetIP: {}]\n\nMade {:11,}$ and {:2d}Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}$\n YourWinChance: {} Anonymous: {} username: {} saving: {}\n".format( 297 | jsons['newmoney'], ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 298 | try: 299 | ip = re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', username).group() 300 | except AttributeError: 301 | pass 302 | # print ip, type(ip), username, type(username) 303 | # self.send2DB(ip, username, money, ipsplevel, fwlevel, avlevel) 304 | 305 | return True 306 | 307 | except KeyError: 308 | logger.info("Bad attack") 309 | return False 310 | 311 | except ValueError as e: 312 | logger.error("error: {}".format(e)) 313 | return True 314 | else: 315 | logger.error("Password Wrong") 316 | return False 317 | else: 318 | logger.info("winchance is poor: {}".format(winchance)) 319 | return False 320 | 321 | if "?" not in str(avlevel) and "?" not in str(winchance) and mode == "Secure": 322 | if int(winchance) > 75 and str(anonymous) == "YES": 323 | password = self.enterPassword(ip, self.uhash) 324 | jsons = json.loads(password) 325 | if int(jsons["result"]) == 0: 326 | try: 327 | if "?" not in str(money) and str(jsons['result']) == 0: 328 | logger.info("\nYour Money: {:11,}$\n[TargetIP: {}]\n\nMade {:11,}$ and {:2d}Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}$\n YourWinChance: {} Anonymous: {} username: {} saving: {}\n".format( 329 | jsons['newmoney'], ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 330 | try: 331 | ip = re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', username).group() 332 | except AttributeError: 333 | pass 334 | # print ip, type(ip), username, type(username) 335 | # self.send2DB(ip, username, money, ipsplevel, fwlevel, avlevel) 336 | return True 337 | else: 338 | logger.info("\nYour Money: {:11,}$\n[TargetIP: {}]\n\nMade {:11,}$ and {:2d}Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}$\n YourWinChance: {} Anonymous: {} username: {} saving: {}\n".format( 339 | jsons['newmoney'], ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 340 | try: 341 | ip = re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', username).group() 342 | except AttributeError: 343 | pass 344 | # print ip, type(ip), username, type(username) 345 | # self.send2DB(ip, username, money, ipsplevel, fwlevel, avlevel) 346 | return True 347 | 348 | except KeyError: 349 | logger.error("Bad attack") 350 | return False 351 | else: 352 | logger.error("Password Incorrect") 353 | return False 354 | else: 355 | # print "\n" 356 | if int(winchance) < 75: 357 | logger.info("winchance is poor: {}".format(winchance)) 358 | # print "passed" 359 | return False 360 | if str(anonymous) == "NO": 361 | logger.info("Hack Anonymous is needed") 362 | # print "passed" 363 | return False 364 | else: 365 | if "?" in str(avlevel): 366 | logger.info("Cant load User") 367 | return False 368 | else: 369 | logger.error("Scan to low ({})".format(avlevel)) 370 | return False 371 | else: 372 | logger.info("Password Error") 373 | return False 374 | 375 | def attack(self, obj): 376 | for i in range(0, (obj.attacks_normal * random.randint(1, 2))): 377 | self.getIP(True, obj.maxanti_normal, obj.mode, obj.active_cluster_protection) 378 | logger.info("wait anti-blocking...") 379 | 380 | def exit_gracefully(self, signum, frame): 381 | # restore the original signal handler as otherwise evil things will happen 382 | # in raw_input when CTRL+C is pressed, and our signal handler is not re-entrant 383 | signal.signal(signal.SIGINT, original_sigint) 384 | 385 | try: 386 | if raw_input("\nReally quit? (y/n)> ").lower().startswith('y'): 387 | sys.exit(1) 388 | 389 | except KeyboardInterrupt: 390 | logger.info("Ok ok, quitting") 391 | sys.exit(1) 392 | 393 | # restore the exit gracefully handler here 394 | signal.signal(signal.SIGINT, self.exit_gracefully) 395 | -------------------------------------------------------------------------------- /console_windows_source.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | # -*- coding: utf-8 3 | 4 | from classes import Passwords 5 | from utils import Utils 6 | from ocr import OCR 7 | from PIL import Image 8 | import base64 9 | import time 10 | import json 11 | import concurrent.futures 12 | import random 13 | import sys 14 | import signal 15 | 16 | 17 | class Console: 18 | def myinfo(self): 19 | ut = Utils() 20 | temp = ut.requestString("user::::pass::::gcm::::uhash", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "eW7lxzLY9bE:APA91bEO2sZd6aibQerL3Uy-wSp3gM7zLs93Xwoj4zIhnyNO8FLyfcODkIRC1dc7kkDymiWxy_dTQ-bXxUUPIhN6jCUBVvGqoNXkeHhRvEtqAtFuYJbknovB_0gItoXiTev7Lc5LJgP2" + "::::" + "userHash_not_needed", "vh_update.php") 21 | return temp 22 | 23 | def requestPassword(self, ip): 24 | ut = Utils() 25 | arr = ut.requestArray("user::::pass::::target", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + ip, "vh_vulnScan.php") 26 | imgs = Passwords(arr) 27 | return imgs 28 | 29 | def enterPassword(self, passwd, target, uhash): 30 | passwd = passwd.split("p") 31 | ut = Utils() 32 | temp = ut.requestString("user::::pass::::port::::target::::uhash", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + str(passwd[1].strip()) + "::::" + str(target) + "::::" + str(uhash), "vh_trTransfer.php") 33 | if temp == "10": 34 | return False 35 | else: 36 | return temp 37 | 38 | def scanUser(self): 39 | ut = Utils() 40 | arr = ut.requestArray("user::::pass::::", self.api.getUsername() + "::::" + self.api.getPassword() + "::::", "vh_scanHost.php") 41 | return arr 42 | 43 | def transferMoney(self, ip): 44 | ut = Utils() 45 | arr = ut.requestArray("user::::pass::::target", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + ip, "vh_trTransfer.php") 46 | return arr 47 | 48 | def clearLog(self, ip): 49 | ut = Utils() 50 | s = ut.requestString("user::::pass::::target", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + ip, "vh_clearAccessLogs.php") 51 | if s == "0": 52 | return True 53 | else: 54 | return False 55 | 56 | def uploadSpyware(self, ip): 57 | ut = Utils() 58 | s = ut.requestString("user::::pass::::target", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + ip, "vh_spywareUpload.php") 59 | if s == "0": 60 | return True 61 | else: 62 | return False 63 | 64 | def getTournament(self): 65 | ut = Utils() 66 | temp = ut.requestString("user::::pass::::uhash", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "UserHash_not_needed", "vh_update.php") 67 | if "tournamentActive" in temp: 68 | if "2" not in temp.split('tournamentActive":"')[1].split('"')[0]: 69 | return True 70 | else: 71 | return False 72 | 73 | def get_main_color(self, file): 74 | img = Image.open(file) 75 | colors = img.getcolors(256) # put a higher value if there are many colors in your image 76 | max_occurence, most_present = 0, 0 77 | try: 78 | for c in colors: 79 | if c[0] > max_occurence: 80 | (max_occurence, most_present) = c 81 | return max_occurence 82 | except TypeError: 83 | raise Exception("Too many colors in the image") 84 | 85 | def getIP(self, blank): 86 | ut = Utils() 87 | try: 88 | info = self.myinfo() 89 | info = json.loads(info) 90 | uhash = info['uhash'] 91 | temp = ut.requestString("user::::pass::::uhash::::global", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + str(uhash) + "::::" + str(random.randint(0, 1)), "vh_getImg.php") 92 | jsons = json.loads(temp) 93 | except TypeError: 94 | return 0, 0 95 | for i in range(0, len(jsons["data"])): 96 | hostname = str(jsons["data"][i]["hostname"]) 97 | 98 | # Overlay on white background, see http://stackoverflow.com/a/7911663/1703216 99 | # bg = Image.new("RGB", image.size, (255,255,255)) 100 | # bg.paste(image,image) 101 | 102 | imgdata = base64.b64decode(jsons["data"][i]['img']) 103 | filename = 'vhack.png' 104 | with open(filename, 'wb') as f: 105 | f.write(imgdata) 106 | image = self.get_main_color(filename) 107 | # print image[0], image[1], image[2], image[3] 108 | if image < 13200: 109 | time.sleep(5) 110 | return 1, hostname 111 | else: 112 | temp = ut.requestString("user::::pass::::uhash::::hostname", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + str(uhash) + "::::" + hostname, "vh_scanHost.php") 113 | try: 114 | jsons = json.loads(temp) 115 | return 0, str(jsons['ipaddress']) 116 | except TypeError: 117 | return 0, 0 118 | # print str(jsons['ipaddress']) 119 | 120 | def attackIP(self, ip, max, mode): 121 | ut = Utils() 122 | info = self.myinfo() 123 | info = json.loads(info) 124 | uhash = info['uhash'] 125 | temp = ut.requestString("user::::pass::::uhash::::target", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + uhash + "::::" + ip, "vh_loadRemoteData.php") 126 | 127 | jsons = json.loads(temp) 128 | 129 | o = OCR() 130 | imgs = o.getSolution(str(temp)) 131 | if imgs is not None: 132 | try: 133 | # user = jsons['username'] 134 | winchance = jsons['winchance'] 135 | except TypeError: 136 | return False 137 | try: 138 | if "?" not in str(winchance): 139 | fwlevel = jsons['fw'] 140 | avlevel = jsons['av'] 141 | # spamlevel = jsons['spam'] 142 | sdklevel = jsons['sdk'] 143 | # ipsplevel = jsons['sdk'] 144 | money = jsons['money'] 145 | saving = jsons['savings'] 146 | anonymous = jsons['anonymous'] 147 | username = jsons['username'] 148 | # winlo = jsons['winelo'] 149 | winchance = jsons['winchance'] 150 | # spywarelevel = jsons['spyware'] 151 | else: 152 | avlevel = "????" 153 | winchance = 0 154 | print "no scan username" 155 | return False 156 | 157 | except TypeError: 158 | fwlevel = jsons['fw'] 159 | avlevel = jsons['av'] 160 | # spamlevel = jsons['spam'] 161 | sdklevel = jsons['sdk'] 162 | # ipsplevel = jsons['sdk'] 163 | money = jsons['money'] 164 | saving = jsons['savings'] 165 | anonymous = jsons['anonymous'] 166 | username = jsons['username'] 167 | # winlo = jsons['winelo'] 168 | winchance = jsons['winchance'] 169 | # spywarelevel = jsons['spyware'] 170 | 171 | if type(winchance) == "int": 172 | if "?" in winchance: 173 | winchance = 0 174 | print "no chance" 175 | return False 176 | 177 | if mode == "Potator": 178 | if winchance > 49: 179 | password = self.enterPassword(imgs, ip, uhash) 180 | jsons = json.loads(password) 181 | if password: 182 | try: 183 | if "?" not in str(money) and str(jsons['result']) == 0: 184 | print("\n[TargetIP: {}]\n\nMade {:11,} and {:2d} Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}\n YourWinChance: {} Anonymous: {} username: {} saving: {}".format( 185 | ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 186 | return True 187 | else: 188 | print("\n[TargetIP: {}]\n\nMade {:11,} and {:2d} Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}\n YourWinChance: {} Anonymous: {} username: {} saving: {}".format( 189 | ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 190 | return True 191 | 192 | except KeyError: 193 | print "Bad attack" 194 | return False 195 | 196 | except ValueError as e: 197 | print "Error: " + e 198 | return True 199 | else: 200 | print "Password Wrong" 201 | return False 202 | else: 203 | print "winchance is poor: " + str(winchance) 204 | 205 | if "?" not in str(avlevel) and mode == "Secure": 206 | if int(avlevel) < max and int(winchance) > 75 and str(anonymous) == "YES": 207 | password = self.enterPassword(imgs, ip, uhash) 208 | jsons = json.loads(password) 209 | if password: 210 | try: 211 | if "?" not in str(money) and str(jsons['result']) == 0: 212 | print("\n[TargetIP: {}]\n\nMade {:11,} and {:2d} Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}\n YourWinChance: {} Anonymous: {} username: {} saving: {}".format( 213 | ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 214 | return True 215 | else: 216 | print("\n[TargetIP: {}]\n\nMade {:11,} and {:2d} Rep.\n Antivirus: {} Firewall: {} Sdk: {} TotalMoney: {:11,}\n YourWinChance: {} Anonymous: {} username: {} saving: {}".format( 217 | ip, jsons['amount'], jsons['eloch'], avlevel, fwlevel, sdklevel, money, winchance, anonymous, username, saving)) 218 | except KeyError: 219 | print "Bad attack" 220 | return False 221 | else: 222 | print "Password Wrong" 223 | return False 224 | else: 225 | # print "\n" 226 | if int(avlevel) > max: 227 | print "Antivir to high " + str(avlevel) 228 | # print "passed" 229 | return False 230 | if int(winchance) < 75: 231 | print "winchance is poor: " + str(winchance) 232 | # print "passed" 233 | return False 234 | if str(anonymous) == "NO": 235 | print "No Anonymous needed" 236 | # print "passed" 237 | return False 238 | else: 239 | if len(avlevel) == 4: 240 | print "Cant load User" 241 | return False 242 | else: 243 | print "Scan to low" 244 | return False 245 | else: 246 | print "Password Error" 247 | return False 248 | 249 | def attackIP2(self, ip, max): 250 | # ut = Utils() 251 | o = OCR(False) 252 | imgs = self.requestPassword(ip) 253 | selection = o.getPassword(imgs) 254 | print selection 255 | 256 | def attack(self, amount, max, wait, mode, api): 257 | with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor: 258 | for i in range(1, amount): 259 | FBI, ips = self.getIP(True) 260 | if FBI == 0: 261 | executor.submit(self.attackIP, ips, max, mode) 262 | print "Waiting..." 263 | time.sleep(wait) 264 | else: 265 | print "Warning FBI Blocking account on " + str(ips) + " I will not attack" 266 | 267 | def exit_gracefully(self, signum, frame): 268 | # restore the original signal handler as otherwise evil things will happen 269 | # in raw_input when CTRL+C is pressed, and our signal handler is not re-entrant 270 | signal.signal(signal.SIGINT, original_sigint) 271 | 272 | try: 273 | if raw_input("\nReally quit? (y/n)> ").lower().startswith('y'): 274 | sys.exit(1) 275 | 276 | except KeyboardInterrupt: 277 | print("Ok ok, quitting") 278 | sys.exit(1) 279 | 280 | # restore the exit gracefully handler here 281 | signal.signal(signal.SIGINT, self.exit_gracefully) 282 | 283 | def __init__(self, api): 284 | global original_sigint 285 | self.api = api 286 | original_sigint = signal.getsignal(signal.SIGINT) 287 | signal.signal(signal.SIGINT, self.exit_gracefully) 288 | -------------------------------------------------------------------------------- /ddos.py: -------------------------------------------------------------------------------- 1 | import config 2 | import json 3 | import sqlite3 4 | import re 5 | import operator 6 | import os 7 | import time 8 | import console 9 | import logging 10 | logger = logging.getLogger(__name__) 11 | 12 | 13 | class Ddos: 14 | 15 | def __init__(self, player): 16 | self.ddos_cluster = config.ddos_cluster 17 | self.database = config.database 18 | self.Max_point_tournament = config.Max_point_tournament 19 | self.username = player.username 20 | self.password = player.password 21 | self.uhash = player.uhash 22 | self.c = console.Console(player) 23 | 24 | def run_ddos(self): 25 | if self.ddos_cluster: 26 | checkcluster = json.loads(self.c.check_Cluster()) 27 | TournamentPosition = json.loads(self.c.GetTournamentPosition()) 28 | try: 29 | # determine and attack cluster tournament 30 | db = sqlite3.connect(self.database) 31 | cursor = db.cursor() 32 | 33 | try: 34 | cursor.execute("""CREATE TABLE Cluster (ID TEXT, cluster_name TEXT, cluster_point TEXT) """) 35 | except sqlite3.OperationalError: 36 | pass 37 | 38 | tournament_left = re.findall('\d+', TournamentPosition["tleft"]) 39 | logger.info("Tournament star finish in {}".format(TournamentPosition["tleft"])) 40 | try: 41 | tournament_hour = tournament_left[0] 42 | tournament_minute = tournament_left[1] 43 | except IndexError: 44 | tournament_hour = 0 45 | try: 46 | tournament_minute = tournament_left[0] 47 | except IndexError: 48 | tournament_minute = 0 49 | 50 | if int(tournament_hour) == 0 and int(tournament_minute) < 60: 51 | 52 | cluster_name = {} 53 | for row in cursor.execute( 54 | "SELECT * FROM (SELECT cluster_point, cluster_name FROM Cluster ORDER BY cluster_point ASC)"): 55 | cluster_name[row[0]] = row[1] 56 | 57 | newA = sorted(cluster_name.iteritems(), key=operator.itemgetter(1), reverse=True)[0:len(cluster_name)] 58 | 59 | for i in range(0, len(newA)): 60 | Cluster_name = newA[i][1] 61 | Cluster_point = newA[i][0] 62 | 63 | checkcluster = json.loads(self.c.check_Cluster()) 64 | if "DDoS not ready" in checkcluster["ddosready"]: 65 | logger.info(checkcluster["ddosready"]) 66 | break 67 | else: 68 | try: 69 | scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.decode("utf-8"))) 70 | except UnicodeEncodeError: 71 | scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.encode("utf-8"))) 72 | 73 | if scan_cluster["result"] == "0": 74 | scan_cluster["ddoschance"] = scan_cluster["ddoschance"].split("%") 75 | ddoschance = re.findall('\d+', scan_cluster["ddoschance"][0]) 76 | if int(ddoschance[0]) > 50: 77 | logger.info("attack {}({}) Your chance is {}%".format(Cluster_name, Cluster_point, scan_cluster["ddoschance"][0])) 78 | result = json.loads(self.c.AttackCluster(Cluster_name)) 79 | os.remove(self.database) 80 | if result['result'] == 6: 81 | pass 82 | else: 83 | break 84 | else: 85 | # Analyse Cluster in tournament 86 | db = sqlite3.connect(self.database) 87 | cursor = db.cursor() 88 | 89 | try: 90 | cursor.execute("""CREATE TABLE Cluster (ID TEXT, cluster_name TEXT, cluster_point TEXT) """) 91 | except sqlite3.OperationalError: 92 | pass 93 | 94 | count = 0 95 | data = [] 96 | point = {} 97 | nb = len(TournamentPosition['data']) 98 | for i in range(1, nb): 99 | getCluster = TournamentPosition['data'][i]['user'].split("|") 100 | data.append(getCluster[0]) 101 | point[getCluster[0].strip()] = point.get(getCluster[0].strip(), 0) + i 102 | 103 | data2 = {} 104 | for i in data: 105 | data2[str(i.encode("utf-8")).strip()] = int(data.count(i)) 106 | newA = sorted(data2.iteritems(), key=operator.itemgetter(1), reverse=True)[0:nb] 107 | 108 | logger.info("best list for tournament :") 109 | final_data = {} 110 | for i in range(0, len(newA)): 111 | Cluster_name = newA[i][0] 112 | Cluster_pepole = newA[i][1] 113 | logger.info(" cluster : {} | people on cluster : {} | Points in clusters = {}".format( 114 | Cluster_name.decode("utf-8"), Cluster_pepole, point[Cluster_name.decode("utf-8")] / Cluster_pepole)) 115 | final_data[Cluster_name.decode("utf-8")] = int(point[Cluster_name.decode("utf-8")] * Cluster_pepole) 116 | 117 | newA = sorted(final_data.iteritems(), key=operator.itemgetter(1), reverse=True)[0:len(newA)] 118 | for i in range(0, len(newA)): 119 | Cluster_name = newA[i][0] 120 | Cluster_point = newA[i][1] 121 | if Cluster_point < self.Max_point_tournament: 122 | # try: 123 | # scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.decode("utf-8"))) 124 | # except UnicodeEncodeError: 125 | # scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.encode("utf-8"))) 126 | 127 | count = count + 1 128 | logger.info("if attack {}({})".format(Cluster_name, Cluster_point)) 129 | Cluster = [(0, Cluster_name, str(Cluster_point))] 130 | cursor.executemany("INSERT INTO Cluster VALUES (?,?,?)", Cluster) 131 | db.commit() 132 | else: 133 | count = 0 134 | for i in range(0, len(newA)): 135 | Cluster_name = newA[i][0] 136 | Cluster_point = newA[i][1] 137 | if Cluster_point < self.Max_point_tournament and count < 5: 138 | # try: 139 | # scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.decode("utf-8"))) 140 | # except UnicodeEncodeError: 141 | # scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.encode("utf-8"))) 142 | 143 | count = count + 1 144 | logger.info("if attack {}({})".format(Cluster_name, Cluster_point)) 145 | Cluster = [(0, Cluster_name, str(Cluster_point))] 146 | cursor.executemany("INSERT INTO Cluster VALUES (?,?,?)", Cluster) 147 | db.commit() 148 | time.sleep(5) 149 | 150 | except KeyError: 151 | # attack cluster for not in tournament 152 | tournament_next = re.findall('\d+', TournamentPosition['nexttournament']) 153 | try: 154 | tournament_hour = tournament_next[0] 155 | tournament_minute = tournament_next[1] 156 | except IndexError: 157 | tournament_hour = 0 158 | try: 159 | tournament_minute = tournament_next[0] 160 | except: 161 | tournament_minute = 0 162 | 163 | if int(tournament_hour) > 4: 164 | data = [] 165 | point = {} 166 | nb = len(TournamentPosition['data']) 167 | for i in range(1, nb): 168 | getCluster = TournamentPosition['data'][i]['user'].split("|") 169 | data.append(getCluster[0]) 170 | point[getCluster[0].strip()] = point.get(getCluster[0].strip(), 0) + i 171 | 172 | data2 = {} 173 | for i in data: 174 | data2[str(i.encode("utf-8")).strip()] = int(data.count(i)) 175 | newA = sorted(data2.iteritems(), key=operator.itemgetter(1), reverse=True)[0:nb] 176 | 177 | logger.info("best list for tournament :") 178 | final_data = {} 179 | for i in range(0, len(newA)): 180 | Cluster_name = newA[i][0] 181 | Cluster_pepole = newA[i][1] 182 | # print " cluster : "+ Cluster_name.decode("utf-8") + " people on cluster : " + str(Cluster_pepole) + " Points in clusters = " + str(point[Cluster_name.decode("utf-8")]/Cluster_pepole) 183 | final_data[Cluster_name.decode("utf-8")] = int(point[Cluster_name.decode("utf-8")] * Cluster_pepole) 184 | 185 | newA = sorted(final_data.iteritems(), key=operator.itemgetter(1), reverse=True)[0:len(newA)] 186 | for i in range(0, len(newA)): 187 | Cluster_name = newA[i][0] 188 | Cluster_point = newA[i][1] 189 | if Cluster_point < self.Max_point_tournament: 190 | checkcluster = json.loads(self.c.check_Cluster()) 191 | test = "no" 192 | if "DDoS not ready" in checkcluster["ddosready"] and test == "no": 193 | logger.info(checkcluster["ddosready"]) 194 | break 195 | else: 196 | try: 197 | scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.decode("utf-8"))) 198 | except UnicodeEncodeError: 199 | scan_cluster = json.loads(self.c.ScanCluster(Cluster_name.encode("utf-8"))) 200 | if scan_cluster["result"] == "0": 201 | scan_cluster["ddoschance"] = scan_cluster["ddoschance"].split("%") 202 | ddoschance = re.findall('\d+', scan_cluster["ddoschance"][0]) 203 | if int(ddoschance[0]) > 50: 204 | logger.info("attack {}({}) Your chance is {}%".format(Cluster_name, Cluster_point, scan_cluster["ddoschance"][0])) 205 | result = json.loads(self.c.AttackCluster(Cluster_name)) 206 | if result['result'] == 6: 207 | pass 208 | else: 209 | break 210 | else: 211 | logger.info("no attack possible to {}({}) Your chance is {}%".format(Cluster_name, Cluster_point, scan_cluster["ddoschance"][0])) 212 | else: 213 | logger.info("next tournament in ".format(TournamentPosition['nexttournament'])) 214 | -------------------------------------------------------------------------------- /getdatabase.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import datetime 4 | import logging 5 | logger = logging.getLogger(__name__) 6 | 7 | 8 | class Dictlist(dict): 9 | def __setitem__(self, key, value): 10 | try: 11 | self[key] 12 | except KeyError: 13 | super(Dictlist, self).__setitem__(key, []) 14 | self[key].append(value) 15 | 16 | 17 | def main(): 18 | s = requests.session() 19 | 20 | database = s.get("https://vhack.olympiccode.ga/database/getdata.php") 21 | database = json.loads(database.text) 22 | # sort = max(database['data'], key=lambda ev: ev[i][3]) 23 | # lines = sorted(database['data'], key=lambda k=database: k['data'][0][2], reverse=True) 24 | # print sort 25 | 26 | results = [x for x in database['data']] 27 | data = sorted(results, key=lambda x: x[2]) 28 | 29 | logger.info("{:>2} {:>2} {:>2} {:>2} {:>2} {:>2} {:>2}".format("IP".rjust(15), 30 | "Username".rjust(15), 31 | "Money".rjust(15), 32 | "IPSP".rjust(15), 33 | "Firewall".rjust(15), 34 | "Antivirus".rjust(15), 35 | "Add Date".rjust(15))) 36 | # list_argent = [] 37 | # list_ip = [] 38 | list_total = {} 39 | list_total = Dictlist() 40 | d = datetime.date.today() 41 | day = '{:02d}'.format(d.day) 42 | month = '{:02d}'.format(d.month) 43 | year = d.year 44 | 45 | for i, data2 in enumerate(data): 46 | if "unknown" not in data2[1] and str(year) + "-" + str(month) + "-" + str(day) in data2[6]: 47 | """print ("{:>2} {:>2} {:>2} {:>2} {:>2} {:>2} {:>2}".format( 48 | str(data2[0]).rjust(15), 49 | str(data2[1]).rjust(15), 50 | str(data2[2]).rjust(15), 51 | str(data2[3]).rjust(15), 52 | str(data2[4]).rjust(15), 53 | str(data2[5]).rjust(15), 54 | str(data2[6]).rjust(15)))""" 55 | list_total["ip"] = data2[0], data2[1], data2[2], data2[3], data2[4], data2[5], data2[6] 56 | 57 | results = [x for x in list_total["ip"]] 58 | data = sorted(results, key=lambda x: int(x[2]), reverse=True) 59 | 60 | for i, data2 in enumerate(data): 61 | logger.info("{:>2} {:>2} {:>2} {:>2} {:>2} {:>2} {:>2}".format( 62 | str(data2[0]).rjust(15), 63 | str(data2[1]).rjust(15), 64 | str(data2[2]).rjust(15), 65 | str(data2[3]).rjust(15), 66 | str(data2[4]).rjust(15), 67 | str(data2[5]).rjust(15), 68 | str(data2[6]).rjust(15))) 69 | 70 | 71 | if __name__ == "__main__": 72 | main() 73 | -------------------------------------------------------------------------------- /install-ubuntu.sh: -------------------------------------------------------------------------------- 1 | apt update 2 | apt upgrade -y 3 | apt install -y python 4 | apt install -y python-pip 5 | apt install -y unzip 6 | cd /tmp 7 | wget https://github.com/OlympicCode/vHackXTBot-Python/archive/master.zip 8 | unzip master.zip 9 | mv vHackXTBot-Python-master ~/vhack-bot 10 | cd ~/vhack-bot 11 | pip install -r requirements.txt 12 | clear 13 | echo "The bot was installed on your system!" 14 | echo "Now open the 'config.py' in '~/vhack-bot' and enter your credentials" 15 | echo "Write 'python ~/vhack-bot/main.py' to start the bot" 16 | -------------------------------------------------------------------------------- /mails.py: -------------------------------------------------------------------------------- 1 | import config 2 | from utils import Utils 3 | import json 4 | import time 5 | import logging 6 | logger = logging.getLogger(__name__) 7 | 8 | 9 | class Mails: 10 | """Get and read mails.""" 11 | ut = Utils() 12 | 13 | def __init__(self, player): 14 | """Mails class init. 15 | 16 | Args: 17 | player: contains player with username, password and uhash 18 | """ 19 | self.username = player.username 20 | self.password = player.password 21 | self.uhash = player.uhash 22 | self.wait_load = config.wait_load 23 | 24 | def get_mails_list(self): 25 | """Get mails list. 26 | 27 | Input: 28 | {"action":"list","time":"1503384535","uhash":"75f1750fe5af53125a9331cf7783c55cd07548d55243e2eb53ec532bb384e342", 29 | "user":"username","pass":"password"} 30 | 31 | Return: 32 | {"elo":"2922","money":"12169318","data":[ 33 | {"from":"vHack XT","id":"579218", 34 | "subject":"Mission Reward!","time":"1502967015","read":"0"}, 35 | {"from":"vHack XT","id":"293963", 36 | "subject":"Special reward!","time":"1502564235","read":"1"}, 37 | {"from":"vHack XT","id":"289849", 38 | "subject":"Tournament Reward","time":"1502528410","read":"1"}]} 39 | """ 40 | response = self.ut.requestString(self.username, 41 | self.password, 42 | self.uhash, 43 | "vh_mails.php", 44 | action="list") 45 | 46 | try: 47 | return json.loads(response) 48 | except Exception as e: 49 | logger.error('get_mails_list: {}'.format(e)) 50 | return '' 51 | 52 | def get_mail(self, mID): 53 | """Get mail content 54 | 55 | Args: 56 | mID (str): mails ID from `id` in `get_mails_list['data']` 57 | 58 | Input: 59 | {"action":"getmail","time":"1503061118","uhash":"c5f3eb2c071c7b74364398977717958cb0dab8e992ae422833e5538f83b7b3e2", 60 | "mID":"586681","user":"username","pass":"password"} 61 | 62 | Return: 63 | Mail content 64 | """ 65 | return self.ut.requestString(self.username, 66 | self.password, 67 | self.uhash, 68 | "vh_mails.php", 69 | action="getmail", 70 | mID=mID) 71 | 72 | def read_mails(self): 73 | """Read all unread mail""" 74 | time.sleep(self.wait_load) 75 | response = self.get_mails_list() 76 | try: 77 | for unread in response['data']: 78 | time.sleep(self.wait_load) 79 | if unread['read'] == "0": 80 | logger.info(self.get_mail(mID=unread['id'])) 81 | except Exception as e: 82 | logger.error('read_mails: {}'.format(e)) 83 | return 84 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | # -*- coding: utf-8 3 | 4 | from console import Console 5 | from update import Update 6 | from botnet import Botnet 7 | from player import Player 8 | from mails import Mails 9 | import time 10 | import json 11 | import config 12 | import ddos 13 | import logging 14 | logger = logging.getLogger(__name__) 15 | FORMAT = '%(asctime)s [%(threadName)10s][%(module)10s][%(levelname)8s] %(message)s' 16 | logging.basicConfig(level=logging.INFO, format=FORMAT) 17 | 18 | 19 | class run: 20 | def __init__(self): 21 | """ 22 | Pull all variables from config.py file. 23 | """ 24 | 25 | self.player = Player() 26 | self.database = config.database 27 | self.Max_point_tournament = config.Max_point_tournament 28 | self.BotNet_update = config.BotNet_update 29 | self.joinTournament = config.joinTournament 30 | self.tournament_potator = config.tournament_potator 31 | self.booster = config.booster 32 | self.Use_netcoins = config.Use_netcoins 33 | self.attacks_normal = config.attacks_normal 34 | self.updates = config.updates 35 | self.updatecount = config.updatecount 36 | self.maxanti_normal = config.maxanti_normal 37 | self.active_cluster_protection = config.active_cluster_protection 38 | self.mode = config.mode 39 | self.number_task = config.number_task 40 | self.min_energy_botnet = config.minimal_energy_botnet_upgrade 41 | self.stat = "0" 42 | self.wait_load = config.wait_load 43 | self.c = Console(self.player) 44 | self.u = Update(self.player) 45 | # disable botnet for > api v13 46 | self.b = Botnet(self.player) 47 | self.ddos = ddos.Ddos(self.player) 48 | self.m = Mails(self.player) 49 | self.init() 50 | 51 | def init(self): 52 | while True: 53 | # update the player 54 | time.sleep(self.wait_load) 55 | stat = "0" 56 | # prepare account 57 | if self.number_task: 58 | self.get_max_update = int(self.number_task) 59 | else: 60 | self.get_max_update = int(self.u.infoUpdate("ram", "new")) - 1 61 | self.running_all = self.u.runningtasks() 62 | logger.info("you are running {}/{} tasks".format(self.running_all, self.get_max_update)) 63 | 64 | if int(self.running_all) < int(self.get_max_update): 65 | while "0" in stat or "3" in stat: 66 | if int(self.u.runningtasks()) < int(self.u.infoUpdate("ram", "new")) - 1 or int(self.u.runningtasks()) < int(self.get_max_update): 67 | try: 68 | moneyforupdate = int(self.u.infoUpdate(self.updates[self.updatecount])) 69 | except IndexError: 70 | logger.info("reset") 71 | self.updatecount = 0 72 | moneyforupdate = int(self.u.infoUpdate(self.updates[self.updatecount])) 73 | stat = "1" 74 | mymoney = int(json.loads(self.c.myinfo())["money"]) 75 | 76 | if mymoney < moneyforupdate: 77 | self.updatecount += 1 78 | 79 | try: 80 | logger.info("require {}$ for update {} your money {}$".format(moneyforupdate, self.updates[self.updatecount], mymoney)) 81 | except IndexError: 82 | stat = "1" 83 | 84 | totaltask = int(self.u.runningtasks()) + int(self.updatecount) 85 | if int(totaltask) == int(self.get_max_update): 86 | stat = "1" 87 | else: 88 | (stat, levelupdates) = self.u.startTask(self.updates[self.updatecount]) 89 | if "3" in stat or "0" in stat: 90 | logger.info("updating {} level {}".format(self.updates[self.updatecount], int(levelupdates)+1)) 91 | # print "Started Update 92 | logger.info("Waiting... in update") 93 | # u.useBooster() 94 | self.updatecount += 1 95 | totaltask = int(self.u.runningtasks()) + int(self.updatecount) 96 | if int(totaltask) == int(self.get_max_update): 97 | stat = "1" 98 | else: 99 | break 100 | 101 | # recheck running ask for boost and netcoins 102 | self.running_all = self.u.runningtasks() 103 | 104 | self.ddos.run_ddos() 105 | if self.BotNet_update: 106 | botnet = json.loads(self.b._botnetInfo()) 107 | if int(botnet['count']) > 0 and int(botnet['energy']) >= self.min_energy_botnet: 108 | for count, i in enumerate(botnet['data']): 109 | self.b.upgradebotnet(i['hostname'], int(i['running']), count) 110 | else: 111 | if int(botnet['count']) == 0: 112 | logger.info("You are not botnet") 113 | 114 | if int(botnet['energy']) == 0: 115 | logger.info("You are not energy for update botnet") 116 | else: 117 | logger.info("Your botnet energy ("+ str(botnet['energy']) +") < " + str(self.min_energy_botnet) + " Please wait for regeneration...") 118 | 119 | # attack botnet 120 | #number_botnet = json.loads(self.b._botnetInfo()) 121 | #if int(number_botnet['count']) > 0: 122 | # self.b.attack() 123 | 124 | if self.joinTournament and self.c.getTournament(): 125 | self.mode = "Potator" 126 | logger.info("** Force Mode to 'Potator' for Tournament **") 127 | # task = self.u.doTasks(self.wait_load) 128 | if self.booster and self.running_all > 1: 129 | try: 130 | vtasks = self.u.getrunningtasks() 131 | json_data = json.loads(vtasks) 132 | while len(json_data["data"]) > 1: 133 | if int(json_data["boost"]) > 5: 134 | json_data = json.loads(self.u.useBooster()) 135 | logger.info("Using booster on rest {}".format(json_data["boost"])) 136 | if int(json_data['fAllCosts']) < 50: 137 | break 138 | # UPDATE Value 139 | else: 140 | logger.info("you have < 5 boost.") 141 | break 142 | except Exception as e: 143 | logger.error("Connection Error try again...{0}".format(e)) 144 | pass 145 | if self.Use_netcoins: 146 | time.sleep(2) 147 | if self.player.netcoins > 1 and self.running_all > 1: 148 | self.u.finishAll() 149 | self.player.refreshinfo() # update player info 150 | logger.info("I used Netcoins for finish all task.") 151 | 152 | if self.player.email > 0: 153 | time.sleep(self.wait_load) 154 | logger.info('Reading mails...') 155 | self.m.read_mails() 156 | 157 | # attack players 158 | self.c.attack(self) 159 | 160 | # reinitialise your profil money, email ... 161 | run.__init__(self) 162 | 163 | if __name__ == "__main__": 164 | r = run() 165 | -------------------------------------------------------------------------------- /ocr.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | from io import BytesIO 3 | import base64 4 | import difflib 5 | 6 | 7 | class OCR: 8 | def analyze(self, im): 9 | # im = Image.open(name) 10 | pix = im.load() 11 | 12 | l = [] 13 | for i1 in range(0, im.size[0]): 14 | count = 0 15 | for i2 in range(0, im.size[1]): 16 | if pix[i1, i2] != 0: 17 | count += 1 18 | l.append(count) 19 | return l 20 | 21 | def splitnumbers(self, l): 22 | nrs = [] 23 | i1 = 0 24 | while i1 < len(l): 25 | if l[i1] > 3: 26 | temp = [] 27 | add = 0 28 | for i2 in range(0, 9): 29 | if not l[i1 + i2] < 4: 30 | temp.append(l[i1 + i2]) 31 | else: 32 | add = i2 33 | break 34 | if add == 0: 35 | add = 8 36 | i1 += add 37 | nrs.append(temp) 38 | i1 += 1 39 | return nrs 40 | 41 | def readit(self, l): 42 | nrs = [] 43 | for i1 in l: 44 | ratio = 0.0 45 | current = 0 46 | for i2 in range(0, len(self.nrlist)): 47 | sm = difflib.SequenceMatcher(None, i1, self.nrlist[i2]) 48 | trat = sm.ratio() 49 | if trat > ratio: 50 | ratio = trat 51 | current = i2 52 | nrs.append(current) 53 | return nrs 54 | 55 | def rightSolution(self, nr, possies): 56 | current = 0 57 | ratio = 0.0 58 | for i1 in range(0, len(possies)): 59 | temp = [] 60 | for i2 in possies[i1]: 61 | temp.append(int(i2)) 62 | sm = difflib.SequenceMatcher(None, nr, temp) 63 | trat = sm.ratio() 64 | if trat > ratio: 65 | ratio = trat 66 | current = i1 67 | return "p" + str(current + 1) 68 | 69 | def base64toImage(self, string): 70 | im = Image.open(BytesIO(base64.b64decode(string))) 71 | return im 72 | 73 | def getSolution(self, response): 74 | try: 75 | string = response.split(',')[0].split('{"img":"')[1].split('"')[0] 76 | except IndexError: 77 | return False 78 | possies = [] 79 | for i1 in range(1, 7): 80 | possies.append(response.split(',')[i1].split(':')[1]) 81 | im = self.base64toImage(string) 82 | l = self.analyze(im) 83 | l = self.splitnumbers(l) 84 | l = self.readit(l) 85 | s = self.rightSolution(l, possies) 86 | return s 87 | 88 | def __init__(self): 89 | self.nrlist = [[13, 14, 15, 8, 6, 7, 15, 15, 12], [4, 4, 15, 15, 15], [9, 12, 13, 11, 14, 14, 13, 9], 90 | [7, 9, 9, 10, 10, 15, 15, 14], [5, 8, 8, 11, 10, 12, 15, 15], [12, 12, 11, 9, 9, 13, 13, 12], 91 | [13, 15, 10, 9, 9, 12, 14, 11], [4, 11, 13, 15, 9, 6, 4], [14, 15, 12, 9, 10, 15, 15, 14], 92 | [10, 13, 14, 10, 11, 15, 15, 14]] 93 | -------------------------------------------------------------------------------- /player.py: -------------------------------------------------------------------------------- 1 | import config 2 | from utils import Utils 3 | import json 4 | import logging 5 | import sys 6 | 7 | logger = logging.getLogger(__name__) 8 | FORMAT = '%(asctime)s [%(threadName)10s][%(module)10s][%(levelname)8s] %(message)s' 9 | logging.basicConfig(level=logging.INFO, format=FORMAT) 10 | 11 | 12 | class Player: 13 | ut = Utils() 14 | 15 | def __init__(self): 16 | self.username = config.user 17 | self.password = config.password 18 | self.money = 0 19 | self.ip = '' 20 | self.score = '' 21 | self.netcoins = '' 22 | self.boosters = '' 23 | self.rank = '' 24 | self.uhash = '' 25 | self.localspyware = '' 26 | self.remotespyware = '' 27 | self.email = 0 28 | self.savedIPs = [] 29 | self.anon_attack = config.anon 30 | self._init() # 10 secs 31 | 32 | def __repr__(self): 33 | return "Money: {0}, Score: {1}".format(self.money, self.score) 34 | 35 | def getplayerinfo(self): 36 | pass 37 | 38 | def setmoney(self, amount): 39 | """ 40 | Change class money value, pass in neg or postive values 41 | :param amount: 42 | :return: 43 | """ 44 | self.money = amount 45 | 46 | def getmoney(self): 47 | return self.money 48 | 49 | def removespy(self): 50 | response = self.ut.requestArray(self.username, self.password, self.uhash, "vh_removeSpyware.php") 51 | return response 52 | 53 | def _init(self): 54 | """ 55 | {"id":"924198","money":"14501972","ip":"83.58.131.20", 56 | "inet":"10","hdd":"10","cpu":"10","ram":"14","fw":"256","av":"410","sdk":"580","ipsp":"50","spam":"71","scan":"436","adw":"76", 57 | "actadw":"","netcoins":"5550","energy":"212286963","score":"10015", 58 | "urmail":"1","active":"1","elo":"2880","clusterID":null,"position":null,"syslog":null, 59 | "lastcmsg":"0","rank":32022,"event":"3","bonus":"0","mystery":"0","vipleft":"OFF", 60 | "hash":"91ec5ed746dfedc0a750d896a4e615c4", 61 | "uhash":"9832f717079f8664109ac9854846e753282c72cdf42fe33fb33c734923e1931c","use":"0", 62 | "tournamentActive":"2","boost":"294","actspyware":"0","tos":"1","unreadmsg":"0"} 63 | :return: 64 | """ 65 | data = self.ut.requestString(self.username, self.password, self.uhash, "vh_update.php") 66 | if len(data) == 1: 67 | logging.warn('Username and password entered in config.py?') 68 | sys.exit() 69 | try: 70 | j = json.loads(data) 71 | self.setmoney(j['money']) 72 | self.ip = j['ip'] 73 | self.score = j['score'] 74 | self.netcoins = j['netcoins'] 75 | self.localspyware = j['actspyware'] 76 | self.rank = j['rank'] 77 | self.boosters = j['boost'] 78 | self.remotespyware = j['actadw'] 79 | self.email = int(j['urmail']) 80 | self.uhash = str(j['uhash']) 81 | logger.info("\n Your profile :\n\n Your IP: {0}, Your Score: {1}, Your netcoins {2}, \n Your rank: {3}, Your Booster: {4}, Active Spyware {5} \n\n".format(j['ip'], j['score'], j['netcoins'], j['rank'], j['boost'], j['actspyware'])) 82 | except: 83 | exit() 84 | 85 | def get_uhash(self): 86 | return self.uhash 87 | 88 | def refreshinfo(self): 89 | """ 90 | Refresh player info. Useful after a dev attack to pick up new email etc. 91 | :return: 92 | """ 93 | self._init() 94 | 95 | def readmail(self): 96 | """ 97 | Read any new emails. Print to console. 98 | :return: None 99 | """ 100 | if self.email: 101 | pass 102 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | futures==3.0.5 2 | olefile==0.44 3 | Pillow==4.0.0 4 | pytesseract==0.1.6 5 | requests==2.13.0 6 | beautifulsoup4==4.1.3 7 | -------------------------------------------------------------------------------- /update.py: -------------------------------------------------------------------------------- 1 | from utils import Utils 2 | import json 3 | 4 | 5 | class Update: 6 | ut = Utils() 7 | 8 | def __init__(self, player): 9 | self.username = player.username 10 | self.password = player.password 11 | self.uhash = player.uhash 12 | 13 | def getrunningtasks(self): 14 | """ 15 | '{"data":[{"type":"sdk","start":"1495356942","end":"1495359788","wto":"1186","taskid":"110610282"}], 16 | "fAllCosts":"23","money":"17798567","inet":"10","hdd":"10","cpu":"10","ram":"14","fw":"350","av":"747", 17 | "sdk":"1185","ipsp":"151","spam":"204","scan":"575","adw":"210","netcoins":"9544","urmail":"0","score":"16254", 18 | "energy":"262260372","useboost":"2","boost":"336","status":"1","stime":"1495357017"}' 19 | 20 | ['data'] 21 | [{u'start': u'1495356942', u'end': u'1495359788', u'type': u'sdk', u'taskid': u'110610282', u'wto': u'1186'}, 22 | {u'start': u'1495357175', u'end': u'1495360024', u'type': u'sdk', u'taskid': u'110612494', u'wto': u'1187'}] 23 | :return: string, as above if tasks. 24 | """ 25 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_tasks.php") 26 | return temp 27 | 28 | def SpywareInfo(self): 29 | """ 30 | < type 'list' >: ['local:0', 'data:[{av:392', 'fw:417', 'money:42793029', 'spam:467', 'user:ShittyGame', 31 | 'ip:23.93.18.103', 'next:now.}]', 'remote:1', 'result:0'] 32 | """ 33 | arr = self.ut.requestArray(self.username, self.password, self.uhash, "vh_spywareInfo.php") 34 | return arr 35 | 36 | def removeSpyware(self): 37 | arr = self.ut.requestArray(self.username, self.password, self.uhash, "vh_removeSpyware.php") 38 | return arr 39 | 40 | def runningtasks(self, tasks=None): 41 | """ 42 | Return the number of running tasks. 43 | :return: int 44 | """ 45 | if not tasks: 46 | tasks = self.getrunningtasks() 47 | j = json.loads(tasks) 48 | try: 49 | return len(j["data"]) 50 | except KeyError: 51 | return "0" 52 | 53 | def getTaskIDs(self, tasks=None): 54 | """ 55 | Return a list of task ids 56 | [u'110610282', u'110612494'] 57 | :param tasks string of json data 58 | :return: list 59 | """ 60 | if not tasks: 61 | tasks = self.getrunningtasks() 62 | j = json.loads(tasks) 63 | return [x['taskid'] for x in j['data']] 64 | 65 | def startTask(self, type): 66 | """ 67 | Start a task. 68 | :param type: string variable of task type, "adw","fw" etc. See config file. 69 | :return: 70 | """ 71 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_addUpdate.php", utype=type) 72 | j = json.loads(temp) 73 | if "result" in temp: 74 | return temp.split('result":"')[1].split('"')[0], j[j['type']] 75 | return "2", False 76 | 77 | def fillWithTask(self, type): 78 | """ 79 | Fill the queue with a task type. 80 | :param type: string variable of task type, "adw","fw" etc. See config file. 81 | :return: 82 | """ 83 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_fillTasks.php", utype=type) 84 | if "result" in temp: 85 | return temp.split('result":"')[1].split('"')[0] 86 | return "2" 87 | 88 | def finishTask(self, taskID): 89 | """ 90 | Finish single task of taskID 91 | :param taskID: 92 | :return: 93 | """ 94 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_finishTask.php", taskid=taskID) 95 | if "4" in temp: 96 | return True 97 | else: 98 | return False 99 | 100 | def finishAll(self): 101 | """ 102 | Finish all tasks currently running. 103 | :return: 104 | """ 105 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_finishAll.php") 106 | if "0" in temp: 107 | return True 108 | else: 109 | return False 110 | 111 | def useBooster(self): 112 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_tasks.php", boost="1") 113 | return temp 114 | 115 | def infoUpdate(self, name, types=None): 116 | temp = self.ut.requestString(self.username, self.password, self.uhash, "vh_updateInfo.php", utype=name) 117 | j = json.loads(temp) 118 | if types is None: 119 | return j["costs"] 120 | else: 121 | return j[types] 122 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | # -*- coding: utf-8 3 | 4 | import base64 5 | import hashlib 6 | import time 7 | import urllib2 8 | import config 9 | import ssl 10 | import logging 11 | import json 12 | logger = logging.getLogger(__name__) 13 | 14 | USER_AGENT = ['Dalvik/2.1.0 (Linux; U; Android 5.0.1; GT-I9508V Build/LRX22C)', 15 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.1; MX4 Build/LRX22C)', 16 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; D5322 Build/19.3.A.0.472)', 17 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; D816w Build/LRX22G)', 18 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; HTC D816v Build/LRX22G)', 19 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; HTC E9pw Build/LRX22G)', 20 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; HTC M8t Build/LRX22G)', 21 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; HTC One M8s Build/LRX22G)', 22 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; LG-F320L Build/LRX22G)', 23 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; Letv X500 Build/DBXCNOP5500912251S)', 24 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; Nexus 5 Build/LRX22G)', 25 | 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; SM-N9005 Build/LRX22G)', 26 | 'Dalvik/2.1.0 (Linux; U; Android 5.0; ASUS_Z00ADB Build/LRX21V)', 27 | 'Dalvik/2.1.0 (Linux; U; Android 5.0; Nexus 5 Build/LPX13D)', 28 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1 Build/LYZ28N)', 29 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; 2014811 MIUI/6.1.26)', 30 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; A0001 Build/LMY47V)', 31 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; A0001 Build/LMY48Y)', 32 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; D5833 Build/23.4.A.1.232)', 33 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; GT-I9152 Build/LMY48Y)', 34 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; LG-D802 Build/LMY48W)', 35 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; MI 2 Build/LMY48B)', 36 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; MI 2SC Build/LMY47V)', 37 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; MI 3 Build/LMY48Y)', 38 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; Mi-4c MIUI/6.1.14)', 39 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; NX403A Build/LMY48Y)', 40 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; ONE A2001 Build/LMY47V)', 41 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; R7Plusm Build/LMY47V)', 42 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; Redmi Note 2 Build/LMY48Y)', 43 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; SM-J3109 Build/LMY47X)', 44 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; SM-N9200 Build/LMY47X)', 45 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; Sparkle V Build/LMY47V)', 46 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; Xperia Z2 Build/LMY48Y)', 47 | 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; titan Build/LMY48W)', 48 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; HTC M9w Build/LMY47O)', 49 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; HTC One M9 Build/LMY47O)', 50 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; LG-H818 Build/LMY47D)', 51 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; MX5 Build/LMY47I)', 52 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; XT1060 Build/LPA23.12-39.7)', 53 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; XT1085 Build/LPE23.32-53)', 54 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; m1 note Build/LMY47D)', 55 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; m2 Build/LMY47D)', 56 | 'Dalvik/2.1.0 (Linux; U; Android 5.1; m2 note Build/LMY47D)', 57 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; 2014813 Build/MMB29U)', 58 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; A0001 Build/MMB29M)', 59 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; ASUS_Z00A Build/MMB29T)', 60 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; MI 4LTE Build/MMB29M)', 61 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Mi-4c Build/MMB29U)', 62 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Moto G 2014 Build/MMB29M)', 63 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Moto G 2014 LTE Build/MMB29T)', 64 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Nexus 4 Build/MMB29M)', 65 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Nexus 5 Build/MMB29K)', 66 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Sensation Build/MMB29U)', 67 | 'Dalvik/2.1.0 (Linux; U; Android 6.0.1; Z1 Build/MMB29T)', 68 | 'Dalvik/2.1.0 (Linux; U; Android 6.0; MI 2 Build/MRA58K)', 69 | 'Dalvik/2.1.0 (Linux; U; Android 6.0; MI 2A Build/MRA58K)', 70 | 'Dalvik/2.1.0 (Linux; U; Android 6.0; Moto G 2014 Build/MDB08M)', 71 | 'Dalvik/2.1.0 (Linux; U; Android 6.0; XT1097 Build/MPE24.49-18)'] 72 | 73 | 74 | class Utils: 75 | def __init__(self): 76 | self.secret = "aeffI" 77 | self.url = "https://api.vhack.cc/v/16/" 78 | self.username = config.user 79 | self.password = config.password 80 | self.user_agent = "" 81 | 82 | def generateUA(self, identifier): 83 | pick = int(self.md5hash(identifier), 16) 84 | user_agents = tuple(USER_AGENT) 85 | return user_agents[pick % len(user_agents)] 86 | 87 | def getTime(self): 88 | return int(round(time.time())) 89 | 90 | def md5hash(self, txt): 91 | m = hashlib.md5() 92 | m.update(txt) 93 | return m.hexdigest() 94 | 95 | def generateUser(self, bArr): 96 | return base64.b64encode(bArr).replace("=", "") 97 | 98 | def generateURL(self, username, password, uhash, php, **kwargs): 99 | if not kwargs: 100 | jsonString = {"": ""} 101 | else: 102 | jsonString = kwargs 103 | currentTimeMillis = str(self.getTime()) 104 | jsonString.update({'time': currentTimeMillis, 'uhash': uhash, 'user': username, 'pass': password}) 105 | jsonString = json.dumps(jsonString, separators=(',', ':')) 106 | a = self.generateUser(jsonString) 107 | a2 = self.md5hash(str(len(jsonString)) + self.md5hash(currentTimeMillis)) 108 | str5 = username + self.md5hash(self.md5hash(password)) 109 | str6 = self.md5hash(currentTimeMillis + jsonString) 110 | a3 = self.md5hash(self.secret + self.md5hash(self.md5hash(self.generateUser(a2)))) 111 | str9 = self.md5hash(a3 + self.generateUser(str5)) 112 | str7 = self.generateUser(str6) 113 | str8 = self.md5hash(self.md5hash(a3 + self.md5hash(self.md5hash(str9) + str7) + str9 + self.md5hash(str7))) 114 | return self.url + php + "?user=" + a + "&pass=" + str8 115 | 116 | def parse(self, string): 117 | return string[1:-1].replace("\"", "").split(",") 118 | 119 | def parseMulti(self, string): 120 | temp = string 121 | temp = temp.replace("[", "").replace("]", "") 122 | temp = temp[len(temp.split(":")[0]) + 1:-1] 123 | 124 | arr = temp.split("},{") 125 | n = [] 126 | for i1 in arr: 127 | temp = i1 128 | if not temp.startswith("{"): 129 | temp = "{" + temp 130 | if not temp.endswith("}"): 131 | temp += "}" 132 | n.append(self.parse(temp)) 133 | return n 134 | 135 | def requestString(self, username, password, uhash, php, **kwargs): 136 | logger.debug("Request: {}".format(php)) 137 | self.user_agent = self.generateUA(username + password) 138 | time.sleep(0.3) 139 | t = None 140 | i = 0 141 | while t is None: 142 | if i > 10: 143 | exit(0) 144 | try: 145 | req = urllib2.Request(self.generateURL(username, password, uhash, php, **kwargs)) 146 | req.add_header('User-agent', self.user_agent) 147 | r = urllib2.urlopen(req, context=ssl._create_unverified_context(), timeout=15) 148 | t = r.read() 149 | logger.debug("Response:\n{}\n".format(t)) 150 | if t == "5": 151 | logger.info("Check your Internet.") 152 | elif t == "8": 153 | logger.info("User/Password wrong!") 154 | elif t == "10": 155 | logger.info("API is updated.") 156 | elif t == "15": 157 | logger.info("You are Banned sorry :(") 158 | elif t == "99": 159 | logger.info("Server is down for Maintenance, please be patient.") 160 | return t 161 | except urllib2.URLError as e: 162 | logger.error('Error: {}'.format(e)) 163 | logger.info('Timeout while requesting "{}"'.format(php)) 164 | time.sleep(1 + i) 165 | except Exception as e: 166 | logger.error('Error: {}'.format(e)) 167 | logger.info("Blocked, trying again. Delaying {0} seconds".format(i)) 168 | time.sleep(1 + i) 169 | i += 1 170 | 171 | def requestStringNoWait(self, username, password, uhash, php, **kwargs): 172 | self.user_agent = self.generateUA(username + password) 173 | for i1 in range(0, 10): 174 | try: 175 | req = urllib2.Request(self.generateURL(username, password, uhash, php, **kwargs)) 176 | req.add_header('User-agent', self.user_agent) 177 | r = urllib2.urlopen(req, context=ssl._create_unverified_context(), timeout=15) 178 | t = r.read() 179 | # print i1 180 | return t 181 | except Exception as e: 182 | logger.error('Error: {}'.format(e)) 183 | time.sleep(1) 184 | return "null" 185 | 186 | def printit(self, txt): 187 | logger.info(txt) 188 | 189 | def requestArray(self, username, password, uhash, php, **kwargs): 190 | temp = self.requestString(username, password, uhash, php, **kwargs) 191 | if temp != "null": 192 | return self.parse(temp) 193 | else: 194 | return [] 195 | --------------------------------------------------------------------------------