egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A little help with !nmap <ip|hostname> [arguments]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
edu
Voice


Joined: 29 Oct 2006
Posts: 31

PostPosted: Sat Jun 09, 2007 4:59 am    Post subject: A little help with !nmap <ip|hostname> [arguments] Reply with quote

hey guys, I have a little problem here

Here's the code:
Code:

bind pub - !nmap nmap:scan
proc nmap:scan {nickname hostname handle channel text} {
      set text [split $text]
   set nmap_host [lindex $text 0]
   if {$nmap_host == ""} {
      putquick "NOTICE $nickname :SYNTAX: !nmap <ip|hostname> \[arguments\]"
      return
   }
   set nmap_arg [lindex $text 1]
   if {$nmap_arg == ""} {
      putquick "PRIVMSG $channel :Scanning $nmap_host (DEFAULT) will occupy me for about one minute!"
      global data_var
      set data_var [exec nmap $nmap_host]
      set l_data_var [split $data_var "\r\n"]
   } else {
      putquick "PRIVMSG $channel :Scanning $nmap_host ($nmap_arg) will occupy me for about one minute!"
      global data_var
      set data_var [exec nmap $nmap_host $nmap_arg]
      set l_data_var [split $data_var "\r\n"]
   }
   foreach nmap_info $l_data_var {
      putquick "PRIVMSG $channel :$nmap_info"
   }
}


When I do "!nmap motd.cc":
Code:

( 10:53:35 [a] ) <@Protos0> Scanning motd.cc (DEFAULT) will occupy me for about one minute!
( 10:55:16 [a] ) <@Protos0> Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-09 10:53 CEST
( 10:55:16 [a] ) <@Protos0> Interesting ports on ip-208-109-197-133.ip.secureserver.net (208.109.197.133):
( 10:55:18 [a] ) <@Protos0> Not shown: 1665 closed ports
( 10:55:20 [a] ) <@Protos0> PORT      STATE    SERVICE
( 10:55:22 [a] ) <@Protos0> 21/tcp    open     ftp
( 10:55:24 [a] ) <@Protos0> 22/tcp    open     ssh
( 10:55:26 [a] ) <@Protos0> 25/tcp    open     smtp
( 10:55:28 [a] ) <@Protos0> 42/tcp    filtered nameserver
( 10:55:30 [a] ) <@Protos0> 53/tcp    open     domain
( 10:55:32 [a] ) <@Protos0> 69/tcp    filtered tftp
( 10:55:34 [a] ) <@Protos0> 80/tcp    open     http
( 10:55:36 [a] ) <@Protos0> 106/tcp   open     pop3pw
( 10:55:38 [a] ) <@Protos0> 110/tcp   open     pop3
( 10:55:40 [a] ) <@Protos0> 113/tcp   open     auth
( 10:55:42 [a] ) <@Protos0> 135/tcp   filtered msrpc
( 10:55:44 [a] ) <@Protos0> 137/tcp   filtered netbios-ns
( 10:55:46 [a] ) <@Protos0> 138/tcp   filtered netbios-dgm
( 10:55:48 [a] ) <@Protos0> 139/tcp   filtered netbios-ssn
( 10:55:50 [a] ) <@Protos0> 143/tcp   open     imap
( 10:55:52 [a] ) <@Protos0> 161/tcp   filtered snmp
( 10:55:54 [a] ) <@Protos0> 162/tcp   filtered snmptrap
( 10:55:56 [a] ) <@Protos0> 179/tcp   filtered bgp
( 10:55:58 [a] ) <@Protos0> 443/tcp   open     https
( 10:56:00 [a] ) <@Protos0> 465/tcp   open     smtps
( 10:56:02 [a] ) <@Protos0> 993/tcp   open     imaps
( 10:56:04 [a] ) <@Protos0> 995/tcp   open     pop3s
( 10:56:06 [a] ) <@Protos0> 1080/tcp  filtered socks
( 10:56:08 [a] ) <@Protos0> 1241/tcp  filtered nessus
( 10:56:10 [a] ) <@Protos0> 3128/tcp  filtered squid-http
( 10:56:12 [a] ) <@Protos0> 3306/tcp  open     mysql
( 10:56:14 [a] ) <@Protos0> 6666/tcp  filtered irc-serv
( 10:56:16 [a] ) <@Protos0> 6667/tcp  filtered irc
( 10:56:18 [a] ) <@Protos0> 6668/tcp  filtered irc
( 10:56:20 [a] ) <@Protos0> 8080/tcp  filtered http-proxy
( 10:56:22 [a] ) <@Protos0> 8443/tcp  open     https-alt
( 10:56:24 [a] ) <@Protos0> 31337/tcp open     Elite
( 10:56:28 [a] ) <@Protos0> Nmap finished: 1 IP address (1 host up) scanned in 100.776 seconds


The problem is when I do something like "!nmap 1" as know as an ERROR, I want it to "reply" into the $channel, not in DCC, the ERROR belong:
Code:

( 10:58:12 [a] ) <Protos0> Tcl error [nmap:scan]:
( 10:58:12 [a] ) <Protos0> Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-09 10:58 CEST
( 10:58:12 [a] ) <Protos0> Invalid target host specification: 1
( 10:58:12 [a] ) <Protos0> QUITTING!


Please help me, thanks.
_________________
Seek the truth
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sat Jun 09, 2007 4:56 pm    Post subject: Reply with quote

You need to catch{} the error msg..

Code:

      set data_var (catch {[exec nmap $nmap_host $nmap_arg]} error)
      if {$error != ""} {puthelp "PRIVMSG $channel :$error"}

something like that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber