Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Source Natt Consultas
- * [Necessita de uso de cookie] & [Metodo pra bombear cookie]
- * Desenvolvida por Kobra
- */
- error_reporting(1);
- extract($_GET);
- $pontuacao = 0;
- define("sess","u2079aj3164fltl9oie9ji6c12");
- function inStr($string, $start, $end, $value) {
- $str = explode($start, $string);
- $str = explode($end, $str[$value]);
- return $str[0];
- }
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'https://www.natt.com.br/sistema/consultas/cpf/Resposta0101.php');
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Cookie: PHPSESSID='.sess,
- 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
- 'Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
- 'Connection: keep-alive',
- 'Referer: https://www.natt.com.br/sistema/consultas/painel.php',
- 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36',
- 'Upgrade-Insecure-Requests: 1',
- ));
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'e_cpf='.$cpf.'&e_cnpj=&e_telefone=');
- $exec = curl_exec($ch);
- //Dados Principais
- $nome = inStr($exec, '<h3>', '</h3>', 1);
- if (!empty($nome)) {
- $pontuacao = $pontuacao + 7;
- }
- $cpf = inStr($exec, '<td width="40%" align="left">', '</td>', 1);
- if (!empty($cpf)) {
- $pontuacao = $pontuacao + 7;
- }
- $emissor = inStr($exec, '<td width="20%" align="left">', '</td>', 1);
- if (!empty($emissor)) {
- $pontuacao = $pontuacao + 7;
- }
- $mae = str_replace("'", "", inStr($exec, "javascript:consultarNome('", "'", 1));
- if (!empty($mae)) {
- $pontuacao = $pontuacao + 7;
- }
- $nascimento = inStr($exec, '<td width="40%" align="left">', '</td>', 2);
- if (!empty($nascimento)) {
- $pontuacao = $pontuacao + 7;
- }
- $genero = inStr($exec, '<td width="20%" align="left">', '</td>', 2);
- if ($genero == "-") {
- $pontuacao = $pontuacao + 7;
- }
- $email = inStr($exec, '<td width="80%" align="left" colspan="3">', '</td>', 2);
- if ($genero == "-") {
- $pontuacao = $pontuacao + 7;
- }
- $situacao = strip_tags(inStr($exec, '<td width="50%" align="center" colspan="3">', '</td>', 1));
- if (!empty($situacao)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- //Endereços
- $tabela = inStr($exec, '<table width="100%" border=1 cellspacing=0 cellpadding=2 bordercolor="#e8ecf6" id="cTable">', '</table>', 2);
- $enderecos = "";
- $count = substr_count($tabela, '<td width="60%">');
- for ($i = 1; $i <= $count; $i++) {
- $enderecos = $enderecos . "Endereço $i: " . strip_tags(inStr($tabela, '<td width="60%">', '</td>', $i)) . "\n";
- }
- if (!empty($enderecos)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- //Participação Societaria
- $tabela = inStr($exec, '<table width="100%" border=1 cellspacing=0 cellpadding=2 bordercolor="#e8ecf6" id="cTable">', '</table>', 3);
- $sociodesde = inStr($tabela, '<td width="8%" align="center">', '</td>', 1);
- $razao = inStr($tabela, '<td width="30%" align="center">', '</td>', 1);
- $cnpj = inStr($tabela, '<td width="15%" align="center">', '</td>', 1);
- $atividade = inStr($tabela, '<td width="35%" align="center">', '</td>', 1);
- if (!empty($sociodesde)) {
- $participacaoFinal = "Participação Societaria: $cnpj | Socio desde: $sociodesde | Razão: $razao | Atividade: $atividade";
- }
- if (!empty($participacaoFinal)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- //Telefones Fixos
- $tabela = inStr($exec, '<table width="100%" border=1 cellspacing=0 cellpadding=2 bordercolor="#e8ecf6" id="cTable">', '</table>', 5);
- $count = substr_count($tabela, '<tr');
- $fixos = "";
- for ($i = 1; $i <= $count; $i++) {
- $pega = inStr($tabela, '<tr', '</tr>', $i);
- $numero = inStr($tabela, '<td width="15%" align="center">', '</td>', 1);
- $endereco = inStr($tabela, '<td width="75%">', '</td>', 1);
- $fixos = $fixos . "Fixo $i: Numero: $numero | Endereço de Cadastro: $endereço\n";
- }
- if (!empty($fixos)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- //Telefones Fixos que já pertenceram
- $tabela = inStr($exec, '<table width="100%" border=1 cellspacing=0 cellpadding=2 bordercolor="#e8ecf6" id="cTable">', '</table>', 7);
- $pertenceram = null;
- $count = substr_count($tabela, '<tr class="elink">');
- for ($i = 1; $i <= $count; $i++) {
- $tab = inStr($tabela, '<tr class="elink">', '</tr>', $i);
- $mesAno = inStr($tab, '<td width="10%" align="center">', '</td>', 1);
- $telefone = inStr($tab, '<td width="15%" align="center">', '</td>', 1);
- $atualProprietario = inStr($tab, '<td width="25%">', '</td>', 1);
- $enderecoInstalacaoEpoca = inStr($tab, '<td width="40%">', '</td>', 1);
- $pertenceram = $pertenceram . "Fixo Antigo $i: $telefone | Mês/Ano: $mesAno | Atual Proprietário: $atualProprietario | Endereço de Instalação na Época: $enderecoInstalacaoEpoca\n";
- }
- if (!empty($pertenceram)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- //Celulares
- $tabela = inStr($exec, '<table width="100%" border=1 cellspacing=0 cellpadding=2 bordercolor="#e8ecf6" id="cTable">', '</table>', 9);
- $count = substr_count($tabela, '<tr');
- $numeros = "";
- for ($i = 1; $i <= $count; $i++) {
- $tab = inStr($tabela, '<tr', '</tr>', $i);
- $numero = trim(inStr($tab, '<td width="15%" align="center">', '</td>', 1));
- $endereco = trim(inStr($tab, '<td width="75%">', '</td>', 1));
- if (!empty($numero)) {
- $numeros .= "Celular $i: $numero | Endereço: $endereco\n";
- }
- }
- if (!empty($numeros)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- //Possiveis Familiares
- $tabela = inStr($exec, '<table width="100%" border=1 cellspacing=0 cellpadding=2 bordercolor="#C6E2FF" id="cTable">', '</table>', 2);
- $count = substr_count($tabela, '<tr class="elink"');
- $familiares = "";
- for ($i = 1; $i <= $count; $i++) {
- $tab = inStr($tabela, '<tr class="elink"', '</tr>', $i);
- $grau = inStr($tab, '<td width="10%" align="center">', '</td>', 1);
- $familiarNome = inStr($tab, '<td width="35%" align="left">', '</td>', 1);
- $cidadeUF = inStr($tab, '<td width="30%" align="left">', '</td>', 1);
- $cpfFamiliar = inStr($tab, '<td width="35%" align="left">', '</td>', 2);
- if (!empty($nome)) {
- $familiares .= "Familiar $i: $familiarNome | Grau: $grau | Cidade: $cidadeUF | Cpf: $cpfFamiliar\n";
- }
- }
- if (!empty($familiares)) {
- $pontuacao = $pontuacao + 7;
- }
- //
- if ($pontuacao < 20) {
- $pontuacao = "$pontuacao% - [PÉSSIMA]";
- } elseif ($pontuacao > 20 && $pontuacao < 40) {
- $pontuacao = "$pontuacao% - [DÁ PRO GASTO]";
- } elseif ($pontuacao > 40 && $pontuacao < 80) {
- $pontuacao = "$pontuacao% - [TOPPER]";
- } elseif ($pontuacao > 80) {
- $pontuacao = "$pontuacao% - [LENDÁRIA]";
- }
- echo json_encode(array("str" => "Nome: $nome\nCpf: $cpf\nEmissor: $emissor\nNome da mãe: $mae\nData de nascimento: $nascimento\nGenero: $genero\nEmail: $email\nSituação no banco central: $situacao\n$enderecos$participacaoFinal$fixos$pertenceram$numeros$familiares", "pontuacao" => $pontuacao));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement