Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 12:32

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Quake Rcon
PostPosted: 07 Jul 2010 15:01 

Joined: 08 May 2010 17:58
Posts: 55
Location: In vast nothingness of space...
Hi!

So theese days, i have been working on some rcon client for quake3, and i made it work properly, it can get the response too
anyways, i figured out that i could remake this into rcon brute forcer (i.e. blocker)

so i stripped down some code it shouldnt require, so the code looks like this now
the thing is: code is in vb.NET, so i would just loop the function calling
Code:
Namespace QuakeRcon
   Friend Class RCON

      Public Function sendCommand(ByVal gameServerIP As String, ByVal password As String, ByVal gameServerPort As Integer) As String
            On Error Resume Next

         Dim client As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
         client.Connect(IPAddress.Parse(gameServerIP), gameServerPort)

         Dim command As String
         command = "rcon " & password & " " & "status"
         Dim bufferTemp() As Byte = Encoding.ASCII.GetBytes(command)
         Dim bufferSend(bufferTemp.Length + 5 - 1) As Byte

         'intial 5 characters as per standard
         bufferSend(0) = Byte.Parse("255")
         bufferSend(1) = Byte.Parse("255")
         bufferSend(2) = Byte.Parse("255")
         bufferSend(3) = Byte.Parse("255")
         bufferSend(4) = Byte.Parse("02")
         Dim j As Integer = 5

         For i As Integer = 0 To bufferTemp.Length - 1
            bufferSend(j) = bufferTemp(i)
            j += 1
         Next i

         Dim RemoteIpEndPoint As New IPEndPoint(IPAddress.Any, 0)
         client.Send(bufferSend, SocketFlags.None)


      End Function
   End Class
End Namespace


so, i removed the code with which i was getting response, as i think that response isn't needed for this task
i looped the call to this function, ans i did a little test run, and guess what?
of course, it didnt work
i have no idea why, so if anyone has, it would be really great to share it :D


Top
 Profile  
 
 
 Post subject: Re: Quake Rcon
PostPosted: 07 Jul 2010 16:00 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
in your code I see the 0x02 byte so it will work only with medal of honor.

for the rest I guess it's ok, I mean, if it worked before there is no reason that it doesn't work now :)
remember to:
- use a sniffer or proxocket to know where this packet goes and what it contains
- add a delay between each packet otherwise the tcp/ip stack will start to scream (freezed network for some seconds or minutes if used on internet)


Top
 Profile  
 
 Post subject: Re: Quake Rcon
PostPosted: 07 Jul 2010 18:51 

Joined: 08 May 2010 17:58
Posts: 55
Location: In vast nothingness of space...
hmm, it seems to connect well on any quake3 game, including cod4, regardlessly of that byte

tho, you probably pointed me to solution: i need to add delay between each packet

anyways, what was the limit of connections in one second (or whatever it is)?


Top
 Profile  
 
 Post subject: Re: Quake Rcon
PostPosted: 07 Jul 2010 20:20 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
the rcon limit is 1 packet each half-second


Top
 Profile  
 
 Post subject: Re: Quake Rcon
PostPosted: 07 Jul 2010 21:48 

Joined: 08 May 2010 17:58
Posts: 55
Location: In vast nothingness of space...
hmm, i tried to make a delay, but it didnt work, so i came on idea to put it in two threaded timers which would send packets simulteneously every 25 miliseconds
so i did that, but then the packets dont seem to be sent, except the first two ones (from every timer thread) and im completely sure that it really has to work, at least because it's coded in the right way


Top
 Profile  
 
 Post subject: Re: Quake Rcon
PostPosted: 07 Jul 2010 21:50 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
are you sure you don't close the socket after the packet is sent?
if the first works and the other don't then the socket is the only explanation


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron