我使用jQuery动态创建表,整个表构建得很好但是在包含click事件的anchor标记中,它在与循环中的最后一个元素匹配的每一行中获取相同的值。 / p>
from BeautifulSoup import BeautifulStoneSoup
import urllib2
import sys
url = sys.argv[1]
with open("dirlist.txt",'r') as f:
for dir in f:
uri = url + "/" + dir.rstrip()
try:
response = urllib2.urlopen(uri)
if response.getcode() == 200:
soup = BeautifulStoneSoup(response.read())
viewstate = soup.find("input", {"type": "submit"})
if viewstate and viewstate.get("value") == "Send":
print("Shell is found!! Yay!!!")
else:
print("There's nothing here")
except urllib2.HTTPError, e:
if e.code == 401:
print "[!] Authorization Required %s " % (uri)
elif e.code == 403:
print "[!] Forbidden %s " % (uri)
elif e.code == 404:
print "[-] Not Found %s " % (uri)
elif e.code == 503:
print "[!] Service Unavailable %s " % (uri)
else:
print "[?] Unknwon"
print "\n:. FINISH :.\n"
以上代码应发送一条提示,其中包含' 0'点击第一行中的锚点标签,' 1'对于第二个,等等,所有链接都会发送一个警告,其中包含' 5' (x的最后一个值,因为JSON数组有6个元素),这个行为有什么想法吗?