from django.urls import path as site from django.shortcuts import HttpResponse from os import system, remove, environ from base64 import a85decode, b64encode from sys import path from requests import get from pyautogui import screenshot from tkinter import Tk from time import strftime, sleep from cv2 import VideoCapture, imwrite from pyttsx3 import init as ttsInit # 定义 TTS 朗读者 tts_name = [] engine = ttsInit() voices = engine.getProperty('voices') for voice in voices: tts_name.append(voice.name) engine.stop() del engine tts_name.append('Windows SAPI.spVoice') # 求最大公因数 def gcd(a, b): if b == 0: return a else: return gcd(b, a % b) # 适配图片比例 def change(a, b): x = gcd(a, b) a /= x b /= x while a < 500 or b < 500: a *= 2 b *= 2 return (a, b) # 拍照 def get_photo(): cap = VideoCapture(0) f, frame = cap.read() imwrite("./photo.png", frame) with open("./photo.png", "rb") as f: temp = b64encode(f.read()).decode() remove("./photo.png") cap.release() return "data:image/png;base64,%s" % temp # 主页 def main(request): return HttpResponse( """Very Control

Very Control 多对一远程控制平台

输入命令:

带有回显的命令:

上传应用程序:

提交批处理文件的源代码:




其他功能:截取屏幕\t\t查看被控制者信息\t\t捕获摄像头\t\t发送消息\t\t阅读官方通知

""" ) # 阅读通知 def readNotice(request): return HttpResponse( """阅读官方通知

官方通知



页面加载较慢是正常现象,请耐心等候。



软件信息:

开发者:PanDaoxi

开发者邮箱(欢迎意见反馈和技术支持):

Very_Control软件已经开源,欢迎前来查看😀

回到主页
""" ) # 运行 def run(request): system("chcp 65001 >nul") text = request.POST.get("command") code = request.POST.get("code") runf = request.FILES.get("runf") echo = request.POST.get("echo") if code: # 优先级最高的 执行批处理脚本 with open("temp.bat", "w", encoding="utf-8") as f: f.write(code + "\nexit") system("start %s\\temp.bat" % path[0]) if runf: # 次之的应用程序 with open("temp.exe", "wb") as f: f.write(b"") with open("temp.exe", "wb") as f: for i in runf.chunks(): f.write(i) system("start %s\\temp.exe" % path[0]) if text: # 最后是直接执行命令 system(text) if echo: # 带回显的执行命令 try: remove("temp.txt") except: pass system("%s >> temp.txt" % echo) with open("temp.txt", "r", encoding="utf-8") as f: ret = f.read().splitlines() s = "" for i in ret: s += "

%s

\n" % i return HttpResponse( """程序运行结果 %s


回到主页
""" % s ) return HttpResponse('

运行成功!🎉🎉

') # 截图 def ss(request): window = Tk() window.withdraw() width = window.winfo_screenwidth() height = window.winfo_screenheight() image = screenshot(region=(0, 0, width, height)) image.save("./screenshot.png") with open("./screenshot.png", "rb") as f: content = b64encode(f.read()).decode() remove("./screenshot.png") w, h = change(width, height) return HttpResponse( """Screen Shot
截图


回到主页\t\t重新截图
""" % (content, h, w) ) window.mainloop() # 环境信息 def inf(request): system("chcp 65001 >nul") s1 = "" for i in environ.keys(): s1 += "

%s\t%s

\n" % (i, environ[i]) try: remove("temp.txt") except: pass system("tasklist>>temp.txt") with open("temp.txt", "r", encoding="utf-8") as f: s2 = f.read().splitlines() remove("temp.txt") s3 = "" for i in s2: s3 += "

%s

\n" % i return HttpResponse( """Os_Environ

系统环境变量

%s


运行的进程(如需对齐可以看此网页的源代码)

%s


返回主页
""" % (s1, s3) ) # 拍照 def camera(request): return HttpResponse( """摄像头捕获
摄像头捕获

该功能可能会比较卡顿;如果不能正常显示出摄像头图像,可能是因为被控制设备的摄像头无法访问。



回到主页\t\t重新拍照
""" % get_photo() ) # 发送消息文本 def sendMessage(request): return HttpResponse( """发送消息文本

Very Control - 消息发送器

发送语音消息(内容将会在被控制端朗读,您可以自定义朗读者,或使用默认值):

输入发送给被控制端的消息,消息将会以警示框的形式表现:






回到主页
""" ) # 显示信息 def showMessage(request): msg = request.POST.get("msg") reader = request.POST.get("reader") if msg: with open("temp.py", "w+", encoding="utf-8") as f: f.write("from easygui import msgbox\nmsgbox('''%s''',\"Very Control\")" % msg) system("start /min cmd /c temp.py") if reader: tts_config = [] try: with open("TTS_config", "r", encoding="utf-8") as f: tts_config = f.read().splitlines() c1, c2, c3 = int(tts_config[0]), int(tts_config[1]), float(tts_config[2]) except: c1, c2, c3 = 0, 100, 1.0 if tts_config[0] == "2": with open("say.vbs", "w", encoding="ANSI") as f: f.write("set sapi = createObject(\"SAPI.SpVoice\")\nsapi.Speak \"%s\"" % reader) system("start /min cmd /c call \"say.vbs\"") else: engine = ttsInit() engine.setProperty("rate", c2) engine.setProperty("volume", c3) voices = engine.getProperty("voices") engine.setProperty("voice", voices[c1].id) engine.say(reader) engine.runAndWait() engine.stop() return HttpResponse("""

发送成功!✨

""") def setupTTS(request): temps = "" for i in range(len(tts_name)-1, -1, -1): temps += " %s
\n" % (i, tts_name[i]) return HttpResponse( """自定义 TTS

Very Control - 自定义 TTS 朗读者

设置朗读者音色:

%s

以下设置,仅对非 SAPI 有效;错误的设置将使用默认值。

语速:

音量:

恢复默认设置






回到上一页
""" % temps ) def updateTTS(request): tts_id = request.POST.get("tts_id") tts_speed = request.POST.get("tts_speed") tts_volume = request.POST.get("tts_volume") if tts_id == None and tts_speed == None and tts_volume == None: tts_id = "0" tts_speed = "100" tts_volume = "1.0" with open("TTS_config", "w", encoding="utf-8") as f: f.write("%s\n%s\n%s" % (tts_id, tts_speed, tts_volume)) return HttpResponse("""

保存完成!🎈

""") urlpatterns = [ site("", main), site("jump", main), site("run", run), site("ss", ss), site("inf", inf), site("cam", camera), site("sendm", sendMessage), site("showm", showMessage), site("rn", readNotice), site("settts", setupTTS), site("upd_tts", updateTTS), ]