Skip to content

Commit

Permalink
fixed multipart form handling issue (sqlmapproject#5602) (sqlmapproje…
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkumarankam authored and MirMohammadd committed May 4, 2024
1 parent 4666e3a commit 6041837
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def process(match, repl):
if not (kb.processUserMarks and kb.customInjectionMark in conf.data):
conf.data = getattr(conf.data, UNENCODED_ORIGINAL_VALUE, conf.data)
conf.data = conf.data.replace(kb.customInjectionMark, ASTERISK_MARKER)
conf.data = re.sub(r"(?si)((Content-Disposition[^\n]+?name\s*=\s*[\"']?(?P<name>[^\"'\r\n]+)[\"']?).+?)((%s)--)" % ("\r\n" if "\r\n" in conf.data else '\n'), functools.partial(process, repl=r"\g<1>%s\g<4>" % kb.customInjectionMark), conf.data)
conf.data = re.sub(r"(?si)(Content-Disposition:[^\n]+\s+name=\"(?P<name>[^\"]+)\"(?:[^f|^b]|f(?!ilename=)|b(?!oundary=))*?)((%s)--)" % ("\r\n" if "\r\n" in conf.data else '\n'),
functools.partial(process, repl=r"\g<1>%s\g<3>" % kb.customInjectionMark), conf.data)

if not kb.postHint:
if kb.customInjectionMark in conf.data: # later processed
Expand Down

0 comments on commit 6041837

Please sign in to comment.