SHARE
TWEET

Untitled

a guest May 21st, 2017 227 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <html lang="en">
  3. <head>
  4.   <title>RDAlcantara - Cadsus</title>
  5.   <meta charset="utf-8">
  6.   <meta name="viewport" content="width=device-width, initial-scale=1">
  7.   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  8.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  9.   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  10. </head>
  11. <link rel='shortcut icon' href='http://simpleicon.com/wp-content/uploads/magnifier-8.png'>
  12. <br>
  13.    <div class="col-xs-12">
  14.  
  15.      <center>   <div class="panel panel-default">
  16.             <div class="col-md-12"><div class="panel panel-info"><div class="panel-heading">
  17.                 <h2>RDAlcantara - CPF Search</h2>
  18.                 <div class="options">
  19.  
  20.                 </div>
  21.             </div>
  22.             <div class="panel-body">
  23.                 <table class="table mb0">
  24.         <form action="" method="post">
  25.     <input class="form-control" name="enviarcpf">
  26.     <input type="submit" class="btn btn-success"' name="pesquisar" value="Pesquisar">
  27.         </center>
  28.  
  29. </form>
  30. </html><tbody><tr class="success">
  31.                     </tbody>
  32.                 </table>
  33.             </div>
  34.             </div>
  35.             </div>
  36. <div class="col-md-12"><div class="panel panel-info"><div class="panel-heading"><h2><center> Resultado </center></h2></div>
  37. <!-- FIM DO HTML -->
  38. <?php
  39. error_reporting(1);
  40.  
  41. function getStr($string,$start,$end){
  42.     $str = explode($start,$string);
  43.     $str = explode($end,$str[1]);
  44.     return $str[0];
  45. }
  46.  
  47.  
  48. $cookies = rand(1000000,1000000);
  49. $cnes = ""; //CNES
  50. $login = ""; //USUARIO
  51. $senha = ""; // SENHA
  52. $ch = curl_init();
  53. curl_setopt($ch, CURLOPT_HEADER, false);
  54. curl_setopt($ch, CURLOPT_NOBODY, false);
  55. curl_setopt($ch, CURLOPT_URL, "https://cadastro.saude.gov.br/cadsusweb/login/actionArmazenarXS.form");
  56. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  57. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies.".txt");
  58. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  59. curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Requested-With: XMLHttpRequest"));
  60. curl_setopt($ch, CURLOPT_REFERER, "https://cadastro.saude.gov.br/cadsusweb/login/actionArmazenarXS.form");
  61. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  62. curl_setopt($ch, CURLOPT_POST, 1);
  63. curl_setopt($ch, CURLOPT_POSTFIELDS, "cnes=$cnes&usuario=$login&senha=$senha");
  64. $neylog1 = curl_exec($ch);
  65. //echo $neylog1 = curl_exec($ch);
  66. curl_setopt($ch, CURLOPT_URL, "https://cadastro.saude.gov.br/cadsusweb/j_security_check");
  67. curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies.".txt");
  68. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  69. curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate, br');
  70. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0');
  71. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
  72. curl_setopt($ch, CURLOPT_POST, 1);
  73. curl_setopt($ch, CURLOPT_POSTFIELDS, "j_username=$cnes.$login&cnes=$cnes&usuario=$login&j_password=$senha");
  74. $neylog2 = curl_exec($ch);
  75. //echo $neylog2 = curl_exec($ch);
  76.  
  77.  
  78.     if(isset($_POST['enviarcpf']))
  79.     {
  80.      $cpf= $_POST['enviarcpf'];
  81.      $cpf=trim($cpf);
  82.  
  83.      if($cpf <> '')
  84.      {
  85.      curl_setopt($ch, CURLOPT_URL, "https://cadastro.saude.gov.br/cadsusweb/restrito/consultar/pesquisar.form");
  86.      curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies . ".txt");
  87.      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  88.      curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate, br');
  89.      curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0');
  90.      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
  91.      curl_setopt($ch, CURLOPT_POST, 1);
  92.      curl_setopt($ch, CURLOPT_POSTFIELDS, "usuario=%7B%22idCorporativo%22%3Anull%2C%22idLocal%22%3Anull%2C%22desabilitarDataQuality%22%3Afalse%2C%22obsDesabilitarDataQuality%22%3Anull%2C%22numeroProtocoloPrecadastro%22%3Anull%2C%22protocoloPrimeiroAcesso%22%3Anull%2C%22protocolo%22%3Anull%2C%22solicitarAcessoPortal%22%3Afalse%2C%22encontradoReceita%22%3Anull%2C%22cpf%22%3Anull%2C%22numeroCns%22%3A%22%22%2C%22nome%22%3A%22%22%2C%22nomeSocial%22%3A%22%22%2C%22nomeMae%22%3A%22%22%2C%22nomePai%22%3A%22%22%2C%22sexo%22%3Anull%2C%22sexoDescricao%22%3Anull%2C%22racaCor%22%3Anull%2C%22racaCorDescricao%22%3Anull%2C%22dataObito%22%3Anull%2C%22dataOperacaoObito%22%3Anull%2C%22motivoDeclaracaoObito%22%3Anull%2C%22cnesOperador%22%3Anull%2C%22tipoSanguineo%22%3Anull%2C%22etniaIndigena%22%3Anull%2C%22etniaIndigenaDescricao%22%3Anull%2C%22dataNascimento%22%3A%22%22%2C%22nacionalidade%22%3Anull%2C%22paisNascimentoCodigo%22%3Anull%2C%22paisNascimento%22%3Anull%2C%22municipioNascimentoCodigo%22%3A%22%22%2C%22municipioNascimento%22%3A%22%22%2C%22dataNaturalizacao%22%3Anull%2C%22portariaNaturalizacao%22%3Anull%2C%22dataEntradaBrasil%22%3Anull%2C%22emailPrincipal%22%3Anull%2C%22emailAlternativo%22%3Anull%2C%22emailPrincipalValidado%22%3Anull%2C%22emailAlternativoValidado%22%3Anull%2C%22telefone%22%3A%5B%5D%2C%22nomade%22%3Afalse%2C%22enderecoCodigo%22%3Anull%2C%22paisResidenciaCodigo%22%3Anull%2C%22paisResidenciaDescricao%22%3Anull%2C%22enderecoMunicipio%22%3Anull%2C%22enderecoMunicipioCodigo%22%3Anull%2C%22enderecoTipoLogradouro%22%3Anull%2C%22enderecoTipoLogradouroCodigo%22%3Anull%2C%22enderecoLogradouro%22%3Anull%2C%22enderecoNumero%22%3Anull%2C%22enderecoComplemento%22%3Anull%2C%22enderecoBairroCodigo%22%3Anull%2C%22enderecoBairro%22%3Anull%2C%22enderecoCep%22%3Anull%2C%22emailPrincipalCodigo%22%3Anull%2C%22emailAlternativoCodigo%22%3Anull%2C%22dnv%22%3Anull%2C%22numeroInscricaoSocialCodigo%22%3Anull%2C%22numeroInscricaoSocial%22%3Anull%2C%22rgCodigo%22%3Anull%2C%22rgNumero%22%3Anull%2C%22rgOrgaoEmissor%22%3Anull%2C%22rgOrgaoEmissorDescricao%22%3Anull%2C%22rgUf%22%3Anull%2C%22rgDataEmissao%22%3Anull%2C%22tituloEleitorCodigo%22%3Anull%2C%22tituloEleitorNumero%22%3Anull%2C%22tituloEleitorZona%22%3Anull%2C%22tituloEleitorSecao%22%3Anull%2C%22certidao%22%3A%5B%5D%2C%22ctpsCodigo%22%3Anull%2C%22ctpsNumero%22%3Anull%2C%22ctpsSerie%22%3Anull%2C%22ctpsDataEmissao%22%3Anull%2C%22cnhNumero%22%3Anull%2C%22cnhDataEmissao%22%3Anull%2C%22cnhUf%22%3Anull%2C%22passaporteCodigo%22%3Anull%2C%22passaporteNumero%22%3Anull%2C%22passaportePaisCodigo%22%3Anull%2C%22passaportePais%22%3Anull%2C%22passaporteDataValidade%22%3Anull%2C%22passaporteDataEmissao%22%3Anull%2C%22fotografia%22%3A%5B%5D%2C%22situacao%22%3A%22Ativo%22%2C%22dataAlteracao%22%3Anull%2C%22spanSituacao%22%3Anull%2C%22motivoCancelamento%22%3Anull%2C%22spanVip%22%3Anull%2C%22vipDescricao%22%3Anull%2C%22spanProtecao%22%3Anull%2C%22protecaoDescricao%22%3Anull%2C%22motivoNaoHigienizado%22%3Anull%2C%22vivo%22%3Anull%2C%22cartoesAgregados%22%3A%5B%5D%2C%22tipoDocumento%22%3A%22CPF%22%2C%22numeroDocumento%22%3A%22" . $cpf . "%22%7D&byPassHigienizacao=false&tpPesquisa=identica");
  93.      $saida = curl_exec($ch);
  94.        //  $saida = getStr($saida,'(','] }');
  95.        //  $saida = str_replace(")"," ",$saida);
  96.         // $saida = str_replace(',','<br>',$saida);
  97.  
  98.          $cns= getStr($saida,'"numeroCns": "','"');
  99.  
  100.          curl_setopt($ch, CURLOPT_URL, "https://cadastro.saude.gov.br/cadsusweb/restrito/consultar/visualizar.form");
  101.          curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies . ".txt");
  102.          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  103.          curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate, br');
  104.          curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0');
  105.          curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
  106.          curl_setopt($ch, CURLOPT_POST, 1);
  107.          curl_setopt($ch, CURLOPT_POSTFIELDS, "cns=$cns");
  108.          $saida2 = curl_exec($ch);
  109.  
  110.  
  111.          $nome= getStr($saida2,'"nome": "','"');
  112.          $nomeMae= getStr($saida2,'"nomeMae": "','"');
  113.          $nomePai = getStr($saida2,'"nomePai": "','"');
  114.          $sexo = getStr($saida2,'"sexo": "','"');
  115.          $raca = getStr($saida2,'"racaCorDescricao": "','"');
  116.          $datanascimendo = getStr($saida2,'"dataNascimento": "','"');
  117.          $dataobito = getStr($saida2,'"dataObito": "','"');
  118.          $paisNascimento = getStr($saida2,'"paisNascimento": "','"');
  119.          $municipioNascimento = getStr($saida2,'"municipioNascimento": "','"');
  120.          $sexo = getStr($saida2,'"sexo": "','"');
  121.          $cpf = getStr($saida2,'"cpf": "','"');
  122.          $sangue = getStr($saida2,'"tipoSanguineo": "','"');
  123.          $cns = getStr($saida2,'"numeroCns": "','"');
  124.          $rg = getStr($saida2,'"rgNumero": "','"');      
  125.          $org = getStr($saida2,'"rgOrgaoEmissorDescricao": "','"');
  126.          $rguf = getStr($saida2,'"rgUf": "','"');
  127.          $rgdata = getStr($saida2,'"rgDataEmissao": "','"');
  128.         ////endere词
  129.          $pais = getStr($saida2,'"paisResidenciaDescricao": "','"');
  130.          $estado = getStr($saida2,'"enderecoMunicipio": "','"');
  131.          $numerocasa = getStr($saida2,'"enderecoNumero": "','"');
  132.          $endereco = getStr($saida2,'"enderecoLogradouro": "','"');
  133.          $bairro = getStr($saida2,'"enderecoBairro": "','"');
  134.          $cep = getStr($saida2,'"enderecoCep": "','"');
  135.          $ddd = getStr($saida2,'"ddd":',',');
  136.          $creditos = getStr($saida2,'"Creditos":',',');
  137.          $telefone = getStr($saida2,'"numero": "','"');
  138.  
  139.  
  140.  
  141.  
  142.          echo "<b> Nome:</b> $nome<br>";
  143.          echo "<b> CPF:</b> $cpf<br>";
  144.          echo "<b> RG:</b> $rg | $org | $rguf | $rgdata<br>";
  145.          echo "<b> Nome da mãe:</b> $nomeMae<br>";
  146.          echo "<b> Nome do pai:</b> $nomePai<br>";
  147.          echo "<b> Sexo:</b> $sexo<br>";
  148.          echo "<b> Data de Nascimento:</b> $datanascimendo<br>";
  149.          echo "<b> Data de Óbito:</b> $dataObito<br>";
  150.          echo "<b> País:</b> $paisNascimento<br>";
  151.          echo "<b> Município de Nascimento:</b> $municipioNascimento<br>";
  152.          echo "<b> TIPO SANGUINEO:</b> $sangue<br>";
  153.          echo "<b> CNS:</b> $cns<br>";
  154.          echo "<b> Raça:</b> $raca<br>";
  155.          
  156.        
  157.                   ////endereço
  158.          echo "<b>País:</b> $pais<br>";
  159.          echo "<b>Estado:</b> $estado <br>";
  160.          echo "<b>Número da Casa:</b> $numerocasa <br>";
  161.          echo "<b>Endereço:</b> $endereco<br>";
  162.          echo "<b>Bairro:</b> $bairro <br>";
  163.          echo "<b>CEP:</b> $cep<br>";
  164.          echo "<b>Telefone:</b> $ddd $telefone <br><br></div>";
  165.          echo "<b>CREDITOS: RDAlcantara<b>$creditos</br>";
  166.  
  167.  
  168.  
  169.  
  170.      }
  171.  
  172.  
  173.  }
  174.  ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top