Automating macchanger with Python

0 votes

I am trying to use Python to change the mac address of the network interface ens33 every 30 seconds. What Python script should I use to do this? Thanks in advance.

Jun 24 in Cyber Security & Ethical Hacking by Phalguni
• 1,010 points
40 views

1 answer to this question.

0 votes

You can use the following code:

import subprocess
import time
import random
ip=['00:11:22:33:44:55','23:53:21:53:89:92','88:18:12:59:19:88']
ip1=random.choice(ip)
while(True):    
    subprocess.call(["sudo","ifconfig","ens33","down"])
    subprocess.call(["sudo","ifconfig","ens33","hw","ether",ip1])
    subprocess.call(["sudo","ifconfig","ens33","up"])
    time.sleep(30)
answered Jun 24 by Avantika
• 1,500 points

Related Questions In Cyber Security & Ethical Hacking

0 votes
1 answer

Not able to use nmap in python.

nmap module doesn’t have PortScanner attribute. The ...READ MORE

answered Jan 28 in Cyber Security & Ethical Hacking by Omkar
• 67,120 points
46 views
0 votes
1 answer

SIOCSIFFLAGS: Operation not permitted

You need sudo permissions to make changes to ...READ MORE

answered Feb 6 in Cyber Security & Ethical Hacking by Omkar
• 67,120 points
94 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 131 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,380 points

edited Nov 6, 2018 by Omkar 6,151 views
+2 votes
2 answers

How can I press ENTER key with the execute_script in selenium python?

The below code containing Keys.ENTER might just ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,050 points
5,080 views
0 votes
1 answer

How to use Selenium with Python?

There are many resources for selenium - ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,050 points
137 views
0 votes
1 answer

How to perform web scraping with python?

Hey, there are various libraries used in ...READ MORE

answered Apr 20, 2018 in Python by aayushi
• 750 points
203 views