|
28 | 28 | from lib.core.data import kb |
29 | 29 | from lib.core.data import logger |
30 | 30 | from lib.core.datatype import OrderedSet |
| 31 | +from lib.core.enums import HTTPMETHOD |
31 | 32 | from lib.core.enums import MKSTEMP_PREFIX |
32 | 33 | from lib.core.exception import SqlmapConnectionException |
33 | 34 | from lib.core.exception import SqlmapSyntaxException |
@@ -116,7 +117,7 @@ def crawlThread(): |
116 | 117 | if (extractRegexResult(r"\A[^?]+\.(?P<result>\w+)(\?|\Z)", url) or "").lower() not in CRAWL_EXCLUDE_EXTENSIONS: |
117 | 118 | with kb.locks.value: |
118 | 119 | threadData.shared.deeper.add(url) |
119 | | - if re.search(r"(.*?)\?(.+)", url): |
| 120 | + if re.search(r"(.*?)\?(.+)", url) and not re.search(r"\?\d+\Z", url): |
120 | 121 | threadData.shared.value.add(url) |
121 | 122 | except UnicodeEncodeError: # for non-HTML files |
122 | 123 | pass |
@@ -211,12 +212,15 @@ def crawlThread(): |
211 | 212 | results = OrderedSet() |
212 | 213 |
|
213 | 214 | for target in kb.targets: |
214 | | - match = re.search(r"/[^/?]*\?.*\Z", target[0]) |
215 | | - if match: |
216 | | - key = re.sub(r"=[^=&]*", "=", match.group(0)) |
217 | | - if key not in seen: |
218 | | - results.add(target) |
219 | | - seen.add(key) |
| 215 | + if target[1] == HTTPMETHOD.GET: |
| 216 | + match = re.search(r"/[^/?]*\?.*\Z", target[0]) |
| 217 | + if match: |
| 218 | + key = re.sub(r"=[^=&]*", "=", match.group(0)) |
| 219 | + if key not in seen: |
| 220 | + results.add(target) |
| 221 | + seen.add(key) |
| 222 | + else: |
| 223 | + results.add(target) |
220 | 224 |
|
221 | 225 | kb.targets = results |
222 | 226 |
|
|
0 commit comments