# HG changeset patch # User Heiko Schlittermann # Date 1262953969 -3600 # Node ID 4168921d915113c4bbaead9f5930a9ca6790a8bb # Parent ddf323751753281345b0a269c42ff003ba66175b# Parent 5682bf09533c3a8178fc5af4b293023385a84fe9 merged 5682bf09533c diff -r 5682bf09533c -r 4168921d9151 sap-vpn.pl --- a/sap-vpn.pl Fri Jan 08 13:31:04 2010 +0100 +++ b/sap-vpn.pl Fri Jan 08 13:32:49 2010 +0100 @@ -94,6 +94,7 @@ $opt_verbose += $opt_debug; + untaint($opt_host) or ohshit "hostname didn't pass verification\n"; untaint($opt_linkname) or ohshit "linkname didn't pass verification\n"; untaint($opt_script) or ohshit "script name didn't pass verification\n" @@ -218,6 +219,7 @@ unless $response->is_success; $response = $response->as_string; + # ? $cookies->set_cookie(0, MRHSession => $sessionid, "/", $opt_host, 443, 1, 0, 10, 0, {}); } # We can then parse the response for the MRHSession Cookie, which contains our @@ -228,8 +230,6 @@ $sessionid = $1; verbose "% session id ${sessionid}\n"; - $cookies->set_cookie(0, MRHSession => $sessionid, "/", $opt_host, 443, 1, 0, 10, 0, {}); - #warn $cookies->as_string; ### ### STEP 3 :: Create the SSL VPN tunnel. @@ -240,8 +240,7 @@ # Now that we are authenticated and have a valid SessionID, we must request # specific pages/objects in order to initiate a SSL VPN tunnel. Before we do # this, let's determine the resource locator for our Network Access favorite. - #if (!$use_lwp) { - if (1) { + if (!$use_lwp) { $request = "GET /vdesk/vpn/index.php3?outform=xml HTTP/1.0\r\n" . "Cookie: MRHSession=${sessionid}\r\n" . "\r\n"; $response = qx(echo "${request}" | ${openssl} 2>/dev/null); @@ -265,8 +264,6 @@ $favorite = $1; verbose "% favorite ${favorite}\n"; - exit; - # We're all set! Let's visit the necessary pages/objects to notify FirePass # that we wish to open a SSL VPN tunnel. foreach my $uri ("/vdesk/", "/vdesk/vpn/connect.php3?Z=0,${favorite}",) {