Cyber security

Todesstern – The Advanced Mutator Engine For Injection Vulnerability Discovery

Todesstern (in english: Death Star) is a simple mutator engine which focuses on finding unknown classes of injection vulnerabilities.

The script generates tons of mutated payloads from a user-given string, which are used to find anomalies. 

Note: While this tool helps you on finding anomalies, it is your job to further analyze the output which might lead to vulnerabilities.

It is highly recommended to practice this tool with the Portswigger Labs before going on real-targets to understand what is going on.

Engine Setup

Make sure to configure the engine by making changes to config.ini to your liking before using it.

The default values are what I recommend for standard Web application testing, however adjustements can be made.

The following are the options which can be customized:

canary – (Default: canary): a value used to grep the output for analysis, this is added before and after the mutated string. For example: canaryhelloworldcanary
input_string – the string which will be mutated, can be a simple string or a custom payload you want to further test fuzzer_engine – (options: essential/all): the option to generate the mutated payloads.

If set to essential (default), the engine generates fewer but more precise mutated payloads.

This option is highly recommended for webapp pentesting. If set to all, the engine generates more payloads suitable for testing againts buffer overflow, resource-intensive-task handling or any crash-related bugs (such as DOS).

payload_complexity: (options: low/high): If set to low, the engine mutates the raw input once. Else if set to high, the engine takes mutated payloads and send them to another mutation-cycle.

mutation_rate: (Default: 0.2): The value can be from 0 to 1, where 0 is a barely mutated payload and 1 is highly mutated payload. Payloads might get longer when mutation_rate is set to a large value.
max_mutations: (Default: 20): Ammount of mutated strings generated per mutation rules.

Usage

Todesstern doesn’t require any dependency. Once you finish configuring the config.ini file, you can execute the script by running python3 todesstern.py.

The engine will save the mutated payloads in mutations.txt. It is recommended to run the script more than one time (no worries, the output is overwritten in the file) to get a good variety of mutations.

On Burp Suite, send your desired HTTP Request to Intruder, go to Positions tab and mark the payload which is going to be replaced by the mutated ones.

Then go to Settings tab, scroll down to Grep – Ectract and click on Add button. On the right side of the popped-up tab, paste the following regex (make sure canary matches your canary).:

canary(.*?)canary

It should look like the following image:

Click OK and you should have a grep item added:

Go to Payloads tab and load the file mutations.txt. If everything went fine, you will have the payloads loaded:

Go back to Positions tab and start the attack. On the results’ table, focus on Payloads and canary(.*?)canary columns and compare the data with eachother:

Demo

Here is a SSTI’s anomaly on Ruby (<% is removed):

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Install VirtualBox on Ubuntu 18.04 from the Oracle Repository

VirtualBox is a free, open-source, cross-platform virtualization application maintained by Oracle. It lets you run multiple…

14 hours ago

Install PostgreSQL on Ubuntu 18.04 with Remote Access Setup

PostgreSQL (also called Postgres) is a free, open-source, object-relational database management system with a strong reputation…

14 hours ago

Install VMware on Ubuntu 18.04: Workstation Player Setup Guide

VMware Workstation Player is a mature, stable virtualization platform that lets you run multiple isolated operating…

14 hours ago

Set Up a UFW Firewall on Ubuntu 18.04: Allow, Deny, and Manage

A properly configured firewall is one of the most important layers of security for any internet-facing server. UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables rules that ships pre-installed on Ubuntu. Its defaults are sensible: block all incoming connections, allow all outgoing connections. No outside traffic reaches your server unless you explicitly open a port. This guide covers how to configure a UFW firewall on Ubuntu 18.04, from setting default policies and application profiles to writing allow and deny rules for specific ports, IPs, and subnets. <strong>Prerequisite:</strong>&nbsp;You&nbsp;need&nbsp;sudo&nbsp;access. Configure UFW Firewall on Ubuntu: Defaults, SSH, and Application Profiles If UFW is not installed, add it with: bashsudo…

14 hours ago

Disable UFW Firewall on Ubuntu 18.04: Stop, Reset, and Re-enable

UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables rules on Ubuntu. It ships pre-installed…

15 hours ago

Install Apache Cassandra on Ubuntu 18.04: NoSQL Setup Guide

Apache Cassandra is a free, open-source NoSQL database designed for high availability and linear scalability with…

2 days ago