Changeset 1283
- Timestamp:
- 10/05/08 13:51:58 (2 months ago)
- Files:
-
- fwknop/trunk/fwknopd (modified) (5 diffs)
- fwknop/trunk/test/fwknop_test.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fwknop/trunk/fwknopd
r1277 r1283 115 115 my $voluntary_exit_timestamp = 0; 116 116 my $fw_data_file = ''; ### legacy port knocking mode 117 my $dump_config = 0; 117 118 118 119 my $cmdline_locale = ''; … … 3739 3740 "(review syslog for more info). Exiting."; 3740 3741 } 3742 &dump_config() if $debug; 3741 3743 if ($debug and $verbose) { 3742 3744 for (my $i=0; $i<=$#access; $i++) { … … 3801 3803 unless $ip_info; 3802 3804 return $ip_info; 3805 } 3806 3807 sub dump_config() { 3808 my $rv = 0; 3809 print STDERR "\n", localtime() . " [+] Dumping config from: $config_file\n"; 3810 for my $var (sort keys %config) { 3811 my $str = $config{$var}; 3812 ### sanitize sensitive information 3813 $str = '(removed)' if $var eq 'EMAIL_ADDRESSES'; 3814 $str = '(removed)' if $var eq 'HOSTNAME'; 3815 $str = '(removed)' if $var eq 'BLACKLIST'; 3816 $str = '(removed)' if $var eq 'GPG_DEFAULT_HOME_DIR'; 3817 printf STDERR "%-30s %s\n", $var, $str; 3818 } 3819 print STDERR "\n", localtime() . " [+] Command paths:\n\n"; 3820 for my $var (sort keys %cmds) { 3821 printf STDERR "%-30s %s\n", $var, $cmds{$var}; 3822 } 3823 return $rv; 3803 3824 } 3804 3825 … … 4074 4095 'no-LC_ALL' => \$no_locale, 4075 4096 'no-locale' => \$no_locale, 4097 'Dump-config' => \$dump_config, 4076 4098 'verbose' => \$verbose, 4077 4099 'Version' => \$print_version, … … 4389 4411 ### import access directives 4390 4412 &import_access(); 4413 4414 if ($dump_config) { 4415 &dump_config(); 4416 print STDERR "\n", localtime() . " [+] Dumping access ", 4417 "config: $config{'ACCESS_CONF'}\n\n"; 4418 for (my $i=0; $i<=$#access; $i++) { 4419 &dump_access($access[$i], $i); 4420 } 4421 exit 0; 4422 } 4391 4423 4392 4424 unless ($debug) { fwknop/trunk/test/fwknop_test.pl
r1277 r1283 750 750 open C, ">> $current_test_file" 751 751 or die "[*] Could not open $current_test_file: $!"; 752 print C "\n TEST: $msg, STATUS: $test_status\n";752 print C "\n" . localtime() . " TEST: $msg, STATUS: $test_status\n"; 753 753 close C; 754 754 … … 913 913 close F; 914 914 system "$cmd >> $current_test_file 2>&1"; 915 for my $cmd ('uname -a', 916 'perl -V', 917 'gpg --version', 918 'ifconfig -a', 919 'ls -l /etc', 'if [ -e /etc/issue ]; then cat /etc/issue; fi', 920 'if [ -e /proc/cpuinfo ]; then cat /proc/cpuinfo; fi', 921 'if [ -e /proc/config.gz ]; then zcat /proc/config.gz; fi', 922 "$fwknopdCmd -S", 923 "$fwknopdCmd -V", 924 "$fwknopCmd -V", 925 'if [ -e /usr/bin/fwknop ]; then /usr/bin/fwknop -V; fi', 926 'if [ -e /usr/sbin/fwknopd ]; then /usr/sbin/fwknopd -V; fi', 927 "ldd $tcpdumpCmd", 928 'ls -l /usr/lib/*pcap*', 929 'ls -l /usr/local/lib/*pcap*', 930 'find /usr/lib/fwknop -type f' 915 for my $cmd ( 916 'uname -a', 917 'perl -V', 918 'gpg --version', 919 'ifconfig -a', 920 'ls -l /etc', 'if [ -e /etc/issue ]; then cat /etc/issue; fi', 921 'if [ -e /proc/cpuinfo ]; then cat /proc/cpuinfo; fi', 922 'if [ -e /proc/config.gz ]; then zcat /proc/config.gz; fi', 923 "$fwknopdCmd -S", 924 "$fwknopdCmd -V", 925 "$fwknopCmd -V", 926 "$fwknopdCmd --Dump-conf", 927 'if [ -e /usr/bin/fwknop ]; then /usr/bin/fwknop -V; fi', 928 'if [ -e /usr/sbin/fwknopd ]; then /usr/sbin/fwknopd -V; fi', 929 "ldd $tcpdumpCmd", 930 'ls -l /usr/lib/*pcap*', 931 'ls -l /usr/local/lib/*pcap*', 932 'find /usr/lib/fwknop -type f' 931 933 ) { 932 934 open F, ">> $current_test_file" or die $!; … … 3075 3077 open F, ">> $current_test_file" 3076 3078 or die "[*] Could not open $current_test_file: $!"; 3077 print F "MSG: $msg\n";3079 print F localtime() . " MSG: $msg\n"; 3078 3080 close F; 3079 3081 }
