国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Solaris > 正文

Solaris7 交流 -- 重新配置系統(tǒng)核心

2024-07-26 00:29:56
字體:
供稿:網(wǎng)友
Sun Microsystems公司于前不久發(fā)布了它的新一代的旗幟性軟件產(chǎn)品線:適用于SPARC  

和Intel兩種計算機的新的Solaris 7 軟件環(huán)境。Solaris 7產(chǎn)品系列包括基本的  

Solaris 7操作環(huán)境和3個模塊化軟件擴展版本(Solaris Easy access Server,Solaris   

EnterPRise Server,Solaris ISP Server)--每個擴展版本都在基本的Solaris 7操作  

環(huán)境上運行。新的產(chǎn)品線主要具有以下特點:  

1.    處理數(shù)據(jù)的能力大為增加,不僅數(shù)據(jù)量沒有什么限制,計算的復(fù)雜性也有突破,  

為新一級的應(yīng)用軟件敞開了大門。  

2.    大型機的能力,而價格只有大型機的幾分之一。  

3.    具有對PC機的完全互操作性,可使客戶連接和管理他們的Windows NT環(huán)境與  

Solaris環(huán)境一樣。  

4.    具有PC機簡易管理的新風(fēng)格,大大簡化了安裝與管理。  

不僅如此,該版本的Solaris還具有強大的軟件支持,其中包括了Sun Visual WorkShop   

C++ 5.0軟件和Sun Performance WorkShop Fortran 5.0軟件,并為C/C++和  

Fortran的開發(fā)商開發(fā)企業(yè)級應(yīng)用軟件提供了具有競爭性的優(yōu)勢。Solaris 7具有全新中  

文版本,中文版本不僅具有多種中文輸入方式、靈活地支持中文的輸出,同時方便地接  

收中文郵件和進行字體轉(zhuǎn)換彌補了過去Solaris在這方面的不足。Solaris 7與 Windows   

無縫連接,從而使用戶可以進行簡單明了的操作和管理。在Solaris 7中,Sun公司著重考  

慮了健壯和安全的問題,提供了一系列的現(xiàn)代化的安全機制,同時修補了安全漏洞和系統(tǒng)  

BUG,使得Solaris 7具有相當(dāng)可靠的安全性和健壯性,將用戶的風(fēng)險降到了最低的限度。   

綜上所述,Solaris 7是適用于企業(yè)網(wǎng)的操作系統(tǒng)。  

一、相關(guān)站點   

1.Solaris軟件免費下載站點:  

http://www.sunfreeware.com/  

2.solaris 咨詢站  

http://www.ibiblio.org/pub/packages/solaris/sparc/  

3.solaris中文手冊:  

http://docs.sun.com/ab2?Ab2Lang=zh&Ab2Enc=gb2312  

4.UNIX depot  

http://www.cise.ufl.edu/depot/  

5.solaris中心  

    http://www.solariscentral.org/  
   
二、重新配置系統(tǒng)核心   

舉例: Oracle 8 for solaris 2.6 安裝的安裝需要增加Shared Memory Segments;  

修改/etc/system文件,在文件后加上  

set shmsys:shminfo_shmmax=4294967295  

set shmsys:shminfo_shmmin=1  

set shmsys:shminfo_shmmni=100  

set shmsys:shminfo_shmseg=15  

set semsys:seminfo_semmns=200  

set semsys:seminfo_semmni=70  

set ulimit=3000000  

比如innd用的文件數(shù)目比較多,需要設(shè)置:  

set rlim_fd_max=4096  

set rlim_fd_cur=1024  

如何看系統(tǒng)默認(rèn)值;  

先看系統(tǒng)默認(rèn)值,超級用戶可以用-k參數(shù)來看核心的各個參數(shù),如果指定-w參數(shù),則可  

以  

adb - general-purpose debugger  

可以看現(xiàn)在的值是什么?  

/usr/bin/adb –kw   

physmem 1f8d9  

maxusers/D   

maxusers:  

maxusers: 504  

maxusers/W 200  

maxusers: 0x1f8 = 0x200  

   

(1)IO相關(guān)的設(shè)置   

最經(jīng)常需要改變的是文件描述符數(shù)因為SOCKET API處理INTERNET連接使用文件描述符,  

set rlim_fd_max = 8192  

set rlim_fd_cur = 4096  

Please, before you start, make a backup copy of your initial /etc/system.   

The backup should be located on your root filesystem. Thus, if some   

parameters fail, you can always supply the alternative, original system   

file on the boot prompt. The following shows two typically entered   

parameters:  

* these are the defaults of Solaris < 8 

set rlim_fd_max=1024 

set rlim_fd_cur=64 

rlim_fd_cur 

這個參數(shù)定義了一個進程可以打開文件描述符的“軟”限制,該數(shù)目由當(dāng)前運行的SHELL 

決定;ulimit –Sn,還可以通過setrlimit()函數(shù)來修改這個參數(shù);不需要超級用戶權(quán) 

限; 

The predicate rlim_fd_cur <= rlim_fd_max must be fulfilled. 

rlim_fd_max 

default 1024, recommended >=4096  

這個參數(shù)決定了一個進程可以打開文件描述符的“硬”限制;如果想改變該限制,必須  

有超級用戶的權(quán)限;  

對于大多數(shù)SERVER,不管使用TCP還是UDP進行通訊,最大描述符數(shù)是每個用戶進程的最  

重要的參數(shù);文件描述符決定了同時可以連接的數(shù)目;  

ulimit -Hn  

You should consider a value of at least 2 * tcp_conn_req_max and you   

should provide at least 2 * rlim_fd_cur. The predicate rlim_fd_cur <= 

rlim_fd_max must be fulfilled. 

(2)進程相關(guān)的設(shè)置 

maxusers 

default 249 ~= Megs RAM (Ultra-2/2 CPUs/256 MB), min 8, max 2048, no 

recommendations 

最大用戶定義系統(tǒng)可以支持的最大用戶數(shù),當(dāng)核心生成的過程中,有一些表的大小就是 

由這個參數(shù)決定的。這個值的大小在當(dāng)前SOALRIS版本中決定于內(nèi)存的兆數(shù)目;有一些參 

數(shù)是由MAXUSER來決定的, 

_ The maximum number of processes on the system 

_ The number of quota structures held in the system 

_ The size of the directory name lookup cache(DNLC) 

默認(rèn)值是系統(tǒng)內(nèi)存兆數(shù),小于2048; 

如果大于1024,必須在/etc/system中指定,如果大于4096,它的值為4096; 

當(dāng)系統(tǒng)出現(xiàn)用戶進程生成(FORK)緩慢時,系統(tǒng)報信息; 

out of processes 

默認(rèn)值比較大有以下情況: 

數(shù)據(jù)庫系統(tǒng)使用較大內(nèi)存,但相對少的進程,減少MAXUSERS的值,可以節(jié)省系統(tǒng)內(nèi)存; 

PIDMAX 

這個參數(shù)指定系統(tǒng)最大可能進程ID; 默認(rèn)值為30000,范圍為266到999999;只在啟動 

時候進行設(shè)置; 

max_nprocs 

系統(tǒng)最大進程數(shù),包含系統(tǒng)進程和用戶進程;默認(rèn)值為為10+(16*MAXUSERS) 

該值范圍為266到MAXPID; 

基于Intel i386體系結(jié)構(gòu)的linux操作系統(tǒng)中,已經(jīng)提供了這樣的多進程運行的支持。 

通過合理的選擇進程調(diào)度算法,可以獲得比較好的平均相應(yīng)時間和較高的系統(tǒng)性能。但 

是,美中不足的是,在目前的2.2.x版本的Linux內(nèi)核中,存在對最大進程數(shù)的限制。也 

就是說,在目前的Linux系統(tǒng)中,最多只能有4090個用戶進程同時存在。對于一般的桌面 

應(yīng)用,這個數(shù)目是綽綽有余。但是,對于企業(yè)級的服務(wù)器應(yīng)用來說,則是不夠的。 

設(shè)想一個典型的Web服務(wù)器軟件,它們一般都采用多進程/線程的結(jié)構(gòu)。每當(dāng)接到一個連 

接請求,就產(chǎn)生一個子進程/線程來處理。顯然,對于一個重負(fù)載的服務(wù)器來說,同時有 

成千上萬個連接是很常見的。而這時,采用kernel 2.2.x的系統(tǒng)就不能勝任了。因此, 

可以說正是因為存在這個最大進程數(shù)的限制,使得Linux不能勝任企業(yè)級服務(wù)器操作系統(tǒng) 

的工作。事實上,目前這個級別的操作系統(tǒng)一般都是較為成熟,并且沒有上述限制的 

Solaris、AIX、HP-UX等系統(tǒng)。 

maxuprc 

一個用戶可以生成的最大用戶進程數(shù); 

默認(rèn)值為MAX_NPROCS-RESERVED_PROCS 

STREAM 

nstrpush 

默認(rèn)值為9,這個參數(shù)定義了允許有多少個STREAM 模塊加載在系統(tǒng)核心中,我猜想這個 

參數(shù)是指相對于一個用戶或一個進程,通常不用修改該參數(shù); 

strmsgsz 

默認(rèn)值為 65536, 單個系統(tǒng)調(diào)用可以傳給一個STREAM設(shè)備信息的數(shù)據(jù)部分的最大字節(jié)數(shù) 

;任何write(2)超過這個大小限制會被分為多個信息; 

范圍為:0到262144 bytes 

當(dāng)出現(xiàn)putmsg(2)系統(tǒng)調(diào)用返回ERANGE時,需要修改該參數(shù); 

strctlsz 

默認(rèn)值為 65536, 單個系統(tǒng)調(diào)用可以傳給一個STREAM設(shè)備信息的控制部分的最大字節(jié)數(shù) 

;范圍:0-MAXINT BYTES; 

General Kernel Variables 

noexec_user_stack 

Warning: This option might crash some of your application software, and 

endanger your system's stability! 

By default, the Solaris 32 bit application stack memory areas are set 

with permissions to read, write and execute, as specified in the SPARC 

and Intel ABI. Though many hacks prefer to modify the program counter 

saved during a subroutine call, a program snippet in the stack area can 

be used to gain root access to a system. 

If the variable is set to a non-zero value, the stack defaults to read 

and write, but not executable permissions. Most programs, but not all, 

will function correctly, if the default stack permissions exclude 

executable rights. Attempts to execute code on the stack will kill the 

process with a SIGSEGV signal and log a message in kern:notice. Program 

which rely on an executable stack must use the mprotect(2) function to 

explicitly mark executable memory areas. 

Refer to the System Administration Guide for more information on this 

topic. Admins which don't want the report about executable stack can set 

the noexec_user_stack_log variable explicitly to 0. 

Also note that the 64 bit V9 ABI defaults to stacks without execute 

permissions. 

TCP/IP參數(shù)設(shè)置 

TCP/IP參數(shù)可以由ndd工具來設(shè)置, 

Ndd命令能容易的在不重新配置系統(tǒng)內(nèi)核和重起系統(tǒng)的情況下,修改核心和TCP/IP的設(shè)備 

的一些參數(shù)。使用如下命令可看到相應(yīng)的幫助。 

#ndd /dev/arp /? 

? (read only) 

arp_cache_report (read only) 

arp_debug (read and write) 

arp_cleanup_interval (read and write) 

# 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) 

#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) 

# ndd /dev/tcp /? 

? (read only) 

tcp_time_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命令語法為 

#ndd –set driver parameter 

顯示當(dāng)前值 

#ndd /dev/arp arp_debug 



0:代表特性禁止 

ndd –set /dev/arp arp_debug 1 

1:允許 

由于這些參數(shù)一般是經(jīng)過優(yōu)化過的,而且一旦改變失誤,可能導(dǎo)致系統(tǒng)的不正常工作。 

所以sun不提供文檔供人隨意調(diào)節(jié)。 

See ndd(1M) for more information; 

但是tcp_conn_hash_size和ipc_tcp_conn_hash_size這兩個參數(shù)只能在/etc/system中 

設(shè)置; 

如果想在系統(tǒng)啟動過程中修改TCP/IP參數(shù),需要將NDD命令加入啟動腳本中。使用下面的 

方法來創(chuàng)建一個包含NDD命令的啟動腳本; 

· 在/etc/init.d路徑下建立一個腳本,并在相應(yīng) 

/etc/rc2.d,/etc/rc1.d,/etc/rcs.d建立相應(yīng)的連接; 

· 這個腳本必須在S69inet和S72inetsvc腳本之間; 

· 該文件名的前綴為S70或S71。有同一前綴的腳本連續(xù)執(zhí)行,不會有什么問 

題; 

· 參閱/etc/init.d目錄下的README文件獲取更多的信息; 

  

tcp:tcp_conn_hash_size 

默認(rèn)值為 256,在忙的服務(wù)器建議增加; 

控制TCP模塊哈希表的大小 

$ ndd /dev/tcp tcp_conn_hash 

tcp_conn_hash_size = 256 

TCP dest snxt suna swnd rnxt rack rwnd 

rto mss w sw rw t recent [lport,fport] state 

251 f5bcf2a8 130.075.003.xxx 204a5e77 204a5e77 0000032120 e6255721 

e6255721 0000034752 

02000 01448 1 00 00 1 002a16c0 [22, 1022] TCP_ESTABLISHED 

The default size is printed when investigating the table. If you have a 

busy server, you might want to consider increasing the table's size. Mr. 

Storm reports that SUN increases the hash size up to 262144 for web 

server benchmarks. 

有關(guān)ARP協(xié)議的細(xì)節(jié),請自己參閱相關(guān)文檔。對于sun的系統(tǒng),核心默認(rèn)的ARP表過期的時 

間是5分鐘,并且可以調(diào)節(jié).另外一張表是ip層的路由表,它和arp表配合記錄動態(tài)路由信 

息,20分鐘過期,最后一個特性是”無償ARP” ,即系統(tǒng)廣播自己的硬件地址。這個特性 

用來診斷是否存在相同的硬件地址,另外也用來生成硬件地址的變動通知。 

1、ARP攻擊 

針對ARP的攻擊主要有兩種,一種是DOS,一種是Spoof。 

ARP欺騙往往應(yīng)用于一個內(nèi)部網(wǎng)絡(luò),我們可以用它來擴大一個已經(jīng)存在的網(wǎng)絡(luò)安全漏洞。 

如果你可以入侵一個子網(wǎng)內(nèi)的機器,其它的機器安全也將受到ARP欺騙的威脅。同樣,利 

用APR的DOS甚至能使整個子網(wǎng)癱瘓。 

2、對ARP攻擊的防護 

防止ARP攻擊是比較困難的,修改協(xié)議也是不大可能。但是有一些工作是可以提高本地網(wǎng) 

絡(luò)的安全性。 

首先,你要知道,如果一個錯誤的記錄被插入ARP或者IP route表,可以用兩種方式來刪 

除。 

a. 使用arp –d host_entry 

b. 自動過期,由系統(tǒng)刪除 

這樣,可以采用以下的一些方法: 

1). 減少過期時間 

#ndd –set /dev/arp arp_cleanup_interval 60000 

#ndd -set /dev/ip ip_ire_flush_interval 60000 

60000=60000毫秒 默認(rèn)是300000 

加快過期時間,并不能避免攻擊,但是使得攻擊更加困難,帶來的影響是在網(wǎng)絡(luò)中會大 

量的出現(xiàn)ARP請求和回復(fù),請不要在繁忙的網(wǎng)絡(luò)上使用。 

2). 建立靜態(tài)ARP表 

這是一種很有效的方法,而且對系統(tǒng)影響不大。缺點是破壞了動態(tài)ARP協(xié)議。可以建立如 

下的文件。 

test.nsfocus.com 08:00:20:ba:a1:f2 

user. nsfocus.com 08:00:20:ee:de:1f 

使用arp –f filename加載進去,這樣的ARP映射將不會過期和被新的ARP數(shù)據(jù)刷新,除 

非使用arp –d才能刪除。但是一旦合法主機的網(wǎng)卡硬件地址改變,就必須手工刷新這個 

arp文件。這個方法,不適合于經(jīng)常變動的網(wǎng)絡(luò)環(huán)境。 

3).禁止ARP 

可以通過ifconfig interface –arp 完全禁止ARP,這樣,網(wǎng)卡不會發(fā)送ARP和接受ARP 

包。但是使用前提是使用靜態(tài)的ARP表,如果不在apr表中的計算機 ,將不能通信。這個 

方法不適用與大多數(shù)網(wǎng)絡(luò)環(huán)境,因為這增加了網(wǎng)絡(luò)管理的成本。但是對小規(guī)模的安全網(wǎng) 

絡(luò)來說,還是有效和可行的。 

3、IP 

IP是用來傳輸數(shù)據(jù)的底層協(xié)議。 

4、IP Forwarding (IP轉(zhuǎn)發(fā)) : 

IP 轉(zhuǎn)發(fā)是在不同網(wǎng)卡之間路由包數(shù)據(jù)的過程。一般是用路由器來實現(xiàn),但是擁有多網(wǎng)絡(luò) 

接口的主機也可以實現(xiàn)。當(dāng)有兩個網(wǎng)絡(luò)接口的時候,Solairs系統(tǒng)默認(rèn)打開ip轉(zhuǎn)發(fā)。 

關(guān)閉IP轉(zhuǎn)發(fā) 

對于多宿主主機,存在可能的安全問題是,攻擊者可能通過ip轉(zhuǎn)發(fā)的方式訪問到私有網(wǎng) 

絡(luò)。在solaisr系統(tǒng)中,包轉(zhuǎn)發(fā)能很的容易關(guān)閉。簡單的生成一個文件 /etc/notrouter 

,就能在下次啟動的時候關(guān)閉ip轉(zhuǎn)發(fā)。 

另外通過ndd命令也能在系統(tǒng)運行的時候關(guān)閉ip轉(zhuǎn)發(fā)。 

#ndd –set /dev/ip ip_forwarding 0 

嚴(yán)格限定多主宿主機 

如果是多宿主機,還可以加上更嚴(yán)格的限定防止ip spoof的攻擊 

#ndd –set /dev/ip ip_strict_dst_multihoning 1 

默認(rèn)是關(guān)閉的(值為0) 

轉(zhuǎn)發(fā)包廣播 

由于在轉(zhuǎn)發(fā)狀態(tài)下默認(rèn)是允許的,為了防止被用來實施smurf攻擊,關(guān)閉這一特性。 (參 

見cert-98.01) 

#ndd –set /dev/ip ip-forward_directed_broadcasts 0 

5、路由 

路由的過程就是檢查路由信息,從而決定如何從哪個接口傳輸數(shù)據(jù)包的過程。即使一個 

桌面系統(tǒng),也要有路由設(shè)置。路由表需要實時的升級。現(xiàn)在有多種路由協(xié)議可以用來路 

由數(shù)據(jù)。Solaris系統(tǒng)使用in.routed守護程序支持RIP version 1,使用in.rdisc守護 

進程支持ICMP路由更新。當(dāng)solairs系統(tǒng)配置成為一個路由設(shè)備來轉(zhuǎn)發(fā)數(shù)據(jù)包的時候,它 

通過上面的兩種方式動態(tài)更新路由信息。 

6、攻擊 

有多種方法能威脅動態(tài)路由協(xié)議。攻擊者能偽造虛假的路由更新信息發(fā)送過來,從而達(dá) 

到DOS的效果;同樣的方法,還能使數(shù)據(jù)報文轉(zhuǎn)發(fā)到其他的網(wǎng)絡(luò)上,使攻擊者能監(jiān)聽數(shù)據(jù) 

。 

默認(rèn)的solairs系統(tǒng)使用系統(tǒng)守護程序動態(tài)管理路由信息。靜態(tài)路由很好的防止路由信息 

被遠(yuǎn)程動態(tài)改變。使用/etc/defaultrouter來設(shè)置本地子網(wǎng)的路由。使用route命令來 

設(shè)置其他路由信息。 

但是對于一個簡單網(wǎng)絡(luò)來說,使用靜態(tài)路由是合適的,一旦網(wǎng)絡(luò)中有較多的路由設(shè)備, 

必須使用動態(tài)路由。Solairs系統(tǒng)將來也會繼續(xù)支持動態(tài)路由協(xié)議。 

轉(zhuǎn)發(fā)源路由包。 

源路由包中包含了了指定數(shù)據(jù)如何路由的信息。因此攻擊者可能使用源路由包繞過某些 

特定的路由器和防火墻設(shè)備,也可能用來避開一個已知的IDS系統(tǒng)的監(jiān)控范圍。在大多數(shù) 

solairs的應(yīng)用系統(tǒng)上,是不需要這個特性的。由于solairs在打開ip轉(zhuǎn)發(fā)以后默認(rèn)支持 

源路由轉(zhuǎn)發(fā),所以我們必須手動關(guān)閉它 

#ndd –set /dev/ip ip_forward_src_routed 0 

7、ICMP 

ICMP:網(wǎng)絡(luò)控制信息協(xié)議。下面討論在IP驅(qū)動上配置solaris的ICMP特性。 

8、廣播: 

ICMP廣播經(jīng)常會帶來麻煩,這里有一條原則來防止廣播風(fēng)暴-控制ICMP的錯誤信息不被 

生成。為來防止攻擊者利用ICMP實施DOS攻擊,最好禁止本地網(wǎng)絡(luò)對ICMP廣播的響應(yīng)。 

Solairs系統(tǒng)能調(diào)節(jié)三種ICMP廣播的參數(shù)。 

響應(yīng)Echo廣播: 

Echo廣播通常用來診斷網(wǎng)絡(luò)主機的存活情況,一旦主機收到一個對廣播地址的echo請求 

,默認(rèn)情況下所有系統(tǒng)會回復(fù)這個廣播要求。當(dāng)有人惡意定制過量的echo包,系統(tǒng)中的 

流量將大為增加。因此我們可以關(guān)閉對echo廣播的響應(yīng) 

#ndd –set /dev/ip ip_respond_to_echo_boadcast 0 

響應(yīng)時間戳廣播 

時間戳通常用來同步兩個不同系統(tǒng)的時鐘,但是系統(tǒng)沒有必要回復(fù)對廣播地址發(fā)送的時 

間戳請求,所以我們可以關(guān)閉這種回應(yīng)。 

#ndd –set /dev/ip ip_respond_to_timestamp_broadcast 0 

地址掩碼廣播 

地址掩碼請求被用來確定本地掩碼,通常是網(wǎng)絡(luò)中無盤工作站在啟動的時候發(fā)送。用下 

面的命令能禁止對這樣請求的應(yīng)答 

#ndd –set /dev/ip ip_respond_to_address_mask_broadcast 0 

9、重定向錯誤 

重定向錯誤:通常是路由器用來通知主機使用另一個路由器來傳輸數(shù)據(jù)的指示報文。報 

文重指定的路由器必須和發(fā)送路由器一樣連接同一個子網(wǎng),而收到報文的主機必須在自 

己的路由表里新增一條到那個子網(wǎng)的路由。不像ARP的包,這個路由不會過期也不會自動 

刪除。很多系統(tǒng)檢測這樣的報文用來發(fā)現(xiàn)錯誤和潛在的問題,從而優(yōu)先更改自己的路由 

表。 

接受重定向錯誤 

一個攻擊者能偽造重定向錯誤的報文從而給目標(biāo)主機裝載一個新的路由,而這個路由也 

許更本就是錯誤的,這樣主機就不會和一些特定的主機或網(wǎng)絡(luò)通信,這是一種DOS(deny 

of service)攻擊。雖然重定向報文本身有一些校驗規(guī)則,但是這些規(guī)則能很容易的被欺 

騙。而且目前存在大量的工具來達(dá)到這個目的。大多數(shù)只有一條默認(rèn)路由主機系統(tǒng)是不 

需要理會這種報文的,因此我們可以使用ndd命令忽略ICMP重定向錯誤報文。(solairs 

默認(rèn)是不忽略的) 

#ndd –set /dev/ip ip_ignore_redirect 1 

發(fā)送重定向錯誤報文 

只有路由器才需要重定向錯誤,任何主機即使是多宿主主機也不需要發(fā)送這種報文,因 

此我們可以使用ndd來禁止本機發(fā)送錯誤重定向報文。 

Ndd –set /dev/ip ip_send_redirects 0 

時間戳響應(yīng) 

就像前面提到的,時間戳廣播報文在大多數(shù)環(huán)境下是不需要的。而solaris系統(tǒng)還能夠完 

全不接受這種報文。 

#ndd –set /dev/ip ip_respond_to_timestamp 0 

關(guān)閉這個特性以后,有些使用rdate系統(tǒng)命令的unix主機將不能再同步時鐘。但是 

solaris 2.6和7使用更好的時鐘同步方式-NTP(網(wǎng)絡(luò)時間協(xié)議),請參見xntpd的幫助。 

10、TCP   

TCP:傳輸控制協(xié)議  

11、SYN_flood攻擊   

TCP-SYN flood又稱半開式連接攻擊,每當(dāng)我們進行一次標(biāo)準(zhǔn)的TCP連接(如WWW瀏覽,下  

載文件等)會有一個一個三次握手的過程,首先是請求方向服務(wù)方發(fā)送一個SYN消息,服  

務(wù)方收到SYN后,會向請求方回送一個SYN-ACK表示確認(rèn),當(dāng)請求方收到SYN-ACK后則再  

次向服務(wù)方發(fā)送一個ACK消息,一次成功的TCP連接由此就建立,可以進行后續(xù)工作了,  

如圖所示:  

請求方 服務(wù)方  

---------------------> SYN  

SYN-ACK <---------------- 

----------------------> ACK  

  而TCP-SYN flood在它的實現(xiàn)過程中只有前兩個步驟,當(dāng)服務(wù)方收到請求方的SYN并  

回送SYN-ACK確認(rèn)消息后, 請求方由于采用源地址欺騙等手段,致使服務(wù)方得不到ACK回  

應(yīng),這樣,服務(wù)方會在一定時間處于等待接收請求方ACK消息的狀態(tài),一臺服務(wù)器可用的  

TCP連接是有限的,如果惡意攻擊方快速連續(xù)的發(fā)送此類連接請求,則服務(wù)器可用TCP連  

接隊列很快將會阻塞,系統(tǒng)可用資源,網(wǎng)絡(luò)可用帶寬急劇下降,無法向用戶提供正常的  

網(wǎng)絡(luò)服務(wù)。  

對于solaris 2.5.1,只有安裝了patch 103582-1(或以上)才能防止syn_flood.在  

synflood沒有流行以前,連接隊列和backlog隊列是相同的,solairs 2.6/7和安裝了  

patch以后的2.5.1系統(tǒng),現(xiàn)在存在兩條隊列,一個是已連接的隊列,一條是未連接完成的  

隊列。SYN攻擊時只能填充后一條隊列,而且,一旦隊列滿,將隨機丟棄老的syn包。系  

統(tǒng)還會監(jiān)控這個隊列被短時間填充的情況,一旦懷疑是syn_flood,將在系統(tǒng)的messages  

中記錄下來。  

Mar 8 19:24:01 example unix: WARNING: High TCP connect timeout rate!   

System (port 80) may be under a SYN flood attack!  

新隊列的大小也是可以調(diào)節(jié)的,繁忙的web服務(wù)器需要提高未連接隊列的大小。默認(rèn)的大  

小是1024,我們可以提高到4096。  

ndd –set /dev/tcp tcp_conn_req_max_q0 4096   

當(dāng)然,一般情況下,核心的隊列增大,系統(tǒng)的內(nèi)存最好也應(yīng)有相應(yīng)的增加。  

12、連接耗盡攻擊   

和SYN flood攻擊不同,連接耗盡攻擊不太常見。因為這種攻擊必須使用真實IP,攻擊的  

目標(biāo)是已連接隊列。許多系統(tǒng)有一個同時連接的上限,取決于核心參數(shù)和系統(tǒng)內(nèi)存情況  

。作為通常的web服務(wù)器,這個上限值很難達(dá)到,因為http的連接是典型的短時連接。但  

是一個攻擊者可能快速發(fā)送大量的連接請求,同時保持連接,這樣正常訪問者的連接就  

可能被服務(wù)器拒絕。  

我們可以通過優(yōu)化系統(tǒng)核心和增加內(nèi)存來緩解,但不是根本的方法。因為攻擊者可能同  

時調(diào)動多臺機器同時攻擊。當(dāng)然,我們可以在發(fā)現(xiàn)攻擊以后,在防火墻或路由器上拒絕  

這些IP來源的連接。  

如果不通過網(wǎng)絡(luò)設(shè)備,僅僅通過調(diào)節(jié)系統(tǒng)參數(shù)來緩解攻擊。一方面,可以調(diào)節(jié)web   

server,如apache的timeout參數(shù),減短連接保持時間,另一方面,我們可以將核心以連  

接隊列參數(shù)增大(默認(rèn)是128)。  

#ndd –set /dev/tcp tcp_conn_req_max_q 1024  

以上的方法能阻止大多數(shù)連接耗盡的攻擊企圖,除非攻擊者調(diào)動更多的資源,發(fā)動大規(guī)模  

的DDOS,但這樣會使攻擊者更容易暴露。  

13、IP 欺騙   

IP欺騙基本原理:  

TCP連接的建立 :為了利用TCP連接交換數(shù)據(jù),主機間首先必須建立一個連接。TCP建立連  

接時可以分為3個 步驟,稱為三步握手法。如果主機A運行rlogin客戶程序,并且希望連  

接到主機B上的rlogin daemon 服務(wù)器程序上,連接過程如圖二所示。  

1 A ---SYN---> B  

2 A <--SYN/ACK--- B 

3 A ---ACK---> B  

圖二  

需要提醒讀者的是,主機A和B的TCP模塊分別使用自己的序列編號。在時刻1時,客戶端   

通過設(shè)置標(biāo)志位SYN=1告訴服務(wù)器它需要建立連接。同時,客戶端在其TCP頭中的序列號   

域SEQ放置了它的初始序列號(ISN),并且告訴服務(wù)器序列號標(biāo)示域是有效的,應(yīng)該 被  

檢查。在時刻2時,服務(wù)器端在接收了上面的SYN后,作出的反應(yīng)是將自己的ISN和對客   

戶端的ACKA發(fā)向客戶端并且千知下一個期待獲得的數(shù)據(jù)序列號是(ISN+1)。客戶端在第  

一流時刻,對服務(wù)器的ISN進行確認(rèn)。這時,數(shù)據(jù)傳輸就可以進行了。ISN與序列號的遞  

增 了解序數(shù)編號如何選擇初始序列號和如何根據(jù)時間變化是很重要的。似乎應(yīng)該有這種  

情 況,當(dāng)主機啟動后序列編號初始化為1,但實際上并非如此。初始序列號是由  

tcp_init函 數(shù)確定的。ISN每秒增加128000,如果有連接出現(xiàn),每次連接將反計數(shù)器的  

數(shù)值增加 64000。很顯然,這使得用于表示ISN的32位計數(shù)器在沒有連接的情況下每  

9.32小時復(fù)位 一次。之所以這樣,是因為這樣有利于最大限度地減少舊有連接的信息干  

擾當(dāng)前連接的 機會。這里運用了2MSL等待時間的概念(不在本文討論的范圍之內(nèi)。)如  

果初始序列 號是隨意選擇的,那么不能保證現(xiàn)有序列號是不同于先前的。假設(shè)有這樣一  

種情況,在 一個路由回路中的數(shù)據(jù)包最終跳出了循環(huán),回到了“舊有”的連接(此時其  

實是不同于 前者的現(xiàn)有連接(,顯然會發(fā)生對現(xiàn)有連接的干擾。 端口號 為了提供對  

TCP模塊的并行訪問,TCP提供了叫做端口的用戶接口。端口被操作系統(tǒng)內(nèi)核 利用來標(biāo)示  

不同的網(wǎng)絡(luò)進程,也就是嚴(yán)格區(qū)分傳輸層入口的標(biāo)示(就是說,IP不關(guān)心他 們的存在)  

。TCP端口與IP地址一起提供網(wǎng)絡(luò)端到端的通信。事實上,在任何時刻任何Internet連接  

都能由4個要素來措述:源IP地址、源地址端口號、目的IP地址和目的地址。采樣目標(biāo)主  

機發(fā)出的TCP序列號,猜測出它的數(shù)據(jù)序列號。然后,偽裝成被信任的主機, 同時建立  

起與目標(biāo)主機基于地址驗證的應(yīng)用連接。如果成功,黑客可以使用一種簡單的命令放置  

一個系統(tǒng)后門,以進行非授權(quán)操作。  

目前,RFC 1498定義了更好的隨機ISN生成方法,使得這種攻擊很難成功。對于solaris  

系統(tǒng)ISN生成有三種方式。  

0: 可預(yù)測的ISN  

1: 增強的ISN 隨機生成  

2: RFC 1948描述的ISN生成方式  

所有版本的solaris默認(rèn)生成方式值是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  

重起系統(tǒng)使他生效。對于solair 2.5.1,此方法無效。  

14、增加私有端口   

一般的情況下,1-1024端口被稱為私有端口,只允許具有根權(quán)限的進程連接。但是有些大  

于1024的端口,即使需要這樣的限制,卻無法定義,如NFS的服務(wù)器端口2049,當(dāng)然還有  

一些其他定義的高于1024的私有端口。  

在solairs2.5.1/2.6/7下使用如下方式,可以自定義最小的非私有端口  

ndd –set /dev/tcp tcp_smallest_nonpriv_port 2050   

這樣以來,0-2049都被定義為私有端口。  

在solaris 2.6/7下,還能使用另一個參數(shù)單獨指定私有端口。  

#ndd /dev/tcp tcp_extra_priv_ports  

2049  

4045  

用來顯示已經(jīng)定義的擴展私有端口  

#ndd –set /dev/tcp tcp_extra_priv_ports_add 6112  

來增加新的私有端口定義。  

使用 ndd –set /dev/tcp tcp_extra_priv_ports_del 來刪除定義。  

要注意的是,不要隨便定義私有端口,因為有些非根權(quán)限的進程會使用這些端口。特別  

是改變最小非私有端口這個參數(shù),經(jīng)常會引起問題。應(yīng)仔細(xì)分析你的需求再用擴展私有  

端口定義的方式單獨增加。  

15.tcp_max_buf  

最大緩存字節(jié)數(shù);這個參數(shù)控制了由setsockopt(3SOCKET)函數(shù)設(shè)置發(fā)送和接收BUFFER  

大小;  

默認(rèn)值:1048576  

范圍為8192到1073741824  

如果在一個高速的網(wǎng)絡(luò)環(huán)境中創(chuàng)建TCP連接,增加該值來與網(wǎng)速相適應(yīng);  

等等;   

   

16、附件:設(shè)置腳本,來源于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  

ndd - get and set driver configuration parameters  

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 汝阳县| 华池县| 加查县| 象州县| 临泽县| 吴川市| 界首市| 扶余县| 黄石市| 万盛区| 涞水县| 安阳县| 沿河| 麻阳| 财经| 乳山市| 茌平县| 建德市| 河津市| 交城县| 霞浦县| 霞浦县| 丘北县| 内乡县| 宣武区| 韶关市| 商都县| 宜兴市| 开江县| 元朗区| 潍坊市| 三台县| 疏勒县| 乌拉特后旗| 岳阳市| 梁平县| 资源县| 富裕县| 古浪县| 荔浦县| 阜新市|