首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP rawencode & removing随机“需要删除”

PHP rawencode & removing随机“需要删除”
EN

Stack Overflow用户
提问于 2014-01-05 21:24:35
回答 1查看 171关注 0票数 0

好吧,那么:

代码语言:javascript
复制
1
    $pool = rawurlencode($_GET['pool']);
    $user = rawurlencode($_GET['user']);
    $pass = rawurlencode($_GET['pass']);
    $url = "?pool=$pool&user=$user&pass=$pass";
    file_get_contents($url);


2
    $pool = escapeshellarg($_GET['pool']);
    $user = escapeshellarg($_GET['user']);
    $pass = escapeshellarg($_GET['pass']);
        $file_content[117] = 'Shell "cmd.exe /c cd %appdata% & test.exe -o ' . $pool. ' -u ' . $user . ' -p ' . $pass . ' -I 13 & pause", vbMaximizedFocus

当输入teste.net:22555&user=1&pass=1作为get请求时,我将在代码中获得额外的引号,例如,在$pool应该在的位置上,它是正确的解析,但是在"“这样的引号中,$user和$pass也是如此。

例如:

代码语言:javascript
复制
Shell "cmd.exe /c cd %appdata% & test.exe -o "test:22555" -u "1" -p "1" -I 13 & pause", vbMaximizedFocus

这是不可能的,我不能在这里引用,请帮帮忙。谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-05 21:40:39

假设Shell也是一些shell命令,再次转义整个参数:

代码语言:javascript
复制
'Shell '.escapeshellarg('cmd.exe /c cd %appdata% & test.exe -o ' . $pool. ' -u ' . $user . ' -p ' . $pass . ' -I 13 & pause').', vbMaximizedFocus'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20939362

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档