-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
72 lines (56 loc) · 2.28 KB
/
index.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
65
66
67
68
69
70
71
72
<html>
<head>
<meta charset="UTF-8">
<title>WebLinks Consulta| by: Cyber</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
</head>
<body>
<center>
<h4>Weblinks | W4Y | Cyber Intelligence</h4>
<form action="" method="POST">
<input type="text" name="url" placeholder="Digite a Url" style="text-align:center"><br>
<input type="submit" value="Consultar">
</form>
<?php
if (!empty($_POST['url'])){
consulta($_POST['url']);
}else{
}
function consulta($str){
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_URL,"https://api.hackertarget.com/pagelinks/?q=$str");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13");
$json = curl_exec($ch);
curl_close($ch);
//tratamento das informações
$json=explode("\n",$json);
$qtd_line=count($json);
//criação da Tabela
echo "
<h5>Informações de Links | Server</h5>
<table class='bordered striped centered highlight responsive-table'>
<tr>
<th style='text-align:center'>ID</th>
<th style='text-align:center'>Links</th>
</tr>
";
//laço for para implementação de dados
for($i=0;$i<$qtd_line;$i++){
echo "
<tr>
<td>$i</td>
<td>$json[$i]</td>
</tr>
";
}
echo "
</table>
";
}
?>
</center>
</body>
</html>