We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I'm trying to recreate your script with bash but I got stuck at the login part, I keep getting:
<?xml version="1.0" encoding="UTF-8"?> <error> <code>100006</code> <message></message> </error>
Based on the error code, it's ERROR_PARAMETER_ERROR = 100006 Here's my script:
ERROR_PARAMETER_ERROR = 100006
#!/bin/bash username="admin" password="admin" E5577_auth() { curl -sc '/tmp/E5577' 'http://192.168.8.1/html/home.html' > /dev/null cookie=$(curl -sb /tmp/E5577 http://192.168.8.1/api/webserver/SesTokInfo | awk -F "[><]" '/SesInfo/ {print $3}') token=$(curl -sb /tmp/E5577 http://192.168.8.1/api/webserver/SesTokInfo | awk -F "[><]" '/TokInfo/ {print $3}') echo "Cookie: $cookie" echo "Token: $token" if [[ -z "$cookie" ]] || [[ -z "$token" ]]; then echo "Authentication failed." fi } login() { E5577_auth password=$(echo -n "$password" | sha256sum | cut -d ' ' -f 1 | sed ':a;N;$!ba;s/\n//g') # 1. Original password is hashed first password=$(echo -n "$password" | base64 | sed ':a;N;$!ba;s/\n//g') # 2. Then the hashed password is encoded with base64 password=$(echo -n "$username$password$token" | sed ':a;N;$!ba;s/\n//g') # 3. Append both username & token password=$(echo -n "$password" | sha256sum | cut -d ' ' -f 1 | sed ':a;N;$!ba;s/\n//g') # 4. hash again password=$(echo -n "$password" | base64 | sed ':a;N;$!ba;s/\n//g') # 5. encode again echo "Password: $password" data="<?xml version=\"1.0\" encoding=\"UTF-8\"?><request><Username>$username</Username><password_type>4</password_type><Password>$password</Password></request>" curl -s 'http://192.168.8.1/api/user/login' -H "Cookie: $cookie" -H "__RequestVerificationToken: $token" --data "$data" } login
Can you help me fix it ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I'm trying to recreate your script with bash but I got stuck at the login part, I keep getting:
Based on the error code, it's
ERROR_PARAMETER_ERROR = 100006
Here's my script:
Can you help me fix it ?
The text was updated successfully, but these errors were encountered: