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 in Cyber Security & Ethical Hacking by Kishan
94 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 by Omkar
• 67,120 points

Related Questions In Cyber Security & Ethical Hacking

0 votes
1 answer

Not able to install arpspoof

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

answered Feb 9 in Cyber Security & Ethical Hacking by Omkar
• 67,120 points
93 views
0 votes
1 answer

Not connected to Internet

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

answered Mar 22 in Cyber Security & Ethical Hacking by Priyaj
• 56,160 points
18 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 in Cyber Security & Ethical Hacking by Karan

reshown Apr 1 by Omkar 25 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 132 views
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

Not able to run nmap scan on router.

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

answered Jan 31 in Cyber Security & Ethical Hacking by Omkar
• 67,120 points
54 views