-
Notifications
You must be signed in to change notification settings - Fork 491
/
Copy pathhtexploit.py
52 lines (42 loc) · 1.86 KB
/
htexploit.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
#!/usr/bin/python
import ConfigParser, optparse, os, signal, sys
from lib import Ascii
from lib import Conn
from lib import Detect
from lib import FullList
def signal_handler(signal, frame):
print "\n[-] Program Aborted by user.\n"
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
version = "0.7b"
title = Ascii.Title(version)
print title
usage = "Usage: %prog -u [URL] [options]"
parser = optparse.OptionParser(usage=usage)
parser.add_option("-m", "--module", action="store", type="string", dest="module", help="Select the module to run (Default: detect)")
parser.add_option("-u", "--url", action="store", type="string", dest="url", help="**REQUIRED** - Specify the URL to scan")
parser.add_option("-o", "--output", action="store", type="string", dest="output", help="Specify the output directory")
parser.add_option("-w", "--wordlist", action="store", dest="wordlist", help="Specify the wordlist to use")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default="False", help="Be verbose")
parser.set_defaults(module="detect")
(options, args) = parser.parse_args()
# Set variables according to parameters
if options.url == None:
parser.print_help()
sys.exit()
if not options.url.startswith("http://") or options.url.startswith("https://"):
options.url = "http://" + options.url
if options.output == None:
outdir = options.output
else:
outdir = os.path.abspath(options.output)
if options.module == "detect":
Detect.Scan(options.url,options.verbose,outdir)
elif options.module == "full":
FullList.Scan(options.url,options.verbose,outdir)
else:
help = "Module '" + options.module + "' not recognized.\n\n"
help = help + "Available Modules:\n"
help = help + " detect - Detects if the directory is vulnerable\n"
help = help + " full - Runs a dictionary attack on the URL, to find protected PHP files\n"
print help