Top Banner
Attacking CAPTCHAs explained Ioan – Carol Plangu
41
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Attacks Against Captcha Systems - DefCamp 2012

Attacking CAPTCHAs explained

Ioan – Carol Plangu

Page 2: Attacks Against Captcha Systems - DefCamp 2012

What's a CAPTCHA

Completely

Automated

Public

Turing test to tell

Computers and

Humans

Apart

Page 3: Attacks Against Captcha Systems - DefCamp 2012
Page 4: Attacks Against Captcha Systems - DefCamp 2012

Three attack methods

Implementation attack

Automated recognition

Manual labor

Page 5: Attacks Against Captcha Systems - DefCamp 2012

The implementation attack

Scenario 1

the image session id can be reused

Page 6: Attacks Against Captcha Systems - DefCamp 2012

The implementation attack

Scenario 1

the image session id can be reused

id

Captcha form

Restricted page

Page 7: Attacks Against Captcha Systems - DefCamp 2012

The implementation attack

Scenario 2

the number of captcha tests is limited

Page 8: Attacks Against Captcha Systems - DefCamp 2012

The implementation attack

Scenario 2

the number of captcha tests is limited

we just need to solve them all and store them in a hash table

Page 9: Attacks Against Captcha Systems - DefCamp 2012

The implementation attack

Scenario 3

hash of solution sent to client

Page 10: Attacks Against Captcha Systems - DefCamp 2012

The implementation attack

Scenario 3

hash of solution sent to client

rainbow tables :)

Page 11: Attacks Against Captcha Systems - DefCamp 2012

Manual labor

There are two options:

Page 12: Attacks Against Captcha Systems - DefCamp 2012

Pay a bunch of monkeys

Page 13: Attacks Against Captcha Systems - DefCamp 2012

XXXComplete this captcha form to continue

Or not...

Page 14: Attacks Against Captcha Systems - DefCamp 2012

Automated recognition

We're going to actually reproduce a human response for the given question

Page 15: Attacks Against Captcha Systems - DefCamp 2012

Can you understand my voice?

Page 16: Attacks Against Captcha Systems - DefCamp 2012

The sound sample is usually generated

Page 17: Attacks Against Captcha Systems - DefCamp 2012

It's hard to add noise to the generated speech without making it

hard for the human

Page 18: Attacks Against Captcha Systems - DefCamp 2012

But can you read?

Page 19: Attacks Against Captcha Systems - DefCamp 2012

Sort of.....

Page 20: Attacks Against Captcha Systems - DefCamp 2012

The most common approach

Greedy optimization – reverse engineer everything

Character segmentation OCR

Page 21: Attacks Against Captcha Systems - DefCamp 2012

Possible security measures

Page 22: Attacks Against Captcha Systems - DefCamp 2012

Possible security measures

Funky background image

Page 23: Attacks Against Captcha Systems - DefCamp 2012

Possible security measures

Funky background image

usually can be removed with basic preprocessing

Page 24: Attacks Against Captcha Systems - DefCamp 2012

Possible security measures

Funky background image usually can be removed with basic preprocessing

Text distortions

Page 25: Attacks Against Captcha Systems - DefCamp 2012

Possible security measures

Funky background image usually can be removed with basic preprocessing

Text distortions

modern OCR techniques can beat it

Page 26: Attacks Against Captcha Systems - DefCamp 2012

Possible security measures

Funky background image usually can be removed with basic preprocessing

Text distortions modern OCR techniques can beat it

Anti segmentation measures

Page 27: Attacks Against Captcha Systems - DefCamp 2012

Beating segmentation

Page 28: Attacks Against Captcha Systems - DefCamp 2012

Beating segmentation

If a character signature can be extracted from only the vertical signature, character segmentation becomes trivial

A Low-cost Attack on a Microsoft CAPTCHA - Jeff Yan, Ahmad Salah El AhmadSchool of Computing Science, Newcastle University, UK

Page 29: Attacks Against Captcha Systems - DefCamp 2012

Beating segmentation

We can otherwise ignore it!

Page 30: Attacks Against Captcha Systems - DefCamp 2012

Beating segmentation

We can otherwise ignore it!

The following slides are about an experiment about this approach

Page 31: Attacks Against Captcha Systems - DefCamp 2012

A Monte-Carlo experiment

Note: for testing performance, the variance of the characters has been kept to a minimum

f(x) → y

x in binary( 0 - 2^3000 )

y in 10^6

Page 32: Attacks Against Captcha Systems - DefCamp 2012

Training:

Select one character image at random Select N black spots Sort the points for uniqueness Subtract the first point from all others for position

independence Assign it a 'weight' for each character using the

following formula:

matched characters count / sample size Assign it a 'score' (indicates classification quality)

selected digit weight / (1 + other digit weights)

Page 33: Attacks Against Captcha Systems - DefCamp 2012

Recognition:

Make a score map for all points Select the most appropriate character for each

column Process the resulting string into a 6 digit string

Page 34: Attacks Against Captcha Systems - DefCamp 2012
Page 35: Attacks Against Captcha Systems - DefCamp 2012
Page 36: Attacks Against Captcha Systems - DefCamp 2012

An equivalent model

input layer

linear hidden layer(feature layer)

threshold layers

softmax layer

Page 37: Attacks Against Captcha Systems - DefCamp 2012

An equivalent model

input layer

linear hidden layer(feature layer)

threshold layers

softmax layer

OCR

without zero penalty

==

No biases for the first layer

(avoids the 2*binary - 1 effect)

Page 38: Attacks Against Captcha Systems - DefCamp 2012

Hacking the OCR:

To negate the effect the biases, for each image we add random noise in the white areas

This will greatly improve the recognition in a noisy image

Page 39: Attacks Against Captcha Systems - DefCamp 2012

An more powerful model

input layer

Hacked OCR layer

Score map

output layer

Page 40: Attacks Against Captcha Systems - DefCamp 2012

Questions?

Page 41: Attacks Against Captcha Systems - DefCamp 2012

The demo source is hosted athttps://github.com/theshark08/howtobreakacaptcha01