SIOCSIFFLAGS Operation not permitted

0 votes

I am trying to write a python script for MacChanger. This is the script I am using:

import subprocess

subprocess.call(["ifconfig","ens33","down"])
subprocess.call(["ifconfig","ens33","hw","ether","00:11:22:33:44:55"])
subprocess.call(["ifconfig","ens33","up"])

When I run this, I am getting this error:

SIOCSIFFLAGS: Operation not permitted
Feb 6, 2019 in Cyber Security & Ethical Hacking by Kishan
4,349 views

1 answer to this question.

0 votes

You need sudo permissions to make changes to the network interfaces. And because you are running the commands in your python script with normal privileges, you won't be able to make these changes. You will have to use sudo. Try this:

import subprocess

subprocess.call(["sudo","ifconfig","ens33","down"])
subprocess.call(["sudo","ifconfig","ens33","hw","ether","00:11:22:33:44:55"])
subprocess.call(["sudo","ifconfig","ens33","up"])
answered Feb 6, 2019 by Omkar
• 69,220 points

Related Questions In Cyber Security & Ethical Hacking

+1 vote
3 answers

Not able to install arpspoof

There is no package called arpspoof. To use the arpspoof command, ...READ MORE

answered Feb 9, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,220 points
62,235 views
0 votes
1 answer

Not connected to Internet

The two major problems that generally occurs ...READ MORE

answered Mar 22, 2019 in Cyber Security & Ethical Hacking by Priyaj
• 58,020 points
1,057 views
0 votes
1 answer
0 votes
1 answer

Not able to run nikto scan on nikto-test.com

Hi, the webpage nikto-test.com doesn’t exist anymore. ...READ MORE

answered Apr 1, 2019 in Cyber Security & Ethical Hacking by Karan

reshown Apr 1, 2019 by Omkar 2,890 views
+1 vote
1 answer
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
+1 vote
1 answer

Not able to use nmap in python.

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

answered Jan 28, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,220 points
3,404 views
0 votes
1 answer

Not able to run nmap scan on router.

Might not be the actual router address. ...READ MORE

answered Jan 31, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,220 points
1,865 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP