soffensive blog

make and makefile

I am a C/C++ newbie, but occassionally I have to compile or build projects. Since make (and Makefiles) are quite prevalent and sometimes they have to be adjusted due to potential errors, I had to learn more about them and want to share my learning publicly here.

Building Blocks

First of all, what are the involved building blocks of make and Makefiles?

  • make:
    • The GNU make utility. This is the executable that you actually run in order to execute a series of commands in order to modify files, typically compiling programs.
    • If you run the program without specifying an explicit input file with the -f option, make will look for the makefiles GNUmakefile, makefile, and Makefile, in that order.
    • make updates a target if it depends on prerequisite files that have been modified since the target was last modified, or if the target does not exist.
  • makefile:
    • This is the input file for the make utility and consists of a series of instructions how to modify files.
    • A makefile can contain one or more rules.
  • rule:
    • A rule consists of one or more targets, prerequisites and commands.
  • target:
    • A target is a file name and typically, there is only one per rule.
  • prerequisite:
    • The prerequisites are file names, separated by spaces. These files need to exist before the commands for the target are run. These are also called dependencies.
  • command:
    • The commands are a series of steps typically to make the target. They need to start with a tab character, not spaces.

The general format of a Makefile is as follows:

XXE with .NET in 2019

After the seminal blog post by James Jardine in 2016 on XXE exploitation in .NET applications back in 2016, Microsoft seems to have implemented some additional changes regarding the default behavior of XML parsers.

We work through the different XML methods provided and their corresponding vulnerable configurations. For all experiments, .NET framework 4.6 was chosen.

TL;DR

In order to create an XXE vulnerability for applications using .NET framework 4.6+, you have to instantiate a vulnerable XmlResolver beforehand.

Exploiting Blind File Reads / Path Traversal Vulnerabilities on Microsoft Windows Operating Systems

In a recent engagement I was confronted with a blind path traversal vulnerability on a server running with the Microsoft Windows operating system. That is, it was not possible to display folder contents but the complete file name and path had to be guessed. Due to the lack of a comprehensive website I was forced to gather information from various different sources.

In this blog post, I want to summarize my findings and focus on the exploitation of  this kind of vulnerability.