Browse Source

Fix problem with makefile

master
Ryan T. Stewart - stewarrt 2 years ago
parent
commit
ea6df5efab
  1. BIN
      debug
  2. 4
      exploit_scanf.c
  3. 9
      makefile

BIN
debug

4
exploit_scanf.c

@ -1,8 +1,8 @@
// Created by Graham Northup
// https://gist.github.com/Grissess/e533a2dcc493a6ac8528c4eeeaf6755a
//
// Compile with gcc -fPIC -shared -o exploit_scanf.so exploit_scanf.c
// Run with LD_PRELOAD=./exploit_scanf.so ./number_guesser
// Compile with gcc -ldl -fPIC -shared -o exploit_scanf.so exploit_scanf.c
// Run with LD_PRELOAD=./exploit_scanf.so ./guess
#define _GNU_SOURCE

9
makefile

@ -1,22 +1,21 @@
CC=gcc
CFLAGS=-I
OBJ = number_guesser.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $<
debug: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) -g
$(CC) -o $@ $^ -g
guess: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS)
$(CC) -o $@ $^
evil: guess
$(CC) -shared -fPIC evil_random.c -o evil_random.so
LD_PRELOAD="$(PWD)/evil_random.so" ./guess
exploit: guess
gcc -fPIC -shared -o exploit_scanf.so exploit_scanf.c
gcc -ldl -fPIC -shared -o exploit_scanf.so exploit_scanf.c
LD_PRELOAD=$(PWD)/exploit_scanf.so ./guess
shim: guess

Loading…
Cancel
Save