Module: Msf::Payload::Linux::Ppc::Prepends

Includes:
Msf::Payload::Linux::Prepends
Defined in:
lib/msf/core/payload/linux/ppc/prepends.rb

Overview

Linux ppc prepends

Instance Method Summary collapse

Methods included from Msf::Payload::Linux::Prepends

#apply_prepends, #initialize, #register_prepend_options

Instance Method Details

#appends_mapObject



66
67
68
69
70
71
72
73
74
# File 'lib/msf/core/payload/linux/ppc/prepends.rb', line 66

def appends_map
  {
    # exit(0)
    'AppendExit' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\x02" + #   addi    r0,r31,-510                #
      "\x44\xff\xff\x02" #   sc                                 #
  }
end

#appends_orderObject



11
12
13
# File 'lib/msf/core/payload/linux/ppc/prepends.rb', line 11

def appends_order
  %w[AppendExit]
end

#prepends_mapObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/msf/core/payload/linux/ppc/prepends.rb', line 15

def prepends_map
  {
    # 'PrependFork' =>  "",

    # setresuid(0, 0, 0)
    'PrependSetresuid' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\xa5\x2a\x78" + #   xor     r5,r5,r5                   #
      "\x7c\x84\x22\x78" + #   xor     r4,r4,r4                   #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\xa5" + #   addi    r0,r31,-347                #
      "\x44\xff\xff\x02", #   sc                                 #

    # setreuid(0, 0)
    'PrependSetreuid' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\x84\x22\x78" + #   xor     r4,r4,r4                   #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\x47" + #   addi    r0,r31,-441                #
      "\x44\xff\xff\x02", #   sc                                 #

    # setuid(0)
    'PrependSetuid' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\x18" + #   addi    r0,r31,-488                #
      "\x44\xff\xff\x02", #   sc                                 #

    # setresgid(0, 0, 0)
    'PrependSetresgid' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\xa5\x2a\x78" + #   xor     r5,r5,r5                   #
      "\x7c\x84\x22\x78" + #   xor     r4,r4,r4                   #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\xab" + #   addi    r0,r31,-341                #
      "\x44\xff\xff\x02", #   sc                                 #

    # setregid(0, 0)
    'PrependSetregid' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\x84\x22\x78" + #   xor     r4,r4,r4                   #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\x48" + #   addi    r0,r31,-440                #
      "\x44\xff\xff\x02", #   sc                                 #

    # setgid(0)
    'PrependSetgid' => "\x3b\xe0\x01\xff" + #   li      r31,511                    #
      "\x7c\x63\x1a\x78" + #   xor     r3,r3,r3                   #
      "\x38\x1f\xfe\x2f" + #   addi    r0,r31,-465                #
      "\x44\xff\xff\x02" #   sc                                 #

    # setreuid(0, 0) = break chroot
    # 'PrependChrootBreak' =>
  }
end

#prepends_orderObject



7
8
9
# File 'lib/msf/core/payload/linux/ppc/prepends.rb', line 7

def prepends_order
  %w[PrependSetresuid PrependSetreuid PrependSetuid PrependSetresgid PrependSetregid PrependSetgid]
end