发现了tonyenc_encode函数

文章插图
百度搜索这个是啥:
- 一个简洁、高性能、跨平台的 PHP7 代码加密扩展,当前版本为 0.2.2
- 就是对PHP7的代码进行加密的函数
GitHub - lihancong/tonyenc: 高性能、跨平台的 PHP7 代码加密扩展 (A high performance and cross-platform encrypt extension for PHP source code)
编译前请在 core.h 中做如下修改:
/* 这里定制你的加密特征头,不限长度,十六进制哦 */const u_char tonyenc_header[] = {0x66, 0x88, 0xff, 0x4f,0x68, 0x86, 0x00, 0x56,0x11, 0x16, 0x16, 0x18,};/* 这里指定密钥,长一些更安全 */const u_char tonyenc_key[] = {0x9f, 0x49, 0x52, 0x00,0x58, 0x9f, 0xff, 0x21,0x3e, 0xfe, 0xea, 0xfa,0xa6, 0x33, 0xf3, 0xc6,};
在IDA中找到对应的加密头和key
文章插图
根据github源码写解密py脚本
import base64header=[0x66, 0x88, 0xff, 0x4f,0x68, 0x86, 0x00, 0x56,0x11, 0x61, 0x16, 0x18,]key=[0x9f, 0x58, 0x54, 0x00,0x58, 0x9f, 0xff, 0x23,0x8e, 0xfe, 0xea, 0xfa,0xa6, 0x35, 0xf3, 0xc6]def decode(data,len):p =0for i in range(0,len):if (i & 1):p += key[p] + i;p %= 16;t = key[p];data[i] = ~data[i]^t;if data[i] < 0:data[i]=data[i]+256decode = "".join([chr(c) for c in data])return decodeencodefile=open('backdoor.php',"rb")base64_encodestr=base64.b64encode(encodefile.read())convert=[c for c in base64.b64decode(base64_encodestr)]del convert[0:len(header)]print(str(decode(convert,len(convert))))
解密得到backdoor.php文件内容为[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gEwEUhZ0-1667461598351)(F:/%E7%AC%94%E8%AE%B0%E5%9B%BE%E7%89%87/image-20221103154452619.png)]

文章插图
经验总结扩展阅读
- 2023年最幸福的星座情侣 无法抵抗的吸引力
- 哪些星座女生无法抵挡制服诱惑
- 12月坠入甜蜜爱情中无法自拔的3星座 完美邂逅良缘
- 电脑无法启动开不了机怎么办(电脑能正常启动但是无法进入系统)
- 电脑无法开机进不了系统怎么解决(win10开机后假死黑屏)
- windows启动不了开不了机怎么办(笔记本无法启动windows)
- 在爱情中让人无法错过的三大星座女
- 日久不生情,即使陪伴再久也无法相爱的星座
- 大S 爆具俊晔打包回韩国,称无法满足大S,已与前女友蔡妍打得火热
- 失恋后,无法从前任阴影中走出的星座