If I run open with:
input, output,error = Open3.popen3 "nikto -host someip -port 80 -output xml"
How can I detect if nikto is done? It takes a while for the scan to complete.
If something goes wrong, I suppose I have to periodically check error to see if anything that been written?
Is there any decent docs that exist for open3? No, the ruby-docs are nowhere near decent.
input, output, error = Open3.popen3 "nikto -host someip -port 80 -output xml"
if select([output], nil, nil, 0.1) and output.eof?
# process exited and doesn't have output queued.
else
# still running or has output not read yet.
end
Also, here is some good documentation I found by googling: http://www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/open3/rdoc/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With