Changeset 228


Ignore:
Timestamp:
10/30/09 03:46:07 (4 years ago)
Author:
jabra
Message:

perltidy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fierce2/branch/fierce

    r227 r228  
    3434use vars qw( $PROG ); 
    3535( $PROG = $0 ) =~ s/^.*[\/\\]//;    # Truncate calling path from the prog name 
    36 my $fversion       = '2.0';         # fierce version 
    37 my $xmlversion     = '1.0';         # xml version 
     36my $fversion   = '2.0';             # fierce version 
     37my $xmlversion = '1.0';             # xml version 
    3838my %options; 
    3939my ( @dns_names,   @name_servers ); 
    4040my ( @prefix_list, @subdomain_list, @ext_list ); 
    4141my ( $log_file,    $filename, $thread_support ); 
    42 my $port           = 53, 
    43 my $tcp_timeout    = 10; 
     42my $port = 53, my $tcp_timeout = 10; 
    4443my $udp_timeout    = 5; 
    4544my $delay          = 5; 
     
    6463    } 
    6564} 
     65 
    6666# handle output calls 
    6767sub header_output { 
     
    7373    print $str; 
    7474} 
    75  
    7675 
    7776# handle output calls 
     
    190189GetOptions( 
    191190    \%options, 
    192     'dns=s',   'format=s', 'no=s', 'all', 'wide', 'traverse=i', 
    193     'delay=i', 'template=s','port=s', 
     191    'dns=s',   'format=s',   'no=s', 'all', 'wide', 'traverse=i', 
     192    'delay=i', 'template=s', 'port=s', 
    194193    'tcptimeout=i', 'udptimeout=i', 'threads=i', 'subdomain=s', 'search=s', 
    195     'dnsservers=s',  'ztstop',       'prefix=s', 
    196     'ext=s',          'output=s',     'range=s', 'wildcstop', 
     194    'dnsservers=s', 'ztstop',       'prefix=s', 
     195    'ext=s',           'output=s',     'range=s', 'wildcstop', 
    197196    'maxbruteforce=i', 'maxlookups=s', 'arin=s', 
    198197    'verbose+'  => \$verbose, 
     
    201200    'version|v' => sub { print_version(); }, 
    202201) or exit 1; 
    203  
    204202 
    205203if ( $options{port} ) { 
     
    291289            $ua->env_proxy; 
    292290            my $response = $ua->get("$request"); 
    293             if ($response->is_success) { 
    294                 @prefix_list = split("\n",$response->decoded_content); 
     291            if ( $response->is_success ) { 
     292                @prefix_list = split( "\n", $response->decoded_content ); 
    295293            } 
    296294            else { 
     
    341339            $ua->env_proxy; 
    342340            my $response = $ua->get("$request"); 
    343             if ($response->is_success) { 
    344                 @subdomain_list = split("\n",$response->decoded_content); 
     341            if ( $response->is_success ) { 
     342                @subdomain_list = split( "\n", $response->decoded_content ); 
    345343            } 
    346344            else { 
     
    368366            $ua->env_proxy; 
    369367            my $response = $ua->get("$request"); 
    370             if ($response->is_success) { 
    371                 @ext_list = split("\n",$response->decoded_content); 
     368            if ( $response->is_success ) { 
     369                @ext_list = split( "\n", $response->decoded_content ); 
    372370            } 
    373371            else { 
     
    382380        'com', 'edu',  'net',  'org', 'co.uk', 'au', 
    383381        'de',  'xxx',  'info', 'tv',  'biz',   'cc', 
    384         'cn',  'name', 'pro',  'us',  'la','com.au' 
     382        'cn',  'name', 'pro',  'us',  'la',    'com.au' 
    385383    ); 
    386384} 
     
    415413my $include_path_txt = $include_path; 
    416414$include_path_txt =~ s/$format/txt/; 
     415 
    417416# some useful options (see below for full list) 
    418417my $config_txt = { 
    419     INCLUDE_PATH => "$include_path_txt", # or list ref 
    420     INTERPOLATE  => 1,                   # expand "$var" in plain text 
    421     POST_CHOMP   => 1,                   # cleanup whitespace 
    422     EVAL_PERL    => 1,                   # evaluate Perl code blocks 
     418    INCLUDE_PATH => "$include_path_txt",    # or list ref 
     419    INTERPOLATE  => 1,                      # expand "$var" in plain text 
     420    POST_CHOMP   => 1,                      # cleanup whitespace 
     421    EVAL_PERL    => 1,                      # evaluate Perl code blocks 
    423422}; 
     423 
    424424# create Template object 
    425425my $tt_txt = Template->new($config_txt); 
     
    427427# some useful options (see below for full list) 
    428428my $config = { 
    429     INCLUDE_PATH => "$include_path",    # or list ref 
    430     INTERPOLATE  => 1,                  # expand "$var" in plain text 
    431     POST_CHOMP   => 1,                  # cleanup whitespace 
    432     EVAL_PERL    => 1,                  # evaluate Perl code blocks 
     429    INCLUDE_PATH => "$include_path",        # or list ref 
     430    INTERPOLATE  => 1,                      # expand "$var" in plain text 
     431    POST_CHOMP   => 1,                      # cleanup whitespace 
     432    EVAL_PERL    => 1,                      # evaluate Perl code blocks 
    433433}; 
     434 
    434435# create Template object 
    435436my $tt = Template->new($config); 
     
    458459        elasp    => $obj->elasp, 
    459460    }; 
    460     
     461 
    461462    ## nmap output style 
    462463    # reference to output text string 
     
    480481        elasp    => $obj->elasp, 
    481482    }; 
    482     
     483 
    483484    ## nmap output style 
    484485    # reference to output text string 
     
    486487        || die $tt_txt->error(), "\n"; 
    487488 
    488  
    489489    $obj_output = validate($obj_output); 
    490490    return $obj_output; 
    491491} 
    492492 
    493  
    494493sub template_output { 
    495     my ( $output,$output_txt ) = @_; 
    496     $output = validate($output); 
     494    my ( $output, $output_txt ) = @_; 
     495    $output     = validate($output); 
    497496    $output_txt = validate($output_txt); 
    498497 
     
    512511my $fierce_startstr       = localtime($fierce_start); 
    513512my $start_fiercescan_vars = { 
    514     args     => $args, 
    515     start    => $fierce_start, 
    516     startstr => $fierce_startstr, 
    517     verbose  => $verbose, 
    518     debug    => $debug, 
    519     fversion => $fversion, 
    520     xmlversion => $xmlversion,  
     513    args       => $args, 
     514    start      => $fierce_start, 
     515    startstr   => $fierce_startstr, 
     516    verbose    => $verbose, 
     517    debug      => $debug, 
     518    fversion   => $fversion, 
     519    xmlversion => $xmlversion, 
    521520}; 
    522521 
     
    528527 
    529528if ( $options{range} ) { 
    530     if ( ! $options{dnsservers} ) { 
     529    if ( !$options{dnsservers} ) { 
    531530        help(); 
    532531    } 
     
    560559    my $find_nearby_result = $find_nearby->result(); 
    561560 
    562     template_output(  
    563         tt_output_setup(    $find_nearby,  
    564                             $find_nearby_result,  
    565                             'find_nearby.tt' ), 
    566         tt_output_setup_txt(    $find_nearby,  
    567                             $find_nearby_result,  
    568                             'find_nearby.tt' ), 
    569                      
    570                     ) ; 
     561    template_output( 
     562        tt_output_setup( 
     563            $find_nearby, $find_nearby_result, 'find_nearby.tt' 
     564        ), 
     565        tt_output_setup_txt( 
     566            $find_nearby, $find_nearby_result, 'find_nearby.tt' 
     567        ), 
     568 
     569    ); 
    571570    exit; 
    572571} 
     
    600599            || die $tt->error(), "\n"; 
    601600        my $start_domainscan_output_txt; 
     601 
    602602        # reference to output text string 
    603603        $tt_txt->process( 'start_domainscan.tt', $start_domainscan_vars, 
     
    605605            || die $tt_txt->error(), "\n"; 
    606606 
    607         template_output($start_domainscan_output,$start_domainscan_output_txt); 
     607        template_output( $start_domainscan_output, 
     608            $start_domainscan_output_txt ); 
    608609 
    609610        my ( $zt, $ns, $prefix_bf, $subdomain_bf, $reverse_lookup, $find_mx ); 
     
    622623 
    623624        my $ns_result = $ns->result(); 
    624         template_output(  
     625        template_output( 
    625626            tt_output_setup( $ns, $ns_result, 'ns.tt' ), 
    626627            tt_output_setup_txt( $ns, $ns_result, 'ns.tt' ), 
    627                         ); 
     628        ); 
    628629 
    629630        if ( grep( !/arin/, $no ) ) { 
     
    665666            $tt_txt->process( "arin.tt", $arin_vars, \$arin_output_txt ) 
    666667                || die $tt_txt->error(), "\n"; 
    667             template_output($arin_output,$arin_output_txt); 
     668            template_output( $arin_output, $arin_output_txt ); 
    668669        } 
    669670 
     
    680681            $zt_result = $zt->result(); 
    681682            template_output( 
    682                     tt_output_setup( $zt, $zt_result, 'zt.tt'), 
    683                     tt_output_setup_txt( $zt, $zt_result, 'zt.tt'), 
    684                 ); 
     683                tt_output_setup( $zt, $zt_result, 'zt.tt' ), 
     684                tt_output_setup_txt( $zt, $zt_result, 'zt.tt' ), 
     685            ); 
    685686        } 
    686687        unless ( $options{ztstop} and $zt->check == 1 ) { 
     
    698699                $wildcard_result = $wildcard->result(); 
    699700                template_output( 
    700                     tt_output_setup( $wildcard, $wildcard_result, 'wildcard.tt' ), 
    701                     tt_output_setup_txt( $wildcard, $wildcard_result, 'wildcard.tt' ), 
     701                    tt_output_setup( 
     702                        $wildcard, $wildcard_result, 'wildcard.tt' 
     703                    ), 
     704                    tt_output_setup_txt( 
     705                        $wildcard, $wildcard_result, 'wildcard.tt' 
     706                    ), 
    702707                ); 
    703708            } 
     
    722727                    $prefix_bf_result = $prefix_bf->result(); 
    723728                    template_output( 
    724                             tt_output_setup( $prefix_bf, $prefix_bf_result, 
    725                         'prefix_bf.tt' ), 
    726                             tt_output_setup_txt( $prefix_bf, $prefix_bf_result, 
    727                         'prefix_bf.tt' ), 
     729                        tt_output_setup( 
     730                            $prefix_bf, $prefix_bf_result, 'prefix_bf.tt' 
     731                        ), 
     732                        tt_output_setup_txt( 
     733                            $prefix_bf, $prefix_bf_result, 'prefix_bf.tt' 
     734                        ), 
    728735                    ); 
    729736                } 
     
    746753                    $subdomain_bf_result = $subdomain_bf->result(); 
    747754                    template_output( 
    748                         tt_output_setup( $subdomain_bf, $subdomain_bf_result, 
    749                         'subdomain_bf.tt' ), 
    750                          tt_output_setup_txt( $subdomain_bf, $subdomain_bf_result, 
    751                         'subdomain_bf.tt' ), 
    752                  
    753                 ); 
     755                        tt_output_setup( 
     756                            $subdomain_bf, $subdomain_bf_result, 
     757                            'subdomain_bf.tt' 
     758                        ), 
     759                        tt_output_setup_txt( 
     760                            $subdomain_bf, $subdomain_bf_result, 
     761                            'subdomain_bf.tt' 
     762                        ), 
     763 
     764                    ); 
    754765                } 
    755766            } 
     
    768779                template_output( 
    769780                    tt_output_setup( $ext_bf, $ext_bf_result, 'ext_bf.tt' ), 
    770                     tt_output_setup_txt( $ext_bf, $ext_bf_result, 'ext_bf.tt' ), 
     781                    tt_output_setup_txt( 
     782                        $ext_bf, $ext_bf_result, 'ext_bf.tt' 
     783                    ), 
    771784                ); 
    772785            } 
     
    784797                $vhost_result = $vhost->result(); 
    785798                template_output( 
    786                         tt_output_setup( $vhost, $vhost_result, 'vhost.tt' ), 
    787                         tt_output_setup_txt( $vhost, $vhost_result, 'vhost.tt' ), 
    788                     ); 
     799                    tt_output_setup( $vhost, $vhost_result, 'vhost.tt' ), 
     800                    tt_output_setup_txt( $vhost, $vhost_result, 'vhost.tt' ), 
     801                ); 
    789802            } 
    790803            ################################################ 
     
    800813                $find_mx_result = $find_mx->result(); 
    801814                template_output( 
    802                         tt_output_setup( $find_mx, $find_mx_result, 'find_mx.tt' ), 
    803                         tt_output_setup_txt( $find_mx, $find_mx_result, 'find_mx.tt' ), 
    804                     ); 
     815                    tt_output_setup( 
     816                        $find_mx, $find_mx_result, 'find_mx.tt' 
     817                    ), 
     818                    tt_output_setup_txt( 
     819                        $find_mx, $find_mx_result, 'find_mx.tt' 
     820                    ), 
     821                ); 
    805822            } 
    806823            ##################################################### 
     
    817834                $whois_result = $whois->result(); 
    818835                template_output( 
    819                         tt_output_setup( $whois, $whois_result, 'whois.tt' ), 
    820                         tt_output_setup_txt( $whois, $whois_result, 'whois.tt' ), 
    821                     ); 
     836                    tt_output_setup( $whois, $whois_result, 'whois.tt' ), 
     837                    tt_output_setup_txt( $whois, $whois_result, 'whois.tt' ), 
     838                ); 
    822839            } 
    823840 
     
    840857                $reverse_lookup_result = $reverse_lookup->result(); 
    841858                template_output( 
    842                         tt_output_setup( $reverse_lookup, $reverse_lookup_result,'reverse_lookup.tt' ), 
    843                          tt_output_setup_txt( $reverse_lookup, $reverse_lookup_result,'reverse_lookup.tt' ), 
    844                     ); 
     859                    tt_output_setup( 
     860                        $reverse_lookup, $reverse_lookup_result, 
     861                        'reverse_lookup.tt' 
     862                    ), 
     863                    tt_output_setup_txt( 
     864                        $reverse_lookup, $reverse_lookup_result, 
     865                        'reverse_lookup.tt' 
     866                    ), 
     867                ); 
    845868            } 
    846869            ######################################################### 
     
    880903                $find_nearby_result = $find_nearby->result(); 
    881904                template_output( 
    882                     tt_output_setup( $find_nearby, $find_nearby_result, 
    883                     'find_nearby.tt' ), 
    884                     tt_output_setup_txt( $find_nearby, $find_nearby_result, 
    885                     'find_nearby.tt' ), 
     905                    tt_output_setup( 
     906                        $find_nearby, $find_nearby_result, 
     907                        'find_nearby.tt' 
     908                    ), 
     909                    tt_output_setup_txt( 
     910                        $find_nearby, $find_nearby_result, 
     911                        'find_nearby.tt' 
     912                    ), 
    886913                ); 
    887914            } 
     
    906933            || die $tt->error(), 
    907934            "\n"; 
    908          
     935 
    909936        my $end_domainscan_output_txt; 
     937 
    910938        # reference to output text string 
    911939        $tt_txt->process( 'end_domainscan.tt', $end_domainscan_vars, 
    912         \$end_domainscan_output_txt ) 
    913         || die $tt_txt->error(), 
     940            \$end_domainscan_output_txt ) 
     941            || die $tt_txt->error(), 
    914942            "\n"; 
    915943 
    916         template_output($end_domainscan_output,$end_domainscan_output_txt); 
     944        template_output( $end_domainscan_output, $end_domainscan_output_txt ); 
    917945    } 
    918946 
     
    933961        \$end_fiercescan_output ) 
    934962        || die $tt->error(), "\n"; 
    935      
     963 
    936964    my $end_fiercescan_output_txt; 
     965 
    937966    # reference to output text string 
    938967    $tt_txt->process( 'end_fiercescan.tt', $end_fiercescan_vars, 
    939     \$end_fiercescan_output_txt ) 
    940     || die $tt_txt->error(), 
    941     "\n"; 
     968        \$end_fiercescan_output_txt ) 
     969        || die $tt_txt->error(), 
     970        "\n"; 
    942971 
    943972    template_output($end_fiercescan_output); 
Note: See TracChangeset for help on using the changeset viewer.