GitXplorerGitXplorer
c

ashnazg

public
5 stars
0 forks
3 issues

Commits

List of commits on branch master.
Unverified
b02b121ad34839388573d3ecd553a1b893755f4e

Specify explicitly version of dorat to pull.

ccwgreene committed 3 months ago
Unverified
b1b34b37078908c2ca505edf057dadd1c2d5ccb4

Fix docker config.

ccwgreene committed 3 months ago
Unverified
ea02052245ad8515bec31ce42117f68f584cb612

Roll back ghidra to ghidra_10.3.2_PUBLIC

ccwgreene committed 3 months ago
Unverified
6f6113d5e6bc6d702bb9071fa3bd8e636cd2bb01

Update docker json file.

ccwgreene committed 4 months ago
Unverified
b4098652faaa34bfc6c922de2c180195b7ed8f9e

Fix test to check if length > 0 rather than None

ccwgreene committed 4 months ago
Unverified
3c31e75368f27b6a4b55a109871e306bc9e6ade1

Fix docker file.

ccwgreene committed 4 months ago

README

The README file for this repository.
Ash nazg durbatulûk, ash nazg gimbatul,
ash nazg thrakatulûk agh burzum-ishi krimpatul.

Ashnazg

Ashnazg is a library and tool for developing binary exploits. It brings together a number of different tools, Ghidra, dorat, ROPgadget, pwntools, angr, smrop, and binds them together to pop shells.

Install

The docker file should contain all steps needed to get ashnazg running. If you want to set this up outside of docker, then the dependencies for ubuntu are there, along with the black magic invocations for making lldb work with python on ubuntu.

Once running, you can run pytest.

Testing

Run pytest -vvv Run pytest -vvv -n auto

Example

Ashnazg is intended to make it possible to describe exploits at a high level.

import ashnazg

from ashnazg.assumptions import *

nazg = ashnazg.Ashnazg(binary="./target", libc="./libc.so.6")

# find a vulnerable function
vuln = list(nazg.find_vulnerable_functions())[0]
print(vuln.type) # says 'GETS' vulnerability

# begin exploit
conn = nazg.connect()

# get the program to the vulnerable function
# input.
conn.navigate(vuln.addr)

# 'GETS' vulnerability can be applied immediately if
# Binary is neither PIE nor canary. This is
# automatically detected, but we explicitly assume
# it here.
conn.exploit(vuln, assume=[NO_PIE, NO_CANARY])

# you have a shell
conn.interactive()

Demos

Old version (before auto prefix handling)

Fully exploitable corctf demo

More verbose demo:

Setting up Virtual Env

lldb seems to be a bit of a problem. It can't be installed via pip, so you probably need to link to your system's install via a symlink instead. Blech.