| View previous topic :: View next topic |
| Author |
Message |
REDLiNE1 Voice
Joined: 03 Jul 2007 Posts: 9
|
Posted: Wed Jan 30, 2008 6:51 pm Post subject: Portscan |
|
|
Hi,
Can some one help me out i want to make a portscan Script that will scan an ip and bring back somthing like this:
!portscan $IP
* start scanning $IP
* 21 (ftp)
* 22 (ssh)
* 113 (auth)
* 8080 (webcache)
* scan finished! 51 ports scanned. (open: 4, closed: 4, stealth: 43)
this is an other frends eggdrop script unfortunately he will not give it to me.
it would be great if someone can help me thanks |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Wed Jan 30, 2008 8:45 pm Post subject: |
|
|
First of all, if you want this script made, then post @ the scripting request's forum.
Secondly, if your willing to modify/learn tcl then heres a pointer:
This is the portscan code from my trojan scanner, with a few tweaks/mods here and there...
| Code: | proc trojan::portscan {host ports} {
set portlist ""
set hostmask ""
set ip ""
set nmap [exec nmap -sT -P0 -p [join $ports ,] $host]
foreach line [split $nmap \n] {
if {[regexp {Interesting ports on (.+) \(([^)]+)\)} $line]} {
set hostmask [lindex [split $line] 3]
set ip [string range [lindex [split $line] 4] 1 end-1]
} elseif {[regexp {[0-9]{1,3}/tcp open|filtered [a-z0-9]} $line]} {
lappend portlist [set p [lindex [split [lindex [split $line] 0] /] 0]]
}
}
if {$portlist == ""} {
set portlist "0"
}
foreach x [split $portlist \n] {
return "$x"
}
} |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
REDLiNE1 Voice
Joined: 03 Jul 2007 Posts: 9
|
Posted: Wed Jan 30, 2008 9:17 pm Post subject: |
|
|
| i ddent no there was a scripting request's forum. also i no tcl but i could never get this to work thats why i came here and asked for help |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Jan 31, 2008 11:28 am Post subject: |
|
|
| REDLiNE1 wrote: | | i ddent no there was a scripting request's forum. |
How could you not see it? Plain as the nose on your face.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Jan 31, 2008 11:46 am Post subject: |
|
|
@Tosser:
Isn't it a bit dangerous using exec with nmap, since scans may take a while. Thought 'bout using "open" with pipe instead? A bit more complex, but wouldn't block your bot while scanning...
Also, what's the point of this:
| Code: | foreach x [split $portlist \n] {
return "$x"
} |
Would'nt it be simpler to just do something like this:
| Code: | | return [lindex [split $portlist \n] 0] |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Jan 31, 2008 12:57 pm Post subject: |
|
|
| nml375 wrote: | @Tosser:
Isn't it a bit dangerous using exec with nmap, since scans may take a while. Thought 'bout using "open" with pipe instead? A bit more complex, but wouldn't block your bot while scanning...
Also, what's the point of this:
| Code: | foreach x [split $portlist \n] {
return "$x"
} |
Would'nt it be simpler to just do something like this:
| Code: | | return [lindex [split $portlist \n] 0] |
|
That's because he doesn't know that it would stop after the first loop.  |
|
| Back to top |
|
 |
REDLiNE1 Voice
Joined: 03 Jul 2007 Posts: 9
|
Posted: Fri Feb 01, 2008 5:28 am Post subject: |
|
|
| could http://insecure.org get the ports then tcl print the info to a irc chan? |
|
| Back to top |
|
 |
|