Results 1 to 14 of 14

Thread: Get remote IP for UDP protocol

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Get remote IP for UDP protocol

    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 ?

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Get remote IP for UDP protocol

    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
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    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):
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Sck.Protocol = sckUDPProtocol
    5.     Sck.RemoteHost = "217.160.252.81"
    6.     Sck.RemotePort = 27500
    7.    
    8.     Sck.SendData String(4, 255) & "getchallenge"
    9. End Sub
    10.  
    11. Private Sub Sck_DataArrival(ByVal bytesTotal As Long)
    12.     Dim Str As String
    13.     Sck.GetData Str, vbString
    14.    
    15.     Debug.Print Str
    16. End Sub
    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 ???

    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 ?

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Get remote IP for UDP protocol

    Just unplug your modem for an hour or so. It will probably change the IP address. Mine always does.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    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:
    VB Code:
    1. Sck.SendData Sck.LocalIP & "|" & myData
    This works right now because myData is never more than 1KByte, and data gets sent every couple of seconds.

    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 ???

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    Great.... my IP did not change...

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Get remote IP for UDP protocol

    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.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    You mean this: "Remaining lease time: 6 days,19 hrs,18 minutes"

    It will be a looong wait...

  9. #9
    New Member
    Join Date
    Apr 2005
    Posts
    5

    Re: Get remote IP for UDP protocol

    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).

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    Thanks for the idea, I'll try it when I get home.

    So, anyone has any idea about getting the IP from UDP ???

  11. #11
    Lively Member
    Join Date
    Apr 2005
    Posts
    127

    Re: Get remote IP for UDP protocol

    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

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    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

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Get remote IP for UDP protocol

    bump...

    So, still now one know how to get remote ip from UDP protocol ?
    .
    .

  14. #14
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Get remote IP for 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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width