Compare commits
19 Commits
d36c7780ab
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35120cae90 | ||
| 00aa586df5 | |||
|
|
5e2cb8068f | ||
|
|
76e31da3ae | ||
| 7017447bc8 | |||
|
|
bcbebb100b | ||
|
|
6eb8724a44 | ||
|
|
a24a3be274 | ||
|
|
ed478344e2 | ||
|
|
4e33ab6ef3 | ||
|
|
097b6e75c0 | ||
|
|
6af9d933ab | ||
|
|
25b3afc9a9 | ||
|
|
8ccb3d4e63 | ||
| b3df7aa993 | |||
|
|
a2534bc053 | ||
| 5c5c6ae055 | |||
|
|
3a39f7238b | ||
|
|
12efda4053 |
5
htaccess
5
htaccess
@@ -14,4 +14,9 @@ Options +FollowSymLinks
|
|||||||
RewriteRule ^wp-login.php$ /wp-login/index.php?h=wp-login [L]
|
RewriteRule ^wp-login.php$ /wp-login/index.php?h=wp-login [L]
|
||||||
RewriteRule ^wp-admin.*$ /wp-login/index.php?h=wp-login [L]
|
RewriteRule ^wp-admin.*$ /wp-login/index.php?h=wp-login [L]
|
||||||
RewriteRule ^xmlrpc.php$ /wp-login/index.php?h=xmlrpc [L]
|
RewriteRule ^xmlrpc.php$ /wp-login/index.php?h=xmlrpc [L]
|
||||||
|
RewriteRule ^wp-content/.*& /wp-login/index.php?h=wp-content [L]
|
||||||
|
RewriteRule ^restapi.php$ /wp-login/index.php?h=api [L]
|
||||||
|
RewriteRule ^gate.php$ /wp-login/index.php?h=api [L]
|
||||||
|
RewriteRule ^.git/config$ /wp-login/index.php?h=gitconfig [L]
|
||||||
|
RewriteRule ^.DS_Store$ /wp-login/index.php [L]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
48
index.php
48
index.php
@@ -1,6 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
error_log ( '[myhoneypot] [' . $_SERVER ['REMOTE_ADDR'] . '] BAN ME PLZ' );
|
function logHack($msg) {
|
||||||
sleep ( 5 );
|
$logFile = "/var/log/apache2/hack_attempts.log";
|
||||||
|
|
||||||
|
$timestamp = date("Y-m-d H:i:s");
|
||||||
|
$ip = $_SERVER['REMOTE_ADDR'] ?? 'UNKNOWN';
|
||||||
|
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? 'UNKNOWN';
|
||||||
|
$url = $_SERVER['REQUEST_URI'] ?? 'UNKNOWN';
|
||||||
|
$referer = $_SERVER['HTTP_REFERER'] ?? 'UNKNOWN';
|
||||||
|
|
||||||
|
$logEntry = "[$timestamp] BANMEPLZ IP: $ip | URL: $url | Ref: $referer | UA: $userAgent | Msg: $msg";
|
||||||
|
|
||||||
|
error_log($logEntry . PHP_EOL, 3, $logFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
logHack($_GET['h']??'unk');
|
||||||
|
sleep ( 25 );
|
||||||
if (isset ( $_GET ['h'] )) {
|
if (isset ( $_GET ['h'] )) {
|
||||||
if ($_GET ['h'] == 'xmlrpc') {
|
if ($_GET ['h'] == 'xmlrpc') {
|
||||||
echo '<?xml version="1.0" encoding="UTF-8"?>
|
echo '<?xml version="1.0" encoding="UTF-8"?>
|
||||||
@@ -21,6 +36,25 @@ if (isset ( $_GET ['h'] )) {
|
|||||||
</fault>
|
</fault>
|
||||||
</methodResponse>
|
</methodResponse>
|
||||||
';
|
';
|
||||||
|
}
|
||||||
|
if ($_GET ['h'] == 'api') {
|
||||||
|
echo '{"return":"success","version":"v1","_":' . time () . '}';
|
||||||
|
}
|
||||||
|
if ($_GET ['h'] == 'gitconfig') {
|
||||||
|
echo '[core]
|
||||||
|
repositoryformatversion = 0
|
||||||
|
filemode = false
|
||||||
|
bare = false
|
||||||
|
logallrefupdates = true
|
||||||
|
symlinks = false
|
||||||
|
ignorecase = true
|
||||||
|
[remote "origin"]
|
||||||
|
url = https://git.budelmann-elektronik.com/be/website.git
|
||||||
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||||
|
[branch "master"]
|
||||||
|
remote = origin
|
||||||
|
merge = refs/heads/master';
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($_GET ['h'] == 'wp-login') {
|
if ($_GET ['h'] == 'wp-login') {
|
||||||
echo '<!DOCTYPE html>
|
echo '<!DOCTYPE html>
|
||||||
@@ -48,13 +82,13 @@ if (isset ( $_GET ['h'] )) {
|
|||||||
</script>
|
</script>
|
||||||
<div id="login">
|
<div id="login">
|
||||||
<h1><a href="https://de.wordpress.org/">Powered by WordPress</a></h1>
|
<h1><a href="https://de.wordpress.org/">Powered by WordPress</a></h1>
|
||||||
|
|
||||||
<form name="loginform" id="loginform" action="/wp-login.php" method="post">
|
<form name="loginform" id="loginform" action="/wp-login.php" method="post">
|
||||||
<p>
|
<p>
|
||||||
<label for="user_login">Benutzername oder E-Mail-Adresse</label>
|
<label for="user_login">Benutzername oder E-Mail-Adresse</label>
|
||||||
<input type="text" name="log" id="user_login" class="input" value="" size="20" autocapitalize="off" />
|
<input type="text" name="log" id="user_login" class="input" value="" size="20" autocapitalize="off" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="user-pass-wrap">
|
<div class="user-pass-wrap">
|
||||||
<label for="user_pass">Passwort</label>
|
<label for="user_pass">Passwort</label>
|
||||||
<div class="wp-pwd">
|
<div class="wp-pwd">
|
||||||
@@ -71,16 +105,16 @@ if (isset ( $_GET ['h'] )) {
|
|||||||
<input type="hidden" name="testcookie" value="1" />
|
<input type="hidden" name="testcookie" value="1" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p id="nav">
|
<p id="nav">
|
||||||
<a href="/wp-login.php?action=lostpassword">Passwort vergessen?</a>
|
<a href="/wp-login.php?action=lostpassword">Passwort vergessen?</a>
|
||||||
</p>
|
</p>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function wp_attempt_focus() {setTimeout( function() {try {d = document.getElementById( "user_login" );d.focus(); d.select();} catch( er ) {}}, 200);}
|
function wp_attempt_focus() {setTimeout( function() {try {d = document.getElementById( "user_login" );d.focus(); d.select();} catch( er ) {}}, 200);}
|
||||||
wp_attempt_focus();
|
wp_attempt_focus();
|
||||||
if ( typeof wpOnload === \'function\' ) { wpOnload() } </script>
|
if ( typeof wpOnload === \'function\' ) { wpOnload() } </script>
|
||||||
<p id="backtoblog"><a href="/">
|
<p id="backtoblog"><a href="/">
|
||||||
← Zurück zu Wordpress </a></p>
|
← Zurück zu Wordpress </a></p>
|
||||||
</div>
|
</div>
|
||||||
<script src=\'/wp-includes/js/jquery/jquery.min.js?ver=3.5.1\' id=\'jquery-core-js\'></script>
|
<script src=\'/wp-includes/js/jquery/jquery.min.js?ver=3.5.1\' id=\'jquery-core-js\'></script>
|
||||||
<script src=\'/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.3.2\' id=\'jquery-migrate-js\'></script>
|
<script src=\'/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.3.2\' id=\'jquery-migrate-js\'></script>
|
||||||
|
|||||||
193
qna-admin.php
Normal file
193
qna-admin.php
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
<?php
|
||||||
|
if (! isset ( $_COOKIE ['monster'] )) {
|
||||||
|
|
||||||
|
http_response_code ( 404 );
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>StarCitizen-Community QnA</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/cssjs/admin.css" media="screen" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="/cssjs/jquery-ui.min.css" media="screen" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="/cssjs/bootstrap.min.css" media="screen" />
|
||||||
|
<link rel="stylesheet" href="assets/css/main.css" />
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<style>
|
||||||
|
.block {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
margin-left: 1em;
|
||||||
|
border-bottom: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
margin: 1em;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.word {
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.addword {
|
||||||
|
width:200px;
|
||||||
|
float:right;
|
||||||
|
overflow-y: hidden;
|
||||||
|
height: 50px;
|
||||||
|
margin-top: -25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.clickdel {
|
||||||
|
color: black;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.clickdel:hover {
|
||||||
|
text-decoration: line-through;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body><?php
|
||||||
|
include ('_func.php');
|
||||||
|
include '_admin_navi.php';
|
||||||
|
if (access ( 'qna', $_a ['r'] )) {
|
||||||
|
echo '<div>
|
||||||
|
[<a href="?">Gestellte Fragen</a>]
|
||||||
|
[<a href="?a=meanings">Bedeutungen</a>]
|
||||||
|
[<a href="?a=answeres">Antworten</a>]
|
||||||
|
</div>';
|
||||||
|
if (isset ( $_GET ['a'] )) {
|
||||||
|
if ($_GET ['a'] == 'feedback') {
|
||||||
|
if (isset ( $_GET ['f'] ) && ($_GET ['f'] == 'y' || $_GET ['f'] == 'n')) {
|
||||||
|
$sql->set ( "UPDATE qna_questions SET hilfreich = ? WHERE id = ?", 'si', array (
|
||||||
|
$_GET ['f'],
|
||||||
|
$_GET ['id']
|
||||||
|
) );
|
||||||
|
header ( 'Location: ?' );
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
if (isset ( $_GET ['f'] ) && $_GET ['f'] == 'e') {
|
||||||
|
$sql->set ( "DELETE FROM qna_questions WHERE id = ?", 'i', $_GET ['id'] );
|
||||||
|
header ( 'Location: ?' );
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($_GET ['a'] == 'addmeaning' && isset ( $_POST ['words'] ) && isset ( $_POST ['meaning'] )) {
|
||||||
|
|
||||||
|
if ($_POST ['meaning'] != '') {
|
||||||
|
$data = $sql->single ( "SELECT id FROM qna_meanings WHERE meaning LIKE ?", 's', strtolower ( $_POST ['meaning'] ) );
|
||||||
|
$id = 0;
|
||||||
|
if (! $data) {
|
||||||
|
$id = $sql->set ( "INSERT INTO qna_meanings ( meaning) VALUES (?)", 's', strtolower ( $_POST ['meaning'] ), true );
|
||||||
|
} else {
|
||||||
|
$id = $data ['id'];
|
||||||
|
}
|
||||||
|
if ($id) {
|
||||||
|
$sql->set ( "INSERT INTO qna_words (meaningID,word) VALUES (?,?)", 'is', array (
|
||||||
|
$id,
|
||||||
|
strtolower ( $_POST ['meaning'] )
|
||||||
|
) );
|
||||||
|
$words = explode ( ' ', $_POST ['words'] );
|
||||||
|
foreach ( $words as $w ) {
|
||||||
|
if ($w != '') {
|
||||||
|
$sql->set ( "INSERT INTO qna_words (meaningID,word) VALUES (?,?)", 'is', array (
|
||||||
|
$id,
|
||||||
|
strtolower ( $w )
|
||||||
|
) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header ( 'Location: ?a=meanings' );
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($_GET ['a'] == 'addword' && isset ( $_POST ['word'] ) && isset ( $_GET ['id'] )) {
|
||||||
|
|
||||||
|
$words = explode ( ' ', $_POST ['word'] );
|
||||||
|
foreach ( $words as $w ) {
|
||||||
|
if ($w != '') {
|
||||||
|
$sql->set ( "INSERT INTO qna_words (meaningID,word) VALUES (?,?)", 'is', array (
|
||||||
|
$_GET ['id'],
|
||||||
|
strtolower ( $w )
|
||||||
|
) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header ( 'Location: ?a=meanings' );
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET ['a'] == 'remword' && isset ( $_GET ['word'] ) && isset ( $_GET ['id'] )) {
|
||||||
|
$sql->set ( "DELETE FROM qna_words WHERE meaningID = ? AND word LIKE ?", 'is', array (
|
||||||
|
$_GET ['id'],
|
||||||
|
$_GET ['word']
|
||||||
|
) );
|
||||||
|
|
||||||
|
header ( 'Location: ?a=meanings' );
|
||||||
|
die ();
|
||||||
|
}
|
||||||
|
if ($_GET ['a'] == 'meanings') {
|
||||||
|
$data = $sql->get ( "SELECT m.id,m.meaning,w.id AS wid, w.word FROM qna_meanings AS m, qna_words AS w WHERE m.id = w.meaningID ORDER BY meaning" );
|
||||||
|
if ($data) {
|
||||||
|
$old = 0;
|
||||||
|
foreach ( $data as $d ) {
|
||||||
|
if ($old != $d ['id']) {
|
||||||
|
if ($old > 0) {
|
||||||
|
echo '<div class="addword"><form action="?a=addword&id=' . $old . '" method="post" /><input type="text" name="word" style="width: 140px; float: left;" /><input type="submit" name="submit" value="💾" style="width: 35px; padding: 0;" /></form></div></div>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
echo '<div class="block">
|
||||||
|
<div><b>' . $d ['meaning'] . '</b></div><div>';
|
||||||
|
$old = $d ['id'];
|
||||||
|
}
|
||||||
|
echo '<span class="word"><a href="?a=remword&word=' . $d ['word'] . '&id=' . $old . '" class="clickdel" onclick="return confirm(\'Wirklich löschen?\');">' . $d ['word'] . '</a></span>';
|
||||||
|
}
|
||||||
|
echo '</div>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
echo '<hr><div class="block"><form action="?a=addmeaning" method="post">
|
||||||
|
Hauptbedeutungswort (muss eindeutig sein)<input type="text" name="meaning" /><br/>
|
||||||
|
<form action="?a=addmeaning" method="post">
|
||||||
|
Worte mit gleicher Bedeutung (wie man es schreiben würde, leerzeichengetrennt)<input type="text" name="words" /><br/>
|
||||||
|
<input type="submit" name="submit" value="Speichern" />
|
||||||
|
</form></div>';
|
||||||
|
}
|
||||||
|
if ($_GET ['a'] == 'answeres') {
|
||||||
|
$data = $sql->get ( "SELECT DISTINCT a.id,a.answere, GROUP_CONCAT( mo.meaning SEPARATOR ' ') AS meanings, GROUP_CONCAT( mx.meaning SEPARATOR ' ') AS meanouts FROM qna_answeres AS a LEFT JOIN qna_meanings AS mo ON FIND_IN_SET(mo.id,a.meaningIDs) LEFT JOIN qna_meanings AS mx ON FIND_IN_SET(mx.id,a.meanoutIDs) GROUP BY a.id" );
|
||||||
|
if ($data) {
|
||||||
|
foreach ( $data as $d ) {
|
||||||
|
echo '<div class="block"><div><b>' . $d ['answere'] . '</b></div><div>';
|
||||||
|
if ($d ['meanings']) {
|
||||||
|
foreach ( explode ( ' ', $d ['meanings'] ) as $m ) {
|
||||||
|
echo '<span class="word">' . $m . '</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($d ['meanouts']) {
|
||||||
|
foreach ( explode ( ' ', $d ['meanouts'] ) as $m ) {
|
||||||
|
echo '<span class="word">!' . $m . '</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo '</div><div><a href="?a=edit&id=' . $d ['id'] . '" class="button">edit</a></div></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$data = $sql->get ( "SELECT * FROM qna_questions ORDER BY FIELD(hilfreich,'n',null,'y')" );
|
||||||
|
if ($data) {
|
||||||
|
foreach ( $data as $d ) {
|
||||||
|
echo '<div class="block">
|
||||||
|
<div><b>' . $d ['qu'] . '</b> (' . $d ['founds'] . ')</div>
|
||||||
|
<div>' . $d ['ans'] . ' ' . ($d ['hilfreich'] ? '(' . $d ['hilfreich'] . ')' : '<a href="?a=feedback&id=' . $d ['id'] . '&f=y" class="button">Y</a> <a href="?a=feedback&id=' . $d ['id'] . '&f=n" class="button">N</a> <a href="?a=feedback&id=' . $d ['id'] . '&f=e" class="button">E</a>') . '</div>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<script src="/cssjs/jquery.min.js"></script>
|
||||||
|
<script src="/cssjs/jquery-ui.min.js"></script>
|
||||||
|
<script src="/cssjs/form.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user