這是 4.19 版才加入的安全性保護功能
protected_regular: This protection is similar to protected_fifos,
but it avoids writes to an attacker-controlled regular file,
where a program expected to create one.
When set to "0", writing to regular files is unrestricted.
When set to "1" don't allow O_CREAT open on regular files that we don't own in world writable sticky directories,
unless they are owned by the owner of the directory.
When set to "2" it also applies to group writable sticky directories.
RedHat 9 系的 Linux protected_regular 預設是 1
常見的目錄是 /tmp 及 /dev/shm
當目錄下面檔案 file owner 是 A,檔案權限是 -rw-rw-rw- (666) 當 B 去存取 file
有用到 O_CREAT 時,是不允許的,
但使用不同編輯器,編輯檔案後存檔,卻有不同樣的結果,
vim 編輯後可以寫入,nano 及 joe 都不能寫入,猜測跟檔案處理方式有關,vim 可能沒有調用 O_CREAT,所以可以寫入
Shell 的處理方式,例如以下動作也是可以,也就是沒有調用 O_CREAT
echo hello > file
echo world >> file
RedHat 要改這個預設值,是改這個檔
/usr/lib/sysctl.d/50-default.conf
訂閱:
張貼留言 (Atom)
Chromecast CLI Tools
catt go-chromecast 這兩套功能類似,可以投放到 Chromecast 的設備,各有優缺點 catt 可以指定 YouTube 網址,也可以指定本機或網路直連的網址 (例如 http://192.168.1.100/foo.mp3),參數較少 catt 在 You...
-
禁止 LINE 電腦版自動或強制更新的方法 LINE 電腦版啟動都會去連這個更新資訊檔 https://desktop.line-scdn.net/win/v1/real/update_info.json 內容大概長這樣 可以看出針對各版本的更新 type 有 force, ...
-
需先安裝 XZ Utils for Windows 把 xz.exe 放在 PATH 有指到的地方 curl -LOs https://github.com/rocky-linux/sig-cloud-instance-images/raw/Rocky-9.2.20230513...
-
RustDesk 使用上跟 Anydesk, Teamviewer 差不多,也是用 ID + Password 就可以連線 其優點是開源,可以自架 ID/Relay Server 在 Client 裝好的情況下,直接是可以使用的,預設應該是使用 RustDesk 的公共 Ser...
-
xrdp 是 Linux 版的 RDP server (遠端桌面) 它運作時需要 Xvnc 的 libvnc.so, 所以安裝時需要連同 VNC 一起安裝(只需 minimal) dnf -y install xrdp tigervnc-server-minimal system...
-
SQL injection 是個老東西,但 20 幾年過去,它依然健在! 在所有 Web 攻擊,弱點佔比仍然是最高的 NEITHNET 精選講座-資安教室:SQL injection - CYBERSEC 2021 臺灣資安大會 NEITHNET_SQL_injection.pp...
-
本例是從 8.0U3 升到 8.0U3d,若從更舊的版本升級,不確定是否適用 先把所有 VM 關機,進入維護模式 把 depot 升級檔 VMware-ESXi-8.0U3d-24585383-depot.zip 放到機器內 ssh ESXi 先查看 depot 有那些 Prof...
-
現在自架的 Mail Server 若沒有簽章,寄出的信件有很大的機會被擋或歸類在垃圾信 所以 SPF + DKIM 已經是必要的設定 環境 CentOS + Postfix,文中的域名均以 yourdomain.com 作為範例 安裝所需套件 yum -y install py...
-
RouterOS 在 7 版以後支援 WireGuard 註: WireGuard 在 Linux Kernel 5.6 版開始內建 設定滿簡單的,在選單 WireGuard New Interface,Private Key 及 Public Key 不用填,會自動產生 在 I...
-
Bracketed Paste Mode 是 Terminal 為了區分手動輸入及剪貼簿貼上的一種模式, 啟用此模式,貼上的文字區塊會被起始控制碼 ESC [ 200 ~ 及結束控制碼 ESC [ 201 ~ 包住 例如在編輯器貼上一段已經排版好的程式碼,若沒有啟用 Brack...
-
Google 意見回饋獎勵 是一個填問券賺 Google Play 回饋金的 APP, 問券問題都不多,有的甚至只有一題,基本的回饋是 4 元台幣,有的問券會回饋比較多 其問券是不定期出現的,一星期也許只有一兩則 Android 及 iOS 都有這個 APP
沒有留言:
張貼留言