mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Retire old developer scripts.
This commit is contained in:
parent
81b491e60a
commit
02b9908f71
@ -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
|
@ -1,25 +0,0 @@
|
||||
// Wrapper around make_safe_url() for fuzzing.
|
||||
// Aborts if the output is deemed safe but contains /../ or /./
|
||||
#include <stdio.h>
|
||||
|
||||
#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: */
|
41
torture.py
41
torture.py
@ -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:
|
Loading…
Reference in New Issue
Block a user