Hello fellow iNinjas! I got another python problem for you guys to try to figure out. I'm working on a little project I call 'Cthulhu'. Basically, the idea is a clone of harvester written in python. I started working on it for two reasons: one, you could get a list from Harvester and one from Cthulhu and combine them for a better chance of a successful brute force, or if your like me and don't like cluttering up your 8gb of space with another programming language (perl). Anyway, I've run into a little problem with it. Whenever I try to run it, first it works just fine, but then I get this:
And when I look in the filesystem with iFile, URL.txt and source.txt where created, but they are totally empty.
Here is the source for linkex.py:
# get_links by Jabba! Modified for use in Cthulhu by [null]
from BeautifulSoup import BeautifulSoup
print "Creating URL file..."
f = open("URL.txt", "w")
version = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:184.108.40.206) Gecko/20110303 Firefox/3.6.15'
myopener = MyOpener()
page = urllib.urlopen(url)
page = myopener.open(url)
text = page.read()
soup = BeautifulSoup(text)
for tag in soup.findAll('a', href=True):
tag['href'] = urlparse.urljoin(url, tag['href'])
print "Writing URLs to file..."
if len(sys.argv) == 1:
print "Jabba's Link Extractor v0.1"
print "Usage: %s URL [URL]..." % sys.argv
# else, if at least one parameter was passed
for url in sys.argv[1:]:
if __name__ == "__main__":
And here is the source for the other program, sourceget.py:
# Get source code from URL list
print "Creating source file..."
l = open("source.txt", "w")
l = open("source.txt", "a")
line = 1
var = 1
print "Reading from URL file..."
url = open("URL.txt", "r").readlines()
while var == 1:
print "Getting source of line ", line
usock = urllib2.urlopen(url[line])
data = usock.read()
line = line + 1
Any help would be much appreciated!