Changeset 1088

Show
Ignore:
Timestamp:
05/28/08 21:50:17 (6 months ago)
Author:
mbr
Message:

minor update to let the user know about NAT access ports (so 'ssh -p <port>' can be used); this is mostly needed with the --NAT-rand-port option

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fwknop/trunk/fwknop

    r1081 r1088  
    824824        print 
    825825"\n[+] Sending $msg_len byte message to $knock_dst over $spoof_proto", 
    826     "/$enc_pcap_port\n    (spoofed src IP: $spoof_src).\n\n" unless $quiet; 
     826    "/$enc_pcap_port\n    (spoofed src IP: $spoof_src).\n" unless $quiet; 
    827827        my $rand_src_port = int(rand(65535)); 
    828828        $rand_src_port = 65001 if $rand_src_port > 65535; 
     
    887887                } 
    888888            }); 
    889             if ($test_mode) { 
    890                 print "    --Test-mode enabled, SPA packet not sent.\n"; 
    891             } else { 
     889            unless ($test_mode) { 
    892890                $rawpkt->send(); 
    893891            } 
     
    897895        if ($spa_established_tcp) {  ### useful for Tor 
    898896            print "\n[+] Sending $msg_len byte message to $knock_dst ", 
    899                 "over established tcp/$enc_pcap_port socket...\n\n
     897                "over established tcp/$enc_pcap_port socket...\n
    900898                unless $quiet; 
    901899 
    902             if ($test_mode) { 
    903                 print "    --Test-mode enabled, SPA packet not sent.\n"; 
    904             } else { 
     900            unless ($test_mode) { 
    905901                my $socket = IO::Socket::INET->new( 
    906902                    PeerAddr => $knock_dst, 
     
    916912        } else { 
    917913            print "\n[+] Sending $msg_len byte message to $knock_dst ", 
    918                 "over udp/$enc_pcap_port...\n\n" unless $quiet; 
    919  
    920             if ($test_mode) { 
    921                 print "    --Test-mode enabled, SPA packet not sent.\n"; 
    922             } else { 
     914                "over udp/$enc_pcap_port...\n" unless $quiet; 
     915 
     916            unless ($test_mode) { 
    923917                my $socket = IO::Socket::INET->new( 
    924918                    PeerAddr => $knock_dst, 
     
    931925                undef $socket; 
    932926            } 
     927        } 
     928    } 
     929    unless ($quiet) { 
     930        if ($NAT_access_str and $NAT_access_str =~ /($ip_re),(\d+)/) { 
     931            my $internal_ip = $1; 
     932            my $nat_port    = $2; 
     933            print "    Requesting NAT access to $access_str on $internal_ip via ", 
     934                "port $nat_port\n\n"; 
     935        } else { 
     936            print "\n"; 
     937        } 
     938        if ($test_mode) { 
     939            print "    --Test-mode enabled, SPA packet not sent.\n\n"; 
    933940        } 
    934941    }