Decryption of the fishing battle protocol

d8509aa5077cd5be18365811c463b452.png

e062f4e631c03349b458575bae193c0b.png

Decryption of the fishing battle protocol

558329a70c1b0c94a1b42d7c31d4c3b5.png

Protocol/protocol/flow/volume/decryption/encryption

35971c0bb43a7ae9892b9e32181626bd.png

Analyze the encryption method and decryption method of the game traffic of Fishing Battle.

sequence

386592c64752e00818e5aa7dab50509f.png

Fishing Battle is a casual game launched by tuyoo many years ago. Yes, it is the Tuyou that this account has criticized before. This game takes the depths of the ocean as the background. Skills to hunt colorful fish. It seems to be very popular recently, and there are many people playing it.

be2a443aa644b04bf1b16cc002bbec3b.png

Book

a8767d651c138c32d5911a5ce8c5c230.png

b72c41fe54c7f03f8cc1e2618276e7d6.jpeg

6235cc5e29eab5a64f5dd5527d307593.jpeg

9ade0c0fa9a3e9e98114e425e44e5a2b.png

c658be4b16907220e76116efb6fd7dfe.png

Undoubtedly, as Tuyoo's product, Fishing Battle has the same protocol, and the data is encrypted. On the whole, the encryption is still divided into two parts, one is the encrypted data carried by HTTP, and the other is the encrypted data carried by TCP long connection. This encryption logic and method have been analyzed before, and you can refer to the analysis of other games related links before the end of the article.

69555259658a1473edc80c1066919db8.png

short connection

The short link is rough HTTP, and there is no user agent in it.

GET /open/v6/user/deviceAccountExistCheck?appId=10010&deviceId=386160xxx6f9436f3&clientId=Android_5.280_tyGuest,tyAccount.weixinPay,alipay,yinlian,jingdong.0-hall28.zhibo.fish3d&phoneType=&deviceName=Pixel%201&mac=5ZsNW558xxxk%2BjKu67Y6yZHB44%2BPIsDAxFMHhY37W3HyGgilLEwIbge4biJ6Klnw%3D%3D&imei=AAc/ir5454%2B54xickIaPcdaWGUrd1FFypjBFttXiIyZhHbdThTKwKCyUxA%2BKMZcXZxLblyojicaZFQ%3D%3D&imsi=&androidId=C0GWv444444WJg1HgzBpt1OFMrAoLJTED4oxlxdnEtuXKiOJxpkV&iccid=&BIParams={%22original_deviceid%22:%22130b7c5dbbb7997e1118897996f8e0bf%22,%22oaid%22:%22%22,%22google_id%22:%221a129cda-87bf-4c23-bd63-544563e341c1%22}&adTraceNamespace=3dbuyu10010&adTraceAid=2&oaid=&extraParams={}&original_deviceid=130b7c5dbbxxxxxe1118897996f8e0bf&code=B0A664507E4FEDBFE9722AE6A65FF3D1 HTTP/1.1
User-Agent: 
Host: open-fish3d.tuyoo.com
Connection: Keep-Alive
Accept-Encoding: gzip

The only highlight of this HTTP is that the code in the url needs to be calculated, and the calculation method is also very simple. First, the url parameters are sorted, and then spliced ​​to form a string. Of course, salt will be added during the splicing process, otherwise it will be meaningless. Then, des ecb is used to encrypt the character string, the encrypted result is base64 encoded, and the encoded result is MD5. Basically, the games of Tuyou use these encryption and hash algorithms. Its python implementation code is roughly as follows (salt and key are mosaic):

keys=sorted(params.keys())
    paramsstr=''
    for a in keys:
        if paramsstr!='':
            paramsstr=paramsstr+'&'+a+'='+params[a]
        else:
            paramsstr = 'xxxx'+ a + '=' + params[a]


    paramsstr=paramsstr+'yyyy'
    datastr=paramsstr.encode()
    endata=desecbEncrypt(datastr,b'zzzzz')
    bdata=base64.b64encode(endata)
    code=GetMd5(bdata.decode()).upper()

It can be referred to during implementation if necessary. If you need the key, please contact me (public account: protocol analysis and restoration).

1ab9bfd761d119355bc515ea3e782698.png

Long connection

Like other games of Tuyou, the long-term connection has always existed, and the implementation is exactly the same. I didn’t want to write it at first, but many people don’t know how to play long-term connection, so I still have to mention it here.

It is inconvenient to capture packets for a long connection. It should be noted that the port used by Fishing Battle is 9013. Its long connection is also encrypted, XOR encryption. The encrypted key is transmitted at the beginning, and the subsequent decryption depends on the key. The content of the long connection is similar to the following:

2232f83e2885038d686fec1af5626191.jpeg

The specific decryption code is not repeated here, you can refer to the previous articles listed at the end of the article. If you want to simulate a long connection, you can encrypt and decrypt according to the algorithm after the connection is established.

Postscript

edabd093dc4aabfa9f4f0a225bcb1954.png

e7f6bd20f542e244f9c8990495a7327f.jpeg

b732f8bd0340e91979e11133426eed2f.jpeg

b5e4317ff3f46c1b909c77b8b2a5cbdc.jpeg

4dcc5721303ff6b459fd4200146d8de0.png

a7bb01d563253994f5697165adfd2a3c.png

The encryption and decryption of this game is fairly simple. I like the simple algorithm the most, and I believe everyone will like it too.

56ffb0ec7984929dccb7d8838296f178.png

Reminder

If you have difficulty in decrypting the protocol, please contact me (protocol analysis and restoration). That's right, some application protocols should be decrypted more.                                                                                 

87177d46df46036685ae672f9484e38f.png

f90a0efa76b82b315db59e2f6c198fbd.png

END

181e13ece17ace7dc28bb3fc50e203b2.png

2719bbe8cd75cd9639e27e127322208b.png

Past review

Analysis and cracking of encryption protocol of Tuyou Doudizhu

Audi chess protocol cracking analysis and revealing

4632b6ea345aa7e12edd928a18a4c4d1.png

6c5389712d1af420dcf1b4fb3b2ec469.jpeg

bccf85a0a50fb5626d4f22350f8166c4.png

Guess you like

Origin blog.csdn.net/yeyiqun/article/details/129002071