Jump to content

Combolock Brute Force Fix


Snowmobil

Recommended Posts

This closes the menu after every attempt.

 

You need to copy

dayz_code\init\compiles.sqf
dayz_code\compile\player_unlockDoor.sqf

to your mission.pbo

 

init.sqf

 

- call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions

+ call compile preprocessFileLineNumbers "path\to\compiles.sqf"; //Compile regular functions

 

compiles.sqf

- player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";

+ player_unlockDoor = compile preprocessFileLineNumbers "path\to\player_unlockDoor.sqf";

 

 

player_unlockDoor.sqf

 

} else {

        DZE_Lock_Door = "";
        [player,"combo_locked",0,false] call dayz_zombieSpeak;
 
        + [player,20,true,(getPosATL player)] spawn player_alertZombies;
        + _display = findDisplay 41144;
        + _display closeDisplay 3000;
};
Link to comment
Share on other sites

If anyone is going to use this fix use the file below as it has already been updated for the next release and to also alerts zeds on failure.

https://raw.github.com/vbawol/DayZ-Epoch/4fecfb0a05d0050b8dcdfd4840f63ee09485b297/SQF/dayz_code/compile/player_unlockDoor.sqf

 

Current build of epoch has random lockout to prevent abuse so this is not necessary anymore.

Link to comment
Share on other sites

You should totally do it. We could put it on bases of cheaters/glitchers before we ban them as an extra laugh for us ;)

 

Really though, I'm not sure just closing the dialog will stop it being brute forced. I know its very "Home Alone" but the knock out could act as a way to deter people from brute forcing as it leaves them vulnerable for a period of time if they get it wrong. Perhaps later down the line, wire fencing, lightbullbs/batteries could be used to upgrade the lock to something a bit more secure.

 

I'm just trying to think of ways to break the mechanism because you know there will be less than honourable people who will do it. Its a shame we can't play it on honesty but it is, what it is and as a 'responsible' server hoster I'm always trying to think of ways that would piss off my community, so I can prevent it!

Link to comment
Share on other sites

Cheers snow, this works:

		DZE_Lock_Door = "";
		[player,"combo_locked",0,false] call dayz_zombieSpeak;
		[player,20,true,(getPosATL player)] spawn player_alertZombies;
		cutText [format["You have been knocked out by CPC security systems for failing to input the correct code."], "PLAIN DOWN"];
		r_player_unconscious = true;
		_display = findDisplay 41144;
		_display closeDisplay 3000;
	};

However its a short duration, 3 ish seconds. The cutText displays a message for the fail so its not entirely random.

 

I tried this also:

	player setVariable["NORRN_unconscious",true, true];
    player setVariable["unconsciousTime",15,true];

but it didn't work, not sure what I did wrong.

Link to comment
Share on other sites

  • 2 weeks later...

would adding setVariable["USEC_injured",true]; make people bleed as well when they get the code wrong?

 

so would look like this

		DZE_Lock_Door = "";
		[player,"combo_locked",0,false] call dayz_zombieSpeak;
		[player,20,true,(getPosATL player)] spawn player_alertZombies;
		cutText [format["You have been knocked out by CPC security systems for failing to input the correct code."], "PLAIN DOWN"];
		r_player_unconscious = true;
                                setVariable["USEC_injured",true];
		_display = findDisplay 41144;
		_display closeDisplay 3000;
	};
Link to comment
Share on other sites

Knocks player to the ground in addition to previous actions.
 

if (!isDedicated) then {
	player_unlockDoor = {
		private ["_ok"];
		if (!isNull dayz_selectedDoor) then
		{
			_obj = dayz_selectedDoor;
			_objectCharacterID 	= _obj getVariable ["CharacterID","0"];
			if (DZE_Lock_Door == _objectCharacterID) then
			{
				[player,"combo_unlock",0,false] call dayz_zombieSpeak;
				_display = findDisplay 41144;
				_display closeDisplay 3000;
				if(_obj animationPhase "Open_hinge" == 0) then
				{
					_obj animate ["Open_hinge", 1];
				};
				if(_obj animationPhase "Open_latch" == 0) then
				{
					_obj animate ["Open_latch", 1];
				};
			}
			else
			{
				DZE_Lock_Door = "";
				[player,"combo_locked",0,false] call dayz_zombieSpeak;
				[player,20,true,(getPosATL player)] spawn player_alertZombies;
				r_player_unconscious = true;
				player setVariable["medForceUpdate",true,true];
				player setVariable ["300", r_player_timeout, true];
				_display = findDisplay 41144;
				_display closeDisplay 3000;
				
				cutText ["WRONG CODE ENTERED - WAIT 20 SECONDS", "PLAIN DOWN"];
				if (isNil 'KeyCodeTry') then {KeyCodeTry = true;};
				[] spawn {sleep 20;KeyCodeTry = nil;};
				[] spawn {
					while {KeyCodeTry} do
					{
						_display = findDisplay 41144;
						_display closeDisplay 3000;
						sleep 0.1;
					};
				};
			};
		}
		else
		{
			_display = findDisplay 41144;
			_display closeDisplay 3000;
		};
	};
};
Link to comment
Share on other sites

The issue isn't with being able to eventually break in, its the sheer amount of time it takes to get a working base together. Even the time for individual pieces including farming a lock, vs being able to crack the code. Here is a post I wrote after someone complained about the knockout on my server.

 

 

 

I just did a little test, I did record it but it just won't encode for some reason, I attempted a door I created for the purpose 9 times. If you don't believe me on the recording, I will post it up if I can get it to work. Just try this out yourself. You only need to be able to count to a max of 20 if you don't own a stopwatch.
 
For the sake of difficulty, I went for 555 9 times. This is the MAXIMUM amount of clicks to enter per lock combination. I simply counted 1.2.3.4.5 every time I clicked. I could very easily count 1.2, 1.2.3, 1.2.3.4 and remember where I was each time in the same amount of time which would reduce the time it takes per lock attempt.
 
Note: I originally calculated this at a lower amount of 8.8seconds, I had to amend it all right before I hit submit so if I fucked something, lemme know.
 
I averaged 10 seconds per attempt from the start of the first attempt to the start of the second. So one full attempt took me 10 seconds.
 
10 x 999(combinations) = 9999 seconds
 
9999 seconds / 60 seconds (in a minute) = 166 minutes.
 
It would take 166 minutes to attempt ALL 999 possible combinations on a 3 digit lock, with my knockout script in place. This is calculated at maximum clicks required per lock which is obviously skewing the figures slightly.
 
Given that all codes are indeed not 555 and my code for this door was 875.
 
999 - 875 = 124
 
124 x 10 = 1240
 
1240 / 60 = 20.6minutes
 
It would take 20 minutes to crack my code, on my own.
 
Now lets look at it a bit more mathematically and likely.
 
You have two people accessing the door at any one time. One of you starts from 000 and one starts from 999 and you count up from 000 and down from 999.
 
If my code was 555:
 
999 - 555 = 444
 
444 x 10 = 4444
 
4444 / 60 = 74 minutes or 1hr and 14 minutes.
 
That is the maximum amount of time required to crack ANY lock in the game with two people.
 
I did this as fast as I could. Even if I doubled that time:
 
40minutes to crack my lock
2hours and 28 minutes to crack any lock in the game
 
To optimize cracking a base, you'd need 4 people
 
Player 1) 000
Player 2) 999
Player 3) 555 <
Player 4) 555 >
 
Meaning you would only need to hit 222 combinations.
444 / 2 = 222
222 x 10 = 2222
2222 / 60 = 37 minutes.
 
If you also want to be really pedantic about it, no-one will ever have the code 000, as the database will see it as a single "0" and it won't work, which is why the code is written in a way that it will never generate a 000 code reducing the time that little bit more.
 
People will sit there and do this and easily get into a base over a few sessions of play or if you take it in turns with a buddy, I'd sit there and crack someones base if they did me over and I know the majority of the server would to. I'd make an evening of it.
 
There are variables there, zombies, other players but even with all of these. The short of it is, the actions for a 4 man group would only need to total 37 minutes each. You don't lose your progress, you forever retain your position if you have a pen and paper or use your phone, even a .txt document on the desktop.
 
That is not a lot of time for breaking into a base where the amount of work put in, is likely 10s and even 100s of hours longer to set it all up and as above, once you're in. You can get in when ever you want.
 
Also remember, this is maximum required clicks per 999 possible combinations, for the lower numbers it is drastically shorter per attempt.

 

 

This as said in the post above, is all with the temporary knockout script AND the closing of the dialog.

 

I'm all for being able to crack a code but a 3digit code is too small, it then forces players into double, trip, quadruple airlocking all entrances. Creating fake doors and walls behind them which increases object amount on the server.

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...

Looks like this has reared its head again. There are graphical tools out there that seem to be able to automate the lock cracking process. I have seen video footage of a tool that seems to take advantage of a colour pixel on the lock which provides information to help the cracker?

The example I saw took just a few minutes and even automated the reopening of the lock panel after the 10 second timeout.

Link to comment
Share on other sites

  • 1 month later...

Is this still workin on 1.0.4.2?

 

 

Knocks player to the ground in addition to previous actions.
 

if (!isDedicated) then {
    player_unlockDoor = {
        private ["_ok"];
        if (!isNull dayz_selectedDoor) then
        {
            _obj = dayz_selectedDoor;
            _objectCharacterID     = _obj getVariable ["CharacterID","0"];
            if (DZE_Lock_Door == _objectCharacterID) then
            {
                [player,"combo_unlock",0,false] call dayz_zombieSpeak;
                _display = findDisplay 41144;
                _display closeDisplay 3000;
                if(_obj animationPhase "Open_hinge" == 0) then
                {
                    _obj animate ["Open_hinge", 1];
                };
                if(_obj animationPhase "Open_latch" == 0) then
                {
                    _obj animate ["Open_latch", 1];
                };
            }
            else
            {
                DZE_Lock_Door = "";
                [player,"combo_locked",0,false] call dayz_zombieSpeak;
                [player,20,true,(getPosATL player)] spawn player_alertZombies;
                r_player_unconscious = true;
                player setVariable["medForceUpdate",true,true];
                player setVariable ["300", r_player_timeout, true];
                _display = findDisplay 41144;
                _display closeDisplay 3000;
                
                cutText
["WRONG CODE ENTERED - WAIT 20 SECONDS", "PLAIN DOWN"];
                if (isNil 'KeyCodeTry') then {KeyCodeTry = true;};
                [] spawn {sleep 20;KeyCodeTry = nil;};
                [] spawn {
                    while {KeyCodeTry} do
                    {
                        _display = findDisplay 41144;
                        _display closeDisplay 3000;
                        sleep 0.1;
                    };
                };
            };
        }
        else
        {
            _display = findDisplay 41144;
            _display closeDisplay 3000;
        };
    };
};

 

Would be nice, thanks!

Link to comment
Share on other sites

I use this, between 2 and 4 bad codes and it kicks the player to the lobby

 

player_unlockDoor.sqf

/*
	DayZ Unlock Door
	Usage: [_obj] call player_unlockDoor;
	Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected].
*/
private ["_display","_obj","_objectCharacterID"];

if(!isNil "DZE_DYN_UnlockDoorInprogress") exitWith { cutText [(localize "str_epoch_player_21") , "PLAIN DOWN"]; };

DZE_DYN_UnlockDoorInprogress = true;

if(!isNull dayz_selectedDoor) then {

	if (!isNil 'KeyCodeTryTimer') then {
		if(diag_tickTime > KeyCodeTryTimer) then {
			KeyCodeTry = nil;
			KeyCodeTryTimer = nil;
		};
	};

	// our target
	_obj = dayz_selectedDoor;

	_notNearestPlayer = _obj call dze_isnearest_player;

	if (_notNearestPlayer) then {
		// close display since another player is closer
		_display = findDisplay 41144;
		_display closeDisplay 3000;
		cutText [(localize "STR_EPOCH_ACTIONS_16"), "PLAIN DOWN"];
	} else {
	
		// get object combination
		_objectCharacterID 	= _obj getVariable ["CharacterID","0"];

		// Check combination
		if (DZE_Lock_Door == _objectCharacterID) then {

			[player,"combo_unlock",0,false] call dayz_zombieSpeak;

			// close display
			_display = findDisplay 41144;
			_display closeDisplay 3000;

			// unlock if locked
			if(_obj animationPhase "Open_hinge" == 0) then {
				_obj animate ["Open_hinge", 1];
			};

			if(_obj animationPhase "Open_latch" == 0) then {
				_obj animate ["Open_latch", 1];
			};
			KeyCodeTry = nil;

		} else {

			[10,10] call dayz_HungerThirst;

			DZE_Lock_Door = "";
			[player,"combo_locked",0,false] call dayz_zombieSpeak;
			[player,20,true,(getPosATL player)] spawn player_alertZombies;

			if (isNil 'KeyCodeTry') then {KeyCodeTry = 0;};

			KeyCodeTry = KeyCodeTry + 1;

			if (!isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;};

			if(KeyCodeTry >= ((round(random 4)) + 2)) then {
			
				if (isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;};
			
				cutText [(localize "str_epoch_player_19"), "PLAIN DOWN"];
				_display = findDisplay 46;
				_display closeDisplay 0;
			};
		};
	};
} else {
	
	// close display since no target
	_display = findDisplay 41144;
	_display closeDisplay 3000;
};
DZE_DYN_UnlockDoorInprogress = nil;

Link to comment
Share on other sites

So I loaded this,

if (!isDedicated) then {
	player_unlockDoor = {
		private ["_ok"];
		if (!isNull dayz_selectedDoor) then
		{
			_obj = dayz_selectedDoor;
			_objectCharacterID 	= _obj getVariable ["CharacterID","0"];
			if (DZE_Lock_Door == _objectCharacterID) then
			{
				[player,"combo_unlock",0,false] call dayz_zombieSpeak;
				_display = findDisplay 41144;
				_display closeDisplay 3000;
				if(_obj animationPhase "Open_hinge" == 0) then
				{
					_obj animate ["Open_hinge", 1];
				};
				if(_obj animationPhase "Open_latch" == 0) then
				{
					_obj animate ["Open_latch", 1];
				};
			}
			else
			{
				DZE_Lock_Door = "";
				[player,"combo_locked",0,false] call dayz_zombieSpeak;
				_display = findDisplay 41144;
				_display closeDisplay 3000;
				
				cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"];
				if (isNil 'KeyCodeTry') then {KeyCodeTry = true;};
				[] spawn {sleep 30;KeyCodeTry = nil;};
				[] spawn {
					while {KeyCodeTry} do
					{
						_display = findDisplay 41144;
						_display closeDisplay 3000;
						sleep 0.1;
					};
				};
			};
		}
		else
		{
			_display = findDisplay 41144;
			_display closeDisplay 3000;
		};
	};
}; 

and it works... just throws an error at the first attempt. any ideas?
 

gIFesGP.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...