nmap tcl

Active 2 Replies 536 Views 2022-12-25 16:14:10 TCL Snippets
Uses the nmap linux application to scan ips for open ports.

- Install nmap using "sudo apt install nmap"

bind pub - .nmap port_scan
proc port_scan {nick uhost handle chan args} {
       putserv "PRIVMSG $chan :4- Scanning... 04$args"
       global data_var
       set data_var [exec nmap $args]
       set l [split $data_var "
"]
       foreach i $l { puthelp "PRIVMSG $chan :4- $i " }
       putlog "<<$chan>> !$handle! !nmap"
}

putlog "nmap loaded"
Janroe replied
6 Months
@Konrado , do you mind pasting the error?

@BlackShadow, no flood protection on that nmap.tcl
Konrado replied
1 Year
any fix for this?

proc portscan {nick uhost hand chan arg} {
    set ip [lindex $arg 0]
    set command "nmap -Pn -sT -T4 -p1-65535 $ip -oG - | awk '/open/{print \$4}'>

    set port_list [exec $command]
    if {$port_list eq ""} {
        putquick "PRIVMSG $nick :No se encontraron puertos abiertos en $ip"
    } else {
        putquick "PRIVMSG $nick :Los siguientes puertos están abiertos en $ip: >
    }
}

bind pub - !portscan portscan
loading...