
工具效果是每接收到一个 HTTP Request ,就执行指定的 Shell Commands ,并返回内容
在脚本里面可以做这些事情:
我们可以这样玩:
# Hello World $ httpbin :8080/hello -c 'httpbin add body world' $ curl http://127.0.0.1:8080/hello # 获取服务器进程 $ httpbin 127.0.0.1:8080/ps -c "ps | httpbin add body" $ curl http://127.0.0.1:8080/ps # 获取本机 IP $ httpbin :8080/ip -c "httpbin get ip | httpbin add body" $ curl http://192.168.1.101:8080/ip # 下服务器文件 $ httpbin :8080/download -c 'file=$( httpbin get form file); httpbin add body < $file' $ curl http://127.0.0.1:8080/download?file=/Users/haha/a.gif Github : https://github.com/six-ddc/httpbin 来吧, F**k Me
1 Finest 2017-04-24 21:21:25 +08:00 我看标题以为是用 shell 写了个 http 服务端 |
2 lsongdev 2017-04-24 21:55:00 +08:00 via iPhone |
4 whileFalse 2017-04-24 21:57:05 +08:00 脑洞不错。 |
5 yangyanggnu 2017-04-24 21:59:57 +08:00 command injection :p |
6 ryd994 2017-04-24 23:06:07 +08:00 via Android 这该算重新发明 CGI 么……… |
7 Tink PRO 这个还挺好玩的,能方便不少 |
8 sunjourney 2017-04-25 09:04:38 +08:00 说好的 shell 呢 |
9 Tink PRO 最好能一个进程实现多个 shell commands 就好了 |
10 gyorou 2017-04-25 15:17:13 +08:00 突然发现, CGI 原来已经是 20 多年前的东西了。。。 |
11 mingyun 2017-07-08 21:29:53 +08:00 记得好像有个 Python 版的 httpbin |