Advertisement
flypip

Flyport (scan port)

Nov 1st, 2011
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.74 KB | None | 0 0
  1. #include <guiconstants.au3>
  2.  
  3. $PortScanner = GUICreate("Flypip port scanner", 300, 175)
  4. GUICtrlCreateGroup("Scan du port", 5, 5, 275, 160)
  5. $IPLabel = GUICtrlCreateLabel("IP", 20, 17)
  6. $PortIPAddress = GUICtrlCreateInput("127.0.0.1", 20, 33, 125)
  7. GUICtrlCreateLabel("Start on Port", 20, 55)
  8. $PortStartNumber = GUICtrlCreateInput("1", 20, 68, 125)
  9. GUICtrlCreateLabel("End on Port", 20, 91)
  10. $PortEndNumber = GUICtrlCreateInput("30", 20, 108, 125)
  11. $StartScan = GUICtrlCreateButton("Start", 20, 135, 125)
  12. GUICtrlSetFont($StartScan,15)
  13. $OnPort = GUICtrlCreateLabel("Scanning Port:None", 150, 142)
  14. GUICtrlCreateGroup("port ouvert", 160, 17,105, 125)
  15. $OpenPortList=GUICtrlCreateList("", 168, 30, 90, 109)
  16. GUICtrlCreateGroup ("",-99,-99,1,1)
  17. GUISetState(@SW_SHOW)
  18.  
  19.  
  20. While 1
  21.     $msg = GUIGetMsg()
  22.     Select
  23.         Case $msg = $GUI_EVENT_ClOSE
  24.             ExitLoop
  25.         Case $msg = $StartScan
  26.             _StartScan()
  27.     EndSelect
  28. WEnd
  29.  
  30.  
  31. Func _StartScan()
  32.     $PortIP=GUICtrlRead($PortIPAddress)
  33.     $PortEndNumberB=guictrlread($PortEndNumber)
  34.     $PortStartNumberB=guictrlread($PortStartNumber)
  35.     TCPStartup()
  36.     $timerstart = TimerInit()
  37.  
  38.     For $LetsGo = $PortStartNumberB To $PortEndNumberB
  39.         $socket = TCPConnect($PortIP,$PortStartNumberB)
  40.         ControlSetText("", "", $OnPort, "Scanning Port:" & $PortStartNumberB & "")
  41.         If $socket = -1 Then
  42.             $PortStartNumberB = $PortStartNumberB + 1
  43.         Else
  44.             GUICtrlSetData($OpenPortList,$PortStartNumberB)
  45.         $PortStartNumberB = $PortStartNumberB + 1
  46.         EndIf
  47.     Next
  48.  
  49.     TCPShutdown()
  50.     $timerend = TimerDiff($timerstart)
  51.     TrayTip("Flypip Port scanner", "le scan est terminé " & Round($timerend,-1)/1000 & " seconds", 7, 1)
  52. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement