Closed Jazb closed 5 years ago
I am success connect send the token in the second line of stdout, with this command template:
echo -e "$PASSWORD\n$TOKEN" | openconnect $ARGS --passwd-on-stdin
The id of form change on each request ? What is the correct way to send this token ?
Which VPN protocol are you using?
@jazb, any updates? Otherwise I'll close due to inactivity.
Expect could be used. In my case portal requesting password twice. It is a possible to modify script to putting token from the input buffer to variable.
My script usage: ./gp.sh Username Password
#!/usr/bin/expect -f
set timeout -1
set username [lindex $argv 0]
set password [lindex $argv 1]
spawn openconnect --protocol=gp --usergroup=portal --cafile=ca.crt --certificate=client.crt --sslkey=client.key --user=$username --authgroup=YourGateway portal.globalprotect.example.com
expect "*Password:*"
send -- "$password\r"
expect "*Password:*"
send -- "$password\r"
expect eof
Closing due to insufficient information to understand what's causing the variation in form name (need to know protocol and ideally more detailed logs).
I have the data of VPN on gopass and wrote script than render connect command user and password fine, static token OTP if request as challenge i and try to use --form-field and the format
FORM:OPT=VALUE
The id of form change on each request ? What is the correct way to send this token ?