ב הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותشسdggרות הל555ה התafhgfh
במסgרות ה gh//شی הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותהתנדaghhhhו12ין יעל, המעציfghfghfע
/
proc
/
self
/
cwd
/
Upload FileeE
HOME
<?php // Google Dork Search via Programmable Search (Custom Search JSON API) // Cara pakai: // 1) Buat API Key di Google Cloud dan Programmable Search Engine (cx) // 2) Set environment variable GOOGLE_API_KEY dan GOOGLE_CX, atau isi konstanta di bawah ini_set('display_errors', 1); error_reporting(E_ALL); session_start(); // Konfigurasi: gunakan nilai tetap sesuai permintaan $GOOGLE_API_KEY = 'AIzaSyCPQEmbbCqQJ6aPUH5UBRKFiXZpZsABaBk'; $GOOGLE_CX = '77ac3735ce4e54eb0'; function h(string $s): string { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); } function google_search(string $query, int $page = 1, int $num = 10, ?string &$error = null): ?array { global $GOOGLE_API_KEY, $GOOGLE_CX; if (empty($GOOGLE_API_KEY) || empty($GOOGLE_CX)) { $error = 'API Key atau CX belum dikonfigurasi. Set env GOOGLE_API_KEY dan GOOGLE_CX, atau edit file.'; return null; } $num = max(1, min(10, $num)); $page = max(1, $page); $startIndex = 1 + ($page - 1) * $num; // Google start index (1-based) $params = [ 'key' => $GOOGLE_API_KEY, 'cx' => $GOOGLE_CX, 'q' => $query, 'num' => $num, 'start' => $startIndex, // 'safe' => 'off', // optional // 'lr' => 'lang_id', // optional language restrict // 'gl' => 'id', // optional country ]; $url = 'https://www.googleapis.com/customsearch/v1?' . http_build_query($params); $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 30, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_USERAGENT => 'Mozilla/5.0 (compatible; DorkSearch/1.0; +https://developers.google.com/custom-search/v1/overview)' ]); $raw = curl_exec($ch); $err = curl_error($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($raw === false) { $error = 'cURL error: ' . $err; return null; } if ($code >= 400) { $error = 'HTTP ' . $code . ' response: ' . $raw; return null; } $data = json_decode($raw, true); if (!is_array($data)) { $error = 'Invalid JSON'; return null; } if (isset($data['error'])) { $error = $data['error']['message'] ?? 'API error'; return null; } return $data; } $q = isset($_GET['q']) ? trim((string)$_GET['q']) : ''; $num = isset($_GET['num']) ? (int)$_GET['num'] : 10; $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; $num = max(1, min(10, $num)); $page = max(1, $page); $error = ''; $results = null; // Click-tracking: record visited URLs and redirect if (isset($_GET['open'])) { $to = (string)$_GET['open']; $to = rawurldecode($to); // Allow only http/https if (!preg_match('~^https?://~i', $to) || !filter_var($to, FILTER_VALIDATE_URL)) { http_response_code(400); echo 'Invalid URL'; exit; } if (!isset($_SESSION['visited_urls'])) $_SESSION['visited_urls'] = []; $_SESSION['visited_urls'][$to] = time(); header('Location: ' . $to); exit; } if ($q !== '') { $results = google_search($q, $page, $num, $error); } // Helper untuk membuat URL query pagination function build_url(array $overrides = []): string { $params = $_GET; foreach ($overrides as $k => $v) { if ($v === null) unset($params[$k]); else $params[$k] = $v; } $path = strtok($_SERVER['REQUEST_URI'], '?'); return $path . '?' . http_build_query($params); } ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Google Dork Search</title> <style> body{font-family:Segoe UI,Arial,sans-serif;background:#0b0b0b;color:#eee;margin:0} .container{max-width:1100px;margin:0 auto;padding:20px} h1{color:#ff4444} .card{background:#161616;border:1px solid #333;border-radius:10px;padding:20px;margin-bottom:20px} input,select,button{background:#1f1f1f;color:#fff;border:1px solid #333;border-radius:8px;padding:10px} input[type=text]{width:100%} .row{display:flex;gap:12px;flex-wrap:wrap} .col{flex:1 1 260px} .btn{background:linear-gradient(135deg,#ff4444,#cc0000);border:none;cursor:pointer} .btn.secondary{background:#2a2a2a} .muted{color:#aaa} .result{padding:10px 0;border-bottom:1px solid #2a2a2a} .result a{color:#66aaff;text-decoration:none} .result a:hover{text-decoration:underline} .url{color:#7dd957;font-size:12px} .snippet{color:#ccc} .pagination{display:flex;gap:10px;align-items:center} .pagination a{color:#66aaff;text-decoration:none} .help{font-size:12px;color:#aaa} code{background:#111;padding:2px 6px;border-radius:6px} .tag{display:inline-block;padding:2px 6px;border-radius:6px;font-size:11px;margin-left:6px} .tag.visited{background:#133016;color:#7dd957;border:1px solid #2b5d30} </style> <script> // UI simplified: only a single query box remains. </script> <?php if (empty($GOOGLE_API_KEY) || empty($GOOGLE_CX)): ?> <meta name="robots" content="noindex"> <?php endif; ?> </head> <body> <div class="container"> <h1>Google Dork Search</h1> <div class="card"> <form method="GET"> <div class="row"> <div class="col" style="flex:1 1 600px"> <label>Kueri / Dork</label> <input type="text" id="q" name="q" value="<?php echo h($q); ?>" placeholder="contoh: site:example.com intitle:login filetype:sql"> </div> <div class="col" style="max-width:140px"> <label>Per halaman</label> <select name="num"> <?php foreach ([10,9,8,7,6,5,4,3,2,1] as $n): ?> <option value="<?php echo $n; ?>" <?php echo $num===$n?'selected':''; ?>><?php echo $n; ?></option> <?php endforeach; ?> </select> </div> <div class="col" style="max-width:120px;align-self:end"> <button class="btn" type="submit">Cari</button> </div> </div> </form> <div class="help" style="margin-top:10px"> Contoh: <code>site:gov.id intitle:"index of" filetype:sql</code> • <a href="https://developers.google.com/custom-search/v1/overview" target="_blank" style="color:#66aaff;">Dokumentasi API</a> </div> </div> <?php if ($q === ''): ?> <div class="card muted">Masukkan dork pada kolom di atas, lalu klik Cari.</div> <?php elseif ($error): ?> <div class="card" style="border-color:#662; color:#ffb">Error: <?php echo h($error); ?></div> <?php else: ?> <div class="card"> <?php $info = $results['searchInformation'] ?? []; $total = isset($info['totalResults']) ? (int)$info['totalResults'] : 0; $time = isset($info['searchTime']) ? (float)$info['searchTime'] : 0.0; ?> <div class="muted" style="margin-bottom:10px"> Hasil untuk: <code><?php echo h($q); ?></code> • <?php echo number_format($total); ?> hasil • <?php echo number_format($time, 2); ?> detik </div> <?php if (!empty($results['items'])): ?> <?php $visited = $_SESSION['visited_urls'] ?? []; ?> <?php foreach ($results['items'] as $item): ?> <?php $link = $item['link']; $isVisited = isset($visited[$link]); $redirect = strtok($_SERVER['REQUEST_URI'], '?') . '?open=' . urlencode($link); ?> <div class="result"> <div> <a href="<?php echo h($redirect); ?>" target="_blank" rel="noopener noreferrer"><?php echo h($item['title']); ?></a> <?php if ($isVisited): ?><span class="tag visited">Visited</span><?php endif; ?> </div> <div class="url"><?php echo h($item['displayLink'] ?? parse_url($link, PHP_URL_HOST)); ?></div> <div class="snippet"><?php echo h($item['snippet'] ?? ''); ?></div> </div> <?php endforeach; ?> <?php else: ?> <div class="muted">Tidak ada hasil.</div> <?php endif; ?> <?php $hasPrev = $page > 1; $hasNext = $total > ($page * $num); ?> <div class="pagination" style="margin-top:12px"> <?php if ($hasPrev): ?> <a href="<?php echo h(build_url(['page' => $page - 1])); ?>">« Prev</a> <?php endif; ?> <span class="muted">Halaman <?php echo $page; ?></span> <?php if ($hasNext): ?> <a href="<?php echo h(build_url(['page' => $page + 1])); ?>">Next »</a> <?php endif; ?> </div> </div> <?php endif; ?> <div class="muted" style="font-size:12px"> Catatan: Menggunakan Google Custom Search API (Programmable Search). Pastikan API key dan CX sudah disetel. Penggunaan operator dork mengikuti dukungan Google CSE. </div> </div> </body> </html>