Sign in to follow this  
Followers 0
susu6514

Send UDP packet with specific source port

9 posts in this topic

#1 ·  Posted (edited)

Hi

I'm doing some test and want to mimicry a DNS behavior but I find I can't use a specific port when sending UDP packet.

The behavior is like this.

PCA sends DNS query to PCB (UDP port 1234 to 53)

PCB sends back DNS reply to PCA (UDP port 53 to 1234)

Is there a way to do this?

Thank you.

Edited by susu6514

Share this post


Link to post
Share on other sites



UDPOpen(), UDPSend()

Dog ate your help file?

;)

Or maybe the dog is writing the program for you using an old version of AutoIt?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Oh, wow. Is that "UDP port 1234 to 53" really old AutoIt syntax?

I wouldn't know, 'cause I'm so much YOUNGER than martin!

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I wouldn't know, 'cause I'm so much YOUNGER than martin!

;)

Yes, .. most people are :). But I've still good a good memory.

And the other thing is, I've still got a good memory.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

What you are trying to do won't work using AutoIt's build in UDP commands. They only let you specify the destination port and not the source port on your outgoing data.

You'll have to make some DllCalls to do this.

Share this post


Link to post
Share on other sites

In my earlier post I think I was thinking of this.

So maybe you could arrange things like this.

Send a udp message from the PC to the PCA port 1234. (I don't know what PCA means!) Then the program on PCA could work out what port was used on the PC and use that port instead of 53.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Martin, that's PC (personal computer) 'A' and PC 'B'. At least that was my understanding.

Also, setting the UDP source port is doable. Just not in pure AutoIt.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thank you, Martin. Maybe I should use WinPcap instead.

Edited by susu6514

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
Sign in to follow this  
Followers 0