近期從外部透過郵件系統 IMAP、POP3 和 SMTP 等開放 port 在 try 內部帳號郵件密碼的情形越來越頻繁,雖然郵件系統有一定的機制可以阻擋,But seeing so many IPs in the report is really uncomfortable,So I started collecting these IPs intending to import them all into the Sonicwall firewall,Directly set them as a blacklist,After searching online for many articles,Sonicwall does not provide a relevant way to do this,Therefore, if you want to create these massive IPs into Address Objects,Using SSH would be the most time-saving method。
##########################
# Sonicwall
# 型號:NSA 4600
# 韌體:6.2.7.1
# SSH 工具:PieTTY 或 Tera Term
##########################
1. 首先透過 excel 和 wxMEdit 將 IP 整理成如下格式:
address-object ipv4 Wan-Hack-1.1.1.1 host 1.1.1.1 zone WAN address-object ipv4 Wan-Hack-2.2.2.2 host 2.2.2.2 zone WAN # 其中 Wan-Hack-1.1.1.1 欄位,可以透過 Excel 函式去抓後面的欄位 # 如 ="Wan-Hack-"&LEFT(E1,15) # E1 為 1.1.1.1 所在的欄位。
2. 再來透過 PieTTY 或 Tera Term 連上 Sonicwall ,如果先前沒有打開 SSH 連線,可以到 Network 底下的 Interface 去設定開啟。

3. 登录后,Enter”config”進入設定模式。

4. 接著將整理好格式的 IP 清單,貼到 PieTTY,這邊要注意一下,如果整理的清單有上千筆,建議分批貼上,一次最多不要超過 400 筆,每貼上 400 筆就執行”commit”存檔,再進行下一個 400 筆,依此類推,如果一次貼 500 筆以上,可能會出現錯誤的情形。

5. 完成之後,就可以在 Address Objects 看到剛剛匯入的 IP 位址。

【参考资料】








留下回复