From b3619bebd8f8b89d5a3064e393466db3a5d76ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Sat, 10 Jul 2021 12:36:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=83=91=E3=83=A0=E5=AF=BE=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/blacklist.dat | 0 public/blacklist.php | 23 +++++++++++ public/bot-trap/index.php | 39 ++++++++++++++++++ public/img/pixel.gif | Bin 0 -> 64 bytes public/robots.txt | 2 +- .../views/pages/common/comments.blade.php | 5 ++- resources/views/theme/techsuwa/site.blade.php | 16 +++++-- 7 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 public/blacklist.dat create mode 100644 public/blacklist.php create mode 100644 public/bot-trap/index.php create mode 100644 public/img/pixel.gif diff --git a/public/blacklist.dat b/public/blacklist.dat new file mode 100644 index 0000000..e69de29 diff --git a/public/blacklist.php b/public/blacklist.php new file mode 100644 index 0000000..0bacce6 --- /dev/null +++ b/public/blacklist.php @@ -0,0 +1,23 @@ +\n"); + while ($line = fgets($fp,255)) { + $u = explode(" ",$line); + $u0 = $u[0]; + if (preg_match("/$u0/",$_SERVER['REMOTE_ADDR'])) {$badbot++;} + } + fclose($fp); + if ($badbot > 0) { /* this is a bad bot, reject it */ + sleep(12); + print ("\n"); + print ("BOT、消えろ\n"); + print ("\n"); + print ("

来たわねwwwwww

\n"); + print ("

残念けど、こちらは人間以外立入錦糸。

\n"); + print ("

オメェーはきゃわいいロリ警察官に報告されたから、早速消えろ!!

\n"); + print ("\n"); + exit; + } +?> diff --git a/public/bot-trap/index.php b/public/bot-trap/index.php new file mode 100644 index 0000000..f214a9c --- /dev/null +++ b/public/bot-trap/index.php @@ -0,0 +1,39 @@ + + + +

ニャンでここに?

+

戻れ

+ \n"); + while ($line = fgets($fp,255)) { + $u = explode(" ",$line); + $u0 = $u[0]; + if (preg_match("/$u0/",$_SERVER['REMOTE_ADDR'])) {$badbot++;} + } + fclose($fp); + if ($badbot == 0) { /* we just see a new bad bot not yet listed ! */ + /* send a mail to hostmaster */ + $tmestamp = time(); + $datum = date("Y-m-d (D) H:i:s",$tmestamp); + $from = "badbot-watch@076.ne.jp"; + $to = "reports@076.ne.jp"; + $subject = "domain-tld alert: bad robot"; + $msg = "A bad robot hit ".$_SERVER['REQUEST_URI']." ".$datum." \n"; + $msg .= "address is ".$_SERVER['REMOTE_ADDR'].", agent is ".$_SERVER['HTTP_USER_AGENT']."\n"; + mail($to, $subject, $msg, "From: $from"); + /* append bad bot address data to blacklist log file: */ + $fp = fopen($filename,'a+'); + fwrite($fp, $_SERVER['REMOTE_ADDR']." - - [".$datum."] ".$_SERVER['REQUEST_METHOD']." ".$_SERVER['REQUEST_URI']." ".$_SERVER['SERVER_PROTOCOL']." ".$_SERVER['HTTP_REFERER']." ".$_SERVER['HTTP_USER_AGENT']."\n"); + fclose($fp); + } + ?> + + diff --git a/public/img/pixel.gif b/public/img/pixel.gif new file mode 100644 index 0000000000000000000000000000000000000000..670932d93619273e6d6bcc3e7913464811e1bd5c GIT binary patch literal 64 zcmZ?wbhEHbWMp7uXkcUjg8%>jEB+I7E=o--Nlj5G&n(GMaQE~LU{L(Y!pH?wr2|p~ NQqI7{{{ $comment['total'] }} 件のコメント
@if ($isvideo !== 'n') -
+ @csrf @if ($user == new stdClass()) +
名前
@@ -36,7 +37,7 @@
- +
diff --git a/resources/views/theme/techsuwa/site.blade.php b/resources/views/theme/techsuwa/site.blade.php index 05ab0d3..605b209 100644 --- a/resources/views/theme/techsuwa/site.blade.php +++ b/resources/views/theme/techsuwa/site.blade.php @@ -1,4 +1,7 @@ - + @@ -15,9 +18,6 @@ @include('theme.'.env('THEME').'.component.colors') - @include('theme.'.env('THEME').'.component.navbar')
@@ -29,6 +29,11 @@ @include('theme.'.env('THEME').'.component.usermenu')
+ @include('theme.'.env('THEME').'.component.contentedit') @yield('content')
@@ -41,5 +46,8 @@ +