[ Bouncer @ 30.09.2006. 23:16 ] @
Code: # Madness v.01 - Simple file fuzzer # Coded by Sytwer import md5 import os import random from mmap import mmap file = ('some_file') # Change this to name of the file you want to fuzz. You can place raw_input here. file_mod = open(file, 'r+b') hash = md5.new() file_hash = file_mod.read() length = os.path.getsize(file) random_fuzz = random.randint(0, 100000) # Picks random number to for maping loop. You can disable it if you wish to run fuzzer just once.Therefore only one change will be made inside of file. byte_random_one = random.randint(0, length) byte_random_two = random.randint(0, length) def file_maping(): maping = mmap(file_mod.fileno(),0) maping[byte_random_one], maping[byte_random_two] = maping[byte_random_two], maping[byte_random_one] maping.close() x = file_maping() for x in range(1, random_fuzz): print 'Fuzzing file -', file hash.update(file_hash) # Informs us about changes inside of file. print 'File hash is -', hash.hexdigest() # Without this fuzzer won't be elite enough :) print '\n' file_maping() file_mod.close() print 'Fuzzing done.' print '\n' Madness v.01 - Simple file fuzzer. Dakle moy prvi program opcenito i prvi fuzzer naravno. Napisa san ga da bi testira jedan program. Ovo bi se mozda dalo i izminit po potrebama, napisat drukcije il bolje te mozda nadogradit opcijama i funkcijama al ima vrimena i za to. Naravno planiran dodat jos brdo toga al s vrimenom. Uzmimo u obzir da sam tek pocea. Fuzzer random odabere 2 byte-a unutar file-a i zamjeni im mista takodjer random odabranima byte-ovima unutar istog file-a. Buduce verzije ovog fuzzera moc ce kreirat nove file-ove i zapisat promjene u njih te pokrenit iste. Planiran dodat i opcie koje ce po extenziji modificirat fajlove svaki na drugi nacin ovisno o file formatu te dodavat neke random odabrane karaktere u file. Samim tim potencijal za otkrivanje bugova bit ce veci. Komentirajte po volji. [Ovu poruku je menjao Bouncer dana 01.10.2006. u 02:24 GMT+1] [Ovu poruku je menjao Bouncer dana 01.10.2006. u 02:24 GMT+1] |