in reply to Experimental sprintf overflow bug detector
As requested by diotalevi I attempted to write a script that utilized this in order to automatically check the perl libraries.
It did not work out the way I wanted, heck I can't seem to figure out how his script works. Here is the code, I sincerely hope someone else can make something useful out of it. Yes I really don't know what I am doing. This is yet over my head.
It searches @INC and generates a nice list of .pl .pm and .cgi files.
-- Detonite#!/usr/bin/perl ###################################################################### +# # # Harness to test to automate earching for sprintf() bug exploit # opportunities in core and CPAN modules, see PM node 513527 # Written on 02-12-2005. Yes, it took me way too long. # # Yes, this code sucks. Yes, I am new here. And yes, I warned you. ;) # ###################################################################### +# use strict; use warnings; use File::Find; use SprintfBugChecker; my @dirs = @INC; my @found = (); my $crnt = ''; while(@dirs) { $crnt = shift @dirs; find(\&wanted, $crnt); } sub wanted { #else construction to save stepping my $hit = $File::Find::name; #Found file return if $hit eq $crnt; #Will otherwise be re-added, endless recurs +ion if(-d $hit) {push @dirs, $hit} #Subdirectory, add to list of dirs +to search elsif($hit =~ m/\w+(\.pm|\.pl|\.cgi)$/) {push @found, $hit} #File +with ext. we want } exit 0;
|
|---|
| Replies are listed 'Best First'. |
|---|