class Arirang
def baedal
$ari_info = {
'description' => 'arirang script examples - multi-port',
'author' => 'pilot pilot@monkey.org'
}
puts $ari_info['description'] + "\n\n"
end
def asadal
ariconnect
ssh = "arirang"
http = "GET / HTTP/1.0\r\n\r\n"
if ($ari_sport == "80" or $ari_sport == "8080")
httpresp = arisend(http)
httpresp.each do |line|
x = line.match(/^Server\: (.+)\r/)
if x != nil
y = "#{$ari_host} - #{$ari_sport}/tcp - #{x[1]}\n"
ariprint(y)
end
end
end
if ($ari_sport == "22")
sshresp = arisend(ssh)
sshresp.each do |line|
a = line.match(/^SSH-(.+)/)
if a != nil
b = "#{$ari_host} - #{$ari_sport}/tcp - #{a[1]}\n"
ariprint(b)
end
end
end
ariclose
end
end