| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 00:58
•
by
domukun367
|
|
First ever post is a fist post! The _moment_ you enter an incorrect character, the error "Incorrect Password!" will be set, and the _moment_ you type the complete text into the password box, you are logged in. It seems that it would be much simpler to simply wait until the user presses enter / OK / whatever to submit the username / password, and then just compare the two strings... I know C# is a silly language, but surely it has string comparisons built in! |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:02
•
by
anon
|
|
please fix the "=3D" microcruft
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:10
•
by
J.
|
|
Except the obvious please-guess-my-password code, what about comparing hashes maybe?
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:17
•
by
Why?
|
|
Doesn't SQL Server already have a perfectly good authentication system? Have a table which contains unhashed passwords which presumably anyone who has a tool like Query Analyser installed can query is pretty nasty... |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:24
•
by
noname
|
|
Unless I'm missing something about the way .Net works Chirs is one heck of a nice guy. I would have just dropped all the tables, or at least changed his passwords to something questioning his parentage. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:40
•
by
Ged
|
Well DUH! Wonder why this ended up in the daily wtf in the first place...? |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:42
•
by
ikegami
|
It's also vulnerable to SQL Injection Attacks! |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:46
•
by
Robert Watkins
|
|
Ignoring the obvious problem of a system which makes it trivial to bust the password... WHY is it doing the SQL query to get the list of passwords on every keypress?
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:47
•
by
IMil
|
|
My favourite username is " '; DROP DATABASE; -- "
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 01:49
•
by
ikegami
|
Because it's possible to brute force the password in (n*26)/2 guesses as implemented instead of (n^26)/2 guesses using the normal way. (well, maybe not 26, but you get the idea.) For an 8 character password, that's 65 guesses vs 11881376 guesses. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 02:16
•
by
DaBookshah
|
|
This is pretty much what I would have expected from someone studying computer science anyway. Those retards(mostly) have no clue.
This isn't a code snippet, it qualifies as a front page story. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 02:45
•
by
aquanight
|
|
Here's an even bigger WTF (appart from the =3D wtfs): (Relevant parts emphasized)
You will never successfully login (i can't be < length and == it at the same time). Also WTF: the "incorrect password" notice will only reflect the last character typed, since the coder forgot to break/return out of the loop... (edit: even if you got into that part, both password[i] and .Text[i] will barf on indexing a nonexistant character) |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 02:56
•
by
arke
|
I'm a CS Student myself but I really have to agree. Those that enter Computer Science without previous programming knowledge pretty much turn out to be the worst possible coders. I'm seriously glad to have learned C, x86 assembler, and several other things prior to enrolling. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 02:58
•
by
nixen
|
|
Apart from the 3D thingies, this is so completely moronic that I have to call BS on it... who could ever, possibly, get the idea to postback a page between every single keystroke? You'd have to wait a second or two between every key you press..
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:14
•
by
Jean Pierre
|
|
This piece of code is a shame for everyone who has a BSc in CS. I *really* hope Christopher's friend failed in his CS tests when he writes such kind of code. I know that learning to write code is not easy and that you do not write perfect code in the first place (heck, I don't dare to look at the source codes of my first programmes I wrote years ago). But there are so many good books out there explaining the dos and don'ts... On the other hand: with this perfect knowledge of programming he still might become a consultant or a manager...
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:16
•
by
bullseye
|
Just a wild guess, but maybe someone with little, if any, programming experience. Like say, maybe someone "who is attending an upstanding college to get his Bachelors of Science in Computer Science". |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:17
•
by
tin
|
You're talking about a world where banks consider case-insensitive, fixed length passwords secure just because they make you include a number. And.... A system we use in our school uses passwords but no usernames... You can log in, go to the password change page and start changing your password until you get a "this password is already in use" error. I don't blame the guy in this WTF for writing it that way... Assuming he never got taught about security and why to not trust users. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:18
•
by
bullseye
|
Again, if he already had his BS, then the real WTF is that he's getting it again. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:30
•
by
Braechnov
|
There is a hint in the article: "He wanted me to test out his new login system that he had written in C#, using SQL Server. I agreed and he sent me his app." I imagine then that this is a winforms app, not webforms (ie, doesn't require postback, doesn't have 'a page'). You wouldn't be likely to send a webforms app - just the url to it. B.
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:42
•
by
zamies
|
No because it will throw a incorrect password message before you can type the sql :) Maybe copy paste will do the trick? |
Brings a tear to my eye
-- Captcha: Completely Automated Public Turing Test To Tell Computers And Humans Apart |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 03:51
•
by
anonymous
|
|
s/=3d/=/g; #Quote printable off
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:12
•
by
Conor
|
The comparison is not "less than" but "less than or equal to" so it can match "equal to" later on.
There no other way to learn than to write dodgy code, this post might have just saved a programmer. The mission of CodeSOD is to create great programmers by poking them with a stick. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:45
•
by
some moron
|
|
I like this. It's good, tactile code that's quite obviously aimed at improving user experience. The trouble with password fields is that you can never actually see what you are typing, and this can lead to a lot of mistakes. I've always thought that if I could design a better password field, it would work something like this. Think of the time I would save on Monday mornings if it actually told me when my shaky hands were malfunctioning more than normal when I'm trying to login. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:47
•
by
Dave
|
Love it, combine string concatenation with a StringBuilder in the same line of code :) |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:50
•
by
Dave
|
|
And why compare the password with the input string byte by byte - .NET has a plethora of string compare methods? A little knowledge is very dangerous
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:50
•
by
IceFreak2000
|
You've gotta love crap like this;
all in 28 lines of code. Genius!
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:52
•
by
Dave
|
I thin that's the "anti-pattern" known as "reinventing the square wheel" :) |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:54
•
by
IceFreak2000
|
Certainly it'll show an incorrect password message, but there's nothing to stop you adding to the TextBox. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 04:59
•
by
c-hash
|
|
StringBuilder sb =3D new StringBuilder(); What on earth is a 3d StringBuilder() ? does it build 3d strings? That Microsoft -- they certainly innovate!
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 05:00
•
by
IceFreak2000
|
|
Oh dear lord, I've missed the most obvious WTF about this code; You only need to get the last character of the password correct for it to validate you; if the password is set to "password" and the user typed in "*******d" the code will validate. Yes, it'll display an incorrect password message, but it'll still log you in. if (i == (sender as TextBox).Text.Length)
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 05:31
•
by
spacedman
|
|
The real WTF is that this should have been implemented using AJAX techniques...
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 05:34
•
by
foxyshadis
|
You guys have never browsed usenet and/or mailing lists and seen what broken mail clients do to quoted printable mime encodings? It has nothing to do with Microsoft whatsoever. lol. ( = escapes a newline, enabling long-line support in standard email, check RFC 1521.) Always fun trying to read archives of a mailing list with half the posts randomly broken. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 05:36
•
by
foxyshadis
|
Since this is obviously a standard gui app, not a web app, that would double the fun instantly. Why do something as silly as open the database directly, when you can xmlify your sql injection with a random chunk of jscript.net plopped in the middle of your C# and dynamically executed. =D |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 05:38
•
by
cyphax
|
|
It is creative, gotta give him that. I guess it's good that he let someone else test it first. It reminds me a little of the login procedure of one of our products, where a user is in an account. Two different accounts can contain two users with the same name, no problem. It would be annoying tho, if those two users accidentally have the same password, of course. My boss thought out loud "we could of course give the user a notification: 'sorry, this combination of username and password is already taken'". We decided that wouldn't be a great idea, but we did get a good laugh out of the suggestion. Auto-suggest for login procedures is never a good idea. The less someone knows about existing accounts, the better. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 05:58
•
by
Anon
|
Actually, doing: for( i=0; i<n; i++ ) blah(); |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 06:30
•
by
Vector
|
|
Yeah, now what's the bet that that was pure luck on the coder's side. :P
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 06:30
•
by
kiriran
|
|
I've learned to give the user immediately feedback if he is doing something wrong before he submits the data. This guy takes it to a new level! I wonder what went through his mind when he came up with this
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:08
•
by
alunharford
|
|
What's wrong with all of you? The wtf is that this ended up on the daily wtf. Shock news: Somebody studying for a BSc, with (presumably) no security knowledge, or training, and little experience of coding generally, writes crap security code. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:30
•
by
mustache
|
And as a computer science student, you'll know that computer science isn't really about programming. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:35
•
by
captcha
|
Thing is, it
I don't hope he fails. I hope he learns from this and doesn't do it again.
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:37
•
by
Alchymist
|
|
I hope some of the posters on this thread never become teachers. He needs encouragement not insults. Yes the guy got a lot of things wrong. That's because he didn't know better. Good on him for going out and trying to learn how to do it right. Better yet, he went to his friend to get him to test the work. Who would you rather have working for you - this guy, once he's got his degree, or Paula? |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:37
•
by
zamies
|
I'm totally screwed here the SQL injection is possible in the username, which has no checking whatsoever...
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:41
•
by
zamies
|
yesz but count the brackets it's inside the for loop! Possibly this is an obfuscation error. If the last check is outside the for loop it is true, and you only have to have the last char right to login! The login method is yet another WTF.
|
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:50
•
by
Mr. Sparkle
|
|
What is the deal with the =3D things? If this was a WebApp (And he was using ASP.NET 2.0), it'd be pretty foolish anyway to build such a thing yourself when there's a perfectly good membership provider for that sort of thing. But as stated above, I doubt this is a webapp anyway. The many postbacks would have been a clue even to the guy writing it. This must be a winforms app. Which still makes it foolish, from a security standpoint, to let the user know exactly when he's on the right path towards guessing the password. CAPTCHA: clueless. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:53
•
by
John Smallberries
|
I know you were joking, but Windows Mobile 5.0 appears to have done this. Each character you type into a password field is briefly displayed before it changes to a masked character. Handy with those tiny little keyboards. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 07:57
•
by
Mr. Sparkle
|
|
Never mind about the =3D things. Thanks, foxy. I knew that wasn't a C# operator, but I was wondering what sort of encoding error would cause it. The real WTFs here are the people badmouthing a student for not knowing the things he's going to school for, and the people who just don't know any better badmouthing Microsoft for writing a language that supposedly uses the =3D operator. |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 08:53
•
by
donazea
|
If only he had Symantec's Enterprise Security software : ) |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 08:55
•
by
Gareth Martin
|
|
This reminds me of my high-school's old "Personal Review" database. The name might not be right, but basically the idea was that the students and teachers both comment on the student's progress over the year. The school used to print out templates and write on them, but someone decided to computerise the lot. Unfortunately the school had one of the world's worst IT people do it, so they ended up with the following:
It was built in some database software that I forget the name of, that allowed multiple simultaneous network logins to the same database. There were only a few passwords (no usernames), two of which were "student" and "staff" (guess which one we were given and which one we guessed). The different users defined the permissions for viewing or editing different database fields and different forms. So the students could see but not edit the teacher's comments, etc. The clever part was the way they made it so you could only open your own report (considering all the students loggen in to the database with the same "student" login): After passing through the real database login you were presented with the "login" form, which was a standard MS-Access-style for with a pair of text boxes (for username and password). IIRC these matched our computer logins. Unfortunately, this "login" form only worked because it automatically entered SEARCH(exact) mode when it was opened. Pressing login performed the search and redirected you to the form where you could edit your record. If you used the menu to cancel the search you could browse the entire database at will, getting anyone's username and password, and editing their personal review... Couple that with the "staff" db login, you could tell the other students what the teacher _really_ thought about them. (insert evil grin smile here) |
Re: [CodeSOD] Passwords! Get Your Free Passwords Here!
2006-11-28 08:57
•
by
donazea
|
Exactly - that's why they have Software Engineering, though I imagine they have changed quite a bit since my day. |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |