-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathindex.php
191 lines (134 loc) · 5.94 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<?php include 'header.php'; ?>
<!--
<nav>
<div class="nav-wrapper">
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
<a href="index.php" class="brand-logo">
<img id="lg" src="/images/logo.png">
</a>
<ul class="right hide-on-med-and-down">
<li class="lulu"><a href="">Home<i class="material-icons left" id="homeicon">home</i></a></li>
<li class="lulu"><a href="tos.html">TOS</a></li>
<li class="lulu"><a href="home.html">FAQ</a></li>
<li class="lulu"><a href="home.html">Contact</a></li>
<li class="lulu" id="reg_btn"><a href="home.html">Register</a></li>
<li><a id="login-btn" class="waves-effect btn">Login</a></li>
</ul>
</div>
</nav>
-->
<!--<div class="search-wrapper">
<input id="search"><i class="material-icons">search</i>
</div>-->
<div class="container">
<center>
<form class="form-elmnts" action="" method="POST">
<input type="text" placeholder="Search Term..." id="textinput" name="search" autofocus>
<select class="browser-default" id="secenekler">
<option id="h264" value="1">Username</option>
<option class="slct-item" value="2">Email</option>
<option class="slct-item" value="3">IP Adress</option>
<option class="slct-item" value="3">MAC Adress</option>
<option class="slct-item" value="3">Phone Number</option>
<option class="slct-item" value="3">Name</option>
</select>
<br/>
<button id="arama-butonu" class="btn waves-effect" type="submit"> <i class="material-icons left" id="search-id">search</i>SEARCH
</button>
</form>
</center>
<?php
// if($_SESSION){
if (empty($_SESSION)){
echo '<center><div class="subtodaybox">
<p><a href="purchase.php">Subscribe</a> today to view the actual data itself and receive unlimited searches.</p>
</div></center>';
}else{
if($_SESSION['sub'] == 0){
echo '<center><div class="subtodaybox">
<p><a href="purchase.php">Subscribe</a> today to view the actual data itself and receive unlimited searches.</p>
</div></center>';
}
// Buraya kullanıcıdnın kaç dakikası kaldığı gelecek...
} ?>
<!--background-color: rgba(0, 11, 56, 0.9);-->
<br/>
<br/>
<?php
/*error_reporting(0);
@ini_set('display_errors', 0);*/
//echo "string";
include 'config.php'; //$db = new PDO('mysql:host=localhost;dbname=leakedsource','root','');
$dbc1 = $db->query("SELECT group_concat(table_name) AS tables FROM information_schema.tables WHERE table_schema='dataleaks'");
//echo "hey";
//echo $_REQUEST["sss"];
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$user_search_entry= trim($_REQUEST["search"]);
$user_selected_field='username';
$dbc1_ftchd = $dbc1->fetch(PDO::FETCH_ASSOC);
foreach(explode(',',$dbc1_ftchd['tables']) as $next_tb_name){ //Her seferinde new table name döndüren fonksiyon <3
//echo $next_tb_name.'<br>';
$m_dbc = $db->query("SELECT * FROM $next_tb_name WHERE $user_selected_field='$user_search_entry'");
$m_dbc_ftchd = $m_dbc->fetchALL(PDO::FETCH_ASSOC);
if($m_dbc_ftchd!=NULL){
echo '<ul class="collapsible" data-collapsible="expandable">';
}
if($m_dbc_ftchd!=NULL){ //Aranan değer varsa yazdıran fonk.
$tblc = $db->query("SELECT group_concat(column_name) AS fields FROM information_schema.columns WHERE table_name='$next_tb_name'");
$tblc_ftchd = $tblc->fetch(PDO::FETCH_ASSOC);
$fields_str = $tblc_ftchd['fields'];
$fields_str = explode(',', $fields_str);// str_replace("_",".",$next_tb_name);
$filtered = array_filter($m_dbc_ftchd['0'], function($var){return !is_null($var);} );
unset($filtered['id']);
echo '<li>
<div class="collapsible-header"><i class="material-icons">keyboard_arrow_right</i>'.str_replace("_",".",$next_tb_name).'</div><div class="collapsible-body">
<table class="bordered">
<tbody>';
foreach ($filtered as $key => $value) {
echo '<tr>';
echo ' <td>'.$key.': </td> <td>'.$value.'</td></tr>';
}
echo ' </tbody>
</table>
</div></li>';
if($m_dbc_ftchd!=NULL){
echo '</ul>';
}
//echo '<br/><hr>';
}
if($m_dbc_ftchd!=NULL){
//echo '</ul>';
}
}
$db = null;
}
?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</div>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
</body>
</html>