Open nyxnor opened 2 years ago
post from 2007 that may help https://www.linuxquestions.org/questions/programming-9/shell-script-to-automate-telnet-573950/
You can use following bash script as an example:
http://tiocu.svn.sourceforge.net/vie...il?revision=58. Function `wait4ack()' and lines below `echo connecting...' are of interest for you.
Shortly speaking we run telnet process in background and associate file descriptors 3 and 4 with its stdin and stdout using something like this:
Code:
mkfifo $FIFO
exec 4< <(telnet $SERVER 25 < $FIFO 2> /dev/null &)
exec 3>$FIFO
Now we can send commands to telnet through 3'rd fd and recieve responses through 4'th one:
Code:
echo $comm >&3
wait4ack "$optn" <&4
wait4ack() reads its stdin (i.e. 4'th file descriptor) until something like '+OK' in POP3 protocol or 250 in SMTP (see corresponding RFC document).
Hope, this helps.
firstfire == agre.
pfetch redirection might also help https://github.com/dylanaraps/pfetch/blob/master/pfetch
It is not working currently because it can't read the replies because all commands are sent, piped to networking tool (netcat/socat/telnet) then it is analyzed by tor;s controller, because of this I am having a bad time to get the ServerNonce without closing the connection, which would result on a new servernonce next time.
https://stem.torproject.org/faq.html#i-m-using-safe-cookie-authentication