--- 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}",) {