Update expload.py
added double extension method and the ability to pass cookies and headersmain
parent
54259d8e14
commit
6bab1015a7
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue