예제 #1
0
 def run(self):
     while 1:
         try:
             self.line = str(queue.popleft())
         except:
             break
         if self.Npath:
             self.Npath = self.Npath
             self.req = urllib2.Request(self.site + "/" + self.Npath + "/" +
                                        self.line)
         else:
             self.req = urllib2.Request(self.site + "/" + self.line)
         try:
             urllib2.urlopen(self.req, timeout=10)
         except urllib2.HTTPError as self.hr:
             if self.hr.code == 404:
                 if self.Npath:
                     print self.smode + ": " + self.Npath + "/" + self.line.ljust(
                         70 - len(self.Npath) - 1, ' '),
                 else:
                     print self.smode + ": " + self.line.ljust(70, ' '),
                 sys.stdout.write("\r")
         except urllib2.URLError as self.ur:
             printError("URL error:" + self.line.ljust(50, ' ') +
                        str(self.ur.args[0]).ljust(20, ' '))
             exit()
예제 #2
0
def f4ckDir(site,sdir,smode,sproxy = None, sscript = None):
    if sproxy:
        connet_proxy = myproxy(sproxy)
        if not connet_proxy:
            printError("proxy Error!!")
            sys.exit(1)
    try:
        filename = site.replace ("http://","").replace ("/","")
        ldir = "/".join(sdir.split("/")[0:-2])
        logging_file=logging(ldir+"/log/"+filename+".txt")

    except Exception,e:
        print e
        pass
예제 #3
0
 def run(self):
     while 1:
         if queue.empty()== True:
             break
         self.line = str(queue.get())
         self.req = urllib2.Request(self.site + "/" + self.line)
         try:
             urllib2.urlopen(self.req,timeout=10)
         except urllib2.HTTPError as self.hr:
             if self.hr.code == 404:
                 print self.smode+": " + self.line.ljust(70,' '),
                 sys.stdout.write("\r")
         except urllib2.URLError as self.ur:
             printError("URL error:" + self.line.ljust(50,' ') + str(self.ur.args[0]).ljust(20,' '))
             exit()
예제 #4
0
def urlcheck(site):
    if site[:4] != "http":
        site = "http://" + site
    if site.endswith("--"):
        site = site.rstrip('--')
    if site.endswith("/*"):
        site = site.rstrip('/*')
    try:
        printProcess("[!] Checking website " + site + "...")
        req = urllib2.Request(site)
        urllib2.urlopen(site, timeout=10)
        printResult("[+] " + site + " appears to be Online.\n")
    except:
        printError("[-] Server offline or invalid URL")
        return None
    return site
예제 #5
0
def urlcheck(site):
	if site[:4] != "http":
		site = "http://"+site
	if site.endswith("--"):
  		site = site.rstrip('--')
	if site.endswith("/*"):
  		site = site.rstrip('/*')
	try:
		printProcess("[!] Checking website " + site + "...")
		req = urllib2.Request(site)
		urllib2.urlopen(site)
		printResult("[+] " + site +" appears to be Online.\n")
	except:
		printError("[-] Server offline or invalid URL")
		return None
	return site
예제 #6
0
def chooseDic(smode):
	path = sys.path[0]
	path = path.replace("\\","/")
	if smode == "shell":
		wordlist=path+"/dic/shell.txt"
	elif smode == "backup":
		wordlist=path+"/dic/backups.txt"
	elif smode == "admin":
		wordlist=path+"/dic/admins.txt"
	elif smode == "dir": 
		wordlist=path+"/dic/dir.txt"
	elif smode == "files": 
		wordlist=path+"/dic/files.txt"
	elif smode == "all": 
		wordlist=path+"/dir/"
	else:
		printError("[-] Mode not specified")
		os._exit(1)
	if smode != "all" and not os.access(wordlist, os.F_OK):
		printError ("[-] File " + wordlist + " does not exist or " + "you are not permitted to access to the file" )
		os._exit(1)
	return wordlist
예제 #7
0
def chooseDic(smode):
	path = sys.path[0]
	path = path.replace("\\","/")
	if smode == "shell":
		wordlist=path+"/dic/shell.txt"
	elif smode == "backup":
		wordlist=path+"/dic/backups.txt"
	elif smode == "admin":
		wordlist=path+"/dic/admins.txt"
	elif smode == "dir": 
		wordlist=path+"/dic/dir.txt"
	elif smode == "files": 
		wordlist=path+"/dic/files.txt"
	elif smode == "all": 
		wordlist=path+"/dic/"
	else:
		printError("[-]warning!!!: Mode not specified")
		wordlist=path+"/dic/"+smode+".txt"
	if smode != "all" and not os.access(wordlist, os.F_OK):
		printError ("[-] File " + wordlist + " does not exist or " + "you are not permitted to access to the file" )
		os._exit(1)
	return wordlist
예제 #8
0
 def run(self):
     while 1:
         try:
             self.line = str(queue.popleft())
         except:
             break
         if self.Npath:
             self.Npath = self.Npath
             self.req = urllib2.Request(self.site + "/" + self.Npath + "/" + self.line)
         else:
             self.req = urllib2.Request(self.site + "/" + self.line)
         try:
             urllib2.urlopen(self.req,timeout=10)
         except urllib2.HTTPError as self.hr:
             if self.hr.code == 404:
                 if self.Npath:
                     print self.smode+": " + self.Npath + "/" + self.line.ljust(70-len(self.Npath)-1,' '),
                 else:
                     print self.smode+": " + self.line.ljust(70,' '),
                 sys.stdout.write("\r")
         except urllib2.URLError as self.ur:
             printError("URL error:" + self.line.ljust(50,' ') + str(self.ur.args[0]).ljust(20,' '))
             exit()
예제 #9
0
def proxycheck(myhttpproxy, myproxy):
    try:
        if myproxy:
            printWait("[+] Testing Proxy...")
            h2 = httplib.HTTPConnection(myhttpproxy)
            h2.connect()
            printResult("[+] Proxy:" + myhttpproxy + "\n")
            return 1
    except (socket.timeout):
        printError("[-] Proxy Timed Out")
        return None
    except (NameError):
        printError("[-] Proxy Not Given")
        return None
    except:
        printError("[-] Proxy Failed")
        return None
예제 #10
0
파일: proxy.py 프로젝트: haxsscker/DirSaber
def proxycheck(myhttpproxy,myproxy):
    try:
        if myproxy:
            printWait("[+] Testing Proxy...")
            h2 = httplib.HTTPConnection(myhttpproxy)
            h2.connect()
            printResult("[+] Proxy:"+myhttpproxy+"\n")
            return 1
    except(socket.timeout):
        printError("[-] Proxy Timed Out")
        return None
    except(NameError):
        printError("[-] Proxy Not Given")
        return None
    except:
        printError("[-] Proxy Failed")
        return None
예제 #11
0
		try:
			opts, args = getopt.getopt (sys.argv[2:], "m:p:")
		except:
			printSyntax()
			sys.exit(1)
	###################################################
	# Load input parameters
	sproxy = None
	smode = None
	for opt, arg in opts:
		if opt == '-m':
			smode = arg
		elif opt == '-p':
			sproxy = arg
		else:
			printError("Unknown options!!") 
			printSyntax()
			sys.exit(1)

	site = sys.argv[1]
	site = urlcheck(site)
	if site == None:
		sys.exit(1)
	sdir = chooseDic(smode)

	f4ckDir(site,sdir,smode)




예제 #12
0
	# Load input parameters
	sproxy = None
	smode = None
	sscript = None
	DG = None
	for opt, arg in opts:
		if opt == '-m':
			smode = arg
		elif opt == '-p':
			sproxy = arg
		elif opt == '-t':
			sscript = arg
		elif opt == '-d':
			DG = 1
		else:
			printError("Unknown options!!") 
			printSyntax()
			sys.exit(1)

	site = sys.argv[1]
	site = urlcheck(site)
	if site == None:
		sys.exit(1)
	sdir = chooseDic(smode)
	if sproxy:
		is_sproxy = proxycheck(sproxy,1)
		if not is_sproxy:
			go_on = raw_input("GO ON to check the website? (N/y): ")
			if go_on != "y":
				sys.exit(1)
	if sscript: