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
79 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 66,910 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
• 66,910 points
70 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,140 points
16 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 16 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
56 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
• 66,910 points
40 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
• 66,910 points
50 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.