Infinitex0 Posted July 27, 2007 Author Share Posted July 27, 2007 (edited) Well, I said I would redo it and I did, here is the TCP in a good *cough* best *cough* form. its a bit sloppy, but thats because I don't ever plan on others seeing my work. expandcollapse popup#include <guiconstants.au3> GUICreate("Infinitex0's Port Scanner", 300, 175) GUICtrlCreateGroup("Port Scan", 5, 5, 275, 160) $IPLabel = GUICtrlCreateLabel("IP", 20, 17) $PortIPAddress = GUICtrlCreateInput("127.0.0.1", 20, 33, 125) GUICtrlCreateLabel("Start on Port", 20, 55) $PortStartNumber = GUICtrlCreateInput("1", 20, 68, 125) GUICtrlCreateLabel("End on Port", 20, 91) $PortEndNumber = GUICtrlCreateInput("30", 20, 108, 125) $StartScan = GUICtrlCreateButton("Start", 20, 135, 125) GUICtrlSetFont($StartScan,15) GUICtrlCreateGroup("Open Ports", 160, 17,105, 125) $OpenPortList=GUICtrlCreateList("", 168, 30, 90, 109) GUICtrlCreateGroup ("",-99,-99,1,1) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_ClOSE ExitLoop Case $msg = $StartScan MsgBox(0, "Scanning", "Now Scanning", 1) _StartScan() EndSelect WEnd Func _StartScan() $PortIP=GUICtrlRead($PortIPAddress) $PortEndNumberB=guictrlread($PortEndNumber) $PortStartNumberB=guictrlread($PortStartNumber) TCPStartup() $timerstart = TimerInit() For $PortStartNumberB = $PortStartNumberB To $PortEndNumberB + 1 $socket = TCPConnect($PortIP,$PortStartNumberB) If $socket = -1 Then $PortStartNumberB = $PortStartNumberB + 1 Else GUICtrlSetData($OpenPortList,$PortStartNumberB) $PortStartNumberB = $PortStartNumberB + 1 EndIf Next TCPShutdown() $timerend = TimerDiff($timerstart) MsgBox(0, "Port Scanner", "Done, Process took " & Round($timerend,-1)/1000 & " seconds") EndFunc EDIT: No Idea how the IP thing got like that, I remember getting rid of that altogether. Edited July 27, 2007 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Pakku Posted July 27, 2007 Share Posted July 27, 2007 (edited) Hi, As a comment to all, if it returns an error that says the address is wrong, it simply means that it will give this error the next times too, so if it gives this error, you should break the loop as in my script earlier. @Richard Robertson Thanks! @SkinnyWhiteGuy add an exitloop after it gives a wrong address error and yours is just perfect Arjan Edited July 27, 2007 by arjan staring How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and backCalculate PiCommand line downloader (Youtube/Google video)Set the transparency of a window just by hitting a key!Secure your pcOther things:My filemanMy profilePM me Link to comment Share on other sites More sharing options...
Infinitex0 Posted July 27, 2007 Author Share Posted July 27, 2007 Hm, thats weird, I remember getting completely rid of that invalid IP thing a while ago. Oh well, its gone now. The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
ConsultingJoe Posted July 27, 2007 Share Posted July 27, 2007 Look for and download: Advanced Port Scanner Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
Infinitex0 Posted July 27, 2007 Author Share Posted July 27, 2007 Lol, as soon as I tried to start it my comp went crazy with antispy stuff stopping it. The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
ConsultingJoe Posted July 28, 2007 Share Posted July 28, 2007 Lol, as soon as I tried to start it my comp went crazy with antispy stuff stopping it.oh, lol. but its not a virus, its just your anti virus is seeing strange activity. Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
X-sploiT Posted July 28, 2007 Share Posted July 28, 2007 the only way to check if a port is open is send a msg to port 7(echo) and you should get a msg back,you dont directly connect to a udp port Link to comment Share on other sites More sharing options...
Infinitex0 Posted July 29, 2007 Author Share Posted July 29, 2007 (edited) oh, lol. but its not a virus, its just your anti virus is seeing strange activity.Yea, thats why it was so funny. Kind of like how people started freaking out when Adult swim put up those ATHF LED posters and people thought it was a terrorist thing. Edited July 29, 2007 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
ConsultingJoe Posted July 29, 2007 Share Posted July 29, 2007 Yea, thats why it was so funny. Kind of like how people started freaking out when Adult swim put up those ATHF LED posters and people thought it was a terrorist thing.Ohh, I loved that. They did it a few more times too. I guess in Chicago too. I know someone that has one of them. Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
Infinitex0 Posted July 29, 2007 Author Share Posted July 29, 2007 CRAP I MESSED UP GUYS SORRY! I messed up and 2.0 scanned every other port due to a math problem I didn't notice. This is 2.5 it has some tiny changes and the big change of scanning every port. Sorry once again I didn't notice this earlier. expandcollapse popup#include <guiconstants.au3> $PortScanner = GUICreate("Infinitex0's Port Scanner", 300, 175) GUICtrlCreateGroup("Port Scan", 5, 5, 275, 160) $IPLabel = GUICtrlCreateLabel("IP", 20, 17) $PortIPAddress = GUICtrlCreateInput("127.0.0.1", 20, 33, 125) GUICtrlCreateLabel("Start on Port", 20, 55) $PortStartNumber = GUICtrlCreateInput("1", 20, 68, 125) GUICtrlCreateLabel("End on Port", 20, 91) $PortEndNumber = GUICtrlCreateInput("30", 20, 108, 125) $StartScan = GUICtrlCreateButton("Start", 20, 135, 125) GUICtrlSetFont($StartScan,15) $OnPort = GUICtrlCreateLabel("Scanning Port:None", 150, 142) GUICtrlCreateGroup("Open Ports", 160, 17,105, 125) $OpenPortList=GUICtrlCreateList("", 168, 30, 90, 109) GUICtrlCreateGroup ("",-99,-99,1,1) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_ClOSE ExitLoop Case $msg = $StartScan _StartScan() EndSelect WEnd Func _StartScan() $PortIP=GUICtrlRead($PortIPAddress) $PortEndNumberB=guictrlread($PortEndNumber) $PortStartNumberB=guictrlread($PortStartNumber) TCPStartup() $timerstart = TimerInit() For $LetsGo = $PortStartNumberB To $PortEndNumberB $socket = TCPConnect($PortIP,$PortStartNumberB) ControlSetText("", "", $OnPort, "Scanning Port:" & $PortStartNumberB & "") If $socket = -1 Then $PortStartNumberB = $PortStartNumberB + 1 Else GUICtrlSetData($OpenPortList,$PortStartNumberB) $PortStartNumberB = $PortStartNumberB + 1 EndIf Next TCPShutdown() $timerend = TimerDiff($timerstart) TrayTip("Port Scanner", "Done Process took " & Round($timerend,-1)/1000 & " seconds", 7, 1) EndFunc The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted July 30, 2007 Share Posted July 30, 2007 the only way to check if a port is open is send a msg to port 7(echo) and you should get a msg back,you dont directly connect to a udp portDoes anyone still use echo? In my opinion it is ancient.. github.com/jvanegmond Link to comment Share on other sites More sharing options...
AzKay Posted August 12, 2007 Share Posted August 12, 2007 yea, I did know that these are used to check your own ports so you know if any are open to hackers (or crackers). One of the reasons I never put up the keylogger I made with autoit (besides the fact that its extremely easy), don't worry, I've never used it on anyone. I put in the timer thing so that I could see how fast it is. I think the max number of ports is like 65535. but even testing on your own comp it would take a while (almost a day) to do, with any scanner. Well, I think this is just what I needed to bring myself back to Autoit. I forgot how much I loved it.I believe I made a portscanner awhile back, So I could use it to check proxies. I made one before using autoit, But the tcp's timeout, was way too long. So, I made one using winsock, Goes 10x faster. x3 I could post the source, But I wont. Because I dont have it, Its one of the many things I didnt backup when I formatted. EDIT:: I just recreated the source. Here you go :3 Keeping in mind, You would need winsock control to be on your system already. $WinSock = ObjCreate("MSWinsock.Winsock.1") $Next = False $StartPort = 1 $EndPort = 65534 $Timeout = 100 For $i = $StartPort To $EndPort $WinSock.RemoteHost = "127.0.0.1" $WinSock.RemotePort = $i $WinSock.Connect AdlibEnable("Timeout", 1) $oTimer = TimerInit() While 1 If $Next = True Then AdlibDisable() $Next = False ExitLoop EndIf WEnd If $WinSock.State = 7 Then ConsoleWrite("[" & $i & "] Open" & @CRLF) Else ConsoleWrite("[" & $i & "] Closed" & @CRLF) EndIf $WinSock.Close Next Func Timeout() If TimerDiff($oTimer) > $Timeout Then $Next = True $oTimer = "" EndIf EndFunc Enjoy ;D # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Fabry Posted August 16, 2007 Share Posted August 16, 2007 Keeping in mind, You would need winsock control to be on your system already.How can I install it? A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center] Link to comment Share on other sites More sharing options...
AzKay Posted August 17, 2007 Share Posted August 17, 2007 Extract that to system32 folder, Then Start > Run > Regsvr32 MSWINSCK.ocx Then, run the script. My friend said doing that didnt work for him, But, Who knows, might work for you.MSWINSCK.rar # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
testingtest Posted August 17, 2007 Share Posted August 17, 2007 Hi, I rewrote your code: expandcollapse popup$SocketIP = "" $socketportstart = 1 $socketportend = 65535 TCPStartup() For $port = $socketportstart To $socketportend $socket = TCPConnect($SocketIP,$port) If $socket = -1 Then ConsoleWrite($port & " - Unable to connect." & @CRLF) ElseIf $socket = 1 Then ConsoleWrite($port & " - Wrong Address" & @CRLF) ExitLoop ElseIf $socket = 2 Then ConsoleWrite($port & " - Wrong Port" & @CRLF) Else ConsoleWrite($port & " - Success!" & @CRLF) EndIf Next TCPShutdown()oÝ÷ Ø2¢çÇ×z0y«"*î)Òr+^jw`÷²¢æ¥+¶{¦mêìjwb~Ø^ɪޢ§¢¹è´ Ý"·©§w*.®Z(§¨)ämëmz¹h¢è®Øb²ë¸Úú®¢×)nëfk&Þjëh×6$SocketIP = "" $socketportstart = 1 $socketportend = 65535 TCPStartup() For $port = $socketportstart To $socketportend $socket = TCPConnect($SocketIP,$port) If $socket = -1 Then ConsoleWrite($port & " - Unable to connect." & @CRLF) ElseIf $socket = 1 Then ConsoleWrite($port & " - Wrong Address" & @CRLF) ExitLoop ElseIf $socket = 2 Then ConsoleWrite($port & " - Wrong Port" & @CRLF) Else ConsoleWrite($port & " - Success!" & @CRLF) FileWrite("Successful Ports.txt" , $port & " - Success!" & @CRLF) EndIf Next TCPShutdown() Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now