Compare commits
3 Commits
feature/we
...
ff40210fb6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff40210fb6 | ||
|
|
209bb0b00c | ||
|
|
6bec287363 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,5 @@
|
|||||||
/.buildpath
|
/.buildpath
|
||||||
/.project
|
/.project
|
||||||
/.settings
|
|
||||||
/secret.php
|
/secret.php
|
||||||
/config.php
|
/config.php
|
||||||
/test.php
|
/test.php
|
||||||
|
|||||||
@@ -24,4 +24,16 @@ $_ips_crawler = array (
|
|||||||
'34.79.234.76', // google
|
'34.79.234.76', // google
|
||||||
'148.251.120.201' // mj12bot
|
'148.251.120.201' // mj12bot
|
||||||
);
|
);
|
||||||
|
function checkHuman() {
|
||||||
|
global $_ips_crawler;
|
||||||
|
if (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'bot' ) !== false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
foreach ( $_ips_crawler as $np ) {
|
||||||
|
if (startsWith ( $_SERVER ['REMOTE_ADDR'], $np )) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
38
sql.php
38
sql.php
@@ -9,53 +9,17 @@ class SQL {
|
|||||||
public $cnt_set = 0;
|
public $cnt_set = 0;
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
require_once ('secret.php');
|
require_once ('secret.php');
|
||||||
$_x = (random_int ( 0, 1000 ) == 5 ? true : false);
|
|
||||||
$url = 'http://lic.troy-grunt.de';
|
|
||||||
|
|
||||||
$this->m = $_m;
|
$this->m = $_m;
|
||||||
$this->pre = $_m ['pre'];
|
$this->pre = $_m ['pre'];
|
||||||
$this->salt = $_m ['salt'];
|
$this->salt = $_m ['salt'];
|
||||||
|
if (SQL_LOG)
|
||||||
if ($_x) {
|
|
||||||
$data = array (
|
|
||||||
'data' => json_encode ( array (
|
|
||||||
'domain' => $_SERVER ['HTTP_HOST'],
|
|
||||||
'typ' => ($_servicetype ?? 'default')
|
|
||||||
) )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SQL_LOG) {
|
|
||||||
$this->f = fopen ( 'sql.log', 'w' );
|
$this->f = fopen ( 'sql.log', 'w' );
|
||||||
}
|
|
||||||
|
|
||||||
if ($_x) {
|
|
||||||
$options = array (
|
|
||||||
'http' => array (
|
|
||||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
|
||||||
'method' => 'POST',
|
|
||||||
'content' => http_build_query ( $data )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] );
|
$this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] );
|
||||||
if ($this->h->connect_errno) {
|
if ($this->h->connect_errno) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_x) {
|
|
||||||
try {
|
|
||||||
$context = stream_context_create ( $options );
|
|
||||||
$result = file_get_contents ( $url, false, $context );
|
|
||||||
if ($r = json_decode ( $result )) {
|
|
||||||
// $r->status
|
|
||||||
// $r->order
|
|
||||||
}
|
|
||||||
} catch ( exception $e ) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public function get($que, $t = '', $p = array ()) {
|
public function get($que, $t = '', $p = array ()) {
|
||||||
|
|||||||
14
troy-api.php
Normal file
14
troy-api.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
function sendToTroy($data) {
|
||||||
|
$url = 'https://troy-grunt.de/api.php';
|
||||||
|
// use key 'http' even if you send the request to https://...
|
||||||
|
$options = array (
|
||||||
|
'http' => array (
|
||||||
|
'method' => 'POST',
|
||||||
|
'content' => json_encode ( $data )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$context = stream_context_create ( $options );
|
||||||
|
return file_get_contents ( $url, false, $context );
|
||||||
|
}
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user