2022/07/03
2022/06/30
今天為了裝一台只有 8G hdd 的机器
找了好久的os
發現現在能裝的os 好少
最後找到 q4os
安裝直接選 自動 裝到好
再來就是處理中文的問題
使用以下指令 把繁中裝上去
$ addlanguage
接下來是輸入法
使用fcitx
apt install fcitx fcitx-table-scj6 fcitx-chewing
之後在config把輸入法選進去
裝好 firefox chrome 目前使用不到 7G
碰到一個問題
如果先啟動 mplayer -ontop 再啟動 chrome 全螢幕 mplayer 會被蓋掉 所以啟動順序只能交換
另外下方的工作列要設為自動隱藏
如果要開几啟動 要把 shell 放在 /home/adminq/.trinity/Autostart/ 這個目錄下
在shell裡的每行指令最後要加上 &
才能依順執行所有指令
範例
#!/bin/bash
google-chrome --kiosk &
mplayer 1.mp4 &
https://q4os.org/index.html
https://www.q4os.org/dqa007.html#inter
2022/06/29
2022/06/28
先簡單記一下zeek file extraction
zkg install zeek/hosom/file-extraction
# you must separately load the package for it to actually do anything
zkg load zeek/hosom/file-extraction
mkdir /opt/extract_files
vi /opt/zeek/share/zeek/base/files/extract/main.zeek
#const prefix = "./extract_files/" &redef;
const prefix = "/opt/extract_files/" &redef;
vi /opt/zeek/share/zeek/site/local.zeek
加上
@load /opt/zeek/share/zeek/policy/frameworks/files/extract-all-files.zeek
root@zeek:~# /opt/zeek/bin/zeekctl
Warning: zeekctl node config has changed (run the zeekctl “deploy” command)
Welcome to ZeekControl 2.2.0
Type “help” for help.
[ZeekControl] > start
starting zeek …
creating crash report for previously crashed nodes: zeek
[ZeekControl] > deploy
[ZeekControl] >quit
https://chanfs.medium.com/file-extraction-with-zeek-2c1a0bb1aa98
https://github.com/hosom/file-extraction
https://www.ericooi.com/zeekurity-zen-part-vi-zeek-file-analysis-framework/
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