24h購物| | PChome| 登入
2017-04-25 14:44:57| 人氣17,661| 回應1 | 上一篇 | 下一篇

www.hi38.org 工作計畫書

推薦 2 收藏 0 轉貼0 訂閱站台

1.寫 www.hi38.org 的工作計畫書。

先測試買回來的東西看看可不可以用

灌系統

打算要改成 openbsd
但是找不到 openbsd2.9 的 iso 他超級穩定 尤其我又是用 pppoe 這種環境是很容易被黑的對了主控權不在我這裡是在中華電信機房裡面的笨烏龜。

==================== 喂喂 有哪位高手能夠看得出來這是什麼結構 , 小弟我真的看不太懂耶 ! (我現在手邊沒有伺服器)

herdbots.info/index.php?pg=
 
amishrabbit.info/ver.php?id=
 
www.amishrabbit.info/tutorials/print.php?page=
 
          www.amishrabbit.info/press.php?lang=
 
         www.amishrabbit.info/index3.php?d=
***************************************








待續

promiscuous mode


我喜歡這隻豬,我有安裝過但是失敗(在資料庫的部分)好想要去買原版的書裡面互帶光碟才能解決問題畢竟自由軟體嗎。找不到地方維修。

##############################################################

OpenBSD
FreeBSD

 Snort 實作入侵偵測系統

前言

在一般企業中通常會設置防火牆作為防止駭客入侵的第一道防線,有些企業甚至認為防火牆即是唯一需要的資安設備,但在實務上,防火牆並無法有效阻擋所有種類的網路攻擊行為。也因此有所謂的入侵偵測系統設備(既然無法阻擋攻擊,那就記錄攻擊行為,以便事後追查,當然目前也有所謂的入侵預防系統 (Intrusion Prevention System, IPS),除了可記錄惡意行為外還可直接阻擋正在進行中的惡意行為)。在本篇文章中,筆者將結合開源碼社群中最有名的入侵偵測軟體 (Snort) 與 Web 介面的管理軟體 (BASE) 實作一個網頁型的入侵偵測系統。

本系統所需套件如下表:
軟體名稱 網址 說明
Fedora 11 https://fedoraproject.org/ Linux 作業系統
Libpcap https://www.tcpdump.org/ 擷取網路封包的程式庫
PCRE https://www.pcre.org/ 正規化表示法的程式庫
Snort https://www.snort.org 網路型入侵偵測系統
PHP https://www.php.net 網頁程式語言
Apache https://www.apache.org 網站伺服器
BASE (Basic Analysis and Security Engine) https://base.secureideas.net 網頁式入侵偵測系統管理程式
MySQL https://www.mysql.com 資料庫軟體
ADOdb https://adodb.sourceforge.net/ PHP 資料庫程式庫
▲表 1

什麼是入侵偵測系統

入侵偵測系統依偵測型式可分為網路型入侵偵測系統(Network-based Intrusion Detection System,以下簡稱為 NIDS)及主機型入侵偵測系統(Host-based Intrusion Detection System,在此我們不多加討論主機型入侵偵測系統)。

NIDS

網路型入侵偵測系統通常部署在網域閘道上 (gateway),通過竊聽 (sniffer) 的方式,即時監測網路上的封包並比對攻擊模式,當發現有疑似入侵行為時能即時提出警告的防禦系統。一般而言 NIDS 網路部署如下圖示:


▲圖 1

NIDS 部署在網域閘道上 (gateway) 監控所有的封包並與攻擊模式資料庫比對,一旦發現有符合攻擊樣式的網路封包,即觸發相關事件來通知管理者,相信細心的讀者一定會發現上圖中的入侵偵測系統 (Snort) 是接在 switch 裝置前的 hub,而不是與 switch 裝置直接連接,這是因為封包在這兩種裝置上傳遞方式不同的緣故。在 hub 上,封包是採用廣播的方式,當封包進入到 hub 時,將會以廣播的方式將封包傳遞給 hub 上所有的主機,但只有目的主機會接收此封包,也就是說,在 hub 上連接的主機都會接收到封包,只是沒收下來而已,在這個情況下,如果我們讓網卡進入所謂的混亂 (promiscuous) 模式,那網卡就會強制的將同一 hub 上的所有封包資訊接收下來(這也是一些以竊取資料為目的木馬程式的特徵),所以有些網管人員會特別注意相關 log 檔案是否有類似 (promiscuous) 的字串,不過 Snort 在啟動後,也會強迫網卡進入混亂 (promiscuous) 模式,藉此取得其它主機的封包。以 Linux 系統為例;讀者可利用 ifconfig 指令查看目前網卡的狀況,如下圖為一個正常模式的網卡,在此模式下,網卡僅會處理與本身相關的封包。


▲圖 2

讀者可利用 ifconfig eth0 promisc 指令,讓網卡進入混亂 (promiscuous) 模式,如下圖即為一個進入混亂 (promiscuous) 模式的網卡,在此模式下,網卡會處理流經 hub 的所有封包,Snort 即是利用此特性處理網域內的所有封包並比對是否有惡意樣式的封包,所以 Snort 程式在執行時,會將網卡設定成混亂 (promiscuous) 模式。


▲圖 3

而在 switch 裝置上,則是會保存一張對應表,對應接在 switch 上的每台主機埠口(即 switch 裝置上的埠會對應連接此實體埠主機的 MAC 資訊),一旦封包流進此 switch 即會先查詢此對應表,並直接將封包直接傳遞給目的主機,而其他不相關的主機無法接收到封包。因此,若無經過特殊的處理,Snort 直接連在 switch 上是無法取得其它主機的封包。這也是為什麼 Snort 主機不能直接接在 switch 上來從事監控作業,而必須接在 hub 上的原因。除非 switch 有提供所謂的 mirror 功能,可將 switch 上其它埠所接收到的封包複製一份到 Snort 主機所在的埠口上,否則 Snort 接在 switch 上是無法取得其它主機的封包(僅可取得流經自己主機的封包)。

NIDS 偵測的方式可分為特徵比對 (Signature-based) 方式與異常偵測 (Anomaly-based) 方式,如下所述:

特徵比對 (Signature-based)

特徵比對 (Signature-based) 又稱為「不當行為偵測 (Misuse detection)」,系統會先針對入侵特徵建立一「異常特徵資料庫」,只要 NIDS 偵測到的封包內容與資料庫的某個特徵相符,系統即會判別為入侵。此種方式的優點是不易誤判,因為個別的攻擊行為通常擁有特殊的特徵符號。就如同病毒碼一般可精確比對出攻擊模式。但就如上所言,此種方式是否能完整的檢測出惡意的封包,取決於「異常特徵資料庫」的完整性,異常特徵資料庫越完整,檢測出惡意封包的機率就越大,所以此種方式並無法檢測出未知的攻擊方式,因為需要先有攻擊行為才會有攻擊特徵,「異常特徵資料庫」才能加入此種攻擊特徵,最後 NIDS 才可藉此掃描出惡意封包。Snort 所採用的偵測方式,即屬於特徴比對的方式。

異常偵測 (Anomaly-based)

運用統計分析的方式,先定義出正常的系統模式(以下簡稱正常模式),而後當 NIDS 檢測出不符合正常模式的流量時,即判別為異常,此種模式的優點在於可偵測未知的攻擊行為,因為攻擊行為常會造成系統偏離正常模式而被檢測出來,但缺點是很難界定所謂的「正常的系統模式」,所以經常會有誤判的情況,也因此大部份的入侵偵測系統大都採用特徵比對的方式。

安裝 Snort

Snort 是一種以攻擊特徵碼為基礎的入侵偵測系統,利用事先建立好的已知攻擊資料特徵碼,來比對接收到的封包內容是否含有攻擊行為。若符合特徵碼即觸發相對應的動作。相關架構圖如下所示:


▲圖 4

Packet Decoder(封包解碼器)

當 Snort 取得各種不同通訊協定的網路封包後,第一件事即將封包置入「封包解碼器」模組中做第一階段的封包處理與分析,以作為下一個階段(前處理器與偵測引擎)的資料來源。

Preprocessors(前處理器)

Snort 的前處理器為外掛程式 (plugin) 的架構,主要功能在於重新標準化網路流量(如重組封包、分段與重組 TCP stream、編碼的轉換等等),以使得網路流量能精確的被偵測引擎 (Detection Engine) 解析及匹配特徵碼。

Detection Engine(偵測模組)

Detection Engine(偵測模組)主要功能在於規則分析與特徵偵測,Detection Engine(偵測模組)將 Snort 的規則文件引入,並按照規則文件中的規則,逐一比對並分析網路封包,一旦發現封包有符合規則文件中定義的行為,即觸發該規則文件中所定義的處理方式,當所有的規則都不符合時,即會丟棄該封包。Snort 的規則文件分為兩個部份:
1. 規則表頭 (Rule-Header) 規則表頭是規則中第一個圓括孤之前的部份,通常是用來決定封包比對來源範圍(如:限定比對那些範圍的 IP)及比對成功時的動作(如:用 log 或是直接丟棄)。
2. 規則選項 (Rule-Options) 規則選項主要利用一至多個關鍵字設定欲偵測的流量特徵,規則選項依功能可區分為下列四個部份:
(1) Meta-data 用來設定欲顯示的相關訊息,如當規則觸發時所要產生的訊息或弱點的相關參考訊息。
(2) Payload 用來比對封包內容的規則,如比對是否需區分大小寫或特定字串等等。
(3) Non-Payload 用來比對各種協定的欄位值。
(4) Post-Detection 當封包內容與規則符合時,除了在規則表頭 (Rule-Header) 所定義的動作外,另外會觸發的動作指令如下規則範例:
alert tcp any any → any 5432 (msg:"someone access PSQL command:SELECT"; content:"select";)
規則描述如下表:
alert【處理方式】 產生警示的 log
tcp【來源通訊協定】 偵測 TCP 的封包
any【來源 IP】 偵測任何的來源 IP
any【來源 port】 偵測任何的來源埠
any【目的 IP】 偵測任何的目的 IP
5432【目的 port】 僅偵測 5432 埠的封包
【進階處理內容】 若符合內容含有「select」的字串,則將 msg 後的字串記錄起來。
▲表 2

上述規則的意義為:
當主機上的 5432 埠,如果有接收到內含有 select 字串的封包,則記錄一筆警示記錄(記錄內容為「someone access PSQL command:SELECT」)。

Logging and Alerting:當 Snort 偵測出惡意封包時,可以將該訊息記錄起來並觸發相關警告事件。
Output Modules:可將相關資訊輸出到檔案或資料庫等儲存媒介,在本解決方案中,我們會將相關的資訊儲存至資料庫中。

接下來,繼續安裝 Snort,假設讀者已安裝完成 Apache 與 MySQL,請讀者依序以下列步驟安裝相關套件:
1.   安裝 Libpcap 及 PCRE
yum install libpcap*
yum install libpcre*
2.   設定 ADOdb
至 https://adodb.sourceforge.net/ 取得最新的版本,解開後,將相關檔案置於 /usr/local/adodb 目錄即可
3.   安裝 Snort 的資料庫
(1)  新建一個名稱為 snort 的資料庫
(2)  在 Snort 原始碼的 schemas 目錄下有一個 create_mysql 檔案
利用 mysql –u [USER] –p [Password] snort 
(新建立 Snort 所需要的資料庫表格)
4.   安裝 Snort
(1)  至 www.snort.org 取得最新版本的 Snort 解壓縮後,如下指令:
./configure && make && make install 即可安裝完成
(2)  接下來即為建立 Snort 所需的相關目錄:
mkdir –p  /opt/snort/etc   #放置 config 檔案目錄
mkdir –p  /opt/snort/rules   #放置規則檔的目錄
mkdir –p  /var/log/snort   #放置 log
(3)下一步即為取得 Snort 的規則集(目前 Snort 是必需付費方可取得最新的規則集,但讀者可至官方網站簡單註冊後,即可取得未註冊的版本)將相關的規則集檔案解壓縮後置於 /opt/snort/rules 即可。
(4)再來即為設定 Snort 的組態檔 (snort.conf),基本上僅需設定下列選項即可:
var HOME_NET any    #設定欲監控的主機(any 表示任意的主機均符合)
var EXTERNAL_NET any #設定外部主機範圍
output database: log, mysql, user =【資料庫使用者帳號】
password =【資料庫密碼】 dbname=snort host=localhost
#MySQL 資料庫的支援

在安裝完成後,即可開始測試 Snort,Snort 提供兩種工作模式:
(1)  監聽 (sniffer) 模式
在此模式下,Snort 僅是 sniffer(如 tcpdump)的功能,監聽所有來往的封包,但不會做攻擊模式的比對。
讀者以 snort –v 進入 sniffer 模式,如下圖示:


▲圖 5

(2)  NIDS(網路型入侵偵測系統)
在此模式下,Snort 不僅會監聽所有來往的封包,並會做攻擊模式的比對。

4.   安裝 BASE 軟體
由於 BASE 軟體有繪圖及 Email 相關功能, 所以我們還必需安裝 PHP 相關的模組。
pear install Mail     #利用安裝 Email                             
pear install Image_Color-1.0.2.tgz  #安裝繪圖所需的模組
pear install Image_Canvas-0.3.0.tgz 
pear install Image_Graph-0.7.2.tgz
安裝完成後,可利用 pear list 來檢查是否有安裝相關模組,如下圖示:


▲圖 6

將 BASE 相關程式置於網站根目錄下的 base 目錄,(在此為 /usr/local/apache2/htdocs/base),後利用瀏覽器設定,如下步驟:
步驟1(檢查相關環境):


▲圖 7

步驟2(設定 ADOdb 的所在目錄):


▲圖 8

步驟3(設定資料庫相關的資訊):


▲圖 9

步驟4(設定從網站登入的帳號及密碼資訊):


▲圖 10

步驟5(產生相關的資料庫表格):


▲圖 11

當一切順利完成後,讀者可利用瀏覽器瀏覽 https://〈base IP〉/base/ 即可瀏覽 BASE 的相關頁面
接下來即請讀者啟動 Snort,如下指令:
/usr/local/snort/bin/snort -c /usr/local/snort/etc/snort.conf  -D
(以常駐程式方式啟動 Snort,並將網卡設定成 promiscuous,讀者可利用 dmesg 查看是否有類似下列的文字「device eth0 entered promiscuous mode」)。
下圖為 Snort 偵測到 Teardrop(一種拒絕服務攻擊的手法)攻擊的畫面:


▲圖 12

至此,讀者已成功建立網頁型入侵偵測系統。可由網頁介面來掌控入侵偵測系統的相關資訊。
###################################


###################################

Linux Journal

Search

Peering Over the Firewall

Security
by Jeffrey L. Taylor
 

When our home LAN graduated to a 24x7 Internet connection, my Linux box became the firewall and the router. I liked the ability to customize the firewall, and by using Snort I could keep an eye on the barbarians at the gates. However, I could not experiment much without disrupting the entire household's Internet access. Adding a DSL/cable broadband router (see Resources) with a built-in firewall took my computer off the critical path and allowed me to experiment with various configurations and operating systems without domestic discord. But, I missed seeing what was going on. I do not want the first sign of someone attacking me to occur when they appear inside the firewall.

Intrusion detection systems (IDSs) are standard practice in the corporate world, but they easily can cost more than an entire home network, including computers. With some free software (Snort), a cheap Ethernet hub and a custom cable, you can have an IDS that is almost as good as a commercial system. The major lack is the pretty reports and graphs necessary to justify a big salary.

A typical home LAN with a broadband router is shown here:

Figure 1. LAN w/Broadband Router

Most broadband routers include a multiport switch. A switch sends packets to only the destination port. In contrast, a hub is a simple repeater and sends each packet to all other ports. With a switch, each computer sees only its own traffic, so computer A cannot monitor attacks on the other computers. Figure 2 shows how to use a hub to peer around the router and see all packets.

Figure 2. LAN w/Broadband Router and Snort Cable

Residential cable and DSL modems run at 1-2Mbps, so a single speed 10Mbps Ethernet hub is fine. These can be found used, reconditioned or dumped as obsolete for as little as $10 at discount outlets.

A packet sniffer, such as Snort, running in promiscuous mode on the second network interface card (NIC) of computer A can see all traffic, including those packets blocked by the firewall. To keep the second NIC from responding to any IP packets, it needs to be brought up with no IP address, that is, ifconfig eth1 up. If the second NIC already is assigned an IP address, taking it down and bringing it back does not always delete the IP address. Instead, take the interface down, remove the driver module (rmmod ne2k-pci) and bring it back up. If the driver is compiled into the kernel, you probably have to reboot here. Some system configuration tools, such as SuSE's yast, do not let you configure an Ethernet interface without an IP address. In this case, you have to edit the necessary files by hand.

No IP address usually is adequate stealthiness, but the second NIC still can respond to low-level, layer 2 requests, such as ARP requests. To make it totally invisible, use a read-only cable. The wiring diagram is in Figure 3. These cables can be made easily with a length of Cat5 cable, two RJ45 connectors and a crimping tool. First, strip off a half inch of the outer insulation, and insert each wire into a slot on the RJ45 connector and crimp. There does not seem to be a consistent standard for which pin gets which color wire, so eyeball a commercial cable and follow its example. Label this the hub end.

Next, cut two inches off the other end of the cable to get a bit of wire to make the jumper between pins 1 and 2 of the Snort end. You can do this by bending it in half and shoving it in the RJ45 connector. Again, strip a half inch off the outer insulation. Strip a quarter inch of the inner insulation off the wires from pins 1, 2, 3 and 6. With care and solid conductor Cat5 cable, you can push the wires from pins 1 and 3 into the slot for pin 3 and the wires for pins 2 and 6 into slot 6. Be sure all wires are inserted fully into the slots, then crimp the end. See Resources for links to pictures of the result. (A word of warning: trying this with stranded wire is a task for masochists.)

If your cable is stranded or if you can't find a crimper and are handy with a soldering iron, simply cut the patch cord in the middle and connect the appropriate wires together. Use heat shrink tubing to insulate and protect your handiwork.

Figure 3. Snort Read-Only Cable Wiring Diagram

When you plug the cable into the NIC and hub, the status LEDs should light in their usual pattern. If not, check and correct your work. Next, put Snort in packet dumping mode with snort -d -p -v -i eth1. You now should see traffic coming from both directions.

Finally, edit snort.conf and start Snort in dæmon mode:

snort -D -i eth1 -p -c /etc/snort.conf

Most home broadband connections have dynamic IP addresses, but they don't change often. Therefore, configuring HOME_NET in snort.conf can be done by hand each time the address changes. An alternative is to run the whois program on your external IP address. It may tell you the IP address range(s) owned by your ISP. Using this address/netmask for HOME_NET makes for less work, but then Snort may ignore attacks from your electronic neighbors because they are considered to be part of your LAN.

With this setup, I again could see the script kiddies rattling the door knobs and the various worms, including Slammer, trying to propagate.

When I upgraded to Snort 1.9.1 and its more extensive attack signatures, I started seeing a P2P GNUTella alert. I don't use P2P, so this was suspicious. The router does network address translation (NAT) between the internal private addresses and the single external IP address, hiding the culprit. By moving the hub inside the firewall, as shown in Figure 4, you can see the untranslated internal addresses. You have to change HOME_NET in /etc/snort.conf from the external IP address to the internal range, probably something like 192.168.0.0/16, to do this.

Figure 4. Snorting Inside the LAN

Before you move cables around, check whether your broadband router supports configuring a spanning port to get all traffic, that is, it is not switched. If so, you can leave the hub where it is and plug Snort into the spanning port.

The culprits turned out to be AmphetaDesk (an RSS headline aggregator) and PGP/GPG key fetches. The P2P GNUTella signature is overly broad; it flags any HTTP GET request to a non-standard port (not port 80). Below are some rules you can add to local.rules to eliminate the false positives:

pass tcp $HOME_NET any -> $EXTERNAL_NET !80 (flow:to_server,established; \
  content:"User-Agent\: AmphetaDesk"; offset:10;)
pass tcp $HOME_NET any -> $EXTERNAL_NET 11371 (flow:to_server,established; \
  content:"GET /pks/lookup?op=get&search="; offset:0;)

In conclusion, Snort makes it easy to tell what's going on. To stay on top of what's going on, update your Snort rules frequently.

Resources

“A Tale of Two Routers”, UnixReview.com, September 2002.

URLs for read-only Snort cable pictures:

www.snortsam.net/1

www.snortsam.net/2

www.snortsam.net/3





















佛經哥 下載 f88tw
http://mypaper.pchome.com.tw/f88tw/post/1370820447

台長: f88tw
人氣(17,661) | 回應(1)| 推薦 (2)| 收藏 (0)| 轉寄
全站分類: 教育學習(進修、留學、學術研究、教育概況)

98800
Private Video Collection, Very Explicit Cams, Naturism And Nudism.
Free Games, Girls and Boys, WT Photos and Videos
Home Made Model HMM Complete series Liluplanet, BD, LS, YWM

Download from Xubster-com:
Link: https://xubster.com/users/546/9721
:.:.:.:.:
Download from Daofile-com:
Link: https://daofile.com/go/7oaszxdrjl14
:.:.:.:.:
Download from Nelion-me:
Link: https://nelion.me/go/qsdfyihfyk3f
:.:.:.:.:
Download from Hostex-link:
Link: https://hostex.link/go/fjmz5u5n4rsn
:.:.:.:.:
Download from File-al:
Link: https://file.al/public/56284/31688

:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:







Private Video Collection, Very Explicit Cams, Naturism And Nudism.
Free Games, Girls and Boys, WT Photos and Videos
Home Made Model HMM Complete series Liluplanet, BD, LS, YWM

Download from Xubster-com:
Link: https://xubster.com/users/546/9721
:.:.:.:.:
Download from Daofile-com:
Link: https://daofile.com/go/7oaszxdrjl14
:.:.:.:.:
Download from Nelion-me:
Link: https://nelion.me/go/qsdfyihfyk3f
:.:.:.:.:
Download from Hostex-link:
Link: https://hostex.link/go/fjmz5u5n4rsn
:.:.:.:.:
Download from File-al:
Link: https://file.al/public/56284/31688

:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:
:-:







Private Video Collection, Very Explicit Cams, Naturism And Nudism.
Free Games, Girls and Boys, WT Photos and Videos.
Home Made Model HMM Complete series Liluplanet, BD, LS, YWM

Download from Xubster-com:
Link: https://xubster.com/users/546/9721
:.:.:.:.:
Download from Daofile-com:
Link: https://daofile.com/go/7oaszxdrjl14
:.:.:.:.:
Download from Nelion-me:
Link: https://nelion.me/go/qsdfyihfyk3f
:.:.:.:.:
Download from Hostex-link:
Link: https://hostex.link/go/fjmz5u5n4rsn
:.:.:.:.:
Download from File-al:
Link: https://file.al/public/56284/31688

:-:
:-:
:-:
:-:
:-:
:-:
:-:
2024-03-18 05:18:32
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文