shell2http使用按扣插入时不起作用,Flask-Shell2HTTP我必须直接触摸文件,所以我用 Python 制作了它。
安装
pip install shell2http
用法
http://localhost:8080/在浏览器中打开以执行命令。 8080是可变的。
shell2http [options] ["shell command" for /] /path "shell command" /path2 "shell command2" ...
options:
-p, --port NNNN : port for http server ( default 8080 )
例子
视窗
curl localhost:8080 关机。http://localhost:8080/您也可以通过打开关闭
shell2http 'shutdown -s -t 0'
curl localhost:8080/beep 将发出哔哔声。
shell2http 'shutdown -s -t 0' /beep 'echo ^G'
http://localhost:3306/beep打开时会发出哔哔声。
shell2http --port 3306 /beep 'echo ^G'
Linux
curl localhost:8080,您将收到通知。http://localhost:8080/您也可以通过打开来接收通知。
shell2http 'notify-send Hello root'
curl localhost:3000/path 将播放声音。
shell2http -p3000 'notify-send Hello root' /path 'canberra-gtk-play -i desktop-login'
shell2http -p3000 /path 'canberra-gtk-play -i desktop-login'
例如,当进程被端口转发(UPnP)杀死时,您可以播放声音或从外部通知桌面。我认为 os 命令注入没有任何问题,因为它不使用请求参数。
一家之主shell2http它比它快 5 倍,并且可以在 100 毫秒内运行。
致谢
原创声明:本文系作者授权爱码网发表,未经许可,不得转载;
原文地址:https://www.likecs.com/show-308623145.html