-
Notifications
You must be signed in to change notification settings - Fork 3
/
falcon.py
executable file
·96 lines (78 loc) · 2.68 KB
/
falcon.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# coding: utf-8
# FalconPathScan v0.1
# By Falcon - www.jisec.com
import os
import sys
import urllib2
import threading
import Queue
q=Queue.Queue()
baidu_spider="Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
lines=open("path.txt",'r')
for line in lines:
line=line.rstrip()
q.put(line)
def scaner():
while not q.empty():
path=q.get()
url="%s%s" % (domain_name,path)
print path
headers={}
headers['User-Agent']=baidu_spider
requset=urllib2.Request(url,headers=headers)
try:
response = urllib2.urlopen(requset)
content=response.read()
if len(content):
print "Status [%s] - path: %s" % (response.code,url)
wx('results.txt',url+'\n')
response.close()
except urllib2.HTTPError as e:
pass
#Check if we are running this on windows platform
is_windows = sys.platform.startswith('win')
#Console Colors
if is_windows:
G = Y = B = R = W = G = Y = B = R = W = '' #use no terminal colors on windows
else:
G = '\033[92m' #green
Y = '\033[93m' #yellow
B = '\033[94m' #blue
R = '\033[91m' #red
W = '\033[0m' #white
def banner():
print """%s
______ _ _____ _ _ _____
| ____| | | | __ \ | | | | / ____|
| |__ __ _| | ___ ___ _ __ | |__) |_ _| |_| |__ | (___ ___ __ _ _ __
| __/ _` | |/ __/ _ \| '_ \| ___/ _` | __| '_ \ \___ \ / __/ _` | '_ \
| | | (_| | | (_| (_) | | | | | | (_| | |_| | | |____) | (_| (_| | | | |
|_| \__,_|_|\___\___/|_| |_|_| \__,_|\__|_| |_|_____/ \___\__,_|_| |_|
%s%s
# Enumeration web path scanning tools, use the dictionary
# Coded By Falcon - www.jisec.com
# Use the help, for example falcon.py http://www.google.com/ 10%s
# 10 is the thread here
# The results of the scan in FalconPathScan/results.txt
"""%(R,W,Y,W)
def parser_error(errmsg):
banner()
print "Usage: python "+sys.argv[0]+" [Options] use -h for help"
print R+"Error: "+errmsg+W
sys.exit()
def show():
banner()
# print "falcon.py http://www.google.com/ 10"
def wx(filename,context):
f= file(filename,"a+")
f.write(context)
f.close()
if __name__ == '__main__':
if len(sys.argv) < 3:
show()
sys.exit()
thread_num=sys.argv[2]
domain_name=sys.argv[1]
for i in range(int(sys.argv[2])):
t = threading.Thread(target=scaner)
t.start()