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
Post-exploitation exploitation #611
Conversation
This commit is the main infrastructure needed to run exploits in a local context, gluing the Exploit and Post module classes together.
Tested on Ubuntu with nmap 6.00 and nmap 5.00
This can currently build an executable that creates a socket, opens a temporary file, truncates that file with ftruncate(2) and calls sendfile. Still needs to mmap NULL and figure out ring0 shellcode. Baby steps.
Something is still broken, my socket() is returning EAFNOSUPPORT whereas what looks like the same syscall in wunderbar_emporium's exploit.c is returning a socket. Similarly, my __mmap2() is returning EFAULT when trying to map anything, not just NULL.
Unfortunately, adds a dep on bionic for runtime compilation. Gets ring0, sets the (res)uid to 0 and jumps to the payload. Still some payload issues because linux stagers don't mprotect(2) the buffer they read(2) into. Single payloads work fine, though. Also cleans up and improves local exploits' ability to compile C. [SEERM rapid7#3038]
/rapid7/metasploit-framework/modules/exploits/windows/local/ms10_092_schelevator.rb:18: warning: toplevel constant File referenced by Msf::Post::File |
Not seeing this with any of the rubies I've tried. |
Both thelightcosine and I are on OSX, I wonder if that has anything to do with this error:
|
My Ubuntu using ruby 1.9.3p0 (r33570) doesn't have this problem. |
The File use needs to be qualified (::File) or it conflicts with relative class name |
@hmoore-r7 : It's not |
This branch contains all the infrastructure necessary for running local privilege escalation exploits. There are three modules to show off usage: setuid_nmap is a unix command execution, sock_sendpage is a linux kernel null dereference which requires compiling an elf, and ms10_092_schelevator is a direct port of the existing post module by jduck.