Skip to content

Instantly share code, notes, and snippets.

@picatz
Created April 14, 2017 23:21
Show Gist options
  • Save picatz/2d1761276b69bba2df20c105f08c6e1b to your computer and use it in GitHub Desktop.
Save picatz/2d1761276b69bba2df20c105f08c6e1b to your computer and use it in GitHub Desktop.
Violent Ruby: Banner Grabber - Basic Usage
require 'violent_ruby'
ViolentRuby::BannerGrabber.new(ip: '192.168.0.2', port: 2222).grab do |result|
# Do something with result.
# => {:ip=>"192.168.0.2", :port=>22, :open=>true, :banner=>"SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3\r\n"}
result[:ip]
# => "192.168.0.2"
result[:port]
# => 22
result[:open]
# => true
result[:banner]
# => "SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3\r\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment