Changeset 196


Ignore:
Timestamp:
10/03/09 19:59:24 (4 years ago)
Author:
jabra
Message:

perltidy fierce

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fierce2/branch/fierce

    r195 r196  
    5555my $pattern        = 0; 
    5656my $wildc_stop     = 0; 
     57 
    5758# ignore all errors while trying to load up thead stuff 
    5859BEGIN { 
     
    177178GetOptions( 
    178179    \%options, 
    179     'dns=s',   'format=s', 'no=s', 'all', 'wide', 'traverse=i',  
    180     'delay=i','template=s', 
     180    'dns=s',   'format=s', 'no=s', 'all', 'wide', 'traverse=i', 
     181    'delay=i', 'template=s', 
    181182    'tcptimeout=i', 'udptimeout=i', 'threads=i', 'subdomains=s', 'search=s', 
    182     'dnsserver=s',  'ztstop',       'prefix=s',   
    183     'exts=s',       'output=s',     'range=s','wildcstop', 
    184     'maxbruteforce=i', 'maxlookups=s','arin=s', 
    185     'verbose+'    => \$verbose, 
    186     'debug+'      => \$debug, 
     183    'dnsserver=s',  'ztstop',       'prefix=s', 
     184    'exts=s',          'output=s',     'range=s', 'wildcstop', 
     185    'maxbruteforce=i', 'maxlookups=s', 'arin=s', 
     186    'verbose+'  => \$verbose, 
     187    'debug+'    => \$debug, 
    187188    'help|h'    => sub { help(); }, 
    188189    'version|v' => sub { print_version(); }, 
     
    235236if ( $options{dnsservers} ) { 
    236237    if ( -r $options{dnsservers} ) { 
    237         open( DNSSERVERS, $options{dnsservers} ) || die("Could not open file!"); 
     238        open( DNSSERVERS, $options{dnsservers} ) 
     239            || die("Could not open file!"); 
    238240        @name_servers = <DNSSERVERS>; 
    239241        close(DNSSERVERS); 
     
    333335my $include_path = "tt/$format"; 
    334336my $template; 
    335 if ($options{template} ) { 
     337if ( $options{template} ) { 
    336338    if ( -d $options{template} ) { 
    337         $template = $options{template}; 
     339        $template     = $options{template}; 
    338340        $include_path = "$template/$format"; 
    339341    } 
     
    343345my $config = { 
    344346    INCLUDE_PATH => "$include_path",    # or list ref 
    345     INTERPOLATE  => 1,               # expand "$var" in plain text 
    346     POST_CHOMP   => 1,               # cleanup whitespace 
    347     EVAL_PERL    => 1,               # evaluate Perl code blocks 
     347    INTERPOLATE  => 1,                  # expand "$var" in plain text 
     348    POST_CHOMP   => 1,                  # cleanup whitespace 
     349    EVAL_PERL    => 1,                  # evaluate Perl code blocks 
    348350}; 
    349351 
     
    361363 
    362364sub template_output { 
    363     my ($obj,$result,$template) = @_; 
     365    my ( $obj, $result, $template ) = @_; 
    364366 
    365367    my $obj_output; 
     
    373375        elasp    => $obj->elasp, 
    374376    }; 
     377 
    375378    # reference to output text string 
    376     $tt->process( "$template", $vars, 
    377         \$obj_output ) 
     379    $tt->process( "$template", $vars, \$obj_output ) 
    378380        || die $tt->error(), "\n"; 
    379381    output($obj_output); 
    380382} 
    381  
    382383 
    383384my $args; 
     
    404405 
    405406if ( $options{range} ) { 
    406     if ($options{dnsservers} ) { 
     407    if ( $options{dnsservers} ) { 
    407408        help(); 
    408409    } 
    409410    my @ipranges; 
    410411 
    411     if ($options{range} =~ /(\d{1,3}\.\d{1,3}\.\d{1,3})\.(\d{1,3})\-(\d{1,3})/ ) { 
    412         my ($group,$oct2,$oct3) = ($1,$2,$3); 
    413         foreach($oct2..$oct3) { 
     412    if ( $options{range} 
     413        =~ /(\d{1,3}\.\d{1,3}\.\d{1,3})\.(\d{1,3})\-(\d{1,3})/ ) 
     414    { 
     415        my ( $group, $oct2, $oct3 ) = ( $1, $2, $3 ); 
     416        foreach ( $oct2 .. $oct3 ) { 
    414417            chomp; 
    415             push(@ipranges,"$group.$_");    
     418            push( @ipranges, "$group.$_" ); 
    416419        } 
    417420    } 
    418     elsif ($options{range} =~ /(\d{1,3}\.\d{1,3}\.\d{1,3})\.(\d{1,3})\/(\d{1,3})/) { 
    419         push(@ipranges,$options{range});    
     421    elsif ( $options{range} 
     422        =~ /(\d{1,3}\.\d{1,3}\.\d{1,3})\.(\d{1,3})\/(\d{1,3})/ ) 
     423    { 
     424        push( @ipranges, $options{range} ); 
    420425    } 
    421426    my $iprange_obj = IPrange->new( iprange => \@ipranges ); 
     
    424429        if ( $verbose > 0 or $format eq 'txt' ); 
    425430    my $find_nearby = tFindNearby->new( 
    426         search     => $search, 
    427         pattern    => $pattern, 
    428         traverse   => $traverse, 
    429         wide       => $wide, 
     431        search   => $search, 
     432        pattern  => $pattern, 
     433        traverse => $traverse, 
     434        wide     => $wide, 
    430435    ); 
    431436    $find_nearby = $find_nearby->execute($iprange_obj); 
    432437 
    433438    my $find_nearby_result = $find_nearby->result(); 
    434     template_output($find_nearby,$find_nearby_result,'find_nearby.tt'); 
     439    template_output( $find_nearby, $find_nearby_result, 'find_nearby.tt' ); 
    435440    exit; 
    436 }  
     441} 
    437442elsif ( $options{dns} ) { 
    438443    if ( -r $options{dns} ) { 
     
    468473        my ( $whois, $wildcard, $ext_bf, $find_nearby ); 
    469474 
    470         my ( %output_data, $vhost_result ); 
    471         my ( $subdomain_bf_result, $prefix_bf_result);     
    472         my ( $wildcard_result, $reverse_lookup_result);  
    473         my ( $find_mx_result, $whois_result);           
    474         my ( $ext_bf_result, $zt_result);            
    475         my ( $find_nearby_result);    
     475        my ( %output_data,         $vhost_result ); 
     476        my ( $subdomain_bf_result, $prefix_bf_result ); 
     477        my ( $wildcard_result,     $reverse_lookup_result ); 
     478        my ( $find_mx_result,      $whois_result ); 
     479        my ( $ext_bf_result,       $zt_result ); 
     480        my ($find_nearby_result); 
    476481 
    477482        print "Nameservers for $dns\n" 
     
    481486 
    482487        my $ns_result = $ns->result(); 
    483         template_output($ns,$ns_result,'ns.tt'); 
     488        template_output( $ns, $ns_result, 'ns.tt' ); 
    484489 
    485490        if ( grep( !/arin/, $no ) ) { 
     
    489494            # 
    490495            my $arin_query; 
    491             if ($options{arin} ) { 
     496            if ( $options{arin} ) { 
    492497                $arin_query = $options{arin}; 
    493498            } 
     
    498503            print "ARIN lookup $arin_query\n" 
    499504                if ( $verbose > 0 or $format eq 'txt' ); 
    500             my $arin = ARIN->new(query => $arin_query ); 
    501             $arin = $arin->execute( $domain ); 
     505            my $arin = ARIN->new( query => $arin_query ); 
     506            $arin = $arin->execute($domain); 
    502507 
    503508            my $arin_result = $arin->result(); 
     
    513518                elasp    => $arin->elasp, 
    514519            }; 
     520 
    515521            # reference to output text string 
    516             $tt->process( "arin.tt", $arin_vars, 
    517                 \$arin_output ) 
     522            $tt->process( "arin.tt", $arin_vars, \$arin_output ) 
    518523                || die $tt->error(), "\n"; 
    519524            output($arin_output); 
     
    533538 
    534539            $zt_result = $zt->result(); 
    535             template_output($zt,$zt_result,'zt.tt'); 
     540            template_output( $zt, $zt_result, 'zt.tt' ); 
    536541        } 
    537542        unless ( $options{ztstop} and $zt->check == 1 ) { 
     
    549554 
    550555                $wildcard_result = $wildcard->result(); 
    551                 template_output($wildcard,$wildcard_result,'wildcard.tt'); 
    552             } 
    553             unless ( $options{wildcstop} and defined($wildcard) and $wildcard->check == 1 ) { 
     556                template_output( $wildcard, $wildcard_result, 'wildcard.tt' ); 
     557            } 
     558            unless ($options{wildcstop} 
     559                and defined($wildcard) 
     560                and $wildcard->check == 1 ) 
     561            { 
    554562                ################################### 
    555563                # 
     
    558566                if ( grep( !/prebf/, $no ) ) { 
    559567 
    560  
    561568                    print "Trying Prefix Bruteforce ... \n" 
    562569                        if ( $verbose > 0 or $format eq 'txt' ); 
     
    569576 
    570577                    $prefix_bf_result = $prefix_bf->result(); 
    571                     template_output($prefix_bf,$prefix_bf_result,'prefix_bf.tt'); 
     578                    template_output( $prefix_bf, $prefix_bf_result, 
     579                        'prefix_bf.tt' ); 
    572580                } 
    573581                ##################################### 
     
    589597 
    590598                    $subdomain_bf_result = $subdomain_bf->result(); 
    591                     template_output($subdomain_bf,$subdomain_bf_result,'subdomain_bf.tt'); 
     599                    template_output( $subdomain_bf, $subdomain_bf_result, 
     600                        'subdomain_bf.tt' ); 
    592601                } 
    593602            } 
     
    603612                $ext_bf = tExtensionBruteForceDNS->new( 
    604613                    'extension_list' => \@ext_list, ); 
    605                 $ext_bf = $ext_bf->execute($domain); 
     614                $ext_bf        = $ext_bf->execute($domain); 
    606615                $ext_bf_result = $ext_bf->result(); 
    607                 template_output($ext_bf,$ext_bf_result,'ext_bf.tt'); 
     616                template_output( $ext_bf, $ext_bf_result, 'ext_bf.tt' ); 
    608617            } 
    609618            ###################################### 
     
    620629 
    621630                $vhost_result = $vhost->result(); 
    622                 template_output($vhost,$vhost_result,'vhost.tt'); 
     631                template_output( $vhost, $vhost_result, 'vhost.tt' ); 
    623632            } 
    624633            ################################################ 
     
    634643                    = $find_mx->execute( $domain, $base->new_dns_resolver ); 
    635644                $find_mx_result = $find_mx->result(); 
    636                 template_output($find_mx,$find_mx_result,'find_mx.tt'); 
     645                template_output( $find_mx, $find_mx_result, 'find_mx.tt' ); 
    637646            } 
    638647            ##################################################### 
     
    649658 
    650659                $whois_result = $whois->result(); 
    651                 template_output($whois,$whois_result,'whois.tt'); 
     660                template_output( $whois, $whois_result, 'whois.tt' ); 
    652661            } 
    653662 
     
    670679 
    671680                $reverse_lookup_result = $reverse_lookup->result(); 
    672                 template_output($reverse_lookup,$reverse_lookup_result,'reverse_lookup.tt'); 
     681                template_output( $reverse_lookup, $reverse_lookup_result, 
     682                    'reverse_lookup.tt' ); 
    673683            } 
    674684            ######################################################### 
     
    708718 
    709719                $find_nearby_result = $find_nearby->result(); 
    710                 template_output($find_nearby,$find_nearby_result,'find_nearby.tt'); 
     720                template_output( $find_nearby, $find_nearby_result, 
     721                    'find_nearby.tt' ); 
    711722            } 
    712723        } 
     
    749760        \$end_fiercescan_output ) 
    750761        || die $tt->error(), "\n"; 
    751     output($end_fiercescan_output) 
     762    output($end_fiercescan_output); 
    752763} 
    753764else { 
Note: See TracChangeset for help on using the changeset viewer.