Pages

08 November 2012

Simple fuzzer.py


#!/usr/bin/python

import random

def randomfunc(length, allthecrap):
    randomstuff = ""
    for number in range(1,length + 1):
        randomthing = random.choice(allthecrap)
        randomstuff += randomthing
        if number == length:
     crud = open("crud.txt", "w")
     crud.write(randomstuff)
     crud.close()

def choices():
    length = int(raw_input("Enter the length: "))
    allthecrap = u"""ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&*()_-<>/\:;,.`'"[]{}|"""
    randomfunc(length, allthecrap)

choices()

0 comments: