faustf

questions about timing tcp scan

13 posts in this topic

hi guy

how  is  possible reduce  a  timing  of  scanning  ip ??

example  i have  a lan, i want  scan  for  find  open port 3356 , start 192.168.1.1 to 192.168.1.255 , how is  possible reduce  a  probing time ?? of  TCPConnect ??

 

1 person likes this

Share this post


Link to post
Share on other sites



Opt('TCPTimeout', 100)

 


Regards,
 

Share this post


Link to post
Share on other sites

100 is  one second ???

 

Share this post


Link to post
Share on other sites

100 is 100 milliseconds, or 1/10th of a second.

1000 is one second.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

32 minutes ago, faustf said:

100 is  one second ???

 

Opt("TCPTimeout", 100) ;100 milliseconds
; 1seconds=1000 milliseconds

 

Eg:

Opt('TCPTimeout', 50)

Global $hGUI = GUICreate("Autoit Port Scanner", 300, 175)
GUICtrlCreateGroup("Port Scan", 5, 5, 275, 160)
GUICtrlCreateLabel("IP", 20, 17)
Global $hcIPAddress = GUICtrlCreateInput(@IPAddress1, 20, 33, 125)
GUICtrlCreateLabel("Start on Port", 20, 55)
Global $hcPortStart = GUICtrlCreateInput("1", 20, 68, 125)
GUICtrlCreateLabel("End on Port", 20, 91)
Global $hcPortEnd = GUICtrlCreateInput("65353", 20, 108, 125)
Global $hcStartScan = GUICtrlCreateButton("Start", 20, 135, 125)
GUICtrlSetFont($hcStartScan, 12)
Global $hcOnPort = GUICtrlCreateLabel("Scanning Port: None", 150, 142)
GUICtrlCreateGroup("Open Ports", 160, 17, 105, 125)
Global $hcOpenPortList = GUICtrlCreateList("", 168, 30, 90, 109)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case -3
            ExitLoop
        Case $hcStartScan
            _StartScan(GUICtrlRead($hcIPAddress), GUICtrlRead($hcPortStart), GUICtrlRead($hcPortEnd))
    EndSwitch
WEnd

Func _StartScan($sIPScan = "127.0.0.1", $sPortStart = 1, $sPortEnd = 65353)
    TCPStartup()
    Local $sSoketID
    Local $sTimeStart = TimerInit()
    For $LetsGo = $sPortStart To $sPortEnd
        GUICtrlSetData($hcOnPort, "Scanning Port: " & $sPortStart)
        $sSoketID = TCPConnect($sIPScan, $sPortStart)
        If $sSoketID > 0 Then GUICtrlSetData($hcOpenPortList, $sPortStart)
        $sPortStart = $sPortStart + 1
    Next
    TCPShutdown()
    Local $sTimeEnd = TimerDiff($sTimeStart)
    TrayTip("Port Scanner", "Done Process took " & Round($sTimeEnd, -1) / 1000 & " seconds", 7, 1)
EndFunc   ;==>_StartScan

 

Edited by VIP
Eg

Regards,
 

Share this post


Link to post
Share on other sites

thankz
  :)

 

Share this post


Link to post
Share on other sites

i try to use  and  also  test  your script  , change  the  number  50  to  1000   but  not  see  differnce

:blink:

Share this post


Link to post
Share on other sites
2 hours ago, faustf said:

i try to use  and  also  test  your script  , change  the  number  50  to  1000   but  not  see  differnce

:blink:

if your server is turned on, it works too slowly, try increasing the delay time in opt!
For example, that you open an FTP server on port 21 and WebServer at port 80
You set the starting port is 1, and the end port is 100.
After the scan will show: 21 and 80 in the list of ports!


Regards,
 

Share this post


Link to post
Share on other sites

thankz  for  suggest , but  in my case  i have  this scenario:

i  want check only  port 3356 , the  server  stay on in many  pc  of my  lan, i want  discover with scan how  many  pc  of my lan  are open, therfore  the tcpconnet , probe one  time , and    go out ,(like  a  ping , i hope  explain  a sense) , because  when is open  the  answer  at  host  is  immidiatly i mesure  with timediff, and  is :

1.53287638512716 ,  but  when host is  closed the  time  is 21001.9468954853, i  want  if  possible, reduce   this timing after  2. or 3. must  answer me  with host down  and  start next ip

thankz at all for  support

 

Share this post


Link to post
Share on other sites

thank is  very  good  work i try to understund   :)

thankz  so much

 

Share this post


Link to post
Share on other sites

i fund a  bug

when i  run  a  TCP Example server for socket_UDF.au3  and run  client 

i  connect  send  somthing  , and  go ok

but if  i push disconnect , start  to write  in  console Data received:

in loop  and  if i try to reconnect not  work, i must  stop

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now