歡迎您光臨本站 註冊首頁

Solaris針對安全的網路設置

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  作者:deepin (deepin@nsfocus.com)
主頁:http://www.nsfocus.com

沒有前言,讓我們直接開始。

一.Solaris ndd命令
Ndd命令能容易的在不重新配置系統內核和重起系統的情況下,修改核心和TCP/IP的設備的一些參數。使用如下命令可看到相應的幫助。

[root@ /]> ndd /dev/arp \?
? (read only)
arp_cache_report (read only)
arp_debug (read and write)
arp_cleanup_interval (read and write)
[root@ /]> ndd /dev/icmp \?
? (read only)
icmp_wroff_extra (read and write)
icmp_def_ttl (read and write)
icmp_bsd_compat (read and write)
icmp_xmit_hiwat (read and write)
icmp_xmit_lowat (read and write)
icmp_recv_hiwat (read and write)
icmp_max_buf (read and write)
icmp_status (read only)
[root@ /]> ndd /dev/ip \?
? (read only)
ip_forwarding (read and write)
ip_respond_to_address_mask_broadcast(read and write)
ip_respond_to_echo_broadcast (read and write)
ip_respond_to_timestamp (read and write)
ip_respond_to_timestamp_broadcast(read and write)
ip_send_redirects (read and write)
ip_forward_directed_broadcasts(read and write)
ip_debug (read and write)
ip_mrtdebug (read and write)
ip_ire_cleanup_interval (read and write)
ip_ire_flush_interval (read and write)
ip_ire_redirect_interval (read and write)
ip_def_ttl (read and write)
ip_forward_src_routed (read and write)
ip_wroff_extra (read and write)
ip_ire_pathmtu_interval (read and write)
ip_icmp_return_data_bytes (read and write)
ip_send_source_quench (read and write)
ip_path_mtu_discovery (read and write)
ip_ignore_delete_time (read and write)
ip_ignore_redirect (read and write)
ip_output_queue (read and write)
ip_broadcast_ttl (read and write)
ip_icmp_err_interval (read and write)
ip_reass_queue_bytes (read and write)
ip_strict_dst_multihoming (read and write)
ip_addrs_per_if (read and write)
ip_ill_status (read only)
ip_ipif_status (read only)
ip_ire_status (read only)
ip_ipc_status (read only)
ip_rput_pullups (read and write)
ip_enable_group_ifs (read and write)
[root@ /]> ndd /dev/tcp \?
? (read only)
tcp_close_wait_interval (read and write)
tcp_conn_req_max_q (read and write)
tcp_conn_req_max_q0 (read and write)
tcp_conn_req_min (read and write)
tcp_conn_grace_period (read and write)
tcp_cwnd_max (read and write)
tcp_debug (read and write)
tcp_smallest_nonpriv_port (read and write)
tcp_ip_abort_cinterval (read and write)
tcp_ip_abort_linterval (read and write)
tcp_ip_abort_interval (read and write)
tcp_ip_notify_cinterval (read and write)
tcp_ip_notify_interval (read and write)
tcp_ip_ttl (read and write)
tcp_keepalive_interval (read and write)
tcp_maxpsz_multiplier (read and write)
tcp_mss_def (read and write)
tcp_mss_max (read and write)
tcp_mss_min (read and write)
tcp_naglim_def (read and write)
tcp_rexmit_interval_initial (read and write)
tcp_rexmit_interval_max (read and write)
tcp_rexmit_interval_min (read and write)
tcp_wroff_xtra (read and write)
tcp_deferred_ack_interval (read and write)
tcp_snd_lowat_fraction (read and write)
tcp_sth_rcv_hiwat (read and write)
tcp_sth_rcv_lowat (read and write)
tcp_dupack_fast_retransmit (read and write)
tcp_ignore_path_mtu (read and write)
tcp_rcv_push_wait (read and write)
tcp_smallest_anon_port (read and write)
tcp_largest_anon_port (read and write)
tcp_xmit_hiwat (read and write)
tcp_xmit_lowat (read and write)
tcp_recv_hiwat (read and write)
tcp_recv_hiwat_minmss (read and write)
tcp_fin_wait_2_flush_interval (read and write)
tcp_co_min (read and write)
tcp_max_buf (read and write)
tcp_zero_win_probesize (read and write)
tcp_strong_iss (read and write)
tcp_rtt_updates (read and write)
tcp_wscale_always (read and write)
tcp_tstamp_always (read and write)
tcp_tstamp_if_wscale (read and write)
tcp_rexmit_interval_extra (read and write)
tcp_deferred_acks_max (read and write)
tcp_slow_start_after_idle (read and write)
tcp_slow_start_initial (read and write)
tcp_co_timer_interval (read and write)
tcp_extra_priv_ports (read only)
tcp_extra_priv_ports_add (write only)
tcp_extra_priv_ports_del (write only)
tcp_status (read only)
tcp_bind_hash (read only)
tcp_listen_hash (read only)
tcp_conn_hash (read only)
tcp_queue_hash (read only)
tcp_host_param (read and write)
tcp_1948_phrase (write only)

顯示當前值
#ndd /dev/arp arp_debug
0
0:代表特性禁止
ndd ?set /dev/arp arp_debug 1
1:允許

由於這些參數一般是經過優化過的,而且一旦改變失誤,可能導致系統的不正常工作。所以sun不提供文檔供人隨意調節。

二.ARP
有關ARP協議的細節,請自己參閱相關文檔。對於sun的系統,核心默認的ARP表過期的時間是5分鐘,並且可以調節.另外一張表是ip層的路由表,它和arp表配合記錄動態路由信息,20分鐘過期,最後一個特性是」無償ARP」 ,即系統廣播自己的硬體地址。這個特性用來診斷是否存在相同的硬體地址,另外也用來生成硬體地址的變動通知。
1、ARP攻擊
針對ARP的攻擊主要有兩種,一種是DOS,一種是Spoof。
ARP欺騙往往應用於一個內部網路,我們可以用它來擴大一個已經存在的網路安全漏洞。
如果你可以入侵一個子網內的機器,其它的機器安全也將受到ARP欺騙的威脅。同樣,利用APR的DOS甚至能使整個子網癱瘓。

2、對ARP攻擊的防護
防止ARP攻擊是比較困難的,修改協議也是不大可能。但是有一些工作是可以提高本地網路的安全性。
首先,你要知道,如果一個錯誤的記錄被插入ARP或者IP route表,可以用兩種方式來刪除。
a. 使用arp ?d host_entry
b. 自動過期,由系統刪除

這樣,可以採用以下的一些方法:
1). 減少過期時間
#ndd ?set /dev/arp arp_cleanup_interval 60000
#ndd -set /dev/ip ip_ire_flush_interval 60000
60000=60000毫秒 默認是300000
加快過期時間,並不能避免攻擊,但是使得攻擊更加困難,帶來的影響是在網路中會大量的出現ARP請求和回復,請不要在繁忙的網路上使用。
2). 建立靜態ARP表
這是一種很有效的方法,而且對系統影響不大。缺點是破壞了動態ARP協議。可以建立如下的文件。
test.nsfocus.com 08:00:20:ba:a1:f2
user. nsfocus.com 08:00:20:ee:de:1f
使用arp ?f filename載入進去,這樣的ARP映射將不會過期和被新的ARP數據刷新,除非使用arp ?d才能刪除。但是一旦合法主機的網卡硬體地址改變,就必須手工刷新這個arp文件。這個方法,不適合於經常變動的網路環境。
3).禁止ARP
可以通過ifconfig interface ?arp 完全禁止ARP,這樣,網卡不會發送ARP和接受ARP包。但是使用前提是使用靜態的ARP表,如果不在apr表中的計算機 ,將不能通信。這個方法不適用與大多數網路環境,因為這增加了網路管理的成本。但是對小規模的安全網路來說,還是有效和可行的。

3、IP
IP是用來傳輸數據的底層協議。

4、IP Forwarding (IP轉發) :
IP 轉發是在不同網卡之間路由包數據的過程。一般是用路由器來實現,但是擁有多網路介面的主機也可以實現。當有兩個網路介面的時候,Solairs系統默認打開ip轉發。

關閉IP轉發
對於多宿主主機,存在可能的安全問題是,攻擊者可能通過ip轉發的方式訪問到私有網路。在solaisr系統中,包轉發能很的容易關閉。簡單的生成一個文件 /etc/notrouter,就能在下次啟動的時候關閉ip轉發。
另外通過ndd命令也能在系統運行的時候關閉ip轉發。
#ndd ?set /dev/ip ip_forwarding 0

嚴格限定多主宿主機
如果是多宿主機,還可以加上更嚴格的限定防止ip spoof的攻擊
#ndd ?set /dev/ip ip_strict_dst_multihoning 1
默認是關閉的(值為0)

轉發包廣播
由於在轉髮狀態下默認是允許的,為了防止被用來實施smurf攻擊,關閉這一特性。 (參見cert-98.01)
#ndd ?set /dev/ip ip-forward_directed_broadcasts 0

5、路由
路由的過程就是檢查路由信息,從而決定如何從哪個介面傳輸數據包的過程。即使一個桌面系統,也要有路由設置。路由表需要實時的升級。現在有多種路由協議可以用來路由數據。Solaris系統使用in.routed守護程序支持RIP version 1,使用in.rdisc守護進程支持ICMP路由更新。當solairs系統配置成為一個路由設備來轉發數據包的時候,它通過上面的兩種方式動態更新路由信息。

6、攻擊
有多種方法能威脅動態路由協議。攻擊者能偽造虛假的路由更新信息發送過來,從而達到DOS的效果;同樣的方法,還能使數據報文轉發到其他的網路上,使攻擊者能監聽數據。
默認的solairs系統使用系統守護程序動態管理路由信息。靜態路由很好的防止路由信息被遠程動態改變。使用/etc/defaultrouter來設置本地子網的路由。使用route命令來設置其他路由信息。
但是對於一個簡單網路來說,使用靜態路由是合適的,一旦網路中有較多的路由設備,必須使用動態路由。Solairs系統將來也會繼續支持動態路由協議。

轉發源路由包。
源路由包中包含了了指定數據如何路由的信息。因此攻擊者可能使用源路由包繞過某些特定的路由器和防火牆設備,也可能用來避開一個已知的IDS系統的監控範圍。在大多數solairs的應用系統上,是不需要這個特性的。由於solairs在打開ip轉發以後默認支持源路由轉發,所以我們必須手動關閉它
#ndd ?set /dev/ip ip_forward_src_routed 0

7、ICMP
ICMP:網路控制信息協議。下面討論在IP驅動上配置solaris的ICMP特性。

8、廣播:
ICMP廣播經常會帶來麻煩,這裡有一條原則來防止廣播風暴-控制ICMP的錯誤信息不被生成。為來防止攻擊者利用ICMP實施DOS攻擊,最好禁止本地網路對ICMP廣播的響應。Solairs系統能調節三種ICMP廣播的參數。

響應Echo廣播:
Echo廣播通常用來診斷網路主機的存活情況,一旦主機收到一個對廣播地址的echo請求,默認情況下所有系統會回復這個廣播要求。當有人惡意定製過量的echo包,系統中的流量將大為增加。因此我們可以關閉對echo廣播的響應
#ndd ?set /dev/ip ip_respond_to_echo_boadcast 0

響應時間戳廣播
時間戳通常用來同步兩個不同系統的時鐘,但是系統沒有必要回復對廣播地址發送的時間戳請求,所以我們可以關閉這種回應。
#ndd ?set /dev/ip ip_respond_to_timestamp_broadcast 0

地址掩碼廣播
地址掩碼請求被用來確定本地掩碼,通常是網路中無盤工作站在啟動的時候發送。用下面的命令能禁止對這樣請求的應答
#ndd ?set /dev/ip ip_respind_to_address_mask_broadcast 0


9、重定向錯誤
重定向錯誤:通常是路由器用來通知主機使用另一個路由器來傳輸數據的指示報文。報文重指定的路由器必須和發送路由器一樣連接同一個子網,而收到報文的主機必須在自己的路由表裡新增一條到那個子網的路由。不像ARP的包,這個路由不會過期也不會自動刪除。很多系統檢測這樣的報文用來發現錯誤和潛在的問題,從而優先更改自己的路由表。

接受重定向錯誤
一個攻擊者能偽造重定向錯誤的報文從而給目標主機裝載一個新的路由,而這個路由也許更本就是錯誤的,這樣主機就不會和一些特定的主機或網路通信,這是一種DOS攻擊。雖然重定向報文本身有一些校驗規則,但是這些規則能很容易的被欺騙。而且目前存在大量的工具來達到這個目的。大多數只有一條默認路由主機系統是不需要理會這種報文的,因此我們可以使用ndd命令忽略ICMP重定向錯誤報文。(solairs默認是不忽略的)
#ndd ?set /dev/ip ip_ignore_redirect 1

發送重定向錯誤報文
只有路由器才需要重定向錯誤,任何主機即使是多宿主主機也不需要發送這種報文,因此我們可以使用ndd來禁止本機發送錯誤重定向報文。
Ndd ?set /dev/ip ip_send_redirects 0

時間戳響應
就像前面提到的,時間戳廣播報文在大多數環境下是不需要的。而solaris系統還能夠完全不接受這種報文。
#ndd ?set /dev/ip ip_respond_to_timestamp 0
關閉這個特性以後,有些使用rdate系統命令的unix主機將不能再同步時鐘。但是solaris 2.6和7使用更好的時鐘同步方式-NTP(網路時間協議),請參見xntpd的幫助。

10、TCP
TCP:傳輸控制協議

11、SYN_flood攻擊
TCP-SYN flood又稱半開式連接攻擊,每當我們進行一次標準的TCP連接(如WWW瀏覽,下載文件等)會有一個一個三次握手的過程,首先是請求方向服務方發送一個SYN消息,服務方收到SYN后,會向請求方回送一個SYN-ACK表示確認,當請求方收到SYN-ACK后則再次向服務方發送一個ACK消息,一次成功的TCP連接由此就建立,可以進行後續工作了,如圖所示:
請求方 服務方
---------------------> SYN
SYN-ACK <----------------
----------------------> ACK

  而TCP-SYN flood在它的實現過程中只有前兩個步驟,當服務方收到請求方的SYN並回送SYN-ACK確認消息后, 請求方由於採用源地址欺騙等手段,致使服務方得不到ACK回應,這樣,服務方會在一定時間處於等待接收請求方ACK消息的狀態,一台伺服器可用的TCP連接是有限的,如果惡意攻擊方快速連續的發送此類連接請求,則伺服器可用TCP連接隊列很快將會阻塞,系統可用資源,網路可用帶寬急劇下降,無法向用戶提供正常的網路服務。
對於solaris 2.5.1,只有安裝了patch 103582-1(或以上)才能防止syn_flood.在synflood沒有流行以前,連接隊列和backlog隊列是相同的,solairs 2.6/7和安裝了patch以後的2.5.1系統,現在存在兩條隊列,一個是已連接的隊列,一條是未連接完成的隊列。SYN攻擊時只能填充后一條隊列,而且,一旦隊列滿,將隨機丟棄老的syn包。系統還會監控這個隊列被短時間填充的情況,一旦懷疑是syn_flood,將在系統的messages中記錄下來。

Mar 8 19:24:01 example unix: WARNING: High TCP connect timeout rate! System (port 80) may be under a SYN flood attack!
新隊列的大小也是可以調節的,繁忙的web伺服器需要提高未連接隊列的大小。默認的大小是1024,我們可以提高到4096。
ndd ?set /dev/tcp tcp_conn_req_max_q0 4096
當然,一般情況下,核心的隊列增大,系統的內存最好也應有相應的增加。

12、連接耗盡攻擊
和SYN flood攻擊不同,連接耗盡攻擊不太常見。因為這種攻擊必須使用真實IP,攻擊的目標是已連接隊列。許多系統有一個同時連接的上限,取決於核心參數和系統內存情況。作為通常的web伺服器,這個上限值很難達到,因為http的連接是典型的短時連接。但是一個攻擊者可能快速發送大量的連接請求,同時保持連接,這樣正常訪問者的連接就可能被伺服器拒絕。
我們可以通過優化系統核心和增加內存來緩解,但不是根本的方法。因為攻擊者可能同時調動多台機器同時攻擊。當然,我們可以在發現攻擊以後,在防火牆或路由器上拒絕這些IP來源的連接。
如果不通過網路設備,僅僅通過調節系統參數來緩解攻擊。一方面,可以調節web server,如apache的timeout參數,減短連接保持時間,另一方面,我們可以將核心以連接隊列參數增大(默認是128)。
#ndd ?set /dev/tcp tcp_conn_req_max_q 1024
以上的方法能阻止大多數連接耗盡的攻擊企圖,除非攻擊者調動更多的資源,發動大規模的DDOS,但這樣會使攻擊者更容易暴露。

13、IP 欺騙
IP欺騙基本原理:
TCP連接的建立 :為了利用TCP連接交換數據,主機間首先必須建立一個連接。TCP建立連接時可以分為3個 步驟,稱為三步握手法。如果主機A運行rlogin客戶程序,並且希望連接到主機B上的rlogin daemon 伺服器程序上,連接過程如圖二所示。

1 A ---SYN---> B
2 A <--syn>3 A ---ACK---> B
圖二

需要提醒讀者的是,主機A和B的TCP模塊分別使用自己的序列編號。在時刻1時,客戶端 通過設置標誌位SYN=1告訴伺服器它需要建立連接。同時,客戶端在其TCP頭中的序列號 域SEQ放置了它的初始序列號(ISN),並且告訴伺服器序列號標示域是有效的,應該 被檢查。在時刻2時,伺服器端在接收了上面的SYN后,作出的反應是將自己的ISN和對客 戶端的ACKA發向客戶端並且千知下一個期待獲得的數據序列號是(ISN+1)。客戶端在第一流時刻,對伺服器的ISN進行確認。這時,數據傳輸就可以進行了。ISN與序列號的遞增 了解序數編號如何選擇初始序列號和如何根據時間變化是很重要的。似乎應該有這種情 況,當主機啟動後序列編號初始化為1,但實際上並非如此。初始序列號是由tcp_init函 數確定的。ISN每秒增加工廠128000,如果有連接出現,每次連接將反計數器的數值增加 64000。很顯然,這使得用於表示ISN的32位計數器在沒有連接的情況下每9.32小時複位 一次。之所以這樣,是因為這樣有利於最大限度地減少舊有連接的信息干擾當前連接的 機會。這裡運用瞭望2MSL等待時間的概念(不在本文討論的範圍之內。)如果初始序列 號是隨意選擇的,那麼不能保證現有序列號是不同於先前的。假設有這樣一種情況,在 一個路由迴路中的數據包最終跳出了循環,回到了「舊有」的連接(此時其實是不同於 前者的現有連接(,顯然會發生對現有連接的干擾。 埠號 為了提供對TCP模塊的并行訪問,TCP提供了叫做埠的用戶介面。埠被操作系統內核 利用來標示不同的網路進程,也就是嚴格區分傳輸層入口的標示(就是說,IP不關心他 們的存在)。TCP埠與IP地址一起提供網路端到端的通信。事實上,在任何時刻任何I nternet連接都能由4個要素來措述:源IP地址、源地址埠號、目的IP地址和目的地址。採樣目標主機發出的TCP序列號,猜測出它的數據序列號。然後,偽裝成被信任的主機, 同時建立起與目標主機基於地址驗證的應用連接。如果成功,黑客可以使用一種簡單的命令放置一個系統後門,以進行非授權操作。
目前,RFC 1498定義了更好的隨機ISN生成方法,使得這種攻擊很難成功。對於solaris系統ISN生成有三種方式。
0: 可預測的ISN
1: 增強的ISN 隨機生成
2: RFC 1948描述的ISN生成方式
所有版本的solaris默認生成方式值是1。2.5.1隻有 0,1兩種方式,2.6/7擁有0,1,2三種ISN 生成方式。
我們可以修改/etc/default/inetinit文件來提高ISN的生成強度。
將 TCP_STRONG_ISS=1改為 TCP_STRONG_ISS=2
重起系統使他生效。對於solair 2.5.1,此方法無效。

14、增加私有埠
一般的情況下,1-1024埠被稱為私有埠,只允許具有根許可權的進程連接。但是有些大於1024的埠,即使需要這樣的限制,卻無法定義,如NFS的伺服器埠2049,當然還有一些其他定義的高於1024的私有埠。
在solairs2.5.1/2.6/7下使用如下方式,可以自定義最小的非私有埠
ndd ?set /dev/tcp tcp_smallest_nonpriv_port 2050
這樣以來,0-2049都被定義為私有埠。
在solaris 2.6/7下,還能使用另一個參數單獨指定私有埠。
#ndd /dev/tcp tcp_extra_priv_ports
2049
4045
用來顯示已經定義的擴展私有埠
#ndd ?set /dev/tcp tcp_extra_priv_ports_add 6112
來增加新的私有埠定義。
使用 ndd ?set /dev/tcp tcp_extra_priv_ports_del 來刪除定義。
要注意的是,不要隨便定義私有埠,因為有些非根許可權的進程會使用這些埠。特別是改變最小非私有埠這個參數,經常會引起問題。應仔細分析你的需求再用擴展私有埠定義的方式單獨增加。
15、附件:設置腳本,來源於sun公司
#!/sbin/sh
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
# $Id: nddconfig,v 1.2 1999/09/29 22:25:04 kaw Exp $
#
# Copy this script to /etc/init.d and name it 'nddconfig'. Create a
# hardlink to /etc/init.d/nddconfig in /etc/rc2.d named 'S70nddconfig'.
#
# Keith A. Watson
#
PATH=/usr/bin:/usr/sbin

#
# This file contain network related options settings. The settings
# included here are considered safe in terms of security. Some settings
# may not work in your environment. The comments provided for each
# explain what effect the setting has.
#
# A '0' indicates false/off.
# A '1' indicates true/on.
#

#
# arp_cleanup_interval
#
# This option determines the period of time the Address Resolution
# Protocol (ARP) cache maintains entries. ARP attacks may be effective
# with the default interval. Shortening the timeout interval should
# reduce the effectiveness of such an attack.
# The default value is 300000 milliseconds (5 minutes).
#
ARP_CLEANUP_INTERVAL=60000

#
# ip_forward_directed_broadcasts
#
# This option determines whether to forward broadcast packets directed
# to a specific net or subnet, if that net or subnet is directly
# connected to the machine. If the system is acting as a router, this
# option can be exploited to generate a great deal of broadcast network
# traffic. Turning this option off will help prevent broadcast traffic
# attacks.
# The default value is 1 (True).
#
IP_FORWARD_DIRECTED_BROADCASTS=0

#
# ip_forward_src_routed
#
# This option determines whether to forward packets that are source
# routed. These packets define the path the packet should take instead
# of allowing network routers to define the path.
# The default value is 1 (True).
#
IP_FORWARD_SRC_ROUTED=0

#
# ip_ignore_redirect
#
# This option determines whether to ignore Internet Control Message
# Protocol (ICMP) packets that define new routes. If the system is
# acting as a router, an attacker may send redirect messages to alter
# routing tables as part of sophisticated attack (man in the middle
# attack) or a simple denial of service.
# The default value is 0 (False).
#
IP_IGNORE_REDIRECT=1

#
# ip_ire_flush_interval
#
# This option determines the period of time at which a specific route
# will be kept, even if currently in use. ARP attacks may be effective
# with the default interval. Shortening the time interval may reduce
# the effectiveness of attacks.
# The default interval is 1200000 milliseconds (20 minutes).
#
IP_IRE_FLUSH_INTERVAL=60000

#
# ip_respond_to_address_mask_broadcast
#
# This options determines whether to respond to ICMP netmask requests
# which are typically sent by diskless clients when booting. An
# attacker may use the netmask information for determining network
# topology or the broadcast address for the subnet.
# The default value is 0 (False).
#
IP_RESPOND_TO_ADDRESS_MASK_BROADCAST=0

#
# ip_respond_to_echo_broadcast
#
# This option determines whether to respond to ICMP broadcast echo
# requests (ping). An attacker may try to create a denial of service
# attack on subnets by sending many broadcast echo requests to which all
# systems will respond. This also provides information on systems that
# are available on the network.
# The default value is 1 (True).
#
IP_RESPOND_TO_ECHO_BROADCAST=0

#
# ip_respond_to_timestamp
#
# This option determines whether to respond to ICMP timestamp requests
# which some systems use to discover the time on a remote system. An
# attacker may use the time information to schedule an attack at a
# period of time when the system may run a cron job (or other time-
# based event) or otherwise be busy. It may also be possible predict
# ID or sequence numbers that are based on the time of day for spoofing
# services.
# The default value is 1 (True).
#
IP_RESPOND_TO_TIMESTAMP=0

#
# ip_respond_to_timestamp_broadcast
#
# This option determines whether to respond to ICMP broadcast timestamp
# requests which are used to discover the time on all systems in the
# broadcast range. This option is dangerous for the same reasons as
# responding to a single timestamp request. Additionally, an attacker
# may try to create a denial of service attack by generating many
# broadcast timestamp requests.
# The default value is 1 (True).
#
IP_RESPOND_TO_TIMESTAMP_BROADCAST=0

#
# ip_send_redirects
#
# This option determines whether to send ICMP redirect messages which
# can introduce changes into remote system's routing table. It should
# only be used on systems that act as routers.
# The default value is 1 (True).
#
IP_SEND_REDIRECTS=0

#
# ip_strict_dst_multihoming
#
# This option determines whether to enable strict destination
# multihoming. If this is set to 1 and ip_forwarding is set to 0, then
# a packet sent to an interface from which it did not arrive will be
# dropped. This setting prevents an attacker from passing packets across
# a machine with multiple interfaces that is not acting a router.
# The default value is 0 (False).
#
IP_STRICT_DST_MULTIHOMING=1

#
# tcp_conn_req_max_q0
#
# This option determines the size of the queue containing half-open
# connections. This setting provides protection from SYN flood attacks.
# Solaris 2.6 and 7 (and 2.5.1 with patch 103582-12 and higher) include
# protection from these attacks. The queue size default is adequate for
# most systems but should be increased for busy Web servers.
# The default value is 1024.
#
TCP_CONN_REQ_MAX_Q0=4096

# Process the argument. 'stop' ignored.
case "$1" in
'start')

# set the appropriate network options
ndd -set /dev/arp arp_cleanup_interval \
$ARP_CLEANUP_INTERVAL
ndd -set /dev/ip ip_forward_directed_broadcasts \
$IP_FORWARD_DIRECTED_BROADCASTS
ndd -set /dev/ip ip_forward_src_routed \
$IP_FORWARD_SRC_ROUTED
ndd -set /dev/ip ip_ignore_redirect \
$IP_IGNORE_REDIRECT
ndd -set /dev/ip ip_ire_flush_interval \
$IP_IRE_FLUSH_INTERVAL
ndd -set /dev/ip ip_respond_to_address_mask_broadcast \
$IP_RESPOND_TO_ADDRESS_MASK_BROADCAST
ndd -set /dev/ip ip_respond_to_echo_broadcast \
$IP_RESPOND_TO_ECHO_BROADCAST
ndd -set /dev/ip ip_respond_to_timestamp \
$IP_RESPOND_TO_TIMESTAMP
ndd -set /dev/ip ip_respond_to_timestamp_broadcast \
$IP_RESPOND_TO_TIMESTAMP_BROADCAST
ndd -set /dev/ip ip_send_redirects \
$IP_SEND_REDIRECTS
ndd -set /dev/ip ip_strict_dst_multihoming \
$IP_STRICT_DST_MULTIHOMING
ndd -set /dev/tcp tcp_conn_req_max_q0 \
$TCP_CONN_REQ_MAX_Q0
;;

'stop')
;;

'show')
echo "Currently unimplemented."
;;

*)
echo "Usage: $0 { start | stop | show }"
exit 1
;;
esac

exit 0



參考資料
Sun Blueprints 1999
TITAN tools

中聯綠盟信息技術有限公司 http://www.nsfocus.com
deepin (deepin@nsfocus.com) 2000/9/28


[火星人 ] Solaris針對安全的網路設置已經有729次圍觀

http://coctec.com/docs/security/show-post-73047.html