Jump to content

Interactive Prompt


sheppardzwc

Recommended Posts

Hi guys,

 

Just ran into a problem when trying to auto-generate something. Basically, the program I'm working with generates it's passwords in a very strange way.. I have to use it's binary to generate the password.

 

zach@ariact:/usr/local/bin$ znc --help

[ ** ] USAGE: znc [options] [config]

[ ** ] Options are:

...

[ ** ]  -s, --makepass    Generates a password for use in config

 

But when using -s, there isn't a normal: znc -s passwordtomake, nooo, it uses an interactive prompt. This is a roadblock for me in PHP. How can I pass a string, well, a string and then the string again, then take whatever output it gives me, to generate the password?

 

i.e. it does this:

 

zach@ariact:/usr/local/bin$ znc -s

[ ?? ] Enter Password:

[ ?? ] Confirm Password:

[ ** ] Use this in the <User> section of your config:

[ ** ] Pass = sha256#06e9685f6fcd7466c23d797cea77818fac49b1bcd8f083f12c93246b762363d7#St/sRT.IkAhMBaXgEReG#

zach@ariact:/usr/local/bin$

 

how can I do this via PHP's exec/system/passthru?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/205859-interactive-prompt/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.