-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range when executing #13
Comments
Can you do an import json and then do a json.dumps(msg_decoded, indent=4)? On Tue, Mar 22, 2016 at 1:19 PM, aszhiak notifications@github.com wrote:
|
Thank you for your reply, I'm sysadmin and I dont know so much about python programming, when i'm trying to do what you say, I'm not able to because the python shell closes after the execution of the script, I tried with subprocess.Popen and os.system from python shell and also doing a script, but the error just closes python without executing the json.dumps.. what can I do? |
Put the import line with the other imports, and put the dumps line on the On Wed, Mar 23, 2016 at 3:28 AM, aszhiak notifications@github.com wrote:
|
Sorry, forget about the popen thing. Try this script: https://gist.github.com/russdill/2052a68801bb09925c77 But rather than running it directly, let openconnect run it with This will make it easy to see the output of the script. On Wed, Mar 23, 2016 at 3:28 AM, aszhiak notifications@github.com wrote:
|
I have tried both script with the import and the json.dump but the output its the same with and without the both lines.. the import is placed at the start of the script with the rest of imports, and json.dump is placed in the line 202 I paste you the error with the openconnect: Traceback (most recent call last): The error is exactly the same with both scripts the old and the new one you gave me.. the only change is the line numbers.. |
My bad, the line should be print json.dumps(msg.decoded, indent=4) On Sat, Mar 26, 2016 at 3:08 PM, aszhiak notifications@github.com wrote:
|
No problem ;P, this is the output: Connected to HTTPS on vpn.company.com |
hmmm...after the response = self.parse_response(), can you put a: print json.dumps(response, indent=4) On Sat, Mar 26, 2016 at 3:19 PM, aszhiak notifications@github.com wrote:
|
sure, here's the output: Connected to HTTPS on vpn.company.com |
Ok, so it's saying policies don't exist for Linux, maybe there is a way to Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1 On Sun, Mar 27, 2016 at 4:29 AM, aszhiak notifications@github.com wrote:
|
I have changed useragent inside tnnc.py because I was having the same issue just changing it in openconnect and now the output is this one: Connected to HTTPS on vpn.company.com |
ok, now try removing the print json.dumps and see if it works. On Sun, Mar 27, 2016 at 1:20 PM, aszhiak notifications@github.com wrote:
|
Well now I have the following issue.. after request me the login and password I got the following message and ask me again for the password. Got HTTP response: HTTP/1.1 302 Moved |
OK, it's not liking the answer you are giving for the policies. Where it On Sun, Mar 27, 2016 at 2:49 PM, aszhiak notifications@github.com wrote:
|
Well I changed that and now openconnect just crashed: Connected to HTTPS on vpn.company.com
I don't know if this is relevant but the vpn doesn't have policies for linux, to connect from linux I have a tweaked firefox with some .so of windows media player, activex etc.. and with this I bypass the hostchecker and then just copy the DSID and paste it as parameter to a script which contains a openconnect sentence. |
I'm guessing the juniper-vpn.py script gives you a "Unknown form type: elif form.name == 'frmConfirmation': to: elif form.name == 'frmConfirmation' or form.name == 'frm': On Sun, Mar 27, 2016 at 3:04 PM, aszhiak notifications@github.com wrote:
|
After that change, the script just stuck or freeze at this point: And after some time do: Traceback (most recent call last): If I execute openconnect instead of juniper-vpn.py I have the frm error. |
In juniper-vpn.py, uncomment the lines before # Want debugging print self.r.info() before self.last_action = action Note in python that indentation is part of the syntax, so be sure they On Sun, Mar 27, 2016 at 4:14 PM, aszhiak notifications@github.com wrote:
|
I am getting this error when I just run
Perhaps it should check that it's invoked with arguments? |
Hello I'm trying to execute the script to connect to my vpn and shows the following error:
------------>8------------------
Traceback (most recent call last):
File "./juniper-vpn.py", line 284, in
jvpn.run()
File "./juniper-vpn.py", line 123, in run
self.action_tncc()
File "./juniper-vpn.py", line 143, in action_tncc
self.cj.set_cookie(t.get_cookie(dspreauth_cookie, dssignin_cookie))
File "/home/usertest/Downloads/juniper-vpn-py-master/tncc.py", line 242, in get_cookie
data = self.get_msg_contents(response['msg'])
File "/home/usertest/Downloads/juniper-vpn-py-master/tncc.py", line 187, in get_msg_contents
compressed = msg_decoded[0x0ce4][0][0x0ce7][0]
IndexError: list index out of range
Terminated
--------------8<------------------------
I'm using Ubuntu 15 with python 2.7.10 any help with this?
The text was updated successfully, but these errors were encountered: