Dearamaze
Dearamaze
## 比如: curl%0a1.1.1.1 利用%0a可以绕过命令注入校验!!! ## 正确的解决方案 https://github.com/alessio/shellescape/blob/master/shellescape.go https://pkg.go.dev/github.com/alessio/shellescape#example-Quote ## 过程中的其他思考: 参考PHP中的防范命令注入的两个函数。 PHP对于命令注入漏洞提供了escapeshellarg()和escapeshellcmd()两个函数来进行防御,当然两者针对的场景有区别。 ### escapeshellarg 主要是为了防止用户的输入逃逸出“参数值”的位置,变成一个“参数选项”。 处理过程:如果输入内容不包含单引号,则直接对输入的字符串添加一对单引号括起来;如果输入内容包含单引号,则先对该单引号进行转义,再对剩余部分字符串添加相应对数的单引号括起来。 场景功能: > 1.确保用户只传递一个参数给命令 > 2.用户不能指定更多的参数一个 > 3.用户不能执行不同的命令 ### escapeshellcmd 主要是防止用户利用shell的一些技巧(如分号、管道符、反引号等)来进行命令注入攻击。 处理过程:如果输入内容中 ``` &#;`|*?~^()[]{}$\, \x0A...
Request Method: | GET -- | -- http://127.0.0.1:8000/ 1.9.6 NoReverseMatch u'account' is not a registered namespace /home/dl/code/xm/OJ_PY_ENV/lib/python2.7/site-packages/django/core/urlresolvers.py in reverse, line 596 /home/dl/code/xm/OJ_PY_ENV/bin/python 2.7.13 ['/home/dl/code/py/test/test_niji', '/home/dl/code/xm/OJ_PY_ENV/lib/python27.zip', '/home/dl/code/xm/OJ_PY_ENV/lib64/python2.7', '/home/dl/code/xm/OJ_PY_ENV/lib64/python2.7/plat-linux2', '/home/dl/code/xm/OJ_PY_ENV/lib64/python2.7/lib-tk', '/home/dl/code/xm/OJ_PY_ENV/lib64/python2.7/lib-old', '/home/dl/code/xm/OJ_PY_ENV/lib64/python2.7/lib-dynload',...