如何在autoit中扫描打开的udp端口? [英] How do i scan open udp port in autoit?
问题描述
我正在开发一个TCP / UDP端口扫描程序。 TCP工作正常,但似乎我不知道如何使用AutoIt实现UDP端口扫描。
因为UDP端口是无连接的我是使用UDPOpen函数绑定我的$ PortIP和$ PortStartNumberB。不幸的是,当我扫描它时会列出所有端口。到目前为止,它将显示我的应用程序中相应的开放端口,该端口已设置为仅允许UDP中的端口4008(例如4008)(因为我使用高级端口扫描工具进行测试,只有此端口应该打开)。
如果有人比我更了解情况,请帮助我了解如何修改下面发布的功能代码,因为我无法在AutoIt脚本中重现UDP开放端口列表?平台是Win7 x86。
$ portList =
$ PortIP =192.168。 11.1
$ PortEndNumberB =4010
$ PortStartNumberB =4000
Func ScanUDP()
UDPStartup()
$ timerstart = TimerInit( )
对于$ LetsGo = $ PortStartNumberB到$ PortEndNumberB
$ a = UDPOpen($ PortIP,$ PortStartNumberB,1)
如果@error<> 0然后
$ portList = $ portList& $ PortStartNumberB& @CRLF
EndIf
$ PortStartNumberB = $ PortStartNumberB + 1
下一个
UDPShutdown()
$ timerend = TimerDiff($ timerstart)
TrayTip(Port Scanner,Done Process take& Round($ timerend,-1)/ 1000&seconds,7,1)
EndFunc
我尝试了什么:
当我尝试跑步时,它列出所有的港口。
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
右边,我需要只显示4008这是右开udp端口(我已经使用其他免费软件工具进行测试 - 高级端口扫描)
PortIP和
PortStartNumberB。不幸的是,当我扫描它时会列出所有端口。到目前为止,它将显示我的应用程序中相应的开放端口,该端口已设置为仅允许UDP中的端口4008(例如4008)(因为我使用高级端口扫描工具进行测试,只有此端口应该打开)。
如果有人比我更了解情况,请帮助我了解如何修改下面发布的功能代码,因为我无法在AutoIt脚本中重现UDP开放端口列表?平台是Win7 x86。
portList =
I am working on a program for TCP/UDP port scanning. TCP is working fine and well but it seems like I have no idea on how to achieve the UDP port scanning using the AutoIt.
Since the UDP port is connectionless I am using UDPOpen function to bind my $PortIP and $PortStartNumberB. Unfortunately when I scan it will list out all ports. By now it will show up the respective open port from my application that has been set to allowed only for port 4008 in UDP for example 4008 (since i testing using advance port scanner tool and only this port should be be open).
Could someone more knowledgeable than myself please help me to understand on how I can modify the function code posted below since I am not able to reproduce the UDP open port list in AutoIt script? Platform is Win7 x86.
$portList = " " $PortIP = "192.168.11.1" $PortEndNumberB = "4010" $PortStartNumberB = "4000" Func ScanUDP() UDPStartup() $timerstart = TimerInit() For $LetsGo = $PortStartNumberB To $PortEndNumberB $a = UDPOpen($PortIP, $PortStartNumberB, 1) If @error <> 0 Then $portList = $portList & $PortStartNumberB & @CRLF EndIf $PortStartNumberB = $PortStartNumberB + 1 Next UDPShutdown() $timerend = TimerDiff($timerstart) TrayTip("Port Scanner", "Done Process took " & Round($timerend,-1)/1000 & " seconds", 7, 1) EndFunc
What I have tried:
when i try run, it list out all the port from.
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
by right, i need to display only 4008 which is the right open udp port (i has tested using other freeware tools-advance port scan)
PortIP and
PortStartNumberB. Unfortunately when I scan it will list out all ports. By now it will show up the respective open port from my application that has been set to allowed only for port 4008 in UDP for example 4008 (since i testing using advance port scanner tool and only this port should be be open).
Could someone more knowledgeable than myself please help me to understand on how I can modify the function code posted below since I am not able to reproduce the UDP open port list in AutoIt script? Platform is Win7 x86.
portList = " "
这篇关于如何在autoit中扫描打开的udp端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!