Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

It it possible to provide the rc4 decodekey from outside the code?#1254

Unanswered
Kezzel asked this question inQ&A
Discussion options

It seems relatively easy to deobfuscate code using online tools. The result is still gibberish, however the used strings can be read. This shows a little too much of the inner workings of our code.

The deopfuscation process seems to be able to find the decodekey for the rc4 directly in the code. So my question is, if it is possible to provide this key as an option when obfuscating, and then provide it, fx. as an variable on the script tag used to run the obfuscated script and then fetch this key using the currentScript global.

If the script is removed after load, it becomes extremely difficult to even see that such key is provided, and it would make the deobfuscation much harder.

What do you think?

Cheers

You must be logged in to vote

Replies: 1 comment 5 replies

Comment options

Suppose, that nothing hard to find external key

You must be logged in to vote
5 replies
@Kezzel
Comment options

The key is provided by chrome extension code, where the code is loaded through injectScript.

It will never be impossible to deobfuscate, I guess that is the nature of js, but if it is not possible to simply use an online tool that recognizes that it has been obfuscated using the javascript-obuscator tool and deobfuscates it right away.

Hiding the key elsewhere will make it much harder, and require real effort.

@BlackYuzia
Comment options

Don't sure on 100%. But, suppose external key is like:
const key = await fetchKey()?
Or what you mean instead?

@Kezzel
Comment options

Well, I would like to provide a key string to be used when obfuscating (as an option) and a function that retrieves the key from within the script, again as an option. Fx.:
{ stringArrayEncodingRc4Key: 'some-key', //If the key fx. is stored as the id value of the script inserted stringArrayEncodingRc4KeyFunction: 'currentScript.attributes.id.value' }

It could also be a global variable, or fetched async from somewhere etc.:-)

@BlackYuzia
Comment options

Same as right now?

@Kezzel
Comment options

No a I mean in the global scope, fx. set on global/window object. The point is that the key is NOT part of the script itself, and therefore the script can not on its own be deobfuscated, but requires at least the detective task to figure out from where / how the key is obtained.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@Kezzel@BlackYuzia

[8]ページ先頭

©2009-2025 Movatter.jp