nmap has this function - when you scan [#nmap -A -T4 localhost] and press "Enter" - it displays the status information "Timing: about 6.17% done",
Question. How can I make this press a few times without touching the keyboard in the bourne shell?
ps: just trying to find a workaround for an error in the php proc_open function when the stdout of the process returns only after the stdout pipe is closed, and php pty emulation does not work on fbsd.
The question is closed. The problem is solved using the "expect" utility
spawn /usr/local/bin/nmap -A -T4 -p 21-100 localhost
expect arting {sleep 3; send \r}
while {1} {
expect eof {
send_user "finished\n";
exit;
} "done;" {
sleep 3;
send \r;
continue;
}
}
source
share