Uh oh!
There was an error while loading. Please reload this page.
forked from sqlmapproject/sqlmap
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_sqlmap.py
More file actions
Latest commit
executable file
·125 lines (101 loc) · 3.32 KB
/
Copy path_sqlmap.py
File metadata and controls
executable file
·125 lines (101 loc) · 3.32 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env python
"""
Copyright (c) 2006-2012 sqlmap developers (http://www.sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
importos
importsys
importtime
importtraceback
importwarnings
warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning)
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
try:
importpsyco
psyco.full()
psyco.profile()
exceptImportError:
pass
fromlib.controller.controllerimportstart
fromlib.core.commonimportbanner
fromlib.core.commonimportdataToStdout
fromlib.core.commonimportgetUnicode
fromlib.core.commonimportsetPaths
fromlib.core.commonimportweAreFrozen
fromlib.core.dataimportcmdLineOptions
fromlib.core.dataimportconf
fromlib.core.dataimportkb
fromlib.core.dataimportlogger
fromlib.core.dataimportpaths
fromlib.core.commonimportunhandledExceptionMessage
fromlib.core.exceptionimportexceptionsTuple
fromlib.core.exceptionimportsqlmapSilentQuitException
fromlib.core.exceptionimportsqlmapUserQuitException
fromlib.core.optionimportinit
fromlib.core.profilingimportprofile
fromlib.core.settingsimportLEGAL_DISCLAIMER
fromlib.core.testingimportsmokeTest
fromlib.core.testingimportliveTest
fromlib.parse.cmdlineimportcmdLineParser
defmodulePath():
"""
This will get us the program's directory, even if we are frozen
using py2exe
"""
returnos.path.dirname(getUnicode(sys.executableifweAreFrozen() else__file__, sys.getfilesystemencoding()))
defmain():
"""
Main function of sqlmap when running from command line.
"""
try:
paths.SQLMAP_ROOT_PATH=modulePath()
setPaths()
banner()
dataToStdout("[!] legal disclaimer: %s\n\n"%LEGAL_DISCLAIMER, forceOutput=True)
dataToStdout("[*] starting at %s\n\n"%time.strftime("%X"), forceOutput=True)
# Store original command line options for possible later restoration
cmdLineOptions.update(cmdLineParser().__dict__)
init(cmdLineOptions)
ifconf.profile:
profile()
elifconf.smokeTest:
smokeTest()
elifconf.liveTest:
liveTest()
else:
start()
exceptsqlmapUserQuitException:
errMsg="user quit"
logger.error(errMsg)
exceptsqlmapSilentQuitException:
pass
exceptexceptionsTuple, e:
e=getUnicode(e)
logger.critical(e)
exceptKeyboardInterrupt:
print
errMsg="user aborted"
logger.error(errMsg)
exceptEOFError:
print
errMsg="exit"
logger.error(errMsg)
exceptSystemExit:
pass
except:
print
errMsg=unhandledExceptionMessage()
logger.critical(errMsg)
traceback.print_exc()
finally:
dataToStdout("\n[*] shutting down at %s\n\n"%time.strftime("%X"), forceOutput=True)
kb.threadContinue=False
kb.threadException=True
ifconf.get("hashDB", None):
try:
conf.hashDB.flush(True)
exceptKeyboardInterrupt:
pass
# Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program
ifconf.get("threads", 0) >1orconf.get("dnsServer", None):
os._exit(0)