亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 系統 > Solaris > 正文

Solaris7 交流 -- 重新配置系統核心

2024-07-26 00:29:56
字體:
來源:轉載
供稿:網友
Sun Microsystems公司于前不久發布了它的新一代的旗幟性軟件產品線:適用于SPARC  

和Intel兩種計算機的新的Solaris 7 軟件環境。Solaris 7產品系列包括基本的  

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

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

環境上運行。新的產品線主要具有以下特點:  

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

為新一級的應用軟件敞開了大門。  

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

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

Solaris環境一樣。  

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

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

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

Fortran的開發商開發企業級應用軟件提供了具有競爭性的優勢。Solaris 7具有全新中  

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

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

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

慮了健壯和安全的問題,提供了一系列的現代化的安全機制,同時修補了安全漏洞和系統  

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

綜上所述,Solaris 7是適用于企業網的操作系統。  

一、相關站點   

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/  
   
二、重新配置系統核心   

舉例: 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用的文件數目比較多,需要設置:  

set rlim_fd_max=4096  

set rlim_fd_cur=1024  

如何看系統默認值;  

先看系統默認值,超級用戶可以用-k參數來看核心的各個參數,如果指定-w參數,則可  

以  

adb - general-purpose debugger  

可以看現在的值是什么?  

/usr/bin/adb –kw   

physmem 1f8d9  

maxusers/D   

maxusers:  

maxusers: 504  

maxusers/W 200  

maxusers: 0x1f8 = 0x200  

   

(1)IO相關的設置   

最經常需要改變的是文件描述符數因為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 

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

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

限; 

The predicate rlim_fd_cur <= rlim_fd_max must be fulfilled. 

rlim_fd_max 

default 1024, recommended >=4096  

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

有超級用戶的權限;  

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

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

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)進程相關的設置 

maxusers 

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

recommendations 

最大用戶定義系統可以支持的最大用戶數,當核心生成的過程中,有一些表的大小就是 

由這個參數決定的。這個值的大小在當前SOALRIS版本中決定于內存的兆數目;有一些參 

數是由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) 

默認值是系統內存兆數,小于2048; 

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

當系統出現用戶進程生成(FORK)緩慢時,系統報信息; 

out of processes 

默認值比較大有以下情況: 

數據庫系統使用較大內存,但相對少的進程,減少MAXUSERS的值,可以節省系統內存; 

PIDMAX 

這個參數指定系統最大可能進程ID; 默認值為30000,范圍為266到999999;只在啟動 

時候進行設置; 

max_nprocs 

系統最大進程數,包含系統進程和用戶進程;默認值為為10+(16*MAXUSERS) 

該值范圍為266到MAXPID; 

基于Intel i386體系結構的linux操作系統中,已經提供了這樣的多進程運行的支持。 

通過合理的選擇進程調度算法,可以獲得比較好的平均相應時間和較高的系統性能。但 

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

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

應用,這個數目是綽綽有余。但是,對于企業級的服務器應用來說,則是不夠的。 

設想一個典型的Web服務器軟件,它們一般都采用多進程/線程的結構。每當接到一個連 

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

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

可以說正是因為存在這個最大進程數的限制,使得Linux不能勝任企業級服務器操作系統 

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

Solaris、AIX、HP-UX等系統。 

maxuprc 

一個用戶可以生成的最大用戶進程數; 

默認值為MAX_NPROCS-RESERVED_PROCS 

STREAM 

nstrpush 

默認值為9,這個參數定義了允許有多少個STREAM 模塊加載在系統核心中,我猜想這個 

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

strmsgsz 

默認值為 65536, 單個系統調用可以傳給一個STREAM設備信息的數據部分的最大字節數 

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

范圍為:0到262144 bytes 

當出現putmsg(2)系統調用返回ERANGE時,需要修改該參數; 

strctlsz 

默認值為 65536, 單個系統調用可以傳給一個STREAM設備信息的控制部分的最大字節數 

;范圍: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參數設置 

TCP/IP參數可以由ndd工具來設置, 

Ndd命令能容易的在不重新配置系統內核和重起系統的情況下,修改核心和TCP/IP的設備 

的一些參數。使用如下命令可看到相應的幫助。 

#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 

顯示當前值 

#ndd /dev/arp arp_debug 



0:代表特性禁止 

ndd –set /dev/arp arp_debug 1 

1:允許 

由于這些參數一般是經過優化過的,而且一旦改變失誤,可能導致系統的不正常工作。 

所以sun不提供文檔供人隨意調節。 

See ndd(1M) for more information; 

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

設置; 

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

方法來創建一個包含NDD命令的啟動腳本; 

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

/etc/rc2.d,/etc/rc1.d,/etc/rcs.d建立相應的連接; 

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

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

題; 

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

  

tcp:tcp_conn_hash_size 

默認值為 256,在忙的服務器建議增加; 

控制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. 

有關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協議??梢越⑷?nbsp;

下的文件。 

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、路由 

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

桌面系統,也要有路由設置。路由表需要實時的升級?,F在有多種路由協議可以用來路 

由數據。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_respond_to_address_mask_broadcast 0 

9、重定向錯誤 

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

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

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

刪除。很多系統檢測這樣的報文用來發現錯誤和潛在的問題,從而優先更改自己的路由 

表。 

接受重定向錯誤 

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

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

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

騙。而且目前存在大量的工具來達到這個目的。大多數只有一條默認路由主機系統是不 

需要理會這種報文的,因此我們可以使用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/ACK--- B 

3 A ---ACK---> B  

圖二  

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

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

域SEQ放置了它的初始序列號(ISN),并且告訴服務器序列號標示域是有效的,應該 被  

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

戶端的ACKA發向客戶端并且千知下一個期待獲得的數據序列號是(ISN+1)??蛻舳嗽诘?nbsp; 

一流時刻,對服務器的ISN進行確認。這時,數據傳輸就可以進行了。ISN與序列號的遞  

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

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

tcp_init函 數確定的。ISN每秒增加128000,如果有連接出現,每次連接將反計數器的  

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

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

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

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

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

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

TCP模塊的并行訪問,TCP提供了叫做端口的用戶接口。端口被操作系統內核 利用來標示  

不同的網絡進程,也就是嚴格區分傳輸層入口的標示(就是說,IP不關心他 們的存在)  

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

都能由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.tcp_max_buf  

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

大??;  

默認值:1048576  

范圍為8192到1073741824  

如果在一個高速的網絡環境中創建TCP連接,增加該值來與網速相適應;  

等等;   

   

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
日本精品视频在线播放| 亚洲精品国产精品国产自| 国产视频精品一区二区三区| 色综合久久88色综合天天看泰| 久久九九有精品国产23| 2019中文字幕全在线观看| 色婷婷综合成人| 国产一区私人高清影院| 久久国产精品久久久久久| 国产精品久久久久久久久久免费| 中文字幕亚洲欧美在线| 国产精品久久久久久久久粉嫩av| 97欧美精品一区二区三区| 日韩视频在线一区| 国内精品久久久久久| 亚洲欧美中文日韩在线v日本| 国产精品久久一| 欧美日韩精品在线观看| 午夜精品福利在线观看| 91精品国产综合久久久久久蜜臀| 国产精品成人观看视频国产奇米| 精品激情国产视频| 中文字幕九色91在线| 欧美黑人又粗大| 日韩av在线一区| 国产视频精品自拍| 久久久久久伊人| 日韩av片永久免费网站| 欧美日韩在线免费| 亚洲aⅴ日韩av电影在线观看| 久久国内精品一国内精品| 亚洲剧情一区二区| 色婷婷久久一区二区| 精品美女永久免费视频| 亚洲综合中文字幕68页| 欧美裸体xxxxx| 国产精品v片在线观看不卡| 91精品国产色综合久久不卡98口| 日韩电影在线观看中文字幕| 国产精品久久久久久久久男| 51视频国产精品一区二区| 亚洲性线免费观看视频成熟| 国产精品久久77777| zzijzzij亚洲日本成熟少妇| 国产精品久久久久久av福利软件| 国产69久久精品成人看| 成人xxxxx| 国产一区深夜福利| 亚洲欧美精品一区| 国产一区二区三区高清在线观看| 亚洲第一页中文字幕| 91国产一区在线| 亚洲xxx视频| 国产999视频| 一级做a爰片久久毛片美女图片| 国产成人高潮免费观看精品| 欧美另类在线播放| 日韩成人av网| 亚洲wwwav| 欧美成人免费在线视频| 91精品国产九九九久久久亚洲| 国产日韩欧美在线看| 亚洲人线精品午夜| 色在人av网站天堂精品| 欧美孕妇性xx| 亚洲一区二区三区sesese| 中文字幕亚洲二区| 久久精品国产综合| 欧美色另类天堂2015| 亚洲专区中文字幕| 亚洲欧美日韩久久久久久| 精品一区二区三区三区| 最近免费中文字幕视频2019| 午夜免费日韩视频| 欧美电影免费在线观看| 91伊人影院在线播放| 色综合亚洲精品激情狠狠| 懂色av中文一区二区三区天美| 国产精品一区专区欧美日韩| 久久综合色88| 91免费福利视频| 亚洲美女动态图120秒| 91亚洲精华国产精华| 国产精品久久久久久久久借妻| 国产精品免费看久久久香蕉| 97精品在线观看| 91性高湖久久久久久久久_久久99| 国产亚洲美女精品久久久| 性色av一区二区三区在线观看| 国产激情综合五月久久| 色噜噜国产精品视频一区二区| 欧美日韩中国免费专区在线看| 精品国产乱码久久久久酒店| 亚洲国产精品成人va在线观看| 成人福利网站在线观看| 91视频九色网站| 欧洲亚洲免费视频| 奇米成人av国产一区二区三区| 亚洲午夜未删减在线观看| 欧美一级片久久久久久久| 亚洲精品久久久久久久久久久| 亚洲日本欧美日韩高观看| 欧美精品在线免费| 国产精品亚洲精品| 国产色视频一区| 亚洲新中文字幕| 亚洲丝袜一区在线| 久久久午夜视频| 成人深夜直播免费观看| 亚洲 日韩 国产第一| 亚洲天堂免费观看| 成人免费在线视频网站| 国产91精品久久久久| 日本精品视频在线播放| 亚洲aⅴ男人的天堂在线观看| 亚洲亚裔videos黑人hd| 亚洲午夜女主播在线直播| 欧美久久精品一级黑人c片| 国产精品爽爽爽爽爽爽在线观看| 国产精品久久久久秋霞鲁丝| 欧美中文在线免费| 日本a级片电影一区二区| 欧美伊久线香蕉线新在线| 一个人www欧美| 日韩中文字幕第一页| 成人动漫网站在线观看| 日韩高清电影好看的电视剧电影| 欧美激情2020午夜免费观看| 欧美黑人国产人伦爽爽爽| 日韩av在线精品| 欧美精品videosex极品1| 久久久精品免费视频| 91在线无精精品一区二区| 精品亚洲一区二区三区四区五区| 国产一区二区三区网站| 中文字幕在线看视频国产欧美在线看完整| 国产午夜精品一区二区三区| 久久精品视频99| 国产xxx69麻豆国语对白| 最近中文字幕mv在线一区二区三区四区| 久热精品视频在线观看| 日本精品久久电影| 亚洲欧美综合区自拍另类| 97视频在线观看网址| 精品免费在线观看| 欧美怡红院视频一区二区三区| 亚洲片在线资源| 国产亚洲精品久久久久久| 国产成人在线一区二区| 亚洲风情亚aⅴ在线发布| 1769国产精品| 黑人巨大精品欧美一区二区三区| 成人xxxx视频| 亚洲毛片在线看| 91久久综合亚洲鲁鲁五月天| 日韩精品久久久久久久玫瑰园| 欧美视频在线视频| 亚洲一区二区中文字幕| 欧日韩不卡在线视频| 亚洲欧美日韩天堂| 国产福利精品av综合导导航| 乱亲女秽乱长久久久| 亚洲成人黄色在线观看| 久久九九热免费视频|