In article <oTGDb.323$>,
"Lucas Van Hieng" <> wrote:
> (http://www.starlance.us/MW4/)
>
> They recently redid the site, so now it requires that you enter the
> random 5 digit number shown on a png image. (Before there was no such
> extra security and I was able to POST with LWP:UserAgent.)
>
> Is there way at all around these things? I'm guessing that this would be
> easier than with what MSN and Yahoo use, which is often a scrambled
> mess. This site however uses uniform text (as if just typed into the
> image with text tool and saved.) Is there anyway to do some sort of OCR
> (char recognition) on the fly?
Funnily enough we're looking at implementing a similar system at work.
Aaanyway...
From looking at it it does appear that the image uses only 2 colours -
the foreground and the background. There seems to be a 1 pixel gap
between each digit. The code appears to use only the digits 0 to 9. The
font doesn't vary and seems to be a variable-width font. The image seems
to be the same as long as you have the same PHPSESSIONID cookie from
them.
Using this information one approach would be:
a) get the image
b) convert it into some format that you can manipulate from perl - GD
might be of use.
c) scan over all the columns to identify columns that contain all the
same colour - those may be the breaks between digits. Trim the leading
and trailing space too. Maybe trim the space above and below too.
d) extract each rectangular area that is probably a digit.
e) the characters vary in size - use the size of the area to identify
some (maybe all) of the digits.
f) or somehow compare the rectangle's contents to digits you've matched
by hand and then you know what the digit is.
I'm not suggesting that you should actually do any of this, because that
may violate their terms of service etc, but it's an interesting problem
to think about. I see from another article that asking the site's admin
didn't help you out - but at leat you tried that approach too.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply