python-实现远程windows机器上传文件和远程执行命令
1. python-实现远程windows机器上传文件和远程执行命令
-
编写上传测试文件
#!/usr/bin/env python3 # _*_ coding: utf-8 _*_ # Author:shichao # File: .py import json def test(): result = { "test": "Uploaded file successfully, executed successfully", } json_data = json.dumps(result) return json_data if __name__ == "__main__": data = test() try: print(data) except Exception as e: result = {'code': 500, 'msg': 'Execution failed'} print(json.dumps(result))
-
编写windows.py文件, 实现远程windows机器上传文件和远程执行命令
#!/usr/bin/env python3 # _*_ coding