From 02b9908f71441e13150fdd0476d3ac9c14833b90 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Sun, 21 Mar 2021 15:06:57 +1100 Subject: [PATCH] Retire old developer scripts. --- devel/fuzz.sh | 7 ------- devel/fuzz_make_safe_uri.c | 25 ----------------------- torture.py | 41 -------------------------------------- 3 files changed, 73 deletions(-) delete mode 100755 devel/fuzz.sh delete mode 100644 devel/fuzz_make_safe_uri.c delete mode 100755 torture.py diff --git a/devel/fuzz.sh b/devel/fuzz.sh deleted file mode 100755 index 649d2dd..0000000 --- a/devel/fuzz.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e -AFL_PATH=~/afl/afl-1.06b -export AFL_PATH -TMP=/dev/shm/darkhttpd -AFL_HARDEN=1 $AFL_PATH/afl-gcc -O3 -DDEBUG fuzz_make_safe_uri.c -o fuzz_make_safe_uri -mkdir $TMP -$AFL_PATH/afl-fuzz -i fuzz_testcases -o $TMP ./fuzz_make_safe_uri diff --git a/devel/fuzz_make_safe_uri.c b/devel/fuzz_make_safe_uri.c deleted file mode 100644 index b2c7ea8..0000000 --- a/devel/fuzz_make_safe_uri.c +++ /dev/null @@ -1,25 +0,0 @@ -// Wrapper around make_safe_url() for fuzzing. -// Aborts if the output is deemed safe but contains /../ or /./ -#include - -#define main _main_disabled_ -#include "../darkhttpd.c" -#undef main - -int main(void) { - char *buf = NULL; - size_t len = 0; - ssize_t num_read = getline(&buf, &len, stdin); - if (num_read == -1) return 1; - int l = strlen(buf); - if (l > 0) { - buf[l-1] = '\0'; - } - char* safe = make_safe_url(buf); - if (safe) { - if (strstr(safe, "/../") != NULL) abort(); - if (strstr(safe, "/./") != NULL) abort(); - } - return 0; -} -/* vim:set ts=4 sw=4 sts=4 expandtab tw=78: */ diff --git a/torture.py b/torture.py deleted file mode 100755 index 1e9f726..0000000 --- a/torture.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -import sys, socket - -request = ( -'GET /darkhttpd.c HTTP/1.0\r\n' -'\r\n' -) - -s = socket.socket() -s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) -s.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1) -#s.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1) -#^ for some reason, this un-cripples the receiving buffer -try: - s.connect(("", 8089)) -except socket.error, e: - print "ERROR: darkhttpd not running?" - print "Run: cd trunk && ./darkhttpd . --port 8089" - print "" - raise e - -print "(start sending)" - -for i in request: - numsent = s.send(i) - if numsent != 1: - raise Exception, "couldn't send" - sys.stdout.write(i) - sys.stdout.flush() - -print "(done sending - start receiving)" - -while True: - c = s.recv(1) - if c == '': - print "(done receiving)" - break - sys.stdout.write(c) - sys.stdout.flush() - -# vim:set sw=4 ts=4 et tw=78: