Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
Started to Fix help command, added TCP/UDP/HTTP Banner grabbing
Browse files Browse the repository at this point in the history
Added the ability for ronin-bot to grab banners

Example:
!banner mail.cnn.com 25
!banner_tcp mail.cnn.com 25
!banner_udp doesthisexist.com 1111
!banner_http www.reddit.com 80
  • Loading branch information
nullthreat committed Apr 10, 2012
1 parent b90c52e commit 4e1dca2
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ronin/ui/irc/plugins/formatting/base64.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Base64 < Plugin
match /(?:b64|base64) (?:enc|encode) (.+)/, :method => :encode
match /(?:b64|base64) (?:dec|decode) (.+)/, :method => :decode

usage "[base64] [encode|decode] STRING"
usage "[encode|decode] STRING"
summary "Encode or Decode a base64 string"

def encode(m,str)
Expand Down
4 changes: 2 additions & 2 deletions lib/ronin/ui/irc/plugins/formatting/digest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Digest < Plugin
match /(?:sha1|sha128) (.+)/, :method => :sha1
match /(?:sha2|sha256) (.+)/, :method => :sha256
match /(?:sha512) (.+)/, :method => :sha512

usage "[digest] [md5|sha1|sha256|sha512] STRING"
usage "[md5|sha1|sha256|sha512] STRING"
summary "Encode a string as md5,sha1,sha256 or sha512"

def md5(m,str)
Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/ui/irc/plugins/misc/insult.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Insult < Plugin

match /insult (\S+)/

usage "USER"
usage "[USER]"
summary "Insults a user in the channel"

def execute(m,nick)
Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/ui/irc/plugins/misc/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Time < Plugin
match /time ([A-Z]+(?:-\d{1,2})?)/

usage "[TIMEZONE]"
summary "Displays the current time, in the optional timezone"
summary "Displays the current time, the timezone is optional"

def execute(m,timezone=nil)
msg_filter(m) do
Expand Down
5 changes: 4 additions & 1 deletion lib/ronin/ui/irc/plugins/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@
# along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/ui/irc/plugins/network/dns'
require 'ronin/ui/irc/plugins/network/dns'
require 'ronin/ui/irc/plugins/network/http'
require 'ronin/ui/irc/plugins/network/tcp'
require 'ronin/ui/irc/plugins/network/udp'
52 changes: 52 additions & 0 deletions lib/ronin/ui/irc/plugins/network/http.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# encoding: utf-8
#
# Copyright (c) 2012 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This file is part of Ronin UI IRC.
#
# Ronin Ui Irc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin Ui Irc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/ui/irc/plugin'
require 'ronin/network/http'

include Ronin::Network::HTTP

module Ronin
module UI
module IRC
module Plugins
class HTTP < Plugin

match /(?:http_banner) (.+) (.+)/, :method => :banner

usage "[HOST] [PORT]"
summary "Retrieve the HTTP banner of remote host"

def banner(m,host,port)
msg_filter(m) do
result = http_server(:url => "http://#{host}:#{port}")
if result
m.reply(result)
else
m.reply("Banner Not Found")
end
end
end

end
end
end
end
end
52 changes: 52 additions & 0 deletions lib/ronin/ui/irc/plugins/network/tcp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# encoding: utf-8
#
# Copyright (c) 2012 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This file is part of Ronin UI IRC.
#
# Ronin Ui Irc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin Ui Irc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/ui/irc/plugin'
require 'ronin/network/tcp'

include Ronin::Network::TCP

module Ronin
module UI
module IRC
module Plugins
class TCP < Plugin

match /(?:banner|tcp_banner) (.+) (.+)/, :method => :banner

usage "[HOST] [PORT]"
summary "Retrieve banner of remote host"

def banner(m,host,port)
msg_filter(m) do
result = tcp_banner(host,port)
if result
m.reply(result)
else
m.reply("Banner Not Found")
end
end
end

end
end
end
end
end
52 changes: 52 additions & 0 deletions lib/ronin/ui/irc/plugins/network/udp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# encoding: utf-8
#
# Copyright (c) 2012 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This file is part of Ronin UI IRC.
#
# Ronin Ui Irc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin Ui Irc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ronin Ui Irc. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/ui/irc/plugin'
require 'ronin/network/udp'

include Ronin::Network::UDP

module Ronin
module UI
module IRC
module Plugins
class UDP < Plugin

match /(?:udp_banner) (.+) (.+)/, :method => :banner

usage "[HOST] [PORT]"
summary "Retrieve banner of remote host"

def banner(m,host,port)
msg_filter(m) do
result = tcp_banner(host,port)
if result
m.reply(result)
else
m.reply("Banner Not Found")
end
end
end

end
end
end
end
end

0 comments on commit 4e1dca2

Please sign in to comment.