May 2015 Archives

Linux Enable Autofsck

user-pic
Vote 0 Votes

echo AUTOFSCK_TIMEOUT=5 > /etc/sysconfig/autofsck
echo AUTOFSCK_DEF_CHECK=yes >> /etc/sysconfig/autofsck

當 Linux Partition 有問題時會停在 Single Mode, 有新增這些參數當有問題會自動 fsck
另一個參數是 forcefsck, 只要 /forcefsck 檔存在, 便會強制單次執行 fsck
(也就是說 touch /forcefsck 下次重開機便會 fsck)
autofsck 及 forcefsck 均是在 /etc/rc.d/rc.sysinit 中判斷執行

Wireshark 有兩種 Filters, Capture Filters and Display Filters
Capture Filters 在抓封包時就進行過濾, 使存下來的封包量不會太多,
通常用在流量大的環境下(每秒幾百Mbps甚至幾Gbps),只抓我們要的封包
Display Filters 是顯示過濾, 這個比較常用, 封包量不是很大通常是全抓再來用 Display Filters 看
Capture Filters 跟 Display Filters 的語法是不太一樣的,
Capture Filters 語法跟 tcpdump 相同 (man tcpdump),
Display Filters 語法是 Wireshark 自己的語法 (man wireshark-filter)

以幾個常用範例說明兩種 Filters 的差別

表示法相同的範例
只抓 ARP 封包
Capture Filter: arp
Display Filter: arp

只抓 IP 封包
Capture Filter: ip
Display Filter: ip

只抓 TCP 封包
Capture Filter: tcp
Display Filter: tcp

只抓 UDP 封包
Capture Filter: udp
Display Filter: udp

只抓 ICMP 封包
Capture Filter: icmp
Display Filter: icmp

表示法不同的範例
特定 IP 的封包
Capture Filter: host 192.168.1.1
Display Filter: ip.addr==192.168.1.1

特定網段的封包
Capture Filter: net 192.168.0.0/24
Display Filter: ip.addr==192.168.0.0/24

TCP Port 80 封包
Capture Filter: tcp port 80
Display Filter: tcp.port==80

UDP Port 53 封包
Capture Filter: tcp port 80
Display Filter: udp.port==80

Destination TCP Port 25 封包
Capture Filter: tcp dst port 25
Display Filter: tcp.dstport==25

Logical expressions 邏輯表示
Capture Filter: and, or, not
Display Filter: and, &&, or, ||, not, !

Comparison operators 比較運算
Capture Filter: ==, !=, >, <, >=, <=
Display Filter: eq, ==, ne, !=, gt, >, lt, <, ge, >=, le, <=

特定主機及 Port 80
Capture Filter: host 192.168.1.1 and port 80
Display Filter: ip.addr==192.168.1.1&&tcp.port==80

Display Filters 有更大的彈性, 可以拆解封包用更祥細的條件過濾
例如只顯示 HTTP POST 封包
http.request.method == "POST"
祥細的欄位資料, 可參考 Wireshark - Display Filter Reference

Netis Routers Leave Wide Open Backdoor
這是去年的新聞了, Netis/Netcore 中國製的分享器有後門, Listen UDP 53413 Port
只要送固定的密碼到這個 Port, 就可以登入, 進而下任何指令, 而且是 root 權限
隨便掃一下, 網路上還不少有後門的設備, 試了一下真的可以下任何指令, 我想很多都已成為駭客的免費跳板或 botnet

若您有這家廠商的設備, 快檢查一下
nc -u {IP} 53413
按 Enter 若有出現 Login: 表示有後門
Windows 版的 nc 可以在 這裡 取得
這個工具也可以檢查 Netcore/Netis Backdoor Checker

無後門會顯示 No backdoor detected

有後門會顯示 ALERT: Backdoor detected

後續 Netcore 有 Patch 的版本, 但只是把後門不啟動, 後門仍是在裡面
ref. Netis Router Backdoor "Patched" But Not Really

About this Archive

This page is an archive of entries from May 2015 listed from newest to oldest.

April 2015 is the previous archive.

June 2015 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives