NothingToShow Grandmaster Cheater Supreme Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Fri Aug 21, 2009 6:48 am Post subject: Cracking CrackMe's on Linux? |
|
|
Heya crackers.
I've always been a fan of CrackMe's, just never really done much with it.
So I decided to try it out on Linux, and found the commands "file", "nm" and "strings" useful, which are used in tutorial.
To test it out, I made a very simple CrackMe in C++, which should be very easy to crack, yet I don't know how to find it.
So how would I find the password value, "hej", using the various commands?
I know this is pretty noobish, but I'd like to learn. And please correct me, if I'm doing it all wrong.
My CrackMe source
Code: | #include <iostream>
using namespace std;
int main()
{
string password;
string userInput;
password = "hej";
cout << "Enter password: ";
cin >> userInput;
if (userInput == password) {
cout << "CORRECT!\n";
}
else {
cout << "Wrong!\n";
}
//cin.get();
return 0;
} |
The "nm" output (Posted on Pastebin.org)
The "strings" output:
Code: | /lib/ld-linux.so.2
RSRhu
CyIk
libstdc++.so.6
__gmon_start__
_Jv_RegisterClasses
pthread_cancel
_ZNKSs4sizeEv
_ZSt4cout
_ZNSsC1Ev
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
_ZNSt8ios_base4InitC1Ev
_ZSt3cin
_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RSbIS4_S5_T1_E
_ZNSsD1Ev
_ZNKSs4dataEv
_ZNSt8ios_base4InitD1Ev
_ZNSsaSEPKc
__gxx_personality_v0
libm.so.6
libgcc_s.so.1
_Unwind_Resume
libc.so.6
_IO_stdin_used
__cxa_atexit
memcmp
__libc_start_main
GCC_3.0
GLIBC_2.0
GLIBC_2.1.3
CXXABI_1.3
GLIBCXX_3.4
PTRh
[^_]
Enter password:
CORRECT!
Wrong!
zPLR |
|
|