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 

Portscan

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
REDLiNE1
Voice


Joined: 03 Jul 2007
Posts: 9

PostPosted: Wed Jan 30, 2008 6:51 pm    Post subject: Portscan Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Wed Jan 30, 2008 8:45 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
REDLiNE1
Voice


Joined: 03 Jul 2007
Posts: 9

PostPosted: Wed Jan 30, 2008 9:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Jan 31, 2008 11:28 am    Post subject: Reply with quote

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. Rolling Eyes
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Jan 31, 2008 11:46 am    Post subject: Reply with quote

@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
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Jan 31, 2008 12:57 pm    Post subject: Reply with quote

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. Rolling Eyes
Back to top
View user's profile Send private message
REDLiNE1
Voice


Joined: 03 Jul 2007
Posts: 9

PostPosted: Fri Feb 01, 2008 5:28 am    Post subject: Reply with quote

could http://insecure.org get the ports then tcl print the info to a irc chan?
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 Requests 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