Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password extractable from executable code?

If a password is hard-coded into a variable in source code such as VB, could someone extract this password by looking at the compiled executable code?

If so, what can be done to avoid this?

like image 312
CJ7 Avatar asked Mar 24 '26 10:03

CJ7


2 Answers

Yes, someone could.

Nothing can be done to avoid it. Obfuscation will make it slightly harder.

In the worst case, if someone didn't understand your obfuscated code, they could run your executable in a debugger and read the password from memory just before you use it.

The solution is, of course, not to hard-code important passwords into your binaries.

like image 105
Borealid Avatar answered Mar 26 '26 00:03

Borealid


Yes. The password could be found by watching the program execute in a debugger. If you do nothing, it might even be possible to find by searching for text in the binary file.

What can be done? There are anti-debugging techniques like obfuscation or anti-tampering mechanisms that will cause the executable to blow up when debugged. Obfuscation is probably easy to implement. Anti-tampering will be difficult.

like image 30
Steve Rowe Avatar answered Mar 25 '26 22:03

Steve Rowe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!