-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add payload/linux/x64/set_hostname module. #20334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add payload/linux/x64/set_hostname module. #20334
Conversation
This payload sets the hostname of a Linux x64 machine by using the sethostname syscall.
…inux_x64 Rewrites shellcode to smaller size, rubocopes
Sorry about that, can you merge this as well? We need to update specs for tests to be passing. |
Of course I can. I'll add the exit syscall as soon as I am home. Thanks. |
pop rdi ; rdi points to the hostname string. | ||
xor byte [rdi+rsi], 0x41 | ||
syscall | ||
ret ; break the loop by causing segfault. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot to add exit
ret ; break the loop by causing segfault. | |
push 0x3c | |
pop rax | |
xor rdi, rdi | |
inc rdi | |
syscall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think exit(0) is better than exit(1)
Release NotesAdds a new payload module for invoking the |
This payload sets the hostname of a Linux x64 machine by using the sethostname syscall. It requires root privileges.
Verification
List the steps needed to make sure this thing works
msfconsole
use payload/linux/x64/set_hostname
HOSTNAME
option as desired.generate
to produce the payload.