FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlmap/lib/parse/html.py at master · sql9/sqlmap · GitHub
sql9
/
sqlmap
Public
forked from
sqlmapproject/sqlmap
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlmap
/
lib
/
parse
/
html.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (48 loc) · 1.68 KB
Breadcrumbs
sqlmap
/
lib
/
parse
/
html.py
Copy path
File metadata and controls
65 lines (48 loc) · 1.68 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import
re
from
xml
.
sax
.
handler
import
ContentHandler
from
lib
.
core
.
common
import
parseXmlFile
from
lib
.
core
.
data
import
kb
from
lib
.
core
.
data
import
paths
from
lib
.
core
.
threads
import
getCurrentThreadData
class
HTMLHandler
(
ContentHandler
):
"""
This class defines methods to parse the input HTML page to
fingerprint the back-end database management system
"""
def
__init__
(
self
,
page
):
ContentHandler
.
__init__
(
self
)
self
.
_dbms
=
None
self
.
_page
=
page
self
.
dbms
=
None
def
_markAsErrorPage
(
self
):
threadData
=
getCurrentThreadData
()
threadData
.
lastErrorPage
=
(
threadData
.
lastRequestUID
,
self
.
_page
)
def
startElement
(
self
,
name
,
attrs
):
if
name
==
"dbms"
:
self
.
_dbms
=
attrs
.
get
(
"value"
)
elif
name
==
"error"
:
if
re
.
search
(
attrs
.
get
(
"regexp"
),
self
.
_page
,
re
.
I
):
self
.
dbms
=
self
.
_dbms
self
.
_markAsErrorPage
()
def
htmlParser
(
page
):
"""
This function calls a class that parses the input HTML page to
fingerprint the back-end database management system
"""
xmlfile
=
paths
.
ERRORS_XML
handler
=
HTMLHandler
(
page
)
parseXmlFile
(
xmlfile
,
handler
)
if
handler
.
dbms
and
handler
.
dbms
not
in
kb
.
htmlFp
:
kb
.
lastParserStatus
=
handler
.
dbms
kb
.
htmlFp
.
append
(
handler
.
dbms
)
else
:
kb
.
lastParserStatus
=
None
# generic SQL warning/error messages
if
re
.
search
(
r"SQL (warning|error|syntax)"
,
page
,
re
.
I
):
handler
.
_markAsErrorPage
()
return
handler
.
dbms
Back
|
FazBrowse Home
|
New Git URL