Computer NetworksNETWORKS

how to rotate ip address



import os
import subprocess
import random
import time
import getpass
from colorama import Fore

GREEN = Fore.GREEN
RED = Fore.RED
CYAN = Fore.CYAN
MAGENTA = Fore.MAGENTA
RESET = Fore.RESET

def clear():
os.system(‘clear’)

def banner():
decorator = f”’ _ _ _
_ __ ___ | |_ __ _| |_ ___ (_)_ __
| ‘__/ _ | __/ _` | __/ _ | | ‘_
| | | (_) | || (_| | || __/ | | |_) |
|_| ___/ ____,_|_____| |_| .__/
|_| ”’ + SUMAN + ”’
– https://t.me/OnlineHacking”’

clear()
time.sleep(0.5)
print(GREEN+decorator+RESET+’n’)

def changeIp():
time.sleep(0.5)
nertworkInterface = input(CYAN + “Network Interface Name: ” + RESET)
ipAddr = input(CYAN + f”Enter the current ip of {nertworkInterface}: ” + RESET)
ipRotateSec = input(CYAN + f”Seconds to rotate ip for every n’th sceond: ” + RESET)
ipAddr = ipAddr.split(‘.’)[:2]
ipAddr = ‘.’.join(ipAddr)
time.sleep(1)
banner()
rotateIp(ipAddr, nertworkInterface, ipRotateSec)

def rotateIp(ipAddr, networkInterface, ipRotateSec):
ip = f'{ipAddr}.{random.randint(0, 9)}{random.randint(0, 9)}.{random.randint(0, 9)}{random.randint(0, 9)}’
changeip = f’sudo ifconfig {networkInterface} {ip} netmask 255.255.255.0′
os.system(f'{changeip}’)
print(f’Current IP is {ip}’)
time.sleep(int(ipRotateSec))
rotateIp(ipAddr, networkInterface, ipRotateSec)

if __name__ == ‘__main__’:
banner()
changeIp()

source
ip address

Alice AUSTIN

Alice AUSTIN is studying Cisco Systems Engineering. He has passion with both hardware and software and writes articles and reviews for many IT websites.

Leave a Reply

Your email address will not be published. Required fields are marked *