Until today I did not think it's possible, but now I am 100% sure that it is possible, and I want to know how ?
Printable View
Until today I did not think it's possible, but now I am 100% sure that it is possible, and I want to know how ?
If you are using UDP over IP then the UDP packet is put inside an IP datagram, so it is possible and also necessary to know the IP address of the sender and recipient.
To tell you how though, it would be useful if you could tell us what you are using :)
OK, here's the story.
I was playing Quake on the net, and some people there were not playing fair, so I thought well why should I play fair ? yea... well... I got banned in like 1 minute.... "permanently banned" :)
So i thought, "they can't bann me, I'm a programmer".
I thought since the connection is UDP they can't bann me by IP, but by something else like an ID... anyways, I made a small program in VB, that acts as a server, I've set my Quake to connect to my program, and quake sent a string to my program, somehting like "getchallenge".
So, then I made another small program that sends "getchallenge" to the server I was playing, as soon as It sent the data, I got a reply back "permanently banned", bummer... aparently it was not an ID, it was my IP they use to bann me...
This is the code I was using (and that's the actual server):
And another weird thing is that in my code "theoretically" i'm not supposed to get a reply, don't I have to use the "bind" winsock function for that ???VB Code:
Option Explicit Private Sub Form_Load() Sck.Protocol = sckUDPProtocol Sck.RemoteHost = "217.160.252.81" Sck.RemotePort = 27500 Sck.SendData String(4, 255) & "getchallenge" End Sub Private Sub Sck_DataArrival(ByVal bytesTotal As Long) Dim Str As String Sck.GetData Str, vbString Debug.Print Str End Sub
PS, if you try this code, obviously you won't get "banned permanently", asumming you did not do the same thing as me :)
By the way, i'm not trying to do anything malicious to the server, all I want to know is how do they get my IP ?
Can't wait until my IP changes...
Anyways, so... how do they do it ?
Just unplug your modem for an hour or so. It will probably change the IP address. Mine always does.
I left it off for the whole night and I'll turn it back on when I get home, aproximatelly 18 hours should be enough... Though, I remember in the past I asked my internet provider how long it takes to reset the IP, and I think they told me 24 to 48 hours...
Also, they did a port scan. I looked in the emails from my firewall logs (phisical firewall), and they stared to scan at port 1033 up to 2148, in about 3 minutes time. It was a multithreaded scan because the port scans were not exactly in order.
Anyways, any ideas on how to get the IP from the UDP packet ?
I'm making a client server app at work, and I am using UDP for some of the stuff, and It will be somewhat usefull if I could get the IP from the UDP packet. Right now, I do something like:This works right now because myData is never more than 1KByte, and data gets sent every couple of seconds.VB Code:
Sck.SendData Sck.LocalIP & "|" & myData
If I could get the IP then I could make some nice improvements.
Also, I already have ideas on other things I could do if I get the IP from UDP.
So... anyone ???
Great.... my IP did not change... :(
Don't you have a lease time for the DHCP? Just unplug it at the time it expires.
They might be 24 hours leases. As long as you're not connected when the DHCP server assigns addresses, they will go out in order.
You mean this: "Remaining lease time: 6 days,19 hrs,18 minutes"
It will be a looong wait...
You may want to try releasing the IP address, then waiting. Depending on how their DHCP server acts, it may give out the IP very quickly and you will get a new one. If you are using windows 2000 or windows xp open command prompt and type ipconfig /release
I would suggest waiting 30 mins to 1 hr, then type in ipconfig /renew (or simply reboot your machine).
Thanks for the idea, I'll try it when I get home.
So, anyone has any idea about getting the IP from UDP ???
if your dialupping then you can sometimes request your own IP address. I can do this on my ISP Im not sure about yours. Just goto properties on your Dialup connection icon. Then look for it, you should be able to find it preety soon since there aren't many things in there
I'm not using dialup, I have cable connection.
But I don't care about changing my IP anymore... that's not why I started this thread...
I want to know how to get the REMOTE IP when I receive data using UDP
bump...
So, still now one know how to get remote ip from UDP protocol ?
.
.
Like I said before, if you are running UDP over IP then one needs to know the IP address of the sender and the receiever.
Unlike TCP, UDP is a conectionless protocol, at the UDP level, each packet is treated as an individual entity. Therefoe there is no reliability when it comes to the successful delivery of packets and a UDP server can receive UDP packets which come from many different IP addresses. The Winsock control does not address this, so you may have to use the Winsock API functions instead.
I will have a look into this.