Comments on: 3 Easy Tips to Prevent a Binary Crack http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/ Wed, 27 Feb 2013 21:05:44 +0000 hourly 1 http://wordpress.org/?v=3.0.1 By: Popin http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-20868 Popin Wed, 14 Jul 2010 21:25:00 +0000 http://www.seoxys.com/?p=88#comment-20868 As long as a program runs it can be hacked. It just takes skill and extream patiance to crack the safest software. If the system can read and run the program then the hacker can break in. If you want to be safe then take twice as long as it took to make the program to encode and protect it. In the long run expect a hacker to get in. You have to give them credit though... They go through the lowest level of programs and have to find all the weakpoints just to get in ONCE. Then they might have to do it again! >.> As long as a program runs it can be hacked. It just takes skill and extream patiance to crack the safest software. If the system can read and run the program then the hacker can break in. If you want to be safe then take twice as long as it took to make the program to encode and protect it. In the long run expect a hacker to get in. You have to give them credit though… They go through the lowest level of programs and have to find all the weakpoints just to get in ONCE. Then they might have to do it again! >.>

]]>
By: ran6110 http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-8483 ran6110 Fri, 13 Feb 2009 18:48:12 +0000 http://www.seoxys.com/?p=88#comment-8483 OK, you really don't have much of a chance at stopping the really serious hacker. These items like most of the others stop the casual hacker and the opportunistic thief. And make the code author feel a little safer. What I've done to delay the hack is to require a serial number with the users email. The serial number is NOT generated by a script. When we get the confirmation email we generate the serial number and sent it out. When the correct information is entered the program is allowed to run. When the incorrect information is entered the program is allowed to run! Yeah, that sounds weird but the twist is the program doesn't report the error/problem until days, weeks or months later! The point being, you don't have to stop and report the error the milli-second it happens, that only helps the hacker. It won't stop them but it makes it really hard to debug and patch. Also, never rely on only one validation check and don't always use the same call. Sometimes I check in the awakeFromNib other time I check in one or more views. I have one program that check when it's closing and reports a corruption error that requires a re-install! The point being, you have to work just as hard to hinder (notice I didn't say stop) the hacker as he does cracking your program. OK, you really don’t have much of a chance at stopping the really serious hacker.

These items like most of the others stop the casual hacker and the opportunistic thief. And make the code author feel a little safer.

What I’ve done to delay the hack is to require a serial number with the users email. The serial number is NOT generated by a script. When we get the confirmation email we generate the serial number and sent it out.

When the correct information is entered the program is allowed to run. When the incorrect information is entered the program is allowed to run!

Yeah, that sounds weird but the twist is the program doesn’t report the error/problem until days, weeks or months later! The point being, you don’t have to stop and report the error the milli-second it happens, that only helps the hacker.

It won’t stop them but it makes it really hard to debug and patch.

Also, never rely on only one validation check and don’t always use the same call. Sometimes I check in the awakeFromNib other time I check in one or more views. I have one program that check when it’s closing and reports a corruption error that requires a re-install!

The point being, you have to work just as hard to hinder (notice I didn’t say stop) the hacker as he does cracking your program.

]]>
By: Mecki http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3741 Mecki Thu, 17 Jul 2008 12:06:20 +0000 http://www.seoxys.com/?p=88#comment-3741 Codesigning buys you nothing! If the binary is modified, the signature becomes invalid... that's it. That's all that happens. It won't have any effect other than that. Who cares for an invalid signature? Apps with invalid sig will run just fine!!! And almost nobody understood the KILL flag. An app with invalid sig will run just fine, even with KILL flag. The KILL flag only means it will be killed if the running app in memory somehow loses its identity (e.g. it would be killed if a process was modifying the app in memory), but it will still start when modifying it on disk (try it, if you don't believe me). Apple has no plans to change that either! They say "Why would we want to do this? A hacker could just patch your app and then resign it with his own signature and it will have a valid sig again. Okay, you could write code that checks if the signature is valid *AND* if the signature is signed by your cert, but the hacker could just replace this piece of code, too" Codesigning buys you nothing! If the binary is modified, the signature becomes invalid… that’s it. That’s all that happens. It won’t have any effect other than that. Who cares for an invalid signature? Apps with invalid sig will run just fine!!! And almost nobody understood the KILL flag. An app with invalid sig will run just fine, even with KILL flag. The KILL flag only means it will be killed if the running app in memory somehow loses its identity (e.g. it would be killed if a process was modifying the app in memory), but it will still start when modifying it on disk (try it, if you don’t believe me).

Apple has no plans to change that either! They say “Why would we want to do this? A hacker could just patch your app and then resign it with his own signature and it will have a valid sig again. Okay, you could write code that checks if the signature is valid *AND* if the signature is signed by your cert, but the hacker could just replace this piece of code, too”

]]>
By: ctwise http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3725 ctwise Mon, 30 Jun 2008 12:55:04 +0000 http://www.seoxys.com/?p=88#comment-3725 PT_DENY_ATTACH doesn't work to stop hackers. The people who want to hack your code will have the knowledge and know-how to load the kext. The only people who will be affected by the PT_DENY_ATTACH will be the people who have a legitimate desire to understand their systems and incorrect behaviors that they are trying to track down. Those people will be forced to either uninstall your application, live with the problems or install a kext they don't actually want or need in order to solve their issues. In other words, PT_DENY_ATTACH doesn't stop hackers and pisses off some of your customers. Sign your code instead. Use techniques and tools that obfuscate and encrypt your code. Just don't make the system opaque to understanding. That path takes us back to Windows. PT_DENY_ATTACH doesn’t work to stop hackers. The people who want to hack your code will have the knowledge and know-how to load the kext. The only people who will be affected by the PT_DENY_ATTACH will be the people who have a legitimate desire to understand their systems and incorrect behaviors that they are trying to track down. Those people will be forced to either uninstall your application, live with the problems or install a kext they don’t actually want or need in order to solve their issues. In other words, PT_DENY_ATTACH doesn’t stop hackers and pisses off some of your customers.

Sign your code instead. Use techniques and tools that obfuscate and encrypt your code. Just don’t make the system opaque to understanding. That path takes us back to Windows.

]]>
By: Jerry Krinock http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3722 Jerry Krinock Sun, 29 Jun 2008 12:41:55 +0000 http://www.seoxys.com/?p=88#comment-3722 Ah, Kevin, you are correct. Being an Xcode GUI user, I missed the tiny letter 'r' in your article. Also, I was fooled by the fact that when I run gdb it does that "Reading symbols for shared libraries ++++++" twice, both before and after I 'run'. Oh, well. So, I re-ran the test, typed 'r' and got an 055 exit. Then I unzipped an old version of my app which was not compiled with the call to ptrace PT_DENY_ATTACH, attached to it, typed 'r', and gdb continued to work. So, I take back what I said yesterday. Thanks, Kenneth. Also, regarding the original comment by ctwise, I don't believe that the "makes...impossible" applies to your machine. #ifdef DEBUG, everything is back to normal. Regarding the workaround, of course, if one hacks the system, anything is possible. PT_DENY_ATTACH just sets up another hurdle for some hacker who may be seriously thinking of not drinking another Coke and going to bed instead. Ah, Kevin, you are correct. Being an Xcode GUI user, I missed the tiny letter ‘r’ in your article. Also, I was fooled by the fact that when I run gdb it does that “Reading symbols for shared libraries ++++++” twice, both before and after I ‘run’. Oh, well.

So, I re-ran the test, typed ‘r’ and got an 055 exit. Then I unzipped an old version of my app which was not compiled with the call to ptrace PT_DENY_ATTACH, attached to it, typed ‘r’, and gdb continued to work. So, I take back what I said yesterday.

Thanks, Kenneth.

Also, regarding the original comment by ctwise, I don’t believe that the “makes…impossible” applies to your machine. #ifdef DEBUG, everything is back to normal. Regarding the workaround, of course, if one hacks the system, anything is possible. PT_DENY_ATTACH just sets up another hurdle for some hacker who may be seriously thinking of not drinking another Coke and going to bed instead.

]]>
By: kenneth http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3721 kenneth Sun, 29 Jun 2008 08:37:24 +0000 http://www.seoxys.com/?p=88#comment-3721 Jerry, I just emailed you the .app. Note that gdb still loads, but won't let you run. So if you load gdb with the executable, it will work, read symbols and everything. However, it's when you "run" that the app exits with code 055 every time. Jerry, I just emailed you the .app.

Note that gdb still loads, but won’t let you run. So if you load gdb with the executable, it will work, read symbols and everything. However, it’s when you “run” that the app exits with code 055 every time.

]]>
By: Jerry Krinock http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3720 Jerry Krinock Sun, 29 Jun 2008 05:59:46 +0000 http://www.seoxys.com/?p=88#comment-3720 I tried this but gdb still attached. Maybe it's because I'm using Xcode 3.0, with an earlier version of gdb than you have? GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct 2 04:07:49 UTC 2007) I'm pretty sure I did it correctly. To make sure that the #ifdef was working (actually I used #ifndef), I logged a compiler #warning just above the call to ptrace(), and it did log. If you send me, or post, your ProtectionSample, I'll see if my gdb can attach to it. I tried this but gdb still attached. Maybe it’s because I’m using Xcode 3.0, with an earlier version of gdb than you have?

GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct 2 04:07:49 UTC 2007)

I’m pretty sure I did it correctly. To make sure that the #ifdef was working (actually I used #ifndef), I logged a compiler #warning just above the call to ptrace(), and it did log. If you send me, or post, your ProtectionSample, I’ll see if my gdb can attach to it.

]]>
By: scrod http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3713 scrod Fri, 27 Jun 2008 21:44:23 +0000 http://www.seoxys.com/?p=88#comment-3713 When running on leopard you can use code signing and force a static validation of your app at launch time or set the KILL flag and wait for it to become dynamically invalid as resources and pieces of the executable are paged-in. This will be less work and significantly more thorough than implementing your own system from the ground up. When running on leopard you can use code signing and force a static validation of your app at launch time or set the KILL flag and wait for it to become dynamically invalid as resources and pieces of the executable are paged-in. This will be less work and significantly more thorough than implementing your own system from the ground up.

]]>
By: ctwise http://www.seoxys.com/3-easy-tips-to-prevent-a-binary-crack/comment-page-1/#comment-3712 ctwise Fri, 27 Jun 2008 11:24:34 +0000 http://www.seoxys.com/?p=88#comment-3712 Please avoid PT_DENY_ATTACH. Not only is it easily circumventable (http://landonf.bikemonkey.org/code/macosx/Leopard_PT_DENY_ATTACH.20080122.html) but it makes monitoring and understanding YOUR OWN MACHINE impossible. Please avoid PT_DENY_ATTACH. Not only is it easily circumventable (http://landonf.bikemonkey.org/code/macosx/Leopard_PT_DENY_ATTACH.20080122.html) but it makes monitoring and understanding YOUR OWN MACHINE impossible.

]]>