我正在制作一个简单的脚本,可以找到网站的管理面板。
我可以使用命令行界面来做到这一点,但我也想使用 easygui 制作一个简单的 gui。
我有几个小时的时间,但我在第 33 行收到此错误:
'TypeError: writelines requires an iterable argument'
这是我的代码:
import os, httplib
import easygui as eg
admpagelist = ['admin/','administrator/','admin1/','admin2/']
title = 'Test Easygui'
msg='Enter Your Target: (without http://) '
value = []
value = eg.enterbox(msg,title)
value = value.replace('Enter Your Target: (without http:// )','')
collectornf = []
collectorf = []
try:
con = httplib.HTTPConnection(value)
con.connect()
except:
eg.msgbox('Host is offline or invalid url! ')
for adm in admpagelist:
adm = '/%s' %adm
host = value + adm
con = httplib.HTTPConnection(value)
con.connect()
request = con.request('GET',adm)
response = con.getresponse()
if response.status == 200:
collectorf = collectorf.append(str(host))
found = open('C:/Users/Andi/Desktop/found.txt','w')
found.writelines(collectorf)
found.close()
else:
collectornf = collectornf.append(str(host))
notfound = open('C:/Users/Andi/Desktop/notfound.txt','w')
notfound.writelines(collectornf)
notfound.close()