{"id":120,"date":"2010-07-06T09:19:54","date_gmt":"2010-07-06T13:19:54","guid":{"rendered":"http:\/\/dominique.leuenberger.net\/blog\/?p=120"},"modified":"2010-07-06T09:30:58","modified_gmt":"2010-07-06T13:30:58","slug":"juniper-vpn-on-opensuse-x86_64","status":"publish","type":"post","link":"https:\/\/dominique.leuenberger.net\/blog\/2010\/07\/juniper-vpn-on-opensuse-x86_64\/","title":{"rendered":"Juniper VPN on openSUSE x86_64"},"content":{"rendered":"<p>I&#8217;m in the unfortunate situation that my employer uses a Juniper SSL\/VPN solution with network connect capabilities (to initiate a real tunnel).<\/p>\n<p>The solution is built around some Java code, some suid services and obviously exists as 32bit only.<\/p>\n<p>Since the update from v5 to v6.5, network connect does no longer work when initiated from the web interface, which is a shame. The issue is a 32bit library that seems no longer to be nicely wrapped and thus the 64bit java is no longer able to start the processes up. The worst about all of it: there is no error message, no log file.<br \/>\nIf you&#8217;re lucky enough and you only have username \/ password auth, you can simply use ncsvc with some parameters. Of course I am less fortunate, and besides username\/password, we also use a OTP RSA Token. And of course, ncsvc does not offer any option to enter a 2nd password.<\/p>\n<p>so, no solution?<\/p>\n<p>Let&#8217;s be more optimistic: there IS a solution, albeit a very hakish one. But I DO need to connect to our VPN, so I consider it a &#8216;valid&#8217; workaround until this is hopefully really getting solved.<\/p>\n<p>So, what needs to be done? When you initiate the VPN tunnel the first time from the web interface, you&#8217;re requested to enter the root password and the network_connect client is installed in ~\/.juniper_network\/network_connect and set suid. That&#8217;s about as far as you can get with the automatic stuff.<\/p>\n<p>you&#8217;ll have to install gcc45-lib32 in order to be able to do the tasks at hand. But then you can convert the libncui.so to a binary which we can later on invoke directly.<br \/>\n<code># Change to the installed client folder<br \/>\ncd ~\/.juniper_networks\/<br \/>\n# Extract the LinuxApp java archive<br \/>\nunzip ncLinuxApp.jar<br \/>\n# go to the actual binary client<br \/>\ncd network_connect<br \/>\n# grab the certificate from the ssl\/vpn gateway server<br \/>\nsh ..\/getx509certificate.sh &lt;host.you.log.in.to&gt; cert.der<br \/>\n# Convert the library into a binary<br \/>\ngcc -m32 -Wl,-rpath,$(pwd) -o ncui libncui.so<br \/>\n# chown and set the new binary suid<br \/>\nsudo chown root:root ncui<br \/>\nsudo chmod 6711 ncui<\/code><\/p>\n<p>From now on we will be able to launch ncui (with some parameters) and have it initiate a tunnel for us. The needed command line for this is:<br \/>\n<code>.\/ncui -h &lt;host.you.log.in.to&gt; -c DSID=&lt;YourSessionID&gt; -f cert.cer<\/code><\/p>\n<p>So now the last obstacle: how to find your session ID? It&#8217;s stored in a cookie in your browser after logging in to the website. In Firefox you can get it from the properties\/privacy or using various plugins (like Web Developer). The cookie name is DSID, so you should have an easy time finding it.<\/p>\n<p>ncui weirdly asks for a password, but in my experience it never mattered what I enter, so I just press enter and go on. The application stays running and builds the tunnel. To tear it down, simply press CTRL-C and abort ncui.<\/p>\n<blockquote><p>Eventually you&#8217;re missing some more 32bit libraries, which I already had. use ldd against libncui and ncsvc to find out what other libraries you might be missing and install the corresponding 32bit equivalents.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Connecting to a Juniper SSL\/VPN from openSUSE x86_64 &#8211; A pain, but does work.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,7],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-opensuse","category-tutorials"],"_links":{"self":[{"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":3,"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/posts\/120\/revisions\/123"}],"wp:attachment":[{"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dominique.leuenberger.net\/blog\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}