mchack: Create the Expect script (that contains the secret data) as usual. Make its permissions be 750 (-rwxr-x---) and owned by a trusted group, i.e., a group which is allowed to read it. If necessary, create a new group for this purpose. Next, create a /bin/sh script with permissions 2751 (-rwxr-s--x) owned by the same group as before.
The result is a script which may be executed (and read) by anyone. When invoked, it runs the Expect script.
The evil of sticky bit and storing of plain secret data in a plain text executable. But its not what I am doing. I am getting the data from GUI dialog and feeding it into the downloader backend, just like what scripts are for - to glue things.
mchack: sorry, I don't understand. on a shell lgogdownloader displays as much as any other command line tool does. How come it's easier to enter your password on the cli than on the lgogdownloader prompt?
Are you running it in a headless docker container?
(Also what kind of password are we talking here? I don't know what you mean by linear password vs. your location based thingie? gog still needs to have your password to authenticate you, so it can't be that different from the usual passwords all of us use. *just curious*)
No, lgogdownloader does not display anything when entering passwords.
The position-based password is dynamically generated.
For example:
your nickname is: mchack
your favorite food, which you can substitute - mutating whole password group as needed - is(for example): pizza
and you was born on day number(for example): 21
the gog full domain is: gog.com
the filler, if data is missing is a: "jf"
Password generation rule:
enter 6 letters of the domain, backwards:: moc.go
enter the day you were born as first and last symbols:: 2moc.go1
enter your nickname, one letter then skip a charater, next letter. But when entering, the first two symbols of your nickname are CAPITALS, second symbols as regulars, repeating: 2MmCohca.CgKo1
salt the example with your favorite food, backwards: 2MmCohca.CagzKzoi1p
this is an example position-based interactively generated password.
It has pros and cons to static linear password, but mostly its pros. The only substantial con is that it requires time to generate(enter). What static or dynamic data is involved in generation and algorythm - are all different and can be anything.
Because lgogdownloader does not display anything and does not support positional buttons, entering (reconstructing) such password is impossible.
mchack: And can you please also explain, why you can't just login via shell once, get your cookie and then backend script away with lgogdownloader since you won't be asked again for a password after that.?
This is the least feasable but possible option. It breaks consistency and as said, its only possible to enter linear passwords. I bet I will have to do this, but then I will write the function in script which either downloads, patches and builds lgogdownloader from source, adding argc/argv functionality; or if I conquer the "expect" wheelchair magic.
mchack: actually I think it can detect and report failures but since I haven't known expect before your question, I am not deep enough into it to explain anything. But there should be plenty of example scripts floating around
As for getting everything from stdout that's what I used the
interact command at the end of my example expect scrpt.
After that it just basically hands you back the shell and gives you all the output and input. (so expect only entered the credentials you gave it in the script in my last post and then gave you back control. the output is exactly the same as if you did it by hand)
Well, basically you tell me that its sourcery for you too :)
I of course tried few scripts over internet, but none showed how can I get what program tries to stdin before quitting. I tried assinging expect call to the variable, but it cuts output right after password - even if password gets accepted.
Currently I am doing this in the script:
expect <<- EOD
spawn "$lgogfile" --login
expect "Email:*"
send -- "$kgogruntime_login\r"
expect "Password:*"
send -- "$kgogruntime_pass\r"
send -- "\r"
expect eof
EOD
And it works. But its blind and I can't detect such strings as:
"HTTP: Login successful"
"API: Login successful"
"Saving config: * /.config/lgogdownloader/config.cfg"
Btw, I managed to get localisation in scripts, without using additional files or po-files. I'll share it once I get it doing job at least half done.
ssokolow: I think Lin545 is complaining about lgogdownloader not using something like libreadline to allow you to make your password more difficult for primitive keyloggers to capture by typing "password" as "swo<Home>pas<End>rd".
Hey Stephan! Almost, I am actually entering passwords like libreadline myself. :)