-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
786 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,4 @@ coverage.xml | |
docs/_build/ | ||
target/ | ||
site | ||
tests/bins | ||
tests/pylint*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
CC = gcc | ||
DEBUG = 1 | ||
CFLAGS += -Wall | ||
SOURCES = $(wildcard *.c) | ||
COMPILED = $(SOURCES:.c=.o) | ||
LINKED = $(SOURCES:.c=.out) | ||
LDFLAGS = | ||
EXTRA_FLAGS = | ||
|
||
ifeq ($(TARGET), x86) | ||
CFLAGS += -m32 | ||
endif | ||
|
||
ifeq ($(DEBUG), 1) | ||
CFLAGS += -DDEBUG=1 -ggdb -O0 | ||
else | ||
CFLAGS += -O1 | ||
endif | ||
|
||
|
||
.PHONY : all clean | ||
|
||
all: $(LINKED) | ||
|
||
|
||
%.out : %.c | ||
@echo "[+] Linking C file '$@'" | ||
@$(CC) $(CFLAGS) $(EXTRA_FLAGS) -o $@ $? $(LDFLAGS) | ||
|
||
clean : | ||
@echo "[+] Cleaning stuff" | ||
@rm -f $(COMPILED) $(LINKED) | ||
|
||
checksec-no-canary.out: EXTRA_FLAGS := -fno-stack-protector | ||
|
||
checksec-no-pie.out: EXTRA_FLAGS := -fno-pie | ||
|
||
checksec-no-nx.out: EXTRA_FLAGS := -z execstack | ||
|
||
pattern.out: EXTRA_FLAGS := -D_FORTIFY_SOURCE=0 -fno-stack-protector | ||
|
||
canary.out: EXTRA_FLAGS := -fstack-protector-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* canary.c | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <string.h> | ||
|
||
|
||
void greetz(char* buf) | ||
{ | ||
char name[8] = {0,}; | ||
strcpy(name, buf); | ||
printf("Hello %s\n", name); | ||
} | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
if(argc < 2) | ||
return EXIT_FAILURE; | ||
|
||
greetz(argv[1]); | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
* | ||
* checksec-no-canary.c | ||
* | ||
* @author: @_hugsy_ | ||
* @licence: WTFPL v.2 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
* | ||
* checksec-no-canary.c | ||
* | ||
* @author: @_hugsy_ | ||
* @licence: WTFPL v.2 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
* | ||
* checksec-no-pie.c | ||
* | ||
* @author: @_hugsy_ | ||
* @licence: WTFPL v.2 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* bof.c | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <string.h> | ||
|
||
|
||
void greetz(char* buf) | ||
{ | ||
char name[256] = {0,}; | ||
strcpy(name, buf); | ||
printf("Hello"); | ||
printf(name); | ||
printf("\n"); | ||
} | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
if(argc < 2) | ||
return EXIT_FAILURE; | ||
|
||
greetz(argv[1]); | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
* | ||
* heap.c | ||
* | ||
* @author: @_hugsy_ | ||
* @licence: WTFPL v.2 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
void* p1 = malloc(0x10); | ||
void* p2 = malloc(0x10); | ||
void* p3 = malloc(0x10); | ||
free(p2); | ||
__asm__ volatile("int3;" : : : ); | ||
(void)p1; | ||
(void)p3; | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
* | ||
* heap.c | ||
* | ||
* @author: @_hugsy_ | ||
* @licence: WTFPL v.2 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
void* p1 = malloc(0x10); | ||
__asm__ volatile("int3;" : : : ); | ||
(void)p1; | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* pattern.c | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <string.h> | ||
|
||
|
||
void greetz(char* buf) | ||
{ | ||
char name[8] = {0,}; | ||
strcpy(name, buf); | ||
printf("Hello %s\n", name); | ||
} | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
if(argc < 2) | ||
return EXIT_FAILURE; | ||
|
||
greetz(argv[1]); | ||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* -*- mode: c -*- | ||
* -*- coding: utf-8 -*- | ||
* | ||
* retdec.c | ||
* | ||
* @author: @_hugsy_ | ||
* @licence: WTFPL v.2 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
|
||
int main(int argc, char** argv, char** envp) | ||
{ | ||
printf("Hello World!\n"); | ||
return EXIT_SUCCESS; | ||
} |
Oops, something went wrong.