Zohar Posted 19 hours ago Posted 19 hours ago (edited) Hi all I am sending a UDP Message using UDPOpen() and UDPSend(). I am specifying the Target_IP and Target_Port, and would like to ask if AutoIt somehow enables me to get the Source_Port that was used for sending that UDP Message. Thank you Edited 19 hours ago by Zohar
argumentum Posted 18 hours ago Posted 18 hours ago (edited) https://www.autoitscript.com/forum/topic/87856-udp-source-port/ 🤔 https://www.autoitscript.com/trac/autoit/ticket/1869 🤷♂️ Edited 18 hours ago by argumentum Festerini 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Nine Posted 18 hours ago Posted 18 hours ago Not sure if this is what you want but I believe you can use $UDP_DATA_ARRAY (2) - returned in an Array : [0] data, [1] from IP, [2] from Port. Use 3 for both binary and array. See UDPRecv in help file. Festerini 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Festerini Posted 11 hours ago Posted 11 hours ago 7 hours ago, Zohar said: Hi all I am sending a UDP Message using UDPOpen() and UDPSend(). I am specifying the Target_IP and Target_Port, and would like to ask if AutoIt somehow enables me to get the Source_Port that was used for sending that UDP Message. Thank you As per what Nine has said. It returns IP and Port in the array. Note that the port used to send is a dynamic port selected at random from the ephemeral (dynamic) port range as dictated by the sending PC. The Ephemeral port range On Windows (using netsh) View current range: netsh int ipv4 show dynamicportrange tcp. Or netsh int ipv4 show dynamicportrange udp Set range (persistent after reboot): netsh int ipv4 set dynamicport tcp start=1025 num=64510 (sets range 1025-65535). Or netsh int ipv4 set dynamicport udp start=1025 num=64510 (sets range 1025-65535) Apply changes: A reboot is often required for persistence. Troubleshooting: Restarting the winnat service (net stop winnat then net start winnat) can sometimes free up port Ephemeral (dynamic) ports exist to allow multiple simultaneous outbound connections so that a single outbound port is not blocked up and used single file. Widening the range prevents port exhaustion. Note: 1025-65535 is the widest range possible. More info here: https://learn.microsoft.com/en-us/troubleshoot/windows-client/networking/tcp-ip-port-exhaustion-troubleshooting
Nine Posted 10 hours ago Posted 10 hours ago Is that an AI answer ? Looks like it as it does not provide useful information for AutoIt programmers. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Festerini Posted 10 hours ago Posted 10 hours ago 5 minutes ago, Nine said: Is that an AI answer ? Looks like it as it does not provide useful information for AutoIt programmers. There must be a reason Zohar is asking to find the outbound UDP port and it will be related to networking, not isolated AutoIT use. I doubt it is for idle curiosity, so I thought I would add a context. If you are referring to my answer, no, it is my answer, but with some text from Google, to avoid typing it out long hand. Actually I am an AutoIT programmer, and have written dozens of Autoit exes to both detect and alter ranges, and track ip and port use in general, as part of an MSP application, and also trying to solve other engineers issues, such as slow bulk mail sending because of port exhaustion. And I also make use of that data for programming Cisco IOS routers and creating of Dynamic Firewalling on said routers. Autoit is also very useful for programmatically setting Windows firewall rules, as well as creating and using syslog and a whole bunch of other process, all created with AutoIT. And I use daily a program originally written by trancexx - NETWORK CONNECTIONS VIEWER, to look at outbound TCP and UDP connections. I took that code and rewrote for internal use.
Nine Posted 10 hours ago Posted 10 hours ago Ok your last answer is not coming from any AI. But I still believe the previous one is from AI. Anyhow not that I disgrace using AI, but I still trust HI to be better. Have a good night “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Festerini Posted 9 hours ago Posted 9 hours ago (edited) 24 minutes ago, Nine said: Ok your last answer is not coming from any AI. But I still believe the previous one is from AI. Anyhow not that I disgrace using AI, but I still trust HI to be better. Have a good night I do not use AI per se. 🙂 The answer was from Google (which seems to use AI, and thus unavoidable), which agreed with my understanding, so copied and edited by me, simply to avoid me digging out all my notes. I have a very Dim view of AI, and blog accordingly, and outspoken on other forums. Over the last 15 years I found searching google quicker to find answers about AutoIT and users solutions for AutoIT, but am becoming frequently disturbed by Google AI trying to be an expert at everything. I've always done my own research. I don't trust AI one bit. I work in Cyber security so even Cloud, the source of most hacks, is off limits where ever possible. AutoIT is a god-send in being able to maintain off-Cloud resources for clients. Edited 9 hours ago by Festerini
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