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():
|
def fileupload():
|
||||||
ext=args.ext
|
ext=args.ext
|
||||||
name=args.name
|
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:
|
with open(args.payload,"r") as payload:
|
||||||
content=payload.read().encode("utf-8")
|
content=payload.read().encode("utf-8")
|
||||||
with tempfile.NamedTemporaryFile() as tmp:
|
with tempfile.NamedTemporaryFile() as tmp:
|
||||||
|
@ -31,7 +31,7 @@ def fileupload():
|
||||||
with httpx.Client(http2=args.http2) as client:
|
with httpx.Client(http2=args.http2) as client:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = client.post(args.url, files=files)
|
r = client.post(args.url, files=files, headers=args.headers)
|
||||||
|
|
||||||
except httpx.ReadTimeout:
|
except httpx.ReadTimeout:
|
||||||
print("Error: Response timed out but file may have been uploaded")
|
print("Error: Response timed out but file may have been uploaded")
|
||||||
|
@ -46,6 +46,8 @@ def fileupload():
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
print("file posted")
|
print("file posted")
|
||||||
|
if args.response:
|
||||||
|
print(r.text)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args=exploadlib.parse.parser()
|
args=exploadlib.parse.parser()
|
||||||
|
|
Loading…
Reference in New Issue