Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

UCH WAP插件

[复制链接]
16BOX 发表于 2009-4-17 01:11:19 | 显示全部楼层
I was looking through a PHP web attack toolkit yesterday and found one of the scripts was obfuscated in an attempt to prevent others from figuring out what the code does. In short, the obfuscation worked by decoded a long base64 encoded string, applying some modifications to each letter based on where it was, and then executing the final output (thru an eval command).

No problem, I thought. There are three options to decode this:

1. Figure out what the code is doing and write a translation program. Nah, too long.
2. Modify the source for PHP itself to print any eval statements to a file. Hmmmm...maybe, but not now.
3. Add a print statement to the obfuscated script to print out the unobfuscated code instead of eval'ing it. Yep...easy.

So I changed the eval statement to a print and ran the PHP code. Nothing.

After ensuring my PHP wasn't borked I decided something was going on and I needed to look at the code. After a few minutes, I found the following:

$file = __FILE__;
$file = file_get_contents($file);
$var8 = 0;

preg_match(base64_decode("LyhwcmludHxzcHJpbnR8ZWNobykv"), $file, $var8);


for (;$interator_1<$enc_str_len;) {
if (count($var8)) exit;

Note that the for loop is the loop to decode each character of the PHP code.

This is a nice little anti-analysis function. First, it grabs the contents of itself in the first two lines. Then, it initializes $var8 to 0. Next, it looks for a regular expression in the contents of the current file, setting $var8 to the number of occurences found. The regular expression is a base64 encoded string. What does it decode to?

/(print|sprint|echo)/

So, its looking for any occurence of print, sprint or echo within the file. Then, in the decoding loop, if any occurences ($var8 > 0) are present the program exits. Simple technique to make analysis more difficult.

Of course, its pretty easy to bypass as well. :)
回复

使用道具 举报

 楼主| scckfzx 发表于 2009-4-17 02:24:08 | 显示全部楼层
I was looking through a PHP web attack toolkit yesterday and found one of the scripts was obfuscated in an attempt to prevent others from figuring out what the code does. In short, the obfuscation wor ...
16BOX 发表于 2009-4-17 01:11

((em:13))
回复

使用道具 举报

mrsaner 发表于 2009-4-17 07:07:55 | 显示全部楼层
((em:12))俺们就不用。。。
官方wap期待中。。。
回复

使用道具 举报

西北同乡网 发表于 2009-4-17 08:16:06 | 显示全部楼层
回复

使用道具 举报

zoumei.com 发表于 2009-4-17 10:48:44 | 显示全部楼层
((em:04))此插件又不共享又不出售,不等于废话嘛。。。。。。。
回复

使用道具 举报

huaclub 发表于 2009-4-25 01:49:45 | 显示全部楼层
自己做一个
回复

使用道具 举报

nihao9129 发表于 2009-4-25 01:57:32 | 显示全部楼层
什么东东啊
回复

使用道具 举报

mywenhua 发表于 2009-4-25 04:13:40 | 显示全部楼层
还商业呢,免费的都出来了
回复

使用道具 举报

heye521 发表于 2009-4-25 04:25:24 | 显示全部楼层
没用   路过
回复

使用道具 举报

morecrazy 发表于 2009-4-29 18:30:58 | 显示全部楼层
官方下一个版本就有WAP 了 谁会冒险用你的收费插件?  呵呵~
king88 发表于 2009-2-14 19:17


何时???何时???
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-13 07:50 , Processed in 0.120891 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表