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]
import re
import sys
import urllib
import urlparse
from BeautifulSoup import BeautifulSoup
import os
print "Creating URL file..."
f = open("URL.txt", "w")
class MyOpener(urllib.FancyURLopener):
version = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15'
def process(url):
myopener = MyOpener()
page = urllib.urlopen(url)
page = myopener.open(url)
text = page.read()
page.close()
soup = BeautifulSoup(text)
for tag in soup.findAll('a', href=True):
tag['href'] = urlparse.urljoin(url, tag['href'])
print "Writing URLs to file..."
f.write(tag['href'])
os.system("python sourceget.py")
# process(url)
def main():
if len(sys.argv) == 1:
print "Jabba's Link Extractor v0.1"
print "Usage: %s URL [URL]..." % sys.argv[0]
sys.exit(-1)
# else, if at least one parameter was passed
for url in sys.argv[1:]:
process(url)
# main()
if __name__ == "__main__":
main()
And here is the source for the other program, sourceget.py:
# Get source code from URL list
import urllib2
import os
print "Creating source file..."
l = open("source.txt", "w")
l.close()
l = open("source.txt", "a")
line = 1
var = 1
print "Reading from URL file..."
url = open("URL.txt", "r").readlines()
while var == 1:
try:
print "Getting source of line ", line
usock = urllib2.urlopen(url[line])
data = usock.read()
l.write(data)
line = line + 1
except IndexError:
print "Done!"
#usock.close()Any help would be much appreciated!
--[null]