2022/06/27
2022/06/25
2022/06/22
/dev/urandom 取得隨几數
随机转换为md5(20位):
head /dev/urandom | md5sum | head -c 20
随机纯数字(20位):
head /dev/urandom | tr -dc 0-9 | head -c 20
随机小写字母+数字(20位):
head /dev/urandom | tr -dc a-z0-9 | head -c 20
随机大小写字母+数字(20位):
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 20
https://piaohua.github.io/post/linux/20200825-linux-dev-urandom/
2022/06/15
之前碰到 almalinux 9 在 lxc 無法開几的問題
有人提供解法了
root@nte-proxmox-1:~# pct enter 106
[root@alma9test ~]# cat /etc/redhat-release
AlmaLinux release 9.0 (Emerald Puma)
[root@alma9test ~]# systemctl stop systemd-firstboot
[root@alma9test ~]# exit
https://forum.proxmox.com/threads/lxc-almalinux-9-issue.110348/
2022/06/07
2022/06/05
SQL Injection
Username: admin' --
Password: 123
Actual Query: SELECT * FROM users WHERE username='admin' -- AND password='123'
Username: admin' union select * from users where '1
Password: 123
Actual Query: SELECT * FROM users WHERE username='admin' union select * from users where '1' AND password='123'
Username: admin';
Password: 123
Actual Query: SELECT * FROM users WHERE username='admin';' AND password='123'
Username: ad'||'min';
Password: 123
Actual Query: SELECT * FROM users WHERE username='ad'||'min';' AND password='123'
https://github.com/onealmond/hacking-lab/blob/master/picoctf-2020/web-gauntlet/writeup.md
2022/05/26
2022/05/21
2022/05/17
2022/05/13
由於 proxmox 几器愈來愈多
所以使用dsh 來處理升級問題
其他几器暫不考慮
因為還要使用key認証 而且os也有不同
流程如下
先建立群組檔
vi ~/.dsh/group/temp
10.0.0.1
10.0.0.2
10.0.0.3
建立好後指令如下
dsh -g temp -M -r ssh -- df -h
如果要下多個指令 要使用單引號 而且指令用 ; 隔開
dsh -g temp -M -r ssh -- 'df-h;ls;date'
https://blog.csdn.net/dcj3sjt126com/article/details/84691641
2022/05/11
2022/05/09
今天要disable ubuntu 18.04 的ipv6的時候
在 /etc/sysctl.conf 加入以下三行
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6 = 1
sysctl -p 是有作用的 可是重開就不行了
有人說是bug
只好換一種方法
修改 /etc/default/grub
GRUB_CMDLINE_LINUX="ipv6.disable=1"
再update grub
sudo update-grub
重開就ok了
https://linuxconfig.org/how-to-disable-ipv6-address-on-ubuntu-18-04-bionic-beaver-linux
2022/04/29
2022/04/18
昨天是舊憑証的到期日
所以今天要撈出那些ip已經上了新憑証
把封包導入解密
使用 nmap 查找憑証指令如下
#!/bin/bash
for i in {1..250}
do
echo $i
nmap -Pn --script ssl-cert -p 443 10.0.0.$i -oN ca_$i
done
若把執行結果餵到變數 注意以下不同
r=`nmap --script ssl-cert -p 443 10.0.0.$i|grep -E 'TWCA|after'`
echo $r > ca_$i #導出結果無換行
echo "$r" > ca_$i #導出結果有換行
使用 curl 程式如下
#!/bin/bash
for i in {1..250}
do
echo $i
curl -m 3 https://10.0.0.$i -k -v -s -o /dev/null 2> /tmp/ca/ca_$i
done
接下來再針對關鍵字及有無過期查找即可
2022/04/11
今天有朋友問greenbone的問題
到官網看了一下
名字又改了
改成 Greenbone Enterprise TRIAL
不過下載時看到的檔案還是GSM
只是比之前用的版本又更新了
順便記錄一下怎麼匯入 proxmox
ova下載回來後先解開
tar xvf GSM-TRIAL-21.04.15-VirtualBox.ova
https://www.greenbone.net/en/testnow/