Check Mates22 Mar 2008 10:54 pm
Here ya go. This is the del.icio.us captcha busted in Python.

#!/usr/bin/python
import Image,time,random,glob,re,os,sys
##$$$$
train = raw_input("train? (y/n)")
if(train == "y") : train= True
else: train = False
##
fileName = ''.join(sys.argv[1:])
def getNeighbourhood(i,width,height,pixels):
results = []
try:
if(pixels[i+1] != 0): results.append(i+1)
if(pixels[i-1] != 0): results.append(i-1)
if(pixels[i-width] != 0): results.append(i-width)
if(pixels[i+width] != 0): results.append(i+width)
if(pixels[i-width+1] != 0): results.append(i-width+1)
if(pixels[i+width+1] != 0): results.append(i+width+1)
if(pixels[i-width-1] != 0): results.append(i-width-1)
if(pixels[i+width-1] != 0): results.append(i+width-1)
except:pass
return results
now = time.time()
captcha = Image.open(fileName)
(width,height) = captcha.size
pixels = list(captcha.getdata())
i=0
for pixel in pixels:
if (pixel == 2): pixels[i] = 0
i+=1
toclean = []
for i in xrange(len(pixels)):
neighbourhood = getNeighbourhood(i,width,height,pixels)
if (len(neighbourhood) < 4) : pixels[i] = 0
captcha.putdata(pixels)
started=False
lowestY,highestY,count = 0,10000,0
captchas = []
slant = 15
for x in xrange(width):
hasBlack = False
for y in xrange(height):
thisPixel = captcha.getpixel((x,y))
if(thisPixel != 0):
if(started == False):
started=True
firstX = x
firstY = y
else:
lastX = x
if(y > lowestY): lowestY = y
if(y< highestY): highestY = y
hasBlack = True
if((hasBlack == False) and (started==True)):
if((lowestY - highestY) > 4):
croppingBox = (firstX,highestY,lastX,lowestY)
newCaptcha = captcha.crop(croppingBox)
if(train):
text = raw_input(”char:n”)
try: os.mkdir(”/home/dbyte/deliciousImages/” + text)
except:pass
text__ = “/home/dbyte/deliciousImages/” + text + “/” + str(random.randint(1,100000)) + “-.png”
newCaptcha.resize((20,30)).save(text__)
text_ = “/home/dbyte/deliciousImages/” + text + “/” + str(random.randint(1,100000)) + “-.png”
newCaptcha.resize((20,30)).rotate(slant).save(text_)
text_ = “/home/dbyte/deliciousImages/” + text + “/” + str(random.randint(1,100000)) + “-.png”
newCaptcha.resize((20,30)).rotate(360 - slant).save(text_)
captchas.append(Image.open(text__))
else:
#text = str(count)
#text = “tmp-delicious-” + text + “.png”
#newCaptcha.save(text)
captchas.append(newCaptcha.resize((20,30)))
started=False
lowestY,highestY = 0,10000
count +=1
if(train == False):
imageFolders = os.listdir(”/home/dbyte/deliciousImages/”)
images =[]
for imageFolder in imageFolders:
imageFiles = glob.glob(”/home/dbyte/deliciousImages/” + imageFolder + “/*.png”)
for imageFile in imageFiles:
pixels = list(Image.open(imageFile).getdata())
for i in xrange(len(pixels)):
if pixels[i] != 0: pixels[i] = 1
images.append((pixels,imageFolder))
crackedString = “”
for captcha in captchas:
bestSum,bestChar = 0,”"
captchaPixels = list(captcha.getdata())
for i in xrange(len(captchaPixels)):
if captchaPixels[i] != 0: captchaPixels[i] = 1
for imageAll in images:
thisSum = 0
pixels = imageAll[0]
for i in xrange(len(captchaPixels)):
try:
if(captchaPixels[i] == pixels[i]): thisSum+=1
except: pass
if(thisSum > bestSum):
bestSum = thisSum
bestChar = imageAll[1]
crackedString += bestChar
print crackedString
#print “time taken: ” + str(time.time() - now)
You are really in war against that dude…
hahah this keeps getting better and better. Get em eli. lol
nice man…those retards can’t evolve so they have to keep bitchin’
this is your code? it’s very neat, i might add.
LOL
I’m glad your site is back anyway
God damn it Eli… I actually use this one on my own already! argghhh.
Eh whatever. Time to evolve I guess. haha
what a lovely piece of code, great share Eli!
Great Eli, thanks
Keep it comin’!
Hi Eli!
I discovered your site just before it goes down…happy to see it’s back, anyway I spent some hours browsing Google cached results to read your past articles…very interesting.
Now, just a question on this script: what kind of parameters do I need to pass? It may be a stupid question, but I’m not a python programmer…
I think this is a little out of my league, but I think the idea is cool.
thanks . ssuper
Some comments in the code would be nice. A short introduction what the algorithm behind this is, would be perfect
After a short glance I guess the solution is, that the letters are always the same (pixelwise), so you are searching for letters from the left to the right buy comparing pixels?
cool….
but pythone is out of my list… anyways I am eagerly waitin for something, from u r box, which i can utilize on full fledged basis…
This is awesome - but unfortunately well out of my league at the moment - just a matter of time me hopes though! Once again Eli you have pulled some great stuff out of the bag
been waiting for this for ages. captcha is getting a joke these days. last week i have to type a 15 alpha numeric code just to submit something. i am glad this is now busted open
Thanks for the usefull information!
I gonna write sumular using php
Awesome post ! I wish I had some programming skills.
Damn crazy
Hope this will not end delicious life:)
Nice to see some new posts recently. Saw all of the drama on wf. To bad it took someone going after you server, though.
Anyway, hope to see more, and the seo empire pt. 2 post soon, too.
lol - please learn to code.
that code reads like some shit a 12 year old fat kid hacked into his xbox controller.
aka you
lol thats great…
phyton is beyond me i’m afraid. even though this is a great achievement. can someone explain what evil things they would do with this?
WOW I lost my bookmarks not to long ago and Im glad i found this site again! i’m never going to lose it this time..LOl Best SEO site hands down!
Thanks for sharing. Comes in handy
Thanks for the usefull information.
Have a nice day!
Great post Eli, as always! No one should mess with us )))).
Just when I thought the site was down and gone forever, I happen to land here and see that it’s back. I don’t know much about what you just posted, but I’m glad to see something here
Thanks for sharing this code. I will use it, for sure!
Seeing this in PHP would be nice.
::emp::
Good code! Thank you.
release more captchas!!
seconded.. i don’t know sh*t about python lol
couldnt help it.
Had to start one.
Wow, how can this be ?
If Delicious offered you money to devise a captcha that wasn’t crackable, would you do it..and for how much?
Nice article!!!
Hilarious! At least you’re making as many friends as enemies along the way. I’d second Gadgets4nowt’s questions about creating a captcha.
Well it might bring more secure captcha…
LOL! I read a little bit into the controversy that cracking captchas has caused. Some of those forum posts are pretty amusing, I like the fact that you redirected to the whitehouse.gov site to get even!
Thanks a lot for this - and good to see you back posting!
Hey…
is Seo Empire part II coming soon??
Haha, thanks!
That is so sneaky mr Blue Hat
Nice news. Thanks you!
Thanks for sharing this code. Of course, it’s good thing
Cool, thanks for sharing the code.
hahah awesome sweet thanks man appreciate it
Sweet Eli keep it up. For the win.
That’s awesome man, keep up the good work. Going to try and dissect the code and see what I can learn.
How long did it take you?
How can you beat it? It’s great! You are master!
Why you want to beat the captcha of Del.icio.us? What use does it have to crack the captcha
For the people who make automated bots to join and submit links.
I wonder if anybody could translate this into VB or C ?
You are very clever!
=)!Thank’s great code ! I will use it ! Continue in same direction! +1 for the post !
Nice! Now i just need to convert it to PHP
I will try to use this code on my blog. Thanks to the author!
Really nice but what about PHP?
I can’t understand why delicious haven’t done anything about this already.
now the spamwave goes on…
Still not sure why this would be helpful. Can anyone explain, please
This is a very nice post, thanks for posting about it!
Well, I guess old good days of captcha in the past now.
Kick as* blog, great stuff. I found another one recently that you all might enjoy (no affiliation). blackhatworld.com
Wow, just found your blog and bookmarked it as there’s so much to read.Keep up the great work
Thank you, i use this code in future.
This one at delicious isnt so bad to crack because:
–the letters are sharp without any garbage over them
–you can easily get rid of the background by setting an RGB threshold value
–the same rotation angle applies to all letters in the word
–the rotation angle is always 0, +15 or -15, as opposed to being completely random
–Only lowercase symbols are present. No caps or numbers. This greatly enhances the success rate.
The next one to tackle down that has most of these difficulties (randomly rotated,caps, numbers,random lines crossing and garbage over symbols..) is the captcha at digg! I’m working on it but it’s hard to obtain sharp letters because of all the line garbage.. I tried the one at delicious with my tools and it got around 50% success of guessing the captchas. Individual letter guessing success is pretty good near 88%
Based on how good your success rate for your script is, a way to improve it:
notice that no two vowels are next to each other on delicious captchas, also no two consonants either. So on top of everything you do you can check for that too. I haven’t tried that tho. keep up the good work
LoL, Now i just need to convert it to PHP
glad your site is back! I know that I can really this.
Great post. Thank you so much and keep it up!
After reading this post i can say…
Eli is the king of blogger..
Very impressive!
You are very clever!
Marvellous work. I always thought this would require some very intense analysis of the graph, but it looks like a miracle with a few lines of code.
Thanks for the info.
Thanks for sharing:)
This is really impressive!
Very Clever. thanks for this.
It’s four months since this post was written, has the captcha been updated in the meantime?
Thank you so much for a very useful information.
Great Nice post
Thanks a lot for posting the code! I learn a lot better when I can look at code like that and figure it out so I can understand whats going on.
Thats a big help!
Great job. Keep them flowing
Thanks for the useful info!
Gracias por el artículo.
Great post. keep up the goodwork.
Thank You! Works great!
I’m gonna try porting this to Perl..
Hey Man,
Thanks for the information. keep posting…
Does this still work? or did they update their stuff
ReCaptcha forever.
Hell yeah!
cool where did u get this
I really need to learn some programming…I don’t know how to use that…I am going to run and hope to find someone who can translate that for me….
I may be dense or something but can one just not sign up for delicious and use it the regular way. I am sure that works fine
I mean what is the application of this method, the benefits
Someone please answer?
And how can I use it to promote my site?
great tactics and Black hat methods : )
Thanks for the nice article.
Is this not a shade black?
Wow, This is definatly above my level of scripting but im glad ive found it, credit to the author and creator of this site, Bookmarked!
Wonder how long the creator of the script has programmed for
Why want to beat the captcha of Del.icio.us? What use does it have to crack the captcha
Why want to beat the captcha of Del.icio.us?
@MSN hacken
Because he can, that’s why!
Maybe you can’t put it on your resume, but it’s quite an impressive and handy feat.
Excellent! Thanks!!
Maybe you can’t put it on your resume, but it’s quite an impressive and handy feat.
This has to be one of the most useful piece of information
I wonder how many other sites are using this same Captcha. You may have screwed over a lot of people…
Nice content. Very simple to understand, i love it!!
keep up this focking good work
lovely piece of code, great share Eli!
another week captcha makes it asy to crack
Complex code.. Hard to understand… Mind-boggling
Its great,
but how this is useful to seo guys??
Well I guess this can be used for auto submissions to the site.
You’re an evil dude Eli, I must say that. Crackin’ captchas is RAW, but they must’ve changed their system by now!!
May captchas are dead not just this one.
It’s about time. The security had been flawed for a while.
It’s amazing to find that happening.
It’s about time someone did that.
That code confuses the crap out of me. Can someone explain?
Thats some sneaky stuff right there…how did you come about making it doe?
This is really impressive!
Thanks for this post.
best regards
Nice hack. But it is not work anymore, because this code is changes by Delicious.com at the moment. It’s outdated, but anyway it’s was very funny in the time when it worked!
nice, very cool script
People crack captchas and then complain when the stuff like the rapidshare captcha comes out.
I don’t think I’ll use it but it’s nice to know.
I discovered your site just before it goes down…happy to see it’s back, anyway I spent some hours browsing Google cached results to read your past articles…very interesting.
crackers are always ahed
Thats useful info.
You never cease to amaze me.
Guy
Thank you for the article! This is awesome - but unfortunately well out of my league at the moment - just a matter of time me hopes though! Once again Eli you have pulled some great stuff out of the bag
I’m impressed by your ability to reverse engineer this code, however I’m not sure what I’d be doing with it ^_^
Thanks for the great posts and tips - pretty intense stuff and I appreciate you disclosing all this information. Very helpful!
Not sure how you figure things out, but I have to say I’m impressed - thanks for the post.
I’ve been trying to crack this stuff for some of my own site exposure and I have to say this is wonderful. Thanks for sharing this information!
Nice post! Crazy that you found a way to do this…thanks for sharing.
This is quite and amazing feat. I mean the hackers.
Eli you are a genius
That’s amazing, and to think it all starts in learning simple coding languages LOL amazing Eli.
Allthough I can’t write a bit python, it’s good to know, that captchas can be broken, because personally I hate them!
thanks 4 this very usefull info. by
Thanks for the nice article.