Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.