| View previous topic :: View next topic |
| Author |
Message |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Tue May 20, 2008 4:08 pm Post subject: TCP TIMEOUT Option in TCP Suite (VDS5) |
|
|
Im running into a slight issue with the TIMEOUT option in the TCP Suite. I want the connection attempt to only last about 3 seconds and if no connection is made to go on to the next item in my list.
Here is the script that im using. Can somebody tell me if i'm doing something wrong here.
| Code: |
external vdstcp50
#include vdstcp50.dsu
TCP OPTION, TIMEOUT, 4
EXTERNAL STRING.DLL
#DEFINE FUNCTION, STRING
Title Extract
DIALOG CREATE,Telnet Scanner,-1,0,650,400
DIALOG ADD,TEXT,TEXT1,360,10,,,Subnets
DIALOG ADD,STATUS,Status,IP Scanner
DIALOG ADD,GROUP,GROUP1,10,10,630,340
DIALOG ADD,LIST,LOG,20,15,620,320
DIALOG ADD,EDIT,SUBNET,355,70
DIALOG ADD,BUTTON,GO,355,570
DIALOG SHOW
# - Delete Hubs = 1
# - Add Hubs = 2
# - Router or Switch = 3
# - Delete Printers = 4
list create,1
list create,2
list create,3
list create,4
:evloop
wait event
goto @event()
:GOBUTTON
%%subnet = @dlgtext(SUBNET)
if @null(%%subnet)
info No Subnet Provided
goto evloop
end
%%now = "1"
REPEAT
%%ip = %%subnet%%now
list add,log,Now scanning %%ip
TCP CONNECT, %%ip, 23
wait 2
if @TCP(CONNECTED)
list add,log,Connected to %%ip
list create,9
list add,9,@TCP(GET)
%%tmpfile = @path(%0)file.tmp
file delete,%%tmpfile
list savefile,9,%%tmpfile
list close,9
##
if @string(FileOps, HoldsString, %%tmpfile,,Hub,,,)
list add,log,%%ip is a hub
list add,2,"add device -ip "@chr(34)"Hubs:"%%ip@chr(34)
list add,1,"del device -ip "%%ip
list savefile,2,@path(%0)newhubs.txt
list savefile,1,@path(%0)delhubs.txt
end
if @string(FileOps, HoldsString, %%tmpfile,,"2950",,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,"2948",,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,Compliance,,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,Cisco,,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,"Warning**",,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,"AP",,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,"WAP",,,)
list add,3,%%ip@chr(44)Router
list savefile,3,@path(%0)routers.txt
list add,log,%%ip is a router or switch
end
if @string(FileOps, HoldsString, %%tmpfile,,"JetDirect",,,)
list add,4,%%ip@chr(44)Printer
list savefile,4,@path(%0)printers.txt
list add,log,%%ip is a Printer
end
##
end
TCP DISCONNECT
%%now = @succ(%%now)
UNTIL @equal(%%now,254)
goto evloop
:Close
list savefile,log,@path(%0)log-@datetime(hhnnssmmddyyyy).log
exit
|
Thanks
WD _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed May 21, 2008 1:18 am Post subject: |
|
|
Try replacing;
| Code: | TCP CONNECT, %%ip, 23
wait 2
if @TCP(CONNECTED) |
-with-
| Code: | TCP CONNECT, %%ip, 23
If @ok() |
|
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Wed May 21, 2008 2:02 pm Post subject: Did'nt Work |
|
|
I tried it both ways and what happens is that if there is no daemon listening on the port you try and connect to it just hangs during the connect about 15 seconds (which is normal for a windows machine typically) and then it tries the next IP in my list. What I want it to do is if it cant connect in about 2 seconds to stop and then just go to the next IP. Maybe I could do this with a timer or some such code but I don't remember exactly how to do it. Arrrgghhh. Will play with it a bit or if somebody has a quick fix I would appreciate it.
WD _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Fri May 23, 2008 9:28 pm Post subject: |
|
|
Your problem is that your script will halt until "TCP CONNECT" is done.
Sounds like "TCP OPTION,TIMEOUT,nn" is broke in vdstcp50.dll
I don't see anyway around it until the Timeout option is fixed.
Note: vdstcp50 can only support a single TCP connection per script. |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sat May 24, 2008 1:02 am Post subject: |
|
|
As an alternative you could use VDSIPP.dll with Threads ON. Using VDSIPP will also allow you to make multiple TCP connections. _________________ cheers
Dave |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Fri May 30, 2008 8:29 pm Post subject: TCP TIMEOUT OPTION |
|
|
I do use VDSIPP also. Thats actually what I have done to fix the issue. I figured if I had to change the extension I might as well thread it out and scan alot quicker so now I start 10 different scans at a time instead of just 1. Thanks for your suggestions. I ended up doing it that way before I could read your response.
WD _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
|
|
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 You can attach files in this forum You can download files in this forum
|
|