Skip to content
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

Merged
merged 17 commits into from Jul 17, 2012
Merged

Conversation

jlee-r7
Copy link
Contributor

@jlee-r7 jlee-r7 commented Jul 16, 2012

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.

egypt added 16 commits June 12, 2012 23:58
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]
@thelightcosine
Copy link

/rapid7/metasploit-framework/modules/exploits/windows/local/ms10_092_schelevator.rb:18: warning: toplevel constant File referenced by Msf::Post::File
[-] WARNING! The following modules could not be loaded!
[-] /rapid7/metasploit-framework/modules/exploits/windows/local/ms10_092_schelevator.rb: TypeError wrong argument type Class (expected Module)

@jlee-r7
Copy link
Contributor Author

jlee-r7 commented Jul 16, 2012

Not seeing this with any of the rubies I've tried.

@wchen-r7
Copy link
Contributor

Both thelightcosine and I are on OSX, I wonder if that has anything to do with this error:

mbp:msf sinn3r$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
mbp:msf sinn3r$ msfconsole -q
/ph33r/msf/modules/exploits/windows/local/ms10_092_schelevator.rb:18: warning: toplevel constant File referenced by Msf::Post::File
[-] WARNING! The following modules could not be loaded!
[-]     /ph33r/msf/modules/exploits/windows/local/ms10_092_schelevator.rb: TypeError wrong argument type Class (expected Module)
msf >

@wchen-r7
Copy link
Contributor

My Ubuntu using ruby 1.9.3p0 (r33570) doesn't have this problem.

@hdm
Copy link
Contributor

hdm commented Jul 17, 2012

The File use needs to be qualified (::File) or it conflicts with relative class name

@jlee-r7
Copy link
Contributor Author

jlee-r7 commented Jul 17, 2012

@hmoore-r7 : It's not File, it's Msf::Post::File

@wchen-r7 wchen-r7 merged commit 6b0196e into rapid7:master Jul 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants