我在python脚本中遇到了一个错误。请让我知道我能做什么
import requests import sys import time
url="http://10.10.10.7/dvwa/vulnerabilities/fi/?page="
words = ['root','version','crontab']
cookies = {'security' : 'medium','PHPSESSID':'fbd52775729365907b53e763854c5d24'}
f=open('Payloads.txt','r')
for i in f.readlines():
ur=requests.get(url+'{}'.format(i),cookies=cookies)
if words in ur.content.decode("utf-8"):
print(( ' [Detect LFI]-------> '+' Payload is '+str(i)))
time.sleep(1)
else:
print("Not Found LFI Vulnerability")
print ("Scanning....... complete")
错误消息:
您的问题在于这一行:
words
是一个列表,ur.content.decode("utf-8")
结果是一个字符串。如错误消息所示,表单表达式的左侧:要求
<left-hand-side>
是字符串,而不是列表。下面是一个表达式,它将执行您想要执行的操作:相关问题 更多 >
编程相关推荐