1
I am working with online games in browsers and need to make the client a safer environment...
Initially I think of the root that is the Global window
, how to maintain its integrity before its values already defined by the browser but with possibility to change, example:
by: https://stackoverflow.com/questions/11403107/capturing-javascript-console-log
let oldLog = console.log;
console.log = function (message) {
// DO MESSAGE HERE.
// CODIGO CAPITURA
oldLog('CAPITURA')
oldLog.apply(console, arguments);
};
console.log('teste')
I know I can’t freeze all properties but I intend to freeze native functions and values if possible, immutable values, so I use existing functions and gain performance decreasing memory cost...
communicate with the server sent to the data stack to return the unique value integrity keys or other way that I do not know yet... there are other security factors like Global window
and very delicate and great, I have a long way to go...
I would like to update some information, I found something very interesting of one of the engineers of Google, practices that really leave the code private and safe besides being efficient in the cleaning of memory, applied with Iifes:
https://philipwalton.com/articles/implementing-private-and-protected-members-in-javascript/
You can do a few tricks, but I’m not going to keep suggesting such a thing that I see as absurd and an unnecessary thought, because if it was to be done and was efficient or even if you want useful, everyone would do it, you don’t have much to worry about it, simply do not work with global scope, isolate variables in a scope, such as the use of IIFE (https://developer.mozilla.org/en-US/docs/Glossary/IIFE), and control everything from there and ready, if you have to release something in the global will be last case.
– Guilherme Nascimento
Great, I already practice this technique but had no details of them, thanks @Guilhermenascimento!
– user167036
I’m not voting to close because there are people looking for it. But I don’t understand the purpose of memorizing native calls this is interesting closed in proprietary API but doing this in native code can lead to unexpected behavior and undetectable bugs.
– Augusto Vasques
So explain more because maybe we don’t have the same vision as you, also I can tell you, the reason is that I’m creating an mmorpg and my main goal to bring it to the browser besides being multi-platform, but accurate makes the environment more secure and makes it difficult to change a function and spy the data by changing the native functions I use. Integrity check data will be loaded via
cors
and then dumped in the trash.– user167036
I’d just like to leave an opinion that I see in many that there are more points here in Stack! Just for the reason that you can deny a question or doubt, do without trying to really understand the real reason, as you said, "I will not close...", maybe you can be very good at what you do but maybe you can also be failing to see things either just want to negativate what you don’t understand, be humble!
– user167036
I did not understand your accusation. I did not deny your question I found you in analysis queue for closing already with three votes to close. I left the observation for anyone who found it not to close it because even though I find a device innocuous and that causes problems of difficult detection during development, there is a search and probably a reason. You claimed yours, even if it doesn’t make sense because it has zero impact on security if the person is willing to modify the behavior of the script he simply makes manipulated the script before starting or uses Vimion.
– Augusto Vasques
I didn’t accuse you, but I did say what I see here. Coming back to the subject, I think you still don’t understand! You can modify quietly but the integrity check will know!
– user167036
One more remark because there is a contradiction, you say that it may generate bugs or errors... but in fact who will be trying to modify the script in the case here at Global
window
and someone who should not do, for what reason would make a change to a script that is working? The answer we already know!– user167036
I assume every client will mess with the system at some point. I do not think it prudent to mount client-side security devices, even more game where players use custom browser for advantage. Unless it is a Honey pot and every check of the received information occurs on the server side and the client modifies on your machine is only on your machine..
– Augusto Vasques
Precisely @Augustovasques, so I want to make difficult the work of this type of user, if he edit something the system will indicate that he should not do and if it continues will be blocked, I also send the data that he tried to edit for study and improvement of integrity security.
– user167036
When I want to cheat in some online game I create two instances of the source one for integrity check, and other checks, and another instance only to send modified HTTP. If the game does not hold a dice conference when receiving I do what you want.
– Augusto Vasques