Jump to content

Captcha cracking optimization


Recommended Posts

Don't get the title wrong, I'm not doing this to spam people.

I'm making an automated pm notifier that logs into a forum with the useraccount and checks for new pms.

The problem is that this forum has a captcha on the login form which in itself is kinda stupid.

Even more stupid though, is that the images never change so it's possible to crack the captcha.

I've come up with this code which works; but takes a lot of time if the numbers are high.

Would be very grateful if someone could help me optimize the code to speed it up a bit.

Global $code
$cap1u = _IEImgGetCollection ($oIE, 8)
$cap2u = _IEImgGetCollection ($oIE, 9)
$cap3u = _IEImgGetCollection ($oIE, 10)
$cap4u = _IEImgGetCollection ($oIE, 11)
$cap5u = _IEImgGetCollection ($oIE, 12)
$cap6u = _IEImgGetCollection ($oIE, 13)
InetGet ($cap1u.src, @ScriptDir&"\TempCaptchas\cap1.gif", 1, 0)
InetGet ($cap2u.src, @ScriptDir&"\TempCaptchas\cap2.gif", 1, 0)
InetGet ($cap3u.src, @ScriptDir&"\TempCaptchas\cap3.gif", 1, 0)
InetGet ($cap4u.src, @ScriptDir&"\TempCaptchas\cap4.gif", 1, 0)
InetGet ($cap5u.src, @ScriptDir&"\TempCaptchas\cap5.gif", 1, 0)
InetGet ($cap6u.src, @ScriptDir&"\TempCaptchas\cap6.gif", 1, 0)
$tempcount = 1
$count = 1

Do
$fc = FileRead(@ScriptDir&"\TempCaptchas\cap"&$tempcount&".gif")
$fc1 = FileRead(@ScriptDir&"\Captchas\"&$count&".gif")

if $fc = $fc1 Then
    $code = $code&$count
    $tempcount = $tempcount + 1
    $count = 1
Else
    $count = $count + 1
EndIf
Until $tempcount = 7

MsgBox (0,"Captcha Cracked!", $code)
Link to comment
Share on other sites

  • Moderators

Don't get the title wrong, I'm not doing this to spam people.

I'm making an automated pm notifier that logs into a forum with the useraccount and checks for new pms.

The problem is that this forum has a captcha on the login form which in itself is kinda stupid.

Even more stupid though, is that the images never change so it's possible to crack the captcha.

I've come up with this code which works; but takes a lot of time if the numbers are high.

Would be very grateful if someone could help me optimize the code to speed it up a bit.

Global $code
$cap1u = _IEImgGetCollection ($oIE, 8)
$cap2u = _IEImgGetCollection ($oIE, 9)
$cap3u = _IEImgGetCollection ($oIE, 10)
$cap4u = _IEImgGetCollection ($oIE, 11)
$cap5u = _IEImgGetCollection ($oIE, 12)
$cap6u = _IEImgGetCollection ($oIE, 13)
InetGet ($cap1u.src, @ScriptDir&"\TempCaptchas\cap1.gif", 1, 0)
InetGet ($cap2u.src, @ScriptDir&"\TempCaptchas\cap2.gif", 1, 0)
InetGet ($cap3u.src, @ScriptDir&"\TempCaptchas\cap3.gif", 1, 0)
InetGet ($cap4u.src, @ScriptDir&"\TempCaptchas\cap4.gif", 1, 0)
InetGet ($cap5u.src, @ScriptDir&"\TempCaptchas\cap5.gif", 1, 0)
InetGet ($cap6u.src, @ScriptDir&"\TempCaptchas\cap6.gif", 1, 0)
$tempcount = 1
$count = 1

Do
$fc = FileRead(@ScriptDir&"\TempCaptchas\cap"&$tempcount&".gif")
$fc1 = FileRead(@ScriptDir&"\Captchas\"&$count&".gif")

if $fc = $fc1 Then
    $code = $code&$count
    $tempcount = $tempcount + 1
    $count = 1
Else
    $count = $count + 1
EndIf
Until $tempcount = 7

MsgBox (0,"Captcha Cracked!", $code)
You say the thought of someone attempting to protect their forum, the best they know how, from some dip shit spamming it is stupid.

Well, Mirror time, .... You're request for help with this, regardless of of it's intent, is actually a lot more ignorant than the "stupid" forum admin/mods.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I think he meant putting a captcha in the login form, which I agree is annoying, but I guess loging in/out alot of times asplodes the system or something :rolleyes: I dunno much bout that...

However, Das Ami, I don't think anyone's going to do this task for you, but your code looks as it should be.. cracking a captcha isin't easy =P

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

You say the thought of someone attempting to protect their forum, the best they know how, from some dip shit spamming it is stupid.

Well, Mirror time, .... You're request for help with this, regardless of of it's intent, is actually a lot more ignorant than the "stupid" forum admin/mods.

That may be the case if it was actually endangered - or at least popular, this useless captcha however is just an annoyance.

Albeit slow it's already working perfectly I'm just looking for a way to optimize my code and maybe learn something new while doing so.

Sure it's a delicate topic but it's not like this code could be used to crack a REAL captcha, I'm simply looking for a way to automize my tasks which worked fine until this.

If you don't want to help me then I can't blame you but I don't see anything wrong by trying to learn.

I think he meant putting a captcha in the login form, which I agree is annoying, but I guess loging in/out alot of times asplodes the system or something :rolleyes: I dunno much bout that...

Correct.

However, Das Ami, I don't think anyone's going to do this task for you, but your code looks as it should be.. cracking a captcha isin't easy =P

It's just comparing images actually.

Edited by Das Ami
Link to comment
Share on other sites

Don't get the title wrong, I'm not doing this to spam people.

I'm making an automated pm notifier that logs into a forum with the useraccount and checks for new pms.

The problem is that this forum has a captcha on the login form which in itself is kinda stupid.

Even more stupid though, is that the images never change so it's possible to crack the captcha.

I've come up with this code which works; but takes a lot of time if the numbers are high.

Would be very grateful if someone could help me optimize the code to speed it up a bit.

Hi, to improve the code I need some web site to test with. Can you please post the URL of the forum?

Thanks

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...