merged 5682bf09533c
authorHeiko Schlittermann <hs@schlittermann.de>
Fri, 08 Jan 2010 13:32:49 +0100
changeset 15 4168921d9151
parent 13 ddf323751753 (diff)
parent 14 5682bf09533c (current diff)
child 16 e0329f2e2f11
merged 5682bf09533c
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}",) {