From 598d510b8e6cbf09e667be0dda40283c6833921f Mon Sep 17 00:00:00 2001 From: BezaleelPaul <145212633+BezaleelPaul@users.noreply.github.com> Date: Sat, 17 May 2025 08:41:45 +0530 Subject: [PATCH 1/4] Update autoTOR.py --- autoTOR.py | 146 +++++++++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 66 deletions(-) diff --git a/autoTOR.py b/autoTOR.py index 62182ea..44cc36a 100644 --- a/autoTOR.py +++ b/autoTOR.py @@ -1,82 +1,96 @@ # -*- coding: utf-8 -*- - import time import os import subprocess - - - - - - try: - import requests -except Exception: - print('[+] python3 requests is not installed') - os.system('pip3 install requests') - os.system('pip3 install requests[socks]') - print('[!] python3 requests is installed ') -try: - - check_tor = subprocess.check_output('which tor', shell=True) -except subprocess.CalledProcessError: +except ImportError: + print('[+] python3-requests is not installed. Installing now...') + os.system('pip3 install requests requests[socks]') + import requests - print('[+] tor is not installed !') - subprocess.check_output('sudo apt update',shell=True) - subprocess.check_output('sudo apt install tor -y',shell=True) - print('[!] tor is installed succesfully ') +def ensure_tor_installed(): + try: + subprocess.check_output('which tor', shell=True) + except subprocess.CalledProcessError: + print('[+] Tor is not installed. Installing...') + subprocess.call('sudo apt update', shell=True) + subprocess.call('sudo apt install tor -y', shell=True) + print('[!] Tor installed successfully.') + +def start_tor(): + try: + subprocess.call('service tor start', shell=True) + except: + try: + subprocess.call('systemctl start tor', shell=True) + except Exception as e: + print(f'[!] Could not start Tor service: {e}') + +def reload_tor(): + try: + subprocess.call('service tor reload', shell=True) + except: + try: + subprocess.call('systemctl reload tor', shell=True) + except Exception as e: + print(f'[!] Could not reload Tor service: {e}') -os.system("clear") def ma_ip(): - url='http://checkip.amazonaws.com' - get_ip= requests.get(url,proxies=dict(http='socks5://127.0.0.1:9050',https='socks5://127.0.0.1:9050')) - return get_ip.text + url = 'http://checkip.amazonaws.com' + try: + get_ip = requests.get(url, proxies=dict( + http='socks5://127.0.0.1:9050', + https='socks5://127.0.0.1:9050' + ), timeout=10) + return get_ip.text.strip() + except Exception as e: + return f'[!] Failed to get IP: {e}' def change(): - os.system("service tor reload") - print ('[+] Your IP has been Changed to : '+str(ma_ip())) - -print('''\033[1;32;40m \n + reload_tor() + print('[+] Your IP has been changed to:', ma_ip()) + +def main(): + ensure_tor_installed() + os.system("clear") + + print('''\033[1;32;40m _ _______ - /\ | | |__ __| - / \ _ _| |_ ___ | | ___ _ __ - / /\ \| | | | __/ _ \ | |/ _ \| '__| - / ____ \ |_| | || (_) | | | (_) | | - /_/ \_\__,_|\__\___/ |_|\___/|_| + /\\ | | |__ __| + / \\ _ _| |_ ___ | | ___ _ __ + / /\\ \\| | | | __/ _ \\ | |/ _ \\| '__| + / ____ \\ |_| | || (_) | | | (_) | | + /_/ \\_\\__,_|\\__\\___/ |_|\\___/|_| V 2.1 from mrFD ''') -print("\033[1;40;31m http://facebook.com/ninja.hackerz.kurdish/\n") - -os.system("service tor start") - - - - -time.sleep(3) -print("\033[1;32;40m change your SOCKES to 127.0.0.1:9050 \n") -os.system("service tor start") -x = input("[+] time to change Ip in Sec [type=60] >> ") -lin = input("[+] How many times do you want to change your IP? enter to infinite IP change] >> ") or "0" - -try: - lin = int(lin) - - if lin == 0: - print("Starting infinite IP change. Press Ctrl+C to stop.") - while True: - try: - time.sleep(int(x)) # Assuming 'x' is defined earlier in your code - change() # Assuming 'change()' is defined elsewhere - except KeyboardInterrupt: - print('\nAuto IP changer is closed.') - break - else: - for _ in range(lin): - time.sleep(int(x)) # Assuming 'x' is defined earlier in your code - change() # Assuming 'change()' is defined elsewhere - -except ValueError: - print("Invalid input. Please enter a valid number.") + print("\033[1;40;31m http://facebook.com/ninja.hackerz.kurdish/\n") + + start_tor() + time.sleep(3) + print("\033[1;32;40m Set your SOCKS to 127.0.0.1:9050 \n") + + x = input("[+] Time delay to change IP in seconds [default=60] >> ") or "60" + lin = input("[+] How many times to change IP? (Enter 0 or leave blank for infinite) >> ") or "0" + + try: + delay = int(x) + lin = int(lin) + + if lin == 0: + print("[*] Starting infinite IP change. Press Ctrl+C to stop.") + while True: + time.sleep(delay) + change() + else: + for _ in range(lin): + time.sleep(delay) + change() + + except ValueError: + print("[!] Invalid input. Please enter valid numbers.") + +if __name__ == "__main__": + main() From 5242fe4e7ae584cbbfd40eef161d218cecd0606c Mon Sep 17 00:00:00 2001 From: BezaleelPaul <145212633+BezaleelPaul@users.noreply.github.com> Date: Sat, 17 May 2025 08:42:26 +0530 Subject: [PATCH 2/4] Update install.py --- install.py | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/install.py b/install.py index e697d8f..02c48b5 100644 --- a/install.py +++ b/install.py @@ -1,18 +1,41 @@ import os -choice = input('[+] to install press (Y) to uninstall press (N) >> ') + +choice = input('[+] To install press (Y) or to uninstall press (N) >> ').strip().lower() run = os.system -if str(choice) =='Y' or str(choice)=='y': - run('chmod 777 autoTOR.py') - run('mkdir /usr/share/aut') - run('cp autoTOR.py /usr/share/aut/autoTOR.py') +INSTALL_DIR = "/usr/share/aut" +SCRIPT_PATH = os.path.join(INSTALL_DIR, "autoTOR.py") +LAUNCHER_PATH = "/usr/bin/aut" + +if choice == 'y': + try: + run('chmod 777 autoTOR.py') + if not os.path.exists(INSTALL_DIR): + run(f'mkdir {INSTALL_DIR}') + run(f'cp autoTOR.py {SCRIPT_PATH}') + + # Create launcher script + launcher_content = "#!/bin/sh\nexec python3 /usr/share/aut/autoTOR.py \"$@\"" + with open(LAUNCHER_PATH, 'w') as file: + file.write(launcher_content) + + run(f'chmod +x {LAUNCHER_PATH}') + run(f'chmod +x {SCRIPT_PATH}') + + print('\n\n[✓] AutoTOR IP Changer installed successfully!') + print('From now on, just type \x1b[6;30;42maut\x1b[0m in the terminal to run it.\n') + except Exception as e: + print(f"[!] Installation failed: {e}") + +elif choice == 'n': + try: + if os.path.exists(INSTALL_DIR): + run(f'rm -rf {INSTALL_DIR}') + if os.path.exists(LAUNCHER_PATH): + run(f'rm -f {LAUNCHER_PATH}') + print('[✓] AutoTOR IP Changer has been removed successfully.') + except Exception as e: + print(f"[!] Uninstallation failed: {e}") - cmnd=(' #! /bin/sh \n exec python3 /usr/share/aut/autoTOR.py "$@"') - with open('/usr/bin/aut','w')as file: - file.write(cmnd) - run('chmod +x /usr/bin/aut & chmod +x /usr/share/aut/autoTOR.py') - print('''\n\ncongratulation auto Tor Ip Changer is installed successfully \nfrom now just type \x1b[6;30;42maut\x1b[0m in terminal ''') -if str(choice)=='N' or str(choice)=='n': - run('rm -r /usr/share/aut ') - run('rm /usr/bin/aut ') - print('[!] now Auto Tor Ip changer has been removed successfully') +else: + print("[!] Invalid choice. Please enter Y or N.") From 2862800b4c2331d6ac108202af598d6c0daf68f4 Mon Sep 17 00:00:00 2001 From: BezaleelPaul <145212633+BezaleelPaul@users.noreply.github.com> Date: Sat, 17 May 2025 08:44:06 +0530 Subject: [PATCH 3/4] Update README.md --- README.md | 88 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 43c8008..4545e03 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,82 @@ -# Auto_Tor_IP_changer V 2.1 -change your Ip Address automatically This tool based on tor project +--- +# Auto\_Tor\_IP\_Changer v2.1 🚀 -how to install this tools : +Automatically change your IP address using the power of the TOR network. +Perfect for privacy enthusiasts, security researchers, and anyone who wants to automate IP rotation. -* : requirements: +--- - sudo apt-get install tor - pip3 install requests[socks] - or just run autoTor it will install everything +## 🧰 Features -1: git clone https://github.com/FDX100/Auto_Tor_IP_changer.git +* Auto IP change using the TOR network +* Set change intervals (in seconds) +* Infinite or limited IP changes +* Installs dependencies automatically (TOR, `requests[socks]`) +* Use anywhere with the simple `aut` command -2 : cd Auto_Tor_IP_changer +--- -3 : python3 install.py +## ⚙️ Requirements -4 : interminal type ( aut ) any where you want - -5 : type time to change IP +> These will be auto-installed if missing. -6: type how many time to change your ip +```bash +sudo apt-get install tor +pip3 install requests[socks] +``` -*[0 to infinte IP change] +--- -6 : go to your browser / pc change sock proxy to 127.0.0.1:9050 +## 🧑‍💻 Installation Steps + +```bash +git clone https://github.com/FDX100/Auto_Tor_IP_changer.git +cd Auto_Tor_IP_changer +python3 install.py +``` + +> 🎉 After installation, just type `aut` from anywhere in the terminal! + +--- + +## 🚀 Usage Guide + +1. Run the tool: + + ```bash + aut + ``` + +2. Enter the **time interval in seconds** between IP changes (e.g. `60` for 1 min). + +3. Enter how many times you want to change your IP: + + * Enter `0` for **infinite** IP changes. + +4. Configure your browser or PC SOCKS proxy settings to: + + ``` + 127.0.0.1:9050 + ``` + +5. Enjoy anonymous browsing with rotating IPs! + +--- + +## 📢 Notes + +* Make sure TOR is allowed through your firewall. +* This tool only works if TOR is functioning correctly on your system. +* Always use this ethically and legally. + +--- + +## 🤖 Developer + +Made with ❤️ by **mrFD** +[🔗 Facebook Page](http://facebook.com/ninja.hackerz.kurdish/) + +--- -7 : BOOOOOOMM -============ -http://facebook.com/ninja.hackerz.kurdish/ From f62ecfae30804d238cf9efe8504e976c2ec3d3ee Mon Sep 17 00:00:00 2001 From: BezaleelPaul <145212633+BezaleelPaul@users.noreply.github.com> Date: Sat, 17 May 2025 09:25:49 +0530 Subject: [PATCH 4/4] Update autoTOR.py --- autoTOR.py | 112 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 77 insertions(+), 35 deletions(-) diff --git a/autoTOR.py b/autoTOR.py index 44cc36a..e4d7e4c 100644 --- a/autoTOR.py +++ b/autoTOR.py @@ -2,13 +2,31 @@ import time import os import subprocess +import sys +import socket -try: - import requests -except ImportError: - print('[+] python3-requests is not installed. Installing now...') - os.system('pip3 install requests requests[socks]') - import requests +TOR_CONTROL_PASSWORD = "your_password_here" # Put your Tor control password here (plaintext) + +def str_to_hex(s): + return ''.join(f'{ord(c):02X}' for c in s) + +def install_python_packages(): + try: + import requests + import socks # from pysocks + except ImportError: + print('[+] Required Python packages not found. Installing now...') + os.system('pip3 install "requests[socks]" pysocks') + # Try importing again after installation + try: + import requests + import socks + except ImportError: + print('[!] Failed to install required Python packages. Please install them manually.') + sys.exit(1) + +install_python_packages() +import requests def ensure_tor_installed(): try: @@ -21,41 +39,65 @@ def ensure_tor_installed(): def start_tor(): try: - subprocess.call('service tor start', shell=True) + subprocess.call('sudo service tor start', shell=True) except: try: - subprocess.call('systemctl start tor', shell=True) + subprocess.call('sudo systemctl start tor', shell=True) except Exception as e: print(f'[!] Could not start Tor service: {e}') -def reload_tor(): +def send_newnym(): + """ + Sends the NEWNYM signal to Tor control port to request a new circuit/IP. + Requires Tor to be configured with ControlPort 9051 and password authentication. + """ try: - subprocess.call('service tor reload', shell=True) - except: - try: - subprocess.call('systemctl reload tor', shell=True) - except Exception as e: - print(f'[!] Could not reload Tor service: {e}') + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.connect(("127.0.0.1", 9051)) + hex_pass = str_to_hex(TOR_CONTROL_PASSWORD) + auth_cmd = f'AUTHENTICATE {hex_pass}\r\n'.encode() + s.send(auth_cmd) + response = s.recv(1024) + if b'250' not in response: + print("[!] Authentication failed with Tor control port") + s.close() + return False + s.send(b'SIGNAL NEWNYM\r\n') + response = s.recv(1024) + if b'250' in response: + print("[+] Successfully sent NEWNYM signal to Tor") + s.close() + return True + else: + print("[!] Failed to send NEWNYM signal") + s.close() + except Exception as e: + print(f"[!] Error communicating with Tor control port: {e}") + return False -def ma_ip(): +def get_ip(): url = 'http://checkip.amazonaws.com' + proxies = { + 'http': 'socks5h://127.0.0.1:9050', + 'https': 'socks5h://127.0.0.1:9050' + } try: - get_ip = requests.get(url, proxies=dict( - http='socks5://127.0.0.1:9050', - https='socks5://127.0.0.1:9050' - ), timeout=10) - return get_ip.text.strip() + response = requests.get(url, proxies=proxies, timeout=10) + return response.text.strip() except Exception as e: return f'[!] Failed to get IP: {e}' -def change(): - reload_tor() - print('[+] Your IP has been changed to:', ma_ip()) +def change_ip(): + if send_newnym(): + time.sleep(5) # Wait for the new circuit to be established + print('[+] Your IP has been changed to:', get_ip()) + else: + print('[!] Could not change IP via NEWNYM signal.') def main(): ensure_tor_installed() os.system("clear") - + print('''\033[1;32;40m _ _______ /\\ | | |__ __| @@ -67,27 +109,27 @@ def main(): from mrFD ''') print("\033[1;40;31m http://facebook.com/ninja.hackerz.kurdish/\n") - + start_tor() time.sleep(3) print("\033[1;32;40m Set your SOCKS to 127.0.0.1:9050 \n") - - x = input("[+] Time delay to change IP in seconds [default=60] >> ") or "60" - lin = input("[+] How many times to change IP? (Enter 0 or leave blank for infinite) >> ") or "0" + + delay_input = input("[+] Time delay to change IP in seconds [default=60] >> ") or "60" + count_input = input("[+] How many times to change IP? (Enter 0 or leave blank for infinite) >> ") or "0" try: - delay = int(x) - lin = int(lin) + delay = int(delay_input) + count = int(count_input) - if lin == 0: + if count == 0: print("[*] Starting infinite IP change. Press Ctrl+C to stop.") while True: time.sleep(delay) - change() + change_ip() else: - for _ in range(lin): + for _ in range(count): time.sleep(delay) - change() + change_ip() except ValueError: print("[!] Invalid input. Please enter valid numbers.")