-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcaptchasolver.php
64 lines (58 loc) · 1.88 KB
/
captchasolver.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
//Esse script retorna as coordenadas corretas do captcha (pechincheiro)
//Basta fazer uma requisição com o preço e as coordenadas para comprar algo nas lojas de neopia
//Util pra comprar itens que dão avatar
$user = "USER123";
$pass = "123456";
function logar($user, $pass){
$pag = acessa("http://www.neopets.com/#.phtml", 1, 1, "username=".$user."&password=".$pass."", 1);
global $cookie;
$cookie = "";
preg_match_all("/Set-Cookie: ([^\n]+)/sim", $pag, $cookies);
foreach($cookies[1] as $coookie){
$cookie.=$coookie.";";
}
}
function acessa($url , $return , $header, $post=0, $cookie=0, $referer=0){
$acessa = curl_init();
curl_setopt_array($acessa, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => $return,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_HEADER => $header,
CURLOPT_FOLLOWLOCATION => TRUE,
CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT']));
if($post){
curl_setopt($acessa, CURLOPT_POST, TRUE);
curl_setopt($acessa, CURLOPT_POSTFIELDS, $post);
}
if($cookie){
curl_setopt($acessa, CURLOPT_COOKIE, $cookie);
}
if($referer){
curl_setopt($acessa, CURLOPT_REFERER, $referer);
}
$pag = curl_exec($acessa);
curl_close($acessa);
return $pag;
}
logar($user,$pass);
$pixeldarkc = "1";
$pixeldark = array();
$imagem = acessa("http://www.neopets.com/captcha_show.phtml",1,0,0,$cookie);
$img = new Imagick();
$img->readImageBlob($imagem);
$largura = $img->getImageWidth();
$altura = $img->getImageHeight();
for($a=0;$a<$largura;$a++){
for($b=0;$b<$altura;$b++){
$pixel = $img->getImagePixelColor($a,$b);
if($pixel->getHSL()['luminosity'] < $pixeldarkc){
$pixeldarkc = $pixel->getHSL()['luminosity'];
$pixeldark['x'] = $a;
$pixeldark['y'] = $b;
}
}
}
print_r($pixeldark);
?>