PDA

View Full Version : [CoD2][Tutorial] How to make your cracked server show up in the master list



Mitch
1st May 2013, 19:57
Everybody probably knows how cracked servers work. They do not use the master list so everybody can join their server. This causes that everybody gets 0 as guid including players who do have an original key. Cracked servers won't show up in the master list because they do not use it.

There is a way to make a cracked server only cracked for the players who cannot join servers that are original. The workaround has two steps.

First you gotta block the packets that the master list sends to the server that say that the player that is connecting isn't allowed to join the server, because he is banned or has an invalid key. This is done by blocking it using the firewall.

In this case iptables:


iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

If your server has a other port, change the dport to the port your server uses or remove it to make it drop every packet.

Now there is one problem left. There is a ~30 minute delay for cracked before you can join them. So if a player joins he will keep connecting for a long time.
You can fix this by patching (hexing) the binary like is done in the latest cracked binary. I compared the original and the cracked binary and this is how they solve this issue:

Original (address 45429h) (patch 1.3)


80 4F 12


Patched


9A 10 00

This is binary i patched for 1.3: 255

Now cracked players can join your original server and you will still have your guid. Also your server will show up in the master list =].

kung foo man
23rd June 2013, 21:51
It's the same for 1.2, just a different address (0x4535D).

kung foo man
24th June 2013, 16:33
This version got:
- No Location strings spam (sometimes nice for debugging but most of the time just annoying)
- VA-patch
- cracked

(thanks to Teufel for testing va-bug)

Mitch
24th July 2013, 15:17
There might be a way to get a windows server on the master list. But it won't give your original players their guids.

In windows firewall you can block incoming and outgoing traffic. For getting on the master list you need to send a heartbeat to the master server from cod2. So you only block all incoming traffic from port 20700 for port(s) your server(s) run on.

Also you need to compare the original and cracked exe and fix the 30 minute delay in the original exe.

thOuMta
26th July 2013, 18:29
It's on win7 but not on win 2008 (for server).
How block this port in this firewall ?

Mitch
26th July 2013, 22:29
It's on win7 but not on win 2008 (for server).
How block this port in this firewall ?
I just checked it with win server 2008 r2 (enterprise) and it is there.

Go to Firewall > Advanced settings

347

Now add a new inbound

348

Now we are gonna set up the rule.

Rule Type: custom
Program: All or just cod2
Protocol and ports: UDP
local ports: 28960 (specific)
remote ports: 20700 (specific)

Scope: you could add that the rule only applies to 63.146.124.40 as remote ip
Action: Block the connection

349

Now your firewall will block all incoming traffic from the cod2 master server. Let me know if your server stays in the master list while blocking all their incoming traffic.

thOuMta
27th July 2013, 00:48
350

351

352

353

I have only this ...

Mitch
27th July 2013, 01:03
350

351

352

353

I have only this ...
I cannot see your attachments.

It says

Invalid Attachment specified. If you followed a valid link, please notify the administrator

Maybe it is under Server Manager.

http://www.windowsnetworking.com/img/upl/Windows%20Firewall%202008%20with%20MMC%20-%20Figure%2011188473265585.jpg

http://www.windowsnetworking.com/articles-tutorials/windows-server-2008/configure-Windows-Server-2008-advanced-firewall-MMC-snap-in.html

thOuMta
27th July 2013, 01:14
For see the attachments click on it :)

Tally
27th July 2013, 07:24
For see the attachments click on it :)

If you click on any of them, it says invalid link/attachment.

kung foo man
27th July 2013, 07:45
Only the first attachment is working, just upload them again and don't link them (then they are automatically added to the post)

Tally
27th July 2013, 10:52
Only the first attachment is working, just upload them again and don't link them (then they are automatically added to the post)

None of them work for me. Using Firefox 22.0.

thOuMta
27th July 2013, 11:23
354
355
356

Mitch
27th July 2013, 13:02
In windows server 2008 you need to add these rules in the server manager.

357

thOuMta
27th July 2013, 13:13
Yes its work fine, but only need to add it on Outbound Rules.
I need disable this rule,
Power on the server, and enable this rule when the server its on.
So its will be showing in master server list :)

Thanks Mitch for your help !!

PS: Sorry for my english :)

Mitch
7th August 2013, 15:02
If you want to make sure that the iptables rules only blocks traffic from the master server. Then you can add this to the iptables rule:


-s cod2master.activision.com


The hostname will be resolved before the rule is submitted to the kernel. According to linux man (http://linux.die.net/man/8/iptables), it is a bad idea to add a name that needs to be resolved with a remote query. So you could replace cod2master.activision with 63.146.124.40.

thOuMta
7th August 2013, 15:09
I will use linux now, windows suck and it make some lags at the game servers.

So if i need to make a cracked server i must add the following commands ?

Mitch
7th August 2013, 20:12
I will use linux now, windows suck and it make some lags at the game servers.

So if i need to make a cracked server i must add the following commands ?
It is not required. You can also use the lines in my first post without any trouble.

But if you want to be sure that it only drops the traffic that comes from the master server you can use the -s param. It is unlikely that there will come much traffic to your game server ports from the port 20700. And even then it will only drop the packets when they contain "BANNED_CDKEY" or "INVALID_CDKEY".
The only difference is probably with -s param that it will use less CPU, because it will only read the data from the packets from that ip.

thOuMta
24th August 2013, 19:04
Did you have the linux cracked patch for 1.0 version ?

thOuMta
27th August 2013, 18:19
Nobody have that?!

Mitch
27th August 2013, 19:16
Did you have the linux cracked patch for 1.0 version ?

I am not sure if there is one. Have you tried to join the server when you have added the iptables rules for this 1.0 server?
I also tried to find the bytes that need to be patched, but I can't find them in the binary for 1.0.

thOuMta
27th August 2013, 19:36
I have joined with my real guid so the server is not cracked.
I have download 1 patch from this: http://gf.wiretarget.com/call_of_duty_2.htm
But the server don't show up in master list.

kung foo man
27th August 2013, 21:44
I've tried like 5 cracked keys and I can connect with all those keys to my uncracked server... always getting this guid:


Going from CS_FREE to CS_CONNECTED for (num 0 guid 629770)

thOuMta
27th August 2013, 22:35
Its strange i have,
Put the cracked 1.0 patch, start the serv, stop the serv.
Put the original 1.0 patch, start the serv, stop the serv,
Put the cracked 1.0 patch, start the serv, and its show up in master list.
Now if i restart the server its show up too.

Know why ? ;)

PS: Server stand 20 min in master list and dont show up...

IzNoGoD
28th August 2013, 02:17
Obv masterlist has a TTL.

Mitch
28th August 2013, 10:23
Its strange i have,
Put the cracked 1.0 patch, start the serv, stop the serv.
Put the original 1.0 patch, start the serv, stop the serv,
Put the cracked 1.0 patch, start the serv, and its show up in master list.
Now if i restart the server its show up too.

Know why ? ;)

PS: Server stand 20 min in master list and dont show up...

Please attach your cracked 1.0 patch binary. Then i can try to patch the original 1.0 binary.

thOuMta
28th August 2013, 17:47
This: 415
Its the patch from http://gf.wiretarget.com/call_of_duty_2.htm

Mitch
29th August 2013, 09:55
This: 415
Its the patch from http://gf.wiretarget.com/call_of_duty_2.htm
Try this binary (i patched 2 times '0F 85 B0' to 'E9 B1 00' which was 2 of the 3 differences between the original and cracked binary)

thOuMta
29th August 2013, 20:20
See the server for 30 min and don't see ..

IzNoGoD
5th September 2013, 22:13
Here's 1.3 localized warning patched, cracked.

thOuMta
13th September 2013, 18:57
And what about 1.0 version ?
The patch don't work (Show up to master list).

botskiller16
25th October 2013, 12:35
Hello, where can i download cracked cod2_lnxded linux file, where no must wait 20 mins to connect my server and show up in the masterserver list? (so, cracked players can join, and show in the in-game server searcher?)

kung foo man
25th October 2013, 13:01
The trick is not just the binary, it's the firewall-rule which is blocking some packets from master-server to your server. It's explained in first post: http://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list

botskiller16
25th October 2013, 14:50
Then nevermind, thanks!

bizkit45
9th November 2013, 21:50
Can someone help me or even get me PB files that work with this patch. I couldnt get PB to work. Is it even possible that PB is enabled while patched with your binary? Thanks for the binary btw

Mitch
10th November 2013, 10:32
Can someone help me or even get me PB files that work with this patch. I couldnt get PB to work. Is it even possible that PB is enabled while patched with your binary? Thanks for the binary btw

The patched binary has nothing to do with your pb problems. Because my PB works just fine. (cracked/semi-cracked)
Do you have +set sv_punkbuster 1 in your startup line?

bizkit45
10th November 2013, 10:54
got it working mate. i dont know what the first time was the problem,but my guess would me RWX for the folder PB was stored in.
tnx

bizkit45
10th November 2013, 13:28
need some more help :) server crashes after some time..pasted you last output. I'll be glad if you could advise me. tnx in advance
br

****** script runtime error *******
pair 'undefined' and '30' has unmatching types 'undefined' and 'int': (file 'maps/mp/gametypes/dm.gsc', line 714)
if(self.score < level.scorelimit)
*
called from:
(file 'maps/mp/gametypes/dm.gsc', line 349)
attacker checkScoreLimit();
*
called from:
(file 'maps/mp/gametypes/_spawnlogic.gsc', line 757)
[[level.spawnlogic_oldCallbackPlayerKilled]](
*
called from:
(file 'maps/mp/gametypes/_callbacksetup.gsc', line 69)
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
*
started from:
(file 'maps/mp/gametypes/dm.gsc', line 709)
waittillframeend;
*
************************************
********************
ERROR: script runtime error
(see console for details)
(file 'maps/mp/gametypes/dm.gsc', line 709)

********************
----- Server Shutdown -----
Sending heartbeat to cod2master.activision.com
==== ShutdownGame ====
Going to CS_ZOMBIE for ^5KLOBASICA
1:^5KLOBASICA EXE_DISCONNECTED
---------------------------

RobsoN
10th November 2013, 13:49
self.score is not defined.

add before if(self.score < level.scorelimit), this: if(!isDefined(self.score)) self.score = 0;

bizkit45
10th November 2013, 14:09
well yea, i am kinda new to this strings. i was hoping for a bit more explanation, 'couse i have no clue what score or to what that is linked to. tnx

edit: i get it, must change the string (add before one)..but where is it located?where can i find file "maps/mp/gametypes/dm.gsc"

edit2: i found out i must decompile the .iwd files. F*** that is too much work :) could you just tell me in which .iwd file this "dm.gsc" file is. I will replace it with a new one. I cant replace all of them, couse my upload is slow. Tnx

edit3 : oh..so easy :) RAR thingy ;)

edit4 : replaced iw_07.iwd (where that string was) with new file. Will give it a shot now ;) thanks

IzNoGoD
10th November 2013, 16:36
Dont replace the stock iwd files. Add an iwd file with the same file in it (maps/mp/gametypes/dm.gsc) with a higher prefix (like zzz_my_mod.iwd) to your main folder, or switch to a fs_game.

bizkit45
10th November 2013, 17:07
i replaced iwd file with stock one. I remember i got disconnected while transfering (from laptop to server via ssh), so it must have happened then. now it is replaced and it is working fine. Tnx to all

bizkit45
10th November 2013, 17:30
The error came back :( and i tryed what Robson sugested..server crashes couse it detects false iwd file :/
dont know what else to do here...anything?

bizkit45
13th November 2013, 14:25
can you give me some intel why do i get error in dm.gsc..it is the second errror since i installed server. Do you have any answers. Thanks

******* script runtime error *******
removed entity is not an entity: (file 'maps/mp/gametypes/dm.gsc', line 347)
lpattacknum = attacker getEntityNumber();
*
called from:
(file 'maps/mp/gametypes/_callbacksetup.gsc', line 69)
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
*
started from:
(file 'maps/mp/gametypes/dm.gsc', line 704)
waittillframeend;
*
************************************
********************
ERROR: script runtime error
(see console for details)
(file 'maps/mp/gametypes/dm.gsc', line 704)

********************
----- Server Shutdown -----
Sending heartbeat to cod2master.activision.com
==== ShutdownGame ====

Tally
13th November 2013, 14:50
attacker makes a kill, and in that same instant leaves the server. The attacker is no longer valid. The server is then trying to get his entity number, and can't because he has left the server. Hence the error.

I wouldn't worry about it. it is just a small glitch in the game code.

bizkit45
13th November 2013, 14:58
i wouldnt worry about it if server would still be running after this error, but it shuts down.That is why i am trying to find a solution. TY

IzNoGoD
13th November 2013, 15:26
turn developer off (/rcon developer 0; rcon map_restart) when you make your mod public.

Or change that piece of code a bit so it checks if the attacker is still defined, or make it determine the attacker's entnum earlier on.

Tally
13th November 2013, 16:27
i wouldnt worry about it if server would still be running after this error, but it shuts down.That is why i am trying to find a solution. TY

Script runtime errors do not shut a server down. They are simply reported, but the server carries on. As IzNoGod has said, make sure you aren't running in developer mode. That is the only explanation for a server shutting down after a runtime error - that you have developer mode switched on.

bizkit45
13th November 2013, 18:28
ok guys. TNAX ALOT. will try this. and report back in day or two.

p.s. : ok, have tryed that but still error. How can i check if i set developer to 0? is there a way to know if it is set to 0?

Jeplaa
13th November 2013, 19:32
sure, type /rcon developer open console and check what value is set.

bizkit45
13th November 2013, 20:07
so easy you say, a? ;) i checkedit and it is set to 0. I hope i dont get those errors now. will let you know.

Tally
13th November 2013, 20:25
Failing that, turn off logfile - in your server config file, set this:

set logfile "0"

NemanjA
17th November 2013, 10:21
I get a error in iptables when i write this code:
iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

Error message:

iptables: No chain/target/match by that name.
What to do?

Mitch
17th November 2013, 11:24
I get a error in iptables when i write this code:
iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

Error message:

iptables: No chain/target/match by that name.
What to do?

I assume you ran the commands with sudo or as root. What linux are you using?
What output do you get when you run 'iptables --list-rules'?

NemanjA
17th November 2013, 13:44
Im using CentOS.
And i get this:

-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

Mitch
17th November 2013, 13:58
Im using CentOS.
And i get this:

-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT


Maybe try adding -t filter.


iptables -t filter -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -t filter -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

https://www.centos.org/forums/viewtopic.php?t=8995

NemanjA
17th November 2013, 14:23
I had tried it already.. It don't work :/

Mitch
17th November 2013, 14:54
I had tried it already.. It don't work :/

What version is your iptables? (iptables --version)

bizkit45
19th November 2013, 19:39
sorry to interupt again..but is there a way to disable DM mode, so only TDM, HQ, CTF,... are enabled. I think it crashes becouse of DM mode.
And i would also like to know if i can disable vote for DM mode (i have votes enabled). so they wont be able to vote for DM Carentan for example, but to still give them all other vote permisions??? thanks

IzNoGoD
19th November 2013, 21:32
Remove iw_07.iwd and iw_15.iwd from your servers main folder, then repack all those files into another file from which you remove dm.gsc, then use that file on your server (do not name it iw_07 or iw_15.iwd)

NemanjA
23rd November 2013, 17:48
What version is your iptables? (iptables --version)
I have Iptables 1.4.7

Mitch
1st December 2013, 17:17
I have Iptables 1.4.7

Does 'iptables -m string -help' work? And what does it say? You are probably missing the string filter module for iptables.

When you do 'cat /proc/net/ip_tables_matches' it should contain atleast string.

If it isn't in the list try loading it with: modprobe ipt_string.

botskiller16
18th December 2013, 14:03
Hi, so, which file is, what show the masterserver, and no must waiting 20mins? I use 1.3 cracked linux server, port: 28139

Mitch
18th December 2013, 16:40
Hi, so, which file is, what show the masterserver, and no must waiting 20mins? I use 1.3 cracked linux server, port: 28139

Read the information here: http://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)&p=8293&viewfull=1#post8293



iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28139 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28139 -j DROP


Edit: INVALID_CDKEY means that the cd key is in use.

bigbro
28th December 2013, 18:54
very nice tutorial.
is it possible to do the same for CoD4 servers?

Mitch
28th December 2013, 19:42
very nice tutorial.
is it possible to do the same for CoD4 servers?

Yes, you only need to fix the delay in binary. (i am assuming that cod4 also uses INVALID_CDKEY and BANNED_CDKEY when the server rejects a connection)

bigbro
31st December 2013, 05:26
iptables strings are not working for me. Only this is working:


iptables -A OUTPUT -p udp --dport 20700 -j DROP

bigbro
31st December 2013, 08:06
unfortunately if I did this


iptables -A OUTPUT -p udp --dport 20700 -j DROP

the servers become invisible in the master list. *SAD*

This strings are not working at all:


iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

no matter ports, destination or source.
So I did a traffic dump, and I have this UDP stream from port 20700:



....getIpAuthorize 250977360 7.7.**.** "" 0 PB "???"....ipAuthorize 250977360 deny BANNED_CDKEY 0 ???.


*??? > replaced some unique ids I believe, related to CDkey and etc... guid or something.

Conversation is going both ways - in and out between server IP and 63.146.124.40 (cod2master.activision.com has address 63.146.124.40).
After all that, server sends to client



....error
EXE_ERR_BAD_CDKEY


and that's it.
Can you help?
Linux server, ubuntu 13.10, game servers 1.3 CoD2


---
update: If the string IpAuthorize is removed, connection is ok with invalid cdkey,
"Connecting player #4 has a zero GUID" and "Sending heartbeat to cod2master.activision.com". Server is missing in master list.

Mitch
31st December 2013, 13:56
Linux server, ubuntu 13.10, game servers 1.3 CoD2


I tested on my own Ubuntu 13.10 (desktop) and I can add the iptables rules there (sudo is required if you are not running it under root)

You need to change the port to the port you are running your server on:


iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport [your game port] -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport [your game port] -j DROP

(sport is master server's port and dport is your own)

Now you need a modified binary for your game that you can find here:
http://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)
(you need at least the nodelay)

bigbro
1st January 2014, 08:43
Hi Mitch,
happy new year and thank you for your answer.
I found a way to fix it. Unfortunately it is not working with ip tables at all.
Just find getIpAuthoruze in bin file using hex editor and rename it (first one) with something else, so it will not get IP authorization for clients who want to connect to the server. That's it. :)

Mitch
2nd January 2014, 15:09
You need to change the sport to 20710.



Resolving cod2master.activision.com
cod2master.activision.com resolved to 63.146.124.40:20710


Edit: you might need both, because it seems to resolve to 20700 too. I am still having problems with the port 20700. Wireshark says it is unreachable for me.



[21:48] Mitch: hi
[21:48] Mitch: can you edit my post
[21:48] Mitch: http://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list/page8
[21:48] Mitch: and say that port 20700 is for player info (guid)
[21:49] Mitch: and 20710 is for reporting to the master server
[21:49] Mitch: aka heartbeat
[21:56] <This user is now offline>

th0r88
11th June 2014, 10:00
Hi,

thanks for the great guides. I'm having problems with iptables. It doesn't seem to be filtering "BANNED_CDKEY" and "INVALID_CDKEY". I've installed on Ubuntu Server 14.04. Everything works, but it's not showing in master list and not filtering those two and all people that don't have an original cd-key can't connect.

My iptables:


root@oc:/home/cod2server# iptables -nL | grep 20700
DROP udp -- 0.0.0.0/0 0.0.0.0/0 STRING match "BANNED_CDKEY" ALGO name bm TO 65535 udp spt:20700 dpt:31333
DROP udp -- 0.0.0.0/0 0.0.0.0/0 STRING match "INVALID_CDKEY" ALGO name bm TO 65535 udp spt:20700 dpt:31333
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:20700
DROP udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:20700

Any idea?

IzNoGoD
11th June 2014, 11:03
Hi,

thanks for the great guides. I'm having problems with iptables. It doesn't seem to be filtering "BANNED_CDKEY" and "INVALID_CDKEY". I've installed on Ubuntu Server 14.04. Everything works, but it's not showing in master list and not filtering those two and all people that don't have an original cd-key can't connect.

My iptables:


root@oc:/home/cod2server# iptables -nL | grep 20700
DROP udp -- 0.0.0.0/0 0.0.0.0/0 STRING match "BANNED_CDKEY" ALGO name bm TO 65535 udp spt:20700 dpt:31333
DROP udp -- 0.0.0.0/0 0.0.0.0/0 STRING match "INVALID_CDKEY" ALGO name bm TO 65535 udp spt:20700 dpt:31333
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:20700
DROP udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:20700

Any idea?
If you're running your own server, just run libcod and set sv_cracked to 1

th0r88
11th June 2014, 11:49
Hm I ran a command:


LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded_1_3_nodelay_va_loc +set fs_basepath /home/cod2server/cod2 +set fs_homepath /home/cod2server/cod2 +set net_ip *.*.*.* +set net_port 31333 +set dedicated 2 +exec dedicated.cfg +set sv_punkbuster 1 +map_rotate

But I still've got the same error: Bad CD Key code.

Am I doing something wrong?

kung foo man
11th June 2014, 12:29
You are using a nomysql version, did you compile it yourself? Otherwise it might be damn old. Try this one: http://killtube.org/downloads/libcod/2014_05_22/

Like IzNoGod said, you need to set sv_cracked. Example:




LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded_1_3_nodelay_va_loc +set fs_basepath /home/cod2server/cod2 +set fs_homepath /home/cod2server/cod2 +set net_ip *.*.*.* +set net_port 31333 +set dedicated 2 +exec dedicated.cfg +set sv_punkbuster 1 +set sv_cracked 1 +map_rotate

Mitch
11th June 2014, 12:41
Hi,

thanks for the great guides. I'm having problems with iptables. It doesn't seem to be filtering "BANNED_CDKEY" and "INVALID_CDKEY". I've installed on Ubuntu Server 14.04. Everything works, but it's not showing in master list and not filtering those two and all people that don't have an original cd-key can't connect.

My iptables:


root@oc:/home/cod2server# iptables -nL | grep 20700
DROP udp -- 0.0.0.0/0 0.0.0.0/0 STRING match "BANNED_CDKEY" ALGO name bm TO 65535 udp spt:20700 dpt:31333
DROP udp -- 0.0.0.0/0 0.0.0.0/0 STRING match "INVALID_CDKEY" ALGO name bm TO 65535 udp spt:20700 dpt:31333
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:20700
DROP udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:20700

Any idea?

Does your game server run on the port 31333? (because most game server run on the port 28960)

th0r88
11th June 2014, 15:29
@kung foo man: I've tried your code with updated libcod2_1_3.so and it still says Invalid CD Key :/

@Mitch: yes, mine runs on 31333.

Any other advice will be greatly appreciated. Thanks!

IzNoGoD
11th June 2014, 17:23
@kung foo man: I've tried your code with updated libcod2_1_3.so and it still says Invalid CD Key :/

@Mitch: yes, mine runs on 31333.

Any other advice will be greatly appreciated. Thanks!

did you set sv_cracked to 1?

th0r88
11th June 2014, 18:13
did you set sv_cracked to 1?

Yes, I used kung foo man's code:


LD_PRELOAD=libcod2_1_3.so ./cod2_lnxded_1_3_nodelay_va_loc +set fs_basepath /home/cod2server/cod2 +set fs_homepath /home/cod2server/cod2 +set net_ip *.*.*.* +set net_port 31333 +set dedicated 2 +exec dedicated.cfg +set sv_punkbuster 1 +set sv_cracked 1 +map_rotate

Is it ok if I use for a cracked server cod2_lnxded_1_3_nodelay_va_loc file?

th0r88
13th June 2014, 13:12
I've solved it! I only changed code to:


LD_LIBRARY_PATH=. LD_PRELOAD=libcod2_1_3.so ./cod2_lnxded_1_3_nodelay_va_loc +set fs_basepath /home/cod2server/cod2 +set fs_homepath /home/cod2server/cod2 +set net_ip *.*.*.* +set net_port 31333 +set dedicated 2 +exec dedicated.cfg +set sv_punkbuster 1 +set sv_cracked 1 +map_rotate

Then I updated punkbuster and everything is smooth :)

Thank you all for your help!

punisher2202
26th March 2015, 13:46
Hello all i am new and i want help please. I have dedicated server linux cracked and i have followed the instructions


iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP]

and my server is visible in the list. Now I have the following problem ,when I try to connect to the server i take this message


"Key code in use.Please try reconnecting later"

If i try to connect to another cracked server , i can connect successful. Please help me . Thanks

IzNoGoD
26th March 2015, 14:04
If you have access to iptables you might just as well use libcod for it.

punisher2202
26th March 2015, 14:25
If you have access to iptables you might just as well use libcod for it.

Yes i have access . What you mean libcod? Sorry i am new :(

Mitch
26th March 2015, 14:36
Yes i have access . What you mean libcod? Sorry i am new :(

See: https://github.com/kungfooman/libcod/blob/master/README.md

When you have libcod working with your cod2 version then you need to set sv_cracked to '1' (with non-cracked binary).

Edit: CentOS instructions: http://killtube.org/showthread.php?2036-Help-me-pls)))&p=10702&viewfull=1#post10702
Edit 2: it is also works better than the iptables. It returns true when it reads that your key was banned, invalid or in use. Instead of blocking a certain message with your firewall.

punisher2202
26th March 2015, 17:23
See: https://github.com/kungfooman/libcod/blob/master/README.md

When you have libcod working with your cod2 version then you need to set sv_cracked to '1' (with non-cracked binary).

Edit: CentOS instructions: http://killtube.org/showthread.php?2036-Help-me-pls)))&p=10702&viewfull=1#post10702
Edit 2: it is also works better than the iptables. It returns true when it reads that your key was banned, invalid or in use. Instead of blocking a certain message with your firewall.

Thanks very much , i will try and then i tell you the result

punisher2202
26th March 2015, 18:57
Thanks very much , i will try and then i tell you the result

i have run


root@SERVER:~/cod2# LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded +cod2_1_2_cracked +set dedicated 2 +exec server.cfg +set sv_punkbuster 1 +map_rotate



and take this error


ERROR: ld.so: object 'libcod2_1_3_nomysql.so' from LD_PRELOAD cannot be preloaded: ignored.
./cod2_lnxded: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

IzNoGoD
26th March 2015, 19:32
chmod it to at least 700

Mitch
26th March 2015, 19:35
If you are running cod2 1.2 then you will need the 1.2 .so version.

Try starting with:

LD_LIBRARY_PATH=. LD_PRELOAD=libcod2_1_[version]_nomysql.so ./cod2_lnxded

Or follow the instructions from the readme from cod itself:

IF YOU HAVE A PROBLEM WITH "LIBSTDC++.SO.5" ...
(This is a frequent-enough problem to merit discussion in the introduction.)

If you are reading this, it's probably because you tried to start your Linux server and saw this message:

./cod2_lnxded: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

COD2 is a C++ program built with gcc 3.3.4, which means it needs a system library specific to gcc 3.3. Older Linux systems won't have this installed, and we're starting to see newer Linux distributions that don't have this either, since they are supplying an incompatible gcc 3.4 version. The good news is that you can drop the needed library into your system without breaking anything else.

Here is the library you need, if your Linux distribution doesn't supply it:
http://icculus.org/updates/cod/gcc3-libs.tar.bz2

You want to unpack that somewhere that the dynamic linker will see it (if you are sure it won't overwrite any files, you can even use /lib).

The brave can put it in the same directory as the game and run the server like this:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./cod2_lnxded

Now the server will start.

punisher2202
26th March 2015, 22:17
If you are running cod2 1.2 then you will need the 1.2 .so version.

Try starting with:


Or follow the instructions from the readme from cod itself:

I have cod 1.3

I will tell you that how to install the cod2 . I install the cod2 in windows, after I install the patch 1.3 and then I put the all cod2 folder in Linux and in the same folder the files cod2_lnxded (linux library) .I would like you to tell me first , if that is the right way.

punisher2202
27th March 2015, 09:38
ok after trying done and run good but he problem still exists with the key

Mitch
27th March 2015, 09:43
ok after trying done and run good but he problem still exists with the key

Check if 'sv_cracked' is set to 1. /rcon sv_cracked
(You might need to use 'set sv_cracked 1' to set it. Because it is not a default cvar.)

Also verify libcod is running: In your (screen) log is should say:

> [PLUGIN LOADED]

punisher2202
27th March 2015, 10:29
Check if 'sv_cracked' is set to 1. /rcon sv_cracked
(You might need to use 'set sv_cracked 1' to set it. Because it is not a default cvar.)

Also verify libcod is running: In your (screen) log is should say:


root@SERVER:~/cod2# LD_PRELOAD="/cod2/libs/libcod2_1_3.so" ./cod2_lnxded +set sv_cracked 1 +set dedicated 2 +exec server.cfg +set sv_punkbuster 0 +map mp_breakout
ERROR: ld.so: object '/cod2/libs/libcod2_1_3.so' from LD_PRELOAD cannot be preloaded: ignored.
CoD2 MP 1.3 build linux-i386 Jun 23 2006
----- FS_Startup -----
Current language: english
Current search path:
/root/.callofduty2/main
/root/cod2/main/iw_15.iwd (85 files)
/root/cod2/main/iw_14.iwd (4038 files)
/root/cod2/main/iw_13.iwd (22624 files)
/root/cod2/main/iw_12.iwd (1016 files)
/root/cod2/main/iw_11.iwd (1462 files)
/root/cod2/main/iw_10.iwd (1936 files)
/root/cod2/main/iw_09.iwd (2142 files)
/root/cod2/main/iw_08.iwd (2723 files)
/root/cod2/main/iw_07.iwd (3384 files)
/root/cod2/main/iw_06.iwd (990 files)
/root/cod2/main/iw_05.iwd (928 files)
/root/cod2/main/iw_04.iwd (698 files)
/root/cod2/main/iw_03.iwd (26 files)
/root/cod2/main/iw_02.iwd (40 files)
/root/cod2/main/iw_01.iwd (16 files)
/root/cod2/main/iw_00.iwd (102 files)
/root/cod2/main
/root/.callofduty2/raw
/root/.callofduty2/raw_shared
/root/.callofduty2/devraw
/root/.callofduty2/devraw_shared
/root/cod2/raw
/root/cod2/raw_shared
/root/cod2/devraw
/root/cod2/devraw_shared
/root/cod2/main/localized_english_iw11.iwd (1 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw10.iwd (414 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw09.iwd (98 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw08.iwd (8 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw07.iwd (1014 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw06.iwd (3110 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw05.iwd (5310 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw04.iwd (6240 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw03.iwd (6580 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw02.iwd (6404 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw01.iwd (5510 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw00.iwd (4764 files)
localized assets iwd file for english

File Handles:
----------------------
81663 files in iwd files
execing default_mp.cfg
couldn't exec language.cfg
execing config_mp_server.cfg
dedicated is read only.
Opening IP socket: localhost:28960
Hostname: SERVER
IP: 127.0.1.1
--- Common Initialization Complete ---
dedicated is read only.
execing server.cfg
sv_cheats is write protected.
g_gametype will be changed upon restarting.
sv_punkbuster is write protected.
------ Server Initialization ------
Server: mp_breakout
----- FS_Startup -----
Current language: english
Current search path:
/root/.callofduty2/main
/root/cod2/main/iw_15.iwd (85 files)
/root/cod2/main/iw_14.iwd (4038 files)
/root/cod2/main/iw_13.iwd (22624 files)
/root/cod2/main/iw_12.iwd (1016 files)
/root/cod2/main/iw_11.iwd (1462 files)
/root/cod2/main/iw_10.iwd (1936 files)
/root/cod2/main/iw_09.iwd (2142 files)
/root/cod2/main/iw_08.iwd (2723 files)
/root/cod2/main/iw_07.iwd (3384 files)
/root/cod2/main/iw_06.iwd (990 files)
/root/cod2/main/iw_05.iwd (928 files)
/root/cod2/main/iw_04.iwd (698 files)
/root/cod2/main/iw_03.iwd (26 files)
/root/cod2/main/iw_02.iwd (40 files)
/root/cod2/main/iw_01.iwd (16 files)
/root/cod2/main/iw_00.iwd (102 files)
/root/cod2/main
/root/.callofduty2/raw
/root/.callofduty2/raw_shared
/root/.callofduty2/devraw
/root/.callofduty2/devraw_shared
/root/cod2/raw
/root/cod2/raw_shared
/root/cod2/devraw
/root/cod2/devraw_shared
/root/cod2/main/localized_english_iw11.iwd (1 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw10.iwd (414 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw09.iwd (98 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw08.iwd (8 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw07.iwd (1014 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw06.iwd (3110 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw05.iwd (5310 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw04.iwd (6240 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw03.iwd (6580 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw02.iwd (6404 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw01.iwd (5510 files)
localized assets iwd file for english
/root/cod2/main/localized_english_iw00.iwd (4764 files)
localized assets iwd file for english

File Handles:
----------------------
81663 files in iwd files
------- Game Initialization -------
gamename: Call of Duty 2
gamedate: Jun 23 2006
-----------------------------------
-----------------------------------
Resolving cod2master.activision.com
cod2master.activision.com resolved to 185.34.104.231:20710
Hitch warning: 6094 msec frame time
Sending heartbeat to cod2master.activision.com
Resolving cod2master.activision.com
cod2master.activision.com resolved to 185.34.104.231:20700



Something doesn't understand......:confused:
I think run the co2 with wrong method

Mitch
27th March 2015, 10:58
ERROR: ld.so: object '/cod2/libs/libcod2_1_3.so' from LD_PRELOAD cannot be preloaded: ignored.

Something doesn't understand......:confused:
I think run the co2 with wrong method

libcod isn't loaded. It might be needed to build it yourself or it needs 'LD_LIBRARY_PATH'.

Did you install the needed 32-bit libraries?

Edit: this thread might give you some additional information or instructions: http://killtube.org/showthread.php?2036-Help-me-pls)))

punisher2202
27th March 2015, 11:03
Check if 'sv_cracked' is set to 1. /rcon sv_cracked
(You might need to use 'set sv_cracked 1' to set it. Because it is not a default cvar.)

Also verify libcod is running: In your (screen) log is should say:

I think I've found what I've forgotten. where to put the folder libcod-master?

punisher2202
27th March 2015, 11:13
I'm very confused. I think that I have done everything wrong. I would greatly appreciate you explain step to step from the beginning the whole process of cod2 cracked server

Mitch
27th March 2015, 11:24
I'm very confused. I think that I have done everything wrong. I would greatly appreciate you explain step to step from the beginning the whole process of cod2 cracked server

Let's start with which Linux OS you are using (including version) e.g. Debian 7, Ubuntu 14.04, CentOS 7.

punisher2202
27th March 2015, 11:48
debian 7 64bit

Mitch
27th March 2015, 11:57
debian 7 64bit

Use kung's precompiled build:
http://killtube.org/downloads/libcod/2015_01_29/libcod2_1_3.so

Execute these commands

dpkg --add-architecture i386
apt-get update
apt-get install gcc-multilib
apt-get install libmysqlclient-dev:i386
apt-get install g++-multilib


Edit: also make sure the user that runs the binary and .so has rwx* rights.
* read, write, execute (7).

punisher2202
27th March 2015, 12:04
ok now i have this error


root@SERVER:~/cod2# LD_PRELOAD=libcod2_1_3.so ./cod2_lnxded +cod2_1_2_cracked +set sv_cracked 1 +set dedicated 2 +exec server.cfg +set sv_punkbuster 0 +map mp_breakout
./cod2_lnxded: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6)
./cod2_lnxded: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6)
root@SERVER:~/cod2#

punisher2202
27th March 2015, 12:15
Give me some time, I will formating the server and start together from the beginning . Is beter 32 bit or 64 bit debian for this?

Mitch
27th March 2015, 12:15
ok now i have this error


root@SERVER:~/cod2# LD_PRELOAD=libcod2_1_3.so ./cod2_lnxded +cod2_1_2_cracked +set sv_cracked 1 +set dedicated 2 +exec server.cfg +set sv_punkbuster 0 +map mp_breakout
./cod2_lnxded: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6)
./cod2_lnxded: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6)
root@SERVER:~/cod2#


Give me some time, I will formating the server and start together from the beginning

Are you sure you installed 'gcc-multilib'. Otherwise it might be needed to build your own version to avoid these dependency issues.



apt-get install git
git clone https://github.com/kungfooman/libcod.git libcod
cd libcod
./doit.sh base
./doit.sh cod2_1_3


Now copy the .so in libcod/bin to your library directory or next to your binary.

Edit: cod2 is a 32-bit program. But it can run on 64-bit.
@mods it might be better to split the libcod posts to a new thread in the libcod forum.

punisher2202
27th March 2015, 12:22
OK, i start a new thread , but please help me from the beginning over there

CaptainSlow
7th September 2015, 23:57
Hi guys,

We're currently in the process of migrating our COD2 servers from Linux to Windows. On Linux, we indeed could just add the firewall rules as mentioned in the first post to make our server cracked and show up in the masterlist. However, on Windows this is a whole different story.
I spent literally all day to get our server cracked AND show up in the masterlist but to no avail. Currently our servers are listed and 'partly' cracked, which means; Some of my friends can join without issues, others get the error that their key code is in use. I cannot understand why some friends can join while others can't. All players have GUID 0 according to RCON which should mean the server is indeed cracked.

I tried blocking all traffic on port 20700 inbound as described in this post: http://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list&p=6508&viewfull=1#post6508
--> made no difference

I tried blocking all traffic on port 20700 outbound _after_ the server started as described in this post: http://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list&p=6517&viewfull=1#post6517
--> Partly works, some players can connect, others get keycode in use error

I tried hex editing the exe file replacing 'getIpAuthorize' with another string as described in this post: http://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list&p=8586&viewfull=1#post8586
--> Partly Works, server won't show up in the master list anymore but everyone can connect using direct IP without issues. I assume there is some MD5 checksum being performed by the masterserver.

Basically I tried every option out there. Sadly my knowledge skills are lacking to try and use tools like Ida Pro to debug this myself, so I was wondering if someone could help us/me out here. I'm willing to buy you a beer to compensate for your time ;)
We run COD2 1.0 on Windows Server 2012 R2.

Many many thanks!

Kind regards,
CS.

filthy_freak_
8th September 2015, 03:09
I tried hex editing the exe file replacing 'getIpAuthorize' with another string as described in this post: http://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list&p=8586&viewfull=1#post8586
--> Partly Works, server won't show up in the master list anymore but everyone can connect using direct IP without issues. I assume there is some MD5 checksum being performed by the masterserver.


Wait 15-20 minutes and it should start showing up.

CaptainSlow
8th September 2015, 10:30
Wait 15-20 minutes and it should start showing up.

You're a legend! That seems do to the trick. Interesting, I thought I already tried that, but I guess I didn't.

Now comes the million dollar question: Is there a way to lower this time limit to like 5 minutes or something? The hex addresses in the startpost are for the 1.3 Linux version

Thank you very much!

Kind regards,
CS

Mitch
8th September 2015, 16:20
You're a legend! That seems do to the trick. Interesting, I thought I already tried that, but I guess I didn't.

Now comes the million dollar question: Is there a way to lower this time limit to like 5 minutes or something? The hex addresses in the startpost are for the 1.3 Linux version

Thank you very much!

Kind regards,
CS

1.0 doesn't have the 20 minute connect delay. I think it takes 20 minutes for the master server to include your server in their server list.

Edit: you can test your server with kung's tracker: http://tracker.killtube.org/server.php?ip=80.241.208.55&port=28960&resource=http://tracker.killtube.org/iframe-styles/frontpage
Replace the ip and port with your own then refresh the page. Now your server should be listed in this tracker.

CaptainSlow
8th September 2015, 16:30
1.0 doesn't have the 20 minute connect delay. I think it takes 20 minutes for the master server to include your server in their server list.

Edit: you can test your server with kung's tracker: http://tracker.killtube.org/server.php?ip=80.241.208.55&port=28960&resource=http://tracker.killtube.org/iframe-styles/frontpage
Replace the ip and port with your own then refresh the page. Now your server should be listed in this tracker.

Many thanks for your reply Mitch, I appreciate it.

If I use the original/unmodified COD2MP_s.exe, my server shows up instantly in the masterlist after I start the server.
If I use the hexed COD2MP_s.exe, it takes 20 minutes for my server to show up in the masterlist after I start the server, so even in COD2 1.0 there seems to be some sort of delay if you hex edit the file on Windows at least.

Is it possible to perform the same 'nodelay' trick you explain here on the COD2 1.0 exe file? http://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)&p=8301&viewfull=1#post8301

If I change the IP en port my server does indeed show up in your tracker.

Many thanks!

Kind regards,
CS

CaptainSlow
9th September 2015, 00:36
I can't seem to edit my post, but I regret to report that after a while the server disappears from the masterlist when using the hexed file :(

IzNoGoD
9th September 2015, 00:53
Why dont you just use libcod and set sv_cracked to 1?

Should fix all your troubles

CaptainSlow
9th September 2015, 09:41
Why dont you just use libcod and set sv_cracked to 1?

Should fix all your troubles

Thanks for your reply.

Isn't libcod just for Linux? I'm running Windows.

EDIT: My bad, just found this topic: http://killtube.org/showthread.php?1730-Libcod-for-windows/page3
I'll check it out

Thanks!!

CaptainSlow
9th September 2015, 17:20
I can't seem to edit my post again, sorry about that

I tried the latest libcod version for Windows, but it doesn't seem to be working.
I added the '+set sv_cracked 1' parameter to my startup line, changed the .bat file to use the correct .DLL file (1.0, not 1.3) and ran the bat file.
It says it was able to successfully inject the DLL into the process, but when I join the server I get a Bad Keycode error.
Is it possible that the cracked feature has not been ported yet to the Windows version of libcod?

Many thanks!

Mitch
9th September 2015, 18:12
I can't seem to edit my post again, sorry about that

I tried the latest libcod version for Windows, but it doesn't seem to be working.
I added the '+set sv_cracked 1' parameter to my startup line, changed the .bat file to use the correct .DLL file (1.0, not 1.3) and ran the bat file.
It says it was able to successfully inject the DLL into the process, but when I join the server I get a Bad Keycode error.
Is it possible that the cracked feature has not been ported yet to the Windows version of libcod?

Many thanks!

I just checked my github log and it doesn't have the same cracked feature as Linux does.
However i just patched a 1.0 binary to replace 'demo (http://killtube.org/showthread.php?1699-Accept-cracked-players&p=8590&viewfull=1#post8590)' with 'deny' and 'fs_restrict' with 'fresnel' (i couldn't find a better text to use a cvar).
With 'set fresnel 1' your server should be listed in the server list and allow cracked players to join and keep your own guid.

Edit: i haven't tested this. So it might or might not work.

CaptainSlow
10th September 2015, 00:08
I just checked my github log and it doesn't have the same cracked feature as Linux does.
However i just patched a 1.0 binary to replace 'demo (http://killtube.org/showthread.php?1699-Accept-cracked-players&p=8590&viewfull=1#post8590)' with 'deny' and 'fs_restrict' with 'fresnel' (i couldn't find a better text to use a cvar).
With 'set fresnel 1' your server should be listed in the server list and allow cracked players to join and keep your own guid.

Edit: i haven't tested this. So it might or might not work.

Many thanks for your reply, time and efforts Mitch!

I have downloaded and tried your executable and so far it seems to be working!! Amazing, thanks so much! I will get back with more results this week, since my friends usually are the ones with issues, not me ;)

Kind regards,
CS.

CaptainSlow
12th September 2015, 16:43
I just checked my github log and it doesn't have the same cracked feature as Linux does.
However i just patched a 1.0 binary to replace 'demo (http://killtube.org/showthread.php?1699-Accept-cracked-players&p=8590&viewfull=1#post8590)' with 'deny' and 'fs_restrict' with 'fresnel' (i couldn't find a better text to use a cvar).
With 'set fresnel 1' your server should be listed in the server list and allow cracked players to join and keep your own guid.

Edit: i haven't tested this. So it might or might not work.

Hi Mitch,

I've got something interesting for you: We run 4 gameservers with ports 28921,28922,28923 and 28924 on the same physical server.
Server 1 (port 28921) works flawlessly, however the other 3 servers (port 28922,28923 and 28924) display the following error while connecting to them: Server is not a demo server.
933
All servers have almost the same server.cfg (only different maps and gametypes). We run no mods, just plain stock COD2 1.0.
What could this be causing? I think it's strange it works for 1 server but not for the rest.

Thank you very much in advance for the trouble to be taken!

Kind regards,
CS

Mitch
12th September 2015, 17:51
I've got something interesting for you: We run 4 gameservers with ports 28921,28922,28923 and 28924 on the same physical server.
Server 1 (port 28921) works flawlessly, however the other 3 servers (port 28922,28923 and 28924) display the following error while connecting to them: Server is not a demo server.
All servers have almost the same server.cfg (only different maps and gametypes). We run no mods, just plain stock COD2 1.0.
What could this be causing? I think it's strange it works for 1 server but not for the rest.
You get 'Server is not a demo server' message when you connect with a banned or in use key. Normally you get a more accurate message.
If you want to enable cracked on those servers you need to add 'set fresnel 1' on those other servers.

For original servers: you can start them via a other exe (e.g. CoD2MP_s_cracked.exe and CoD2MP_s.exe).
This way you can run original and cracked servers from the same install.

CaptainSlow
13th September 2015, 17:32
You get 'Server is not a demo server' message when you connect with a banned or in use key. Normally you get a more accurate message.
If you want to enable cracked on those servers you need to add 'set fresnel 1' on those other servers.

For original servers: you can start them via a other exe (e.g. CoD2MP_s_cracked.exe and CoD2MP_s.exe).
This way you can run original and cracked servers from the same install.

Ugh, I feel so dumb now! I thought I also modified the startup line of the other three servers but apparently I didn't. Indeed, they were missing the 'set fresnel 1' parameter.
Sorry for wasting your time Mitch and once again thanks for pointing me into the right direction!!

CaptainSlow
1st October 2015, 10:43
Will this method also work for COD5 World at War?

Tally
1st October 2015, 10:55
Will this method also work for COD5 World at War?

The binary address from the first post will be different for the CD:WaW executable.

Other than that, the principles are the same.

Mitch
11th January 2016, 19:31
However i just patched a 1.0 binary to replace 'demo (http://killtube.org/showthread.php?1699-Accept-cracked-players&p=8590&viewfull=1#post8590)' with 'deny' and 'fs_restrict' with 'fresnel' (i couldn't find a better text to use a cvar).
With 'set fresnel 1' your server should be listed in the server list and allow cracked players to join and keep your own guid.

1.3 version (untested)

ReaDyMade
1st March 2016, 15:16
iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

Where should i make this comments?

I have my own bought server , running v1.3. I have acces to gpanel. Help

thOuMta
1st March 2016, 16:16
You just need libcod_1_3.so and put +sv_cracked 1

Tutorial by IzNoGoD: http://killtube.org/showthread.php?2454-Work-in-progress-Setup-CoD2-on-your-ubuntu-14-04-server

ReaDyMade
1st March 2016, 16:39
[Work in progress] Setup CoD2 on your ubuntu 14.04 server

That works for windows as well?

thOuMta
1st March 2016, 17:07
Maybe this: http://killtube.org/showthread.php?1730-Libcod-for-windows&p=10310&viewfull=1#post10310
I dont know i don't use windows libcod ^^

IzNoGoD
1st March 2016, 17:16
[Work in progress] Setup CoD2 on your ubuntu 14.04 server

That works for windows as well?

Is your windows ubuntu 14.04?

https://i.ytimg.com/vi/PvP_4J2MUEc/maxresdefault.jpg

ReaDyMade
1st March 2016, 19:25
This is binary i patched for 1.3: cod2_lnxded.rar

LOL its a cod4 index WTF

dukkiiEaz
24th July 2016, 15:29
so where do you have to put this file extracted from cod2_Inded.rar? i'm kinda noob..

Ni3ls
24th July 2016, 15:30
next to "main"folder

dukkiiEaz
24th July 2016, 15:34
thanks for your answer.

dukkiiEaz
28th July 2016, 12:38
So I am running a Windows server and did the following:

Installed the crack (when i connect to the server guid = 0; so that works!)
Blocked the ports as described earlier

But somehow my server aint showing up in the master server list, even after 30 minutes. Do i have to wait longer? Or did i do something wrong or have to do more?

dukkiiEaz
28th July 2016, 15:38
Anyone please?

Mitch
28th July 2016, 22:13
So I am running a Windows server and did the following:

Installed the crack (when i connect to the server guid = 0; so that works!)
Blocked the ports as described earlier

But somehow my server aint showing up in the master server list, even after 30 minutes. Do i have to wait longer? Or did i do something wrong or have to do more?

There is no libcod support for semi-cracked server(s) on Windows.

Edit: best method for semi-cracked servers is with libcod (Linux) and having sv_cracked to 1.
Edit 2: The first post only works if you can filter that certain packet (which prevents cracked players from joining).
This method has a side effect that could give a cracked player a guid from someone else.

donmario
28th November 2016, 10:05
Everybody probably knows how cracked servers work. They do not use the master list so everybody can join their server. This causes that everybody gets 0 as guid including players who do have an original key. Cracked servers won't show up in the master list because they do not use it.

There is a way to make a cracked server only cracked for the players who cannot join servers that are original. The workaround has two steps.

First you gotta block the packets that the master list sends to the server that say that the player that is connecting isn't allowed to join the server, because he is banned or has an invalid key. This is done by blocking it using the firewall.

In this case iptables:


iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP

If your server has a other port, change the dport to the port your server uses or remove it to make it drop every packet.

Now there is one problem left. There is a ~30 minute delay for cracked before you can join them. So if a player joins he will keep connecting for a long time.
You can fix this by patching (hexing) the binary like is done in the latest cracked binary. I compared the original and the cracked binary and this is how they solve this issue:

Original (address 45429h) (patch 1.3)


80 4F 12


Patched


9A 10 00

This is binary i patched for 1.3: 255

Now cracked players can join your original server and you will still have your guid. Also your server will show up in the master list =].

This worked great for me! I downloaded cod2_lnxded_1_3_nodelay.zip from: https://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)

To start my server, i log in to my server using SSH and execute the following script:
#!/bin/bash
cd /home/cod2server/
sudo iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28960 -j DROP
sudo iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28960 -j DROP
screen -S cod2screen -m ./cod2_lnxded_1_3_nodelay + set rcon_password "xxxxxx" + exec Config.cfg

When i reconnect later, i can restore the server console by typing: screen -r

saimonmi
16th December 2016, 03:44
Can someone explain to me how I make my cracked server show up in the master server list ? I have been looking in this post but couldn't find anything about WINDOWS system and which file crack should I use ?

IzNoGoD
16th December 2016, 08:49
Can someone explain to me how I make my cracked server show up in the master server list ? I have been looking in this post but couldn't find anything about WINDOWS system and which file crack should I use ?

Read post 6 in this thread, as I already told you in the OTHER thread you opened.

saimonmi
17th December 2016, 03:23
Read post 6 in this thread, as I already told you in the OTHER thread you opened.

I tried #6 its never working ? Could you please provide me with the correct exe file that should I use ?

saimonmi
18th December 2016, 19:28
I tried #6 its never working ? Could you please provide me with the correct exe file that should I use ?

The cracked server is now online on master server list with 5 sec waiting. Any way to get real guid instead of zero ?

IzNoGoD
18th December 2016, 22:10
The cracked server is now online on master server list with 5 sec waiting. Any way to get real guid instead of zero ?

You want a real guid
on a cracked server
so people with a cracked version of the game get a guid from the masterserver
because the masterserver is so generous it gives out guids to everyone, including cracked players?


That was sarcasm btw.

saimonmi
18th December 2016, 22:18
You want a real guid
on a cracked server
so people with a cracked version of the game get a guid from the masterserver
because the masterserver is so generous it gives out guids to everyone, including cracked players?


That was sarcasm btw.


LOL I know its impossible to get real guid on cracked servers, I thought maybe you guys have some trick to make it work
anyway thank you.

IzNoGoD
18th December 2016, 23:07
LOL I know its impossible to get real guid on cracked servers, I thought maybe you guys have some trick to make it work
anyway thank you.

Ye, with libcod the legit clients get a guid and the cracked get nothing.

linux though.

saimonmi
26th December 2016, 01:57
Ye, with libcod the legit clients get a guid and the cracked get nothing.

linux though.

Once I restarted Windows PC my server won't show any more on the server list ? and gives me waiting for ever could you please help me with this

vesicant
28th January 2018, 04:32
Sorry for the necropost. Just want to report in with my experience of getting a cracked server running.

I've tested this with cod2_lnxded_1_3_nodelay and cod2_lnxded_1_3_nodelay_va_loc from bgauduch/call-of-duty-2-docker-server (https://github.com/bgauduch/call-of-duty-2-docker-server/tree/master/backups). I'm too lazy to run md5sum, but I'm guessing they're the files from the "Latest cod2 linux binaries" thread (http://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)).

With these files, my server shows up on the masterlist instantly. When using cod2_lnxded_1_3_cracked, my server would not show up on the masterlist at all. I had it running for several hours, so it wasn't a matter of waiting.

However, using the iptables configs specified in the OP did not work for me. When my client tried to connect, my server would send a `getIpAuthorize` query to the master server and deny my client's connection with the following error, which I assume the `INVALID_CDKEY` ipconfig is meant to prevent:


Key Code in use. Please try reconnecting later.

I did find a solution that worked for me on this thread (http://www.fpsadmin.com/forum/archive/index.php/t-10207.html) in the FPSadmin forums.

I added this new ipconfig directive:



iptables -I INPUT -p UDP --sport 20700 -s cod2master.activision.com -j REJECT


...and ran these commands to remove the ones suggested in this thread:



iptables -D INPUT -p udp -m string --string "BANNED_CDKEY" --algo bm --to 65535 -m udp --sport 20700 --dport 28961 -j DROP
iptables -D INPUT -p udp -m string --string "INVALID_CDKEY" --algo bm --to 65535 -m udp --sport 20700 --dport 28961 -j DROP


Now, when I try to connect to my server, it logs the following messages, and lets me in:



sending getIpAuthorize for MY.CLIENT.IP.HERE:28960 [four times]
authorize server timed out
SV_DirectConnect()
Client 1 connecting with 100 challenge ping from MY.CLIENT.IP.HERE:28960
Connecting player #0 has a zero GUID
Going from CS_FREE to CS_CONNECTED for (num 0 guid 0)


I had to increase the max ping in my server config file. One time, it spiked to 2100 during this timeout, and I got a "Server is for low ping players only" error:


set sv_maxPing "10000"

tl;dr When using cod2_lnxded_1_3_nodelay_va_loc and a more strict ipconfig rule, my server shows up instantly in the masterlist, and players with duplicate CD keys can connect within 5-10 seconds.

I'd like to figure out why the solution suggested here didn't work in my case. Any insights?

Mitch
28th January 2018, 14:03
I'd like to figure out why the solution suggested here didn't work in my case. Any insights?

The cracked binary disables the master server.
The no delay binary changes the minimum required master server offline time before you can connect to a original server (from ~30 minutes to 5 seconds).
The iptables solution blocks the reject message for cracked players (requires the right server ports and root access).
The best solution is installing libcod and setting sv_cracked to 1.

For more information see the libcod section:
https://killtube.org/forumdisplay.php?44-libcod

vesicant
28th January 2018, 23:07
The iptables solution blocks the reject message for cracked players (requires the right server ports and root access).

Oh, I see, I missed this part from the OP:


If your server has a other port, change the dport to the port your server uses or remove it to make it drop every packet.

I set my server to port 28960 (https://github.com/bgauduch/call-of-duty-2-docker-server/blob/6a06f66363db95b75eceb38672287eed8ae36f56/cod2server/main/config.cfg#L15), not 28961 as targeted by your ipconfig rules. I removed the more restrictive rule I was using, re-added the rules from the OP with corrected dport, and everything works as intended. Thanks for the explanation!

Noob question: Are there reasons to run a COD2 server on a port other than the default 28960, besides to avoid conflicts with other apps running on the server? I can imagine running multiple COD2 dedicated servers from the same box, but is there anything else?

Edit: I did try using libcod2_1_3_nomysql.so (2013-Aug-30) from here (http://killtube.org/downloads/libcod/), but no luck. (I did set sv_cracked correctly.) I'll try with the 2015-Jan-29 versions later, but I'm satisfied with my setup for now. Thanks again.

kung foo man
29th January 2018, 01:38
Oh those old .so-files, they are totally outdated and lack most features. Just compile from source (Vorons repo), it's pretty fast and painless.

Maybe installing gcc is too much for a small docker, but once compiled, you can reuse the .so-files for (atleast) the same distribution version.

IzNoGoD
29th January 2018, 21:59
Oh those old .so-files, they are totally outdated and lack most features. Just compile from source (Vorons repo), it's pretty fast and painless.

Maybe installing gcc is too much for a small docker, but once compiled, you can reuse the .so-files for (atleast) the same distribution version.

Newer versions use g++ for compiling.

kung foo man
29th January 2018, 22:19
With GCC, the GNU Compiler Collection, you can compile C, C++, Objective-C, Fortran, Ada, and Go.
</nitpick>

rgl12
15th March 2018, 23:49
I did all what is written in this post:

https://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list&p=16843&viewfull=1#post16843

and i see my server on master list, but i cant join it? :/


EDIT: It works!
cod2_lnxded_1_3_nodelay_va_loc did the job! :)

rgl12
16th March 2018, 17:24
But I still dont understand, why only one server is listed?

connect 80.211.219.240:28960 - Only this one is listed
connect 80.211.219.240:28962 - this one is not
connect 80.211.219.240:28964 - this one is not either

any solutions?


on gametracker they are active

https://www.gametracker.com/search/?query=chlejtuny


EDIT:
Got it worked with this command

iptables -I INPUT -p UDP --sport 20700 -s cod2master.activision.com -j REJECT

bgauduch
10th April 2019, 16:01
Hi there,

I created this project bgauduch/call-of-duty-2-docker-server (https://github.com/bgauduch/call-of-duty-2-docker-server) quite a while ago, it's funny its still in use today :D

So looking at the feedback given to @vesicant and @rgl12, I updated the project and added the libcod base library, maybe it will be of some use ;)
Any feedback would be much appreciated !

By the way, HUDGE thanks to all the community members for their work on the cracked server binaries and the libcod !
@Mitch @KungFooMan @IzNoGod @Voron00 and anyone I would have forgotten to mention.
Keep up the awesome work :cool:

HF & GL

leanic
11th April 2020, 01:29
Can you do a video please?

bgauduch
28th April 2020, 16:35
Can you do a video please?
What do you mean exactly @leanic? A video of what?

Gummz
12th May 2020, 19:19
where do i put cod2_inxded or do i install it somehow somewere?

Rohambili
12th November 2021, 23:23
Hi! What about COD4x? And CODWAW ? Its the same sport 20700 --dport serversport ?

Please help! Thank you!



iptables -A INPUT -p udp -m string --algo bm --string "BANNED_CDKEY" --sport 20700 --dport 28961 -j DROP
iptables -A INPUT -p udp -m string --algo bm --string "INVALID_CDKEY" --sport 20700 --dport 28961 -j DROP