<?php
$socks5_list = explode ("\n", str_replace ("\r", "", file_get_contents (dirname(__FILE__)."/gotovo_vse_sellery_bezdybley.txt")));
if (empty($socks5_list))
{
exit(1);
}
function _check_socks5 ($socks = array(), $filename)
{
foreach ($socks as $s)
{
list ($ip, $port) = explode (":", $s);
if (geoip_country_code_by_name($ip) == "CN") continue;
if ($socket = @fsockopen ($ip, $port, $errno, $errstr, 1))
{
$threads[$s] = $socket;
}
}
foreach ($threads as $s => $h)
{
fwrite ($h, "\x05\x01\x00");
}
foreach ($threads as $s => $h)
{
$r = fread ($h, 2);
if ((ord ($r [0]) == 5) && (ord ($r [1]) == 0))
{
file_put_contents ($filename, $s."\r\n");
}
}
}
_check_socks5 ($socks5_list, dirname(__FILE__)."/socks5_valid.txt");
?>
<?php
$proxies = file ("1_ne_check.txt");
if (empty($proxies))
{
exit(1);
}
$mc = curl_multi_init ();
for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
{
$c [$thread_no] = curl_init ();
curl_setopt ($c [$thread_no], CURLOPT_URL, "http://google.com");
curl_setopt ($c [$thread_no], CURLOPT_HEADER, 0);
curl_setopt ($c [$thread_no], CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c [$thread_no], CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($c [$thread_no], CURLOPT_TIMEOUT, 10);
curl_setopt ($c [$thread_no], CURLOPT_PROXY, trim ($proxies [$thread_no]));
curl_setopt ($c [$thread_no], CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_multi_add_handle ($mc, $c [$thread_no]);
}
$proxies_out = array();
do {
while (($execrun = curl_multi_exec ($mc, $running)) == CURLM_CALL_MULTI_PERFORM);
if ($execrun != CURLM_OK) break;
while ($done = curl_multi_info_read ($mc))
{
$info = curl_getinfo ($done ['handle']);
if ($info ['http_code'] == 301) {
echo trim ($proxies [array_search ($done['handle'], $c)])."\r\n";
$proxies_out[trim($proxies[array_search($done['handle'], $c)])] = trim($proxies[array_search($done['handle'], $c)]);
unset($proxies[array_search ($done['handle'], $c)]);
}
curl_multi_remove_handle ($mc, $done ['handle']);
}
} while ($running);
curl_multi_close ($mc);
$mc = curl_multi_init ();
for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
{
$c [$thread_no] = curl_init ();
curl_setopt ($c [$thread_no], CURLOPT_URL, "http://google.com");
curl_setopt ($c [$thread_no], CURLOPT_HEADER, 0);
curl_setopt ($c [$thread_no], CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c [$thread_no], CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($c [$thread_no], CURLOPT_TIMEOUT, 10);
curl_setopt ($c [$thread_no], CURLOPT_PROXY, trim ($proxies [$thread_no]));
curl_setopt ($c [$thread_no], CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_multi_add_handle ($mc, $c [$thread_no]);
}
$proxies5_out = array();
do {
while (($execrun = curl_multi_exec ($mc, $running)) == CURLM_CALL_MULTI_PERFORM);
if ($execrun != CURLM_OK) break;
while ($done = curl_multi_info_read ($mc))
{
$info = curl_getinfo ($done ['handle']);
if ($info ['http_code'] == 301) {
echo trim ($proxies [array_search ($done['handle'], $c)])."\r\n";
$proxies5_out[trim($proxies[array_search($done['handle'], $c)])] = trim($proxies[array_search($done['handle'], $c)]);
}
curl_multi_remove_handle ($mc, $done ['handle']);
}
} while ($running);
curl_multi_close ($mc);
file_put_contents("2_results.txt", implode("\r\n", $proxies_out)."\r\n\r\n".implode("\r\n", $proxies5_out));
?>
<?php
session_start();
require('connect.php');
$fsmsg = "";
if (!empty($_POST['username']) AND !empty($_POST['password'])) {
$username = mysqli_real_escape_string($connection, $_POST['username']);
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username='{$username}'";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$row = mysqli_fetch_assoc($result);
if (isset($row['ban']) AND $row['ban'] == 1){
$fsmsg = "Пользователь заблокирован";
}
else if (isset($row['password']) AND $row['password'] == $password) {
$_SESSION['username'] = $username;
$fsmsg = "Вы вошли под пользователем";
if (isset($row['role']) AND $row['role'] == "admin") {
$fsmsg = "Вы вошли под админом";
}
} else {
$fsmsg = "Ошибка";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>Авторизация</title>
</head>
<body>
<div class="container">
<?php
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
echo("Hello," . $username . ".<br>\n");
if(!empty($fsmsg)) echo("<h2>{$fsmsg}</h2><br>\n");
echo("<a href='logout.php' class='btn btn-lg btn-primary'>Выйти</a>");
}
else
{
?>
<form class="form-signin" method="POST">
<?php if(!empty($fsmsg)) echo("<h2>{$fsmsg}</h2><br>\n"); ?>
<h2>Авторизация</h2>
<input type="text" name="username" class="form-control" placeholder="Username" required>
<input type="password" name="password" class="form-control" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Авторизоваться</button>
<a href="index.php" class="btn btn-lg btn-primary btn-block">Зарегистрироваться</a>
</form>
</div>
<?php
}
?>
</body>
</html>
<?php
$proxies = file ("gotovo_vse_sellery_bezdybley.txt");
$proxies_out = array();
$mc = curl_multi_init ();
for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
{
$c [$thread_no] = curl_init ();
curl_setopt ($c [$thread_no], CURLOPT_URL, "http://google.com");
curl_setopt ($c [$thread_no], CURLOPT_HEADER, 0);
curl_setopt ($c [$thread_no], CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c [$thread_no], CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($c [$thread_no], CURLOPT_TIMEOUT, 10);
curl_setopt ($c [$thread_no], CURLOPT_PROXY, trim ($proxies [$thread_no]));
curl_setopt ($c [$thread_no], CURLOPT_PROXYTYPE, 0);
curl_multi_add_handle ($mc, $c [$thread_no]);
}
do {
while (($execrun = curl_multi_exec ($mc, $running)) == CURLM_CALL_MULTI_PERFORM);
if ($execrun != CURLM_OK) break;
while ($done = curl_multi_info_read ($mc))
{
$info = curl_getinfo ($done ['handle']);
if ($info ['http_code'] == 301) {
echo trim ($proxies [array_search ($done['handle'], $c)])."\r\n";
$proxies_out[trim($proxies[array_search($done['handle'], $c)])] = trim($proxies[array_search($done['handle'], $c)]);
}
curl_multi_remove_handle ($mc, $done ['handle']);
}
} while ($running);
curl_multi_close ($mc);
file_put_contents("proxyuniq.txt", implode("\r\n", $proxies_out));
?>
while( ($cat = mysqli_fetch_assoc($result)) )
{
if ($articles_count = mysqli_query($conection, "SELECT * FROM `articles` WHERE `categories_id`='".mysqli_real_escape_string($connection, $cat['id'])."'"))
{
echo '<li>' . $cat['name'] . ' ('. mysqli_num_rows($articles_count).') </li>';
}
}
mysqli_real_escape_string()
).