Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: [nmap-svn] r32114 - nmap-exp/d33tah/ncat-lua-callbacks/ncat/test
From: Jacek Wielemborek <wielemborekj1 () gmail com>
Date: Fri, 30 Aug 2013 12:48:29 +0200

The new addition to the tests uncovered a weird, probably unwanted
behavior introduced in r32028. The problem is that when you do -L
scripts/filters/rot13.lua on both proxy server and proxy client, the
target through which we're proxying to also needs to be run with -L
rot13.lua. Should I revert r32028 to make the ultimate destination
host receive the decoded data?

2013/8/30  <commit-mailer () nmap org>:
Author: d33tah
Date: Fri Aug 30 10:51:43 2013
New Revision: 32114

Log:
Test --load-lua-socket-file proxy as well.

Modified:
   nmap-exp/d33tah/ncat-lua-callbacks/ncat/test/ncat-test.pl

Modified: nmap-exp/d33tah/ncat-lua-callbacks/ncat/test/ncat-test.pl
==============================================================================
--- nmap-exp/d33tah/ncat-lua-callbacks/ncat/test/ncat-test.pl   (original)
+++ nmap-exp/d33tah/ncat-lua-callbacks/ncat/test/ncat-test.pl   Fri Aug 30 10:51:43 2013
@@ -2723,8 +2723,10 @@
 max_conns_test_all("--max-conns 0", [], [], 0);
 max_conns_test_all("--max-conns 0 with exec", ["--exec", "/bin/cat"], [], 0);

+my @filters_args = ("--load-lua-socket-file", "rot13.lua", "--load-lua-socket-file", "base64.lua");
+
 server_client_test_all "--load-lua-socket-file (listen mode)",
-["--load-lua-socket-file", "rot13.lua", "--load-lua-socket-file", "base64.lua"], [], sub {
+\ () filters_args, [], sub {
        syswrite($c_in, "LKAxPt==\n");
        my $resp = timeout_read($s_out) or die "Read timeout";
        $resp eq "asd\n" or die "Server received " . d($resp) . ", not " . d("asd\n");
@@ -2734,7 +2736,7 @@
 };

 server_client_test_all "--load-lua-socket-file (connect mode)",
-[], ["--load-lua-socket-file", "rot13.lua", "--load-lua-socket-file", "base64.lua"], sub {
+[], \ () filters_args, sub {
        syswrite($c_in, "asd\n");
        my $resp = timeout_read($s_out) or die "Read timeout";
        $resp eq "LKAxPt==" or die "Client received " . d($resp) . ", not " . d("LKAxPt==");
@@ -2743,6 +2745,17 @@
        $resp eq "asd\n" or die "Server received " . d($resp) . ", not " . d("asd\n");
 };

+# Check that the --load-lua-socket-file proxy relays in both directions.
+proxy_test "--load-lua-socket-file proxy",
+\ () filters_args, \ () filters_args, \ () filters_args, sub {
+       syswrite($c_in, "abc\n");
+       my $resp = timeout_read($s_out) or die "Read timeout";
+       $resp eq "abc\n" or die "Proxy relayed \"$resp\", not \"abc\\n\"";
+       syswrite($s_in, "def\n");
+       $resp = timeout_read($c_out) or die "Read timeout";
+       $resp eq "def\n" or die "Proxy relayed \"$resp\", not \"def\\n\"";
+};
+
 print "$num_expected_failures expected failures.\n" if $num_expected_failures > 0;
 print "$num_unexpected_passes unexpected passes.\n" if $num_unexpected_passes > 0;
 print "$num_failures unexpected failures.\n";

_______________________________________________
Sent through the svn mailing list
http://nmap.org/mailman/listinfo/svn
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]