Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

c kiddies, need your help

Name: Anonymous 2010-04-25 18:53

int main(){
    char data[2][5] = {"root", "pass"};
    char holder[5];
    printf("Please enter your username>");
    gets(holder);
    if(data[1]==holder){
    printf("Correct Username");
    };
    return 0;
}

The problem is even if I type the correct username in it will not pass to
if(data[1]==holder){

Name: Anonymous 2010-04-25 20:17

Even if fix all the vulnerabilities in your example, it's still a terribad idea.

1) You seem to be building this on Windows, so you're going to give this exe to someone to run right? He can just use a disassembler, or in this case (since there's no encryption), he could just run a "strings" on it or whatever.
2) If this was meant as some sort of remote-auth. I've once encountered such sillyness in a *nix environment where the permissions were +x only (no r/w). a bit of minimal gdb magic and the password presented itself.
The only way this can work is if it's fully remote and the user has no way on accessing the local file.

tl;dr: terrible idea.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List