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
727 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,030 points

Related Questions In Cyber Security & Ethical Hacking

+1 vote
1 answer

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,030 points
26,186 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
• 57,700 points
266 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 320 views
+1 vote
1 answer
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,458 views
0 votes
0 answers
+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,030 points
613 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,030 points
409 views