Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NCU2019 Information Security 101

Avatar for NotSurprised NotSurprised
September 03, 2019

NCU2019 Information Security 101

Avatar for NotSurprised

NotSurprised

September 03, 2019
Tweet

More Decks by NotSurprised

Other Decks in Education

Transcript

  1. > • Background • Penetration Test – Web/Host Scanning –

    Escalate / persistence – Phishing Real-World Invading • Malware Analysis – Get Sample – Static Analysis – Dynamic Analysis • Tool Develop – Blue Team – Red Team – Real Tool • Summary
  2. > NotSurprised Intro • UCCU Hacker • AIS3 2016 trainee

    • HITCON Defend 2018 3rd (etc.) • SITCON 2019 speaker • HITCON 2019 training indicator • MOPCON 2019 speaker • ITRI Engineer (serve my country) • 5-years Bachelor & Master of NSYSU Email : [email protected] Skill • Windows Kernel Driver (Minifilter) • Penetration Test (Web) • Malware Analysis (Ransomware) • Ethereum Smart Contract (Solidity) • Car Security (OMA DM)
  3. > • G-force – Ace pilot should tolerate 9G for

    15s – If pilot cannot keep blood in head • Greyout • Tunnel vision • Blackout • G-LOC • Spoofing IFF (Identification, friend or foe) affiliation to single aircraft or AWACS
  4. > • FlexRay bus – Fastest – Expensive – Top

    class car – Sensitive • CAN bus – Good CP value – Widely used credit :
  5. > • GPS and a cellular connection to extend their

    range to anywhere with an internet connection. credit :
  6. > • Account & Password is default in FactoryBootstrap and

    popular • User Guide which contain AC/PW public on internet – https://fccid.io/2AEB4AG21/User-Manual/User-manual-3104674 credit :
  7. > • Such Vulhub website provide by car Vendors, OBDII

    like device default install on your car. credit :
  8. > • HTTP sniffer than you will get the AC/PW

    • Door seq. being shown on URL query as plaintext • Even you have no AC/PW, you can unlock most door remote by SQLi
  9. >

  10. > • A human-readable JSON protocol “encrypted” with an easily

    reversible autokey (-85) XOR cipher and a binary DES-encrypted configuration (AC/PW : admin/admin)
  11. >

  12. > • DEFCON27 DEVCORE Principle Researcher Orange & Researcher Meh

    find SSL VPN vulnerability • Win the “Pwnie Awards” (Oscar in Information Security)
  13. >

  14. >

  15. >

  16. >

  17. > Remote Code Execution • Vulnerabilities on existed services •

    No need with click bait • Usually need PoE from user privilage Phishing • Picnic (problem in chair, not in computer) • Need click bait • Usually also get AD privilege with click bait (UAC)
  18. >

  19. >

  20. >

  21. > • Microsoft Server Message Block 1.0 (SMBv1) server handles

    certain requests • tcp port 445 • srvnet在接收包的時候就會在a1字節後存放0xffdff000指標,而 0xffdff000這個地址存入客戶端發送來的資料。 • srv.sys 在處理 SrvOs2FeaListSizeToNt 的時候邏輯不正確導 致複製貼上越界覆蓋,造成可執行shellcode。 unsigned int __fastcall SrvOs2FeaListSizeToNt(int pOs2Fea) { …… Length = *(_DWORD *)pOs2Fea; …… *(_WORD *)pOs2Fea = pBody - pOs2Fea; …… } Typical Ransomware Eternal Blue = WannaCry
  22. > Step 1. 收集病毒情報 • 疫情、感染範圍、發作情形、併發症狀 Step 2. 收集病毒樣本 •

    分辨是下載器還是病毒本體 • 足夠的初階樣本分析可以有效提升對高階樣本混淆的推測直覺 • 根據批露資料自撰病毒樣本 (記得不要 open source) Step 3. 靜態分析 • 反組譯拆解: 監測模組、持續性模組、傳播模組、反連模組 Step 4. 建立檢測環境 • 建立 fake C&C server (如果有需求) • 設置激活開關 (IP位置、具漏洞之Service) • 模擬受害情境 (一般使用者、IoT、產線HMI/PLC、Server) Step 5. 動態分析 • 掛載啟動 Log/Debug 功能的所有工具 (syscalls、network) • 想辦法回收數據 (BSoD、Encrypt、ForceReboot)
  23. >

  24. > IAT existed API directly calling No shell pack No

    obscuration Source comparable IAT destroyed API magic calling Heavy shell pack Lots obscuration BlackBox
  25. >

  26. > • 同家族 data structure (collapsed, need fix) • 結構、項目量、不同

    Developer 具有微妙差異可分辨家族 (很多時 候還是很難分辨)
  27. > • 混淆技術 (obscuration): – 將程式的代碼,轉換成一種功能上等價,但是難於閱讀和理解的形式 • 加殼技術 (shell packer):

    – 一種對EXE檔案的數據壓縮及加密保護,可自我解壓檔案,並能隱藏解壓進程 – 有些加殼還會加上混淆的技術或概念,例如 VM Shell 將 ASM 完全加密,只剩 FDE • 2006 年時就有 80%~90% 的惡意軟體使用加殼技術,其中 50% 使用大眾技術或 舊加殼,但相信現在這比率更高。使用 Entropy、Signature、 PE header 偵 測加殼等方式皆有缺陷。防毒軟體對於任何新出的加殼技術防禦能力較低 • 混淆是所有良性軟體開發者與惡意軟體開發者的基本要求,一定程度的混淆能減 少開發技術被解譯拷貝竊取
  28. > • Save Load 大法 – 將真實指令位置存在 Stack 上,然後在需要時讀出使用 •

    流程混淆 – 跟甩開跟蹤的繞路一樣,運用一些等價但反組譯辨認較弱的跳轉或 register 搬移使反組譯結果 無法直視 ( eg. call xxx = push retAddr; push xxx; ret ) • 字串混淆 – 初階的換編碼,進階的會用算的生成字串 • 反ASM2C – 藉由一些反組譯工具在辨認上會誤會的技巧來使工具無法順利反組譯成 C code • IAT (import address table) – 破壞 IAT 可避免被快速看出意圖並且增加靜態查找 entries 困難,藉由動態計算偏移重新填入 IAT 使程式運行 • Structure Exception Handling (SEH) – try, exception, __finally 跟 SL 大法類似,返回錯誤點重新執行,只是 Jump 的目的是自 建予 CPU 的 IDT List (TIB fs:[0]),另外這種 JUMP 不用 Jmp、Jl、Je 等 ASM,而 Catch Handler 還可於被反編回 C 時被工具視為無用而捨棄(然而異常處理仍可被執行) – 某些時候可供病毒用來偵測是否掛載了 debugger
  29. > • UPX – UPX 是一個以 command line 方式操作的免費壓縮軟體,使用一種叫做 UCL

    的壓縮算法。UCL 最大的好處就是在壓縮及解壓縮的過程中不需要額外的內存,UPX 目有 DOS、Linux 以及 Windows 版本。 • Armadillo – 是一款應用面很廣的商業殼,可以為程式加上使用時間,次數以及啟動畫面等設定,他的保護功 能其中一項稱為 Nanomite。 – Nanomite 技術能夠標記某些程式區段,將這些區段做混淆並寫入記憶體中。對於原本應該是這些 程式碼所在的地方則改為 jump。在壓縮前殼再將這些 jump 改為 int 3(op code 為 0xCC) 的程式中斷點並紀錄這些標記。 – Import table Elimination 也是 Armadillo 使用的技術之一。 由於分析師能夠依據程式 import table 裡的 APIs 猜測到這隻程式的意圖,破壞原本程式的 import table 就能夠增 加反編譯的困難。這項技術在私有殼中也十分常見。 • VM Shell – 以類似於 Java、Python 的 VM Agent (FDE) 來解譯每行加密過的 ASM (vOpCode) 指令。
  30. > Free EDR • SysMon • Wazuh Windows Tools •

    Process Monitor • Process Explorer • Procexp • Autoruns NetWorkSniffer • MITM Proxy • TCPViewer • Nirsoft TCPLogView(有log)
  31. >

  32. >

  33. >

  34. >

  35. >

  36. > • Signal Amplification Relay Attack • Original designed to

    copy for backup and become all in one RFID key in personal used • Can copy 125 kHz (“low frequency”) RFID • Can not copy 13.56MHz (“high frequency”) NFC
  37. >

  38. >

  39. >

  40. > Real Network Force • USA NSA • China APT3

    (a.k.a. Gothic Panda) • Russia APT28 (Hillary Clinton campaign) • Vietnam APT32 (a.k.a. SeaLotus, Toyota global incident) • TW 資通電軍, 調查局資訊科學組, 國安局資訊組
  41. > 國內資安會議 • HITCON CMT • HITCON Pacific • TDoH

    conf • DEVCORE conf (篩選制) • 國際資訊安全組織台灣高峰會 • iThome資安大會 國外資安會議 • SECCON (JP) • CodeBlue (JP) • CCC (GM) • DEFCON (US) • BlackHat (Global: USA、Asia、神州、Europe) 國內技術研討會 • COSCUP • SITCON • MOPCON • PYCON TW • RubyCON • JSDC • RedHat Taiwan • Symantec Taiwan • DevOpsDaysAsia Taipei • vForumTW
  42. > & • 教育部 AIS3 暑期訓練營 – 仿造韓國 BoB 的資安訓練營,有線上前測,前

    180 名可進訓練名單,限我國在學生 • 臺灣好厲駭 年度個別指導計畫 – 1:1 進行指導,老師多為 chroot 組織成員與專業教授或是知名駭客,限我國在學生 • 中科院 AEGIS – 初辦題目較為通靈,近一洗前風,要求 8 小時內解完極困難有條理的題目 (尤其是 Pwn),甚至 Misc1 也是混和整整五道常見 手法成一題的超級混和題 • 金盾盃資安競賽 – 以選擇題前測初篩,KoF 為決賽的競賽,少數非 Jeopardy 競賽,限我國在學生 • 國網 IoT 競賽 – 以上市或未上市的實體產品進行比賽測試,挑戰檢測能力與證明挖掘以及報告撰寫能力 • 國網 Red Alert 72 – 以 Defense 為主的競賽,搭配些許 Jeopardy 做基本分數 • HITCON CTF – 我國最權威資安競賽,也是世界屈指可數權威競賽,亦為世界大賽 DEFCON 之種子賽 所有線上Jeopardy,全球戰隊積分與競賽預定時程 • TrendMicro CTF – HITCON CTF 種子賽 • AIS3 EoF – AIS3 的年尾嘉年華競賽,前身 AIS3 Final 為 HITCON CTF 種子賽 • MyFirstCTF – 適合高中職生的CTF,多考古變形 • BreakAll-CTF – 適合高中職生的CTF,多考古變形
  43. > • WikiPedia x86 / x86_calling_conventions / x86… • Wikibooks

    x86 Assembling • 看雪論壇文章集結本 【加密與解密】 • 【The Shellcoders Handbook】 【Hacking:The Art of Exploitation】 • CTFtime 上關於 Pwn、Reversing 的 WriteUps • Online PWN CTF – Pwn.kr 練習網站 由淺入深、Pwn.tw 經典題目收集網站、OverTheWire • Online Reversing CTF – RingZer0team/Reversing • 52pojie 工具推薦、插件推薦與精華文 • TalkSlides: – AngelBoy1(HITCON 217)、SeanWu(HITCON 217)、aaaddress1(TDoH)、 AsukNakajima(SECCON)、VinceChen(MTK)、ss8654twtw(BFKinesiS)、 frozenkp (BambooFox)
  44. > & • HackerPlayBook v2 • HackerPlayBook v3 • Kali

    Linux 滲透測試工具 第二版 • 白帽子講Web安全 • The Browser Hacker’s Handbook駭客攻防聖經 • Windows Internals, System architecture, processes, threads, memory management, and more, 6/e • Windows Internals, System architecture, processes, threads, memory management, and more, 7/e
  45. > Static Reversing • IDA pro • Ghidra • Snowman

    • Hopper Dynamic Debugger • Ollydbg • CheatEngine MetaData • ExifTool • Peview • Petool • Winhex • HexWorkshop • WinHex • Stud_PE UnPacker • PEiD Dynamic Logger • Elasticsearch + Moloch • MITM Proxy • TCPViewer • Nirsoft TCPLogView(有log) • Procexpa • MemMon • Vmmap • DPerfLite • IRPMon • SdtViewer
  46. > • ANY.RUN: https://app.any.run/submissions • Contagio Malware Dump: http://contagiodump.blogspot.com/ •

    Das Malwerk: http://dasmalwerk.eu/ • Hybrid Analysis: https://www.hybrid-analysis.com/ • KernelMode.info: http://www.kernelmode.info/forum/viewforum.php?f=16 • MalShare: http://malshare.com/ • Malware.lu’s AVCaesar: http://avcaesar.malware.lu/ • malware-traffic-analysis.net https://www.malware-traffic-analysis.net/ • Objective-See Collection: https://objective-see.com/malware.html • PacketTotal: https://packettotal.com/malware-archive.html • SNDBOX: https://app.sndbox.com/ • theZoo: https://thezoo.morirt.com/ • VirusBay: https://beta.virusbay.io/ • VirusShare: http://virusshare.com/ • Virusign: http://www.virusign.com/ • VirusSign: https://www.virussign.com/downloads.html
  47. >

  48. • Penetration Test • Anti-Virus Driver • Sandbox • Secure

    Compiler • Fuzzing Test • Symbolic Execution • Android Kernel • Linux Kernel • CAN Bus