ã¯ããã«
ãã®è¨äºã¯ãNFLaboratories Advent Calendar 2023 - Adventar 11æ¥ç®ã®è¨äºã§ãã
çæ§ãæ¯æ¥ãç²ãæ§ã§ããæè²ã½ãªã¥ã¼ã·ã§ã³æ
å½ã®çªå ´ã§ãã
2023å¹´11æã«OffSec社ã®æä¾ãã¦ããè³æ ¼ã§ããOSEDãåå¾ããã®ã§ãå½è³æ ¼ã®æ¦è¦ãåå¾ããã¾ã§ã®éã®ããç´¹ä»ãããã¨æãã¾ãã
- OffSecã®é¢é£è³æ ¼ã«èå³ãããã
- OSEDåé¨ãèãã¦ããããæ¥æ¬èªã®åèè¨äºãå°ãªãã
- ã©ãããã°åå¾ã§ããã®ãï¼ã©ã®ãããªæè¡ã身ã«ã¤ããããã®ãï¼å ·ä½çã«ç¥ãããã
ãªã©ã®æ¹ã¯æ¯éåèã«ãã¦ã¿ã¦ä¸ããã
ç®æ¬¡
OSEDã¨ã¯ï¼
OSEDã¯ãEXP-301ã¨ãããã¬ã¼ãã³ã°ãåè¬ãã試é¨ã«åæ ¼ãããã¨ã§å¾ãããè³æ ¼ã§ããã¾ããEXP-301: Windows User Mode Exploit Developmentã¨ã¯ãOffSec社ãæä¾ããå¦ç¿ã³ã¼ã¹ã§ãã
EXP-301ã®å 容ã¯ãWindowsã®ã¦ã¼ã¶ã¼ã¢ã¼ãã§åãããã°ã©ã ã®Exploitéçºãã§ããããã«ãªãããã®ãã¬ã¼ãã³ã°ã¨ãªã£ã¦ãããç°¡åãªã¹ã¿ãã¯ãªã¼ãã¼ããã¼ããDEP/ASLRãã¤ãã¹ããã¤ããªè§£æãå©ç¨ããèå¼±æ§ã®çºè¦ã«ããã©ã¼ã«ã¹ãã¦ãã¾ãã
以ä¸ã®å 容ãããEXP-301ãåè¬ããã¨èå¼±æ§ã®çºè¦ï½Exploitéçºã¾ã§ã«å¿ è¦ãªç¥èãå¾ãäºãã§ãã¾ãã
EXP-301ã®æ§æ
EXP-301ã¯TRAINING MATERIALã¨ããæè²è³æãåç»/ExerciseãExtraMilesã¨ããåã»ã¯ã·ã§ã³ç¨ã®æ¼ç¿åé¡ãçºå±åé¡ãã»ããã«ãªã£ãå¦ç¿ç¨ã³ã³ãã³ãã¨CHALLENGE LABSã¨å¼ã°ããæ¼ç¿ç°å¢ã§æ§æããã¦ãã¾ãã
TRAINING MATERIALã®ãã¡ã®æè²è³æã¯ã以ä¸ã®å
容ã§æ§æããã¦ãã¾ãã
â»syllabusã«ã¤ãã¦ã¯こちらãåç
§ä¸ããã
- WinDbg and x86 Architecture
- Exploiting Stack Overflows
- Exploiting SEH overflows
- Introduction to IDA Pro
- Overcoming Space Restrictions: Egghunters
- Creating Custom Shellcode
- Reverse Engineering for Bugs
- Stack Overflows and DEP Bypass
- Stack Overflows and ASLR Bypass
- Format String Specifier Attack Part I
- Format String Specifier Attack Part II
- â»Windows x86ã®ã¹ã¿ãã¯ãã¼ã¹ã®Exploitéçºãã¡ã¤ã³ã§ãã
ä¸è¨å 容ãåç §ããã¨ã解æã«æ £ãã¦ããªãæ¹ã«ã¨ã£ã¦ã¯ãå°ã æ·å± ã®é«ãå 容ã«è¦ãã¦ãã¾ãã¾ãããWindowsã«ãããx86ã¢ã¼ããã¯ãã£ã®æ¦è¦èª¬æã¨ãã¦ãã¹ã¿ãã¯ã¨ã¯ä½ãï¼ãããå¼ã³åºãè¦ç´ããåCPUã¬ã¸ã¹ã¿ã®ç¨éãçã®åºæ¬çãªå 容ãè³æå ã§èª¬æãã¦ããã¦ãã¾ãã
ã¾ããWinDbgãIDA Freeã®ä½¿ç¨æ¹æ³ã説æãã¦ããã¦ããã®ã§ããã¾ã§æ·å± ã¯é«ããªãã¨æãã¾ãã
EXP-301ãåè¬ããåã«èº«ã«çãã¦ããã¨æ¥½ã«ãªãã¹ãã«
ç§ãèããEXP-301ãåé¨ããåã«èº«ã«çãã¦ããã¨æ¥½ã«ãªãã¹ãã«ã¯ä»¥ä¸ã®éãã§ãã
- åºæ¬çãªPython3ã®æ§æãç解ããæå³ããããã/ããã£ãå«ãHTTPãªã¯ã¨ã¹ããéä¿¡ããã³ã¼ããç´ãã«è¨è¿°ã§ããã
- x86ã¢ã»ã³ããªè¨èªã®ã³ã¼ããèªãã§ãåä½ãç解ã§ããã
- æ´ã«ãã¢ã»ã³ããªãèªãã æã«Cè¨èªã®ã½ã¼ã¹ã³ã¼ããã¤ã¡ã¼ã¸ã§ããã
- ããã°ã©ã å®è¡æã«ã¡ã¢ãªé åãã©ã®ããã«ç®¡çããã¦ããããç¥ã£ã¦ããã(ã¹ã¿ãã¯ã®ç©ã¿ä¸ãé åºããã¼ã¿ã®æ ¼ç´é åºã®ç解ç¨åº¦ã§åé¡ããã¾ããã)
ä½µãã¦ãã¹ã¿ãã¯ãã¼ã¹ã§ããã¼ããã¼ã¹ã§ãè¯ãã®ã§Buffer Overflowãç¨ãã¦Shellcodeãå®è¡ããçµé¨ãããæ¹ã¯ãããè³æã®å 容ãç解ããããã¨æãã¾ãã
â»ãã¡ãããEXP-301ã®åè¬ãéãã¦ä¸è¨ã®ã¹ãã«ã身ã«ã¤ãããã¾ãã®ã§ãå®å¿ãã ãããããã¾ã§èº«ã«çãã¦ããã¨æ¥½ã«ãªãã¹ãã«ã¨èãã¦ãã¾ãã
EXP-301ãåè¬ããå¾ã«èº«ã«ã¤ããããã¹ãã«
TRAINING MATERIALãCHALLENGE LABSã®å 容ãã以ä¸ã®ã¹ãã«ã身ã«çããäºãã§ãã¾ãã
ã解æã«é¢ããæè¡ã
- WinDbgã§ã®åç解æ/IDAã§ã®éç解æãçµã¿åããã解ææè¡
- äºã¤ã®ãã¼ã«éã§è§£æ対象ã®ãã¼ã¹ã¢ãã¬ã¹ãåæãããéç解æã«ã¦ãã¼ã«ã«å¤æ°/ã¬ã¸ã¹ã¿ã¸ã®æ ¼ç´å¤ãæ¡ä»¶åå²ã®åå²å ãäºæ¸¬ãã¤ã¤ãåç解æã«ã¦æå³ããå¤ãæ ¼ç´ããã¦ãããã確èªãã¾ãã
- ç§ã¯ãéç解æãè¡ã£ã¦ãããç¨åº¦èå¼±æ§ã®ãããããªå ´æã«è¦åããã¤ããå¾ã«ãåç解æã使ç¨ããªãããéä¿¡ãããã¤ãã¼ããã©ã®å¦çã辿ã£ã¦ãããã確èªãã¦ãã¾ãããð¤
- â»èå¼±æ§çºè¦ã®æè¡ã«ç¦ç¹ãå½ã¦ã¦ããã®ã§ãã«ã¦ã§ã¢è§£æã®æè¡ã¨ã¯å°ã ç°ãªãã¾ãã
ãStack Overflowã«é¢ããæè¡ã
- SEH(Structured Exception Handling)
- SEHã¨ã¯ãæ§é åä¾å¤å¦çã¨ãå¼ã°ããWindows OSã«ãããããã°ã©ã ã®ä¾å¤å¦çç¨ã«å®è£ ãããæ©æ§ã§ãã
- Egghunter
- ã¯ã©ãã·ã¥æç¹ã§ä½¿ç¨ã§ããã¹ã¿ãã¯é åãå°ãªãå ´åã«ãã¡ã¢ãªä¸ã«é ç½®ããShellcodeãæ¢ãåºãå é ã¢ãã¬ã¹ã«é·ç§»ãããã¢ã»ã³ããª(Egghunter)ãä½æãã¾ãã
- æä½å¯è½ãªã¡ã¢ãªé åã«Pivotããããã®ç®å°ã¨ãªããã¤ããªãã¿ã¼ã³ãEggã§ããããæ¢ãåºãå¦çãå®è£ ããããEgghunterã§ããð¥
- ROP(Return-Oriented Programming)
- Return-Oriented Programmingã¯ç´è¨³ããã¨ããªã¿ã¼ã³æåããã°ã©ãã³ã°ã§ãããç°¡åã«èª¬æããã¨ãå½ä»¤+RETå½ä»¤ããåå¨ããã¡ã¢ãªã¢ãã¬ã¹æå®ãç¹°ãè¿ããã¨ã§DEPãæå¹åããããã¤ããªä¸ã§ãæªæã®ããæä½ãå®ç¾ãããã¨ããå 容ã§ãã
- ãå½ä»¤+RETå½ä»¤ãã®çµã¿åãããROPã¬ã¸ã§ããã¨å¼ã³ããã¤ããªä¸ã«åå¨ããROPã¬ã¸ã§ãããæ¢ãä½æ¥ã¯ãå®ãããðã«ä¼¼ã¦ããããå人çã«ã¯ã¨ã¦ã好ãã§ããCTFçã§æ±ã£ãçµé¨ããããåç¥ã®æ¹ãå¤ãã¨æãã¾ãã
- å¾ã»ã©ç°¡åãªROPã¬ã¸ã§ããã¨ãã®åä½ã«ã¤ãã¦ç´¹ä»ãã¾ãã
- DEP/ASLR bypass
- DEPã«ã¤ãã¦ã¯ãROPã使ç¨ãã¦åé¿ã§ãã¾ãããASLRã®å ´åã«ã¯ãã¼ããã¹ã¿ãã¯çã®é åãä»®æ³ã¢ãã¬ã¹ç©ºéä¸ã®ã©ã³ãã ãªã¢ãã¬ã¹ã«é
ç½®ããã¦ãã¾ã£ã¦ããã®ã§ã主ã«ä»¥ä¸ã®ãããªæ¹æ³ã§åé¿ããå¿
è¦ãããã¾ãã
- 1.ASLRãç¡å¹åããã¦ããã¢ã¸ã¥ã¼ã«ãæ¢ãã
- âã¢ãã³ãªããã°ã©ã ã§ã¯æå¹åããã¦ããå ´åãå¤ãã
- 2.ASLRãæå¹åããã¦ãããã¤ããªã§ããã¡ã¢ãªä¸ã«é
ç½®ãããéã«ä¸é¨ã®bitãåºå®ããããã¨ãå©ç¨ããé¨åçãªä¸æ¸ããå®è¡ããã
- âROPãä½µç¨ããå ´åã¯ã使ç¨ã§ããã¬ã¸ã§ãããéããã¦ãã¾ãã
- 3.ãã¼ã¹ã¢ãã¬ã¹ããã«ã¼ããã©ã¼ã¹ããã
- âã¢ã¯ã»ã¹ã§ããªãç¡å¹ãªã¢ãã¬ã¹ããã«ã¼ããã©ã¼ã¹éä¸ã§æå®ãã¦ãããã°ã©ã èªä½ãã¯ã©ãã·ã¥ããªãããã¯ã©ãã·ã¥ãã¦ãèªåçã«åèµ·åããããã°ã©ã ã«å¯¾ãã¦ããå®è¡ã§ããªãã
- âãã¤ã¨ã³ãããã¼ASLRãæå¹åããã¦ããç°å¢ã§ã¯è¨ç®éãé常ã«å¤§ãããªã£ã¦ãã¾ãã
- 4.Info Leak(Information Leakage)é¢é£ã®èå¼±æ§ã使ç¨ãã¦ã¢ã¸ã¥ã¼ã«ã®ã¢ãã¬ã¹ãåå¾ããã
- âInfo Leaké¢é£ã®èå¼±æ§ããªãã¨å®è¡ã§ããªãã
- 1.ASLRãç¡å¹åããã¦ããã¢ã¸ã¥ã¼ã«ãæ¢ãã
- DEPã«ã¤ãã¦ã¯ãROPã使ç¨ãã¦åé¿ã§ãã¾ãããASLRã®å ´åã«ã¯ãã¼ããã¹ã¿ãã¯çã®é åãä»®æ³ã¢ãã¬ã¹ç©ºéä¸ã®ã©ã³ãã ãªã¢ãã¬ã¹ã«é
ç½®ããã¦ãã¾ã£ã¦ããã®ã§ã主ã«ä»¥ä¸ã®ãããªæ¹æ³ã§åé¿ããå¿
è¦ãããã¾ãã
ä¸è¨ã®ææ³ã®ãã¡ãEXP-301ã§ã¯ã4çªç®ã®Info Leakã®ææ³ãä¸å¿ã«æ¼ç¿ãå®æ½ãã¦ããã¾ãã
ãéçºã«é¢ããæè¡ã
- Python3ã§ã®éçºæè¡
- å ¨ã¦ã®Exploit Codeã¯Python3ã§éçºãã¾ããã¾ããOSEDã§ã¯ãªã¢ã¼ããããã¤ãã¼ããéä¿¡ããããã°ã©ã ã«å¯¾ãã¦å¤ãå ¥åããäºã§Shellcodeã®çºç«ãè¡ãã¾ã§ãç¦ç¹ã«ãªã£ã¦ãã¾ãã
- ãã£ã¦ããã¤ãã¼ããéä¿¡ããã¨ãã«ã¯æå³ããå¤ããã±ããã«å«ããããã«Python3ã®ã³ã¼ããè¨è¿°ããå¿
è¦ãããã¾ãã
- ããå³å¯ã«ã¯ããã¤ãã¼ããåãåã£ãããã°ã©ã ã§ã¡ã¢ãªã«å¤ãæ ¼ç´ããã¨ãã«ã¯ã(OSEDã§ã¯x86ç³»ã®CPUãæ¨çã¨ãã¦ããããã«)ãªãã«ã¨ã³ãã£ã¢ã³ãèæ ®ãã¦ã³ã¼ããè¨è¿°ãã¾ãã
- ãããã®ãå¤ã®éä¿¡âã¡ã¢ãªã¸ã®æ ¼ç´âããã°ã©ã ã§ã®å¦çãã¾ã§ãæå³ããæµãã§è¡ããããã«éçºãè¡ãã¾ããð
- Shellcodeã®éçºæè¡
- ã¢ã»ã³ããªã§è¨è¿°ããå¦çå 容ã16é²æ°ã«å¤æããShellcodeãä½æãã¾ãããã®æã«Shellcodeã®ãã¤ãæ°ãæ¸ãããå¦çãå¹çåããããã«EDTããåå¾ããWindows APIã®ååãrorå½ä»¤ã使ç¨ãã¦ããã·ã¥å(API Hashing)ããããWindows APIã®é¢æ°å¼ã³åºãæã®ã¹ã¿ãã¯ãåç¾ãããã¨å·¥å¤«ãæ½ãã¾ããð
å°ã
é·ããªãã¾ããããã¤ã¡ã¼ã¸ãå
·ä½åãããæ¹ã®ããã«ã詳ããæ¸ãã¾ããã
ãªãã以ä¸ã®ãããªã¨ã¯ã¹ããã¤ãéçºã¯å«ã¾ããªãã³ã¼ã¹ã«ãªã£ã¦ãã¾ãã
- Heapé åã対象ã«ããã¡ã¢ãªç ´å£
- 64bitã¢ããªã±ã¼ã·ã§ã³ã対象ã«ããã¨ã¯ã¹ããã¤ã
- Windowsã®ã«ã¼ãã«ãã©ã¤ãã対象ã«ãã解æã¨èå¼±æ§çºè¦
ä¸è¨ã¯ãEXP-301ã®ä¸ä½äºæã§ããEXP-401/OSEEãåè¬ããå¦ç¿ããå¿ è¦ãããã¾ãã
ç§ã¯è§£æãæ¯è¼ç好ããªæ¹ãªã®ã§ç·ãã¦ã¨ã¦ã楽ãããæ¯æ¥ã¯ã¯ã¯ã¯ããªããè³æãæ¼ç¿ç°å¢ã¨åãåã£ã¦ãã¾ããã
ç¹ã«å®æ¥åå ã§ããã¯ã¨ã³ãã®å¦çãåãããããã£ã¨æ©ãã§ããäºããã£ãã®ã§ããããããä½ã¬ã¤ã¤ã§å¦çãä¸ã¤ãã¤æ´çãã¦ããæ¹ãããã£ã¨æ¥½ããã¨æãã¾ãããð¥³
Windows OSã«é¢ããå¦çã®ç´°ããé¨åã¾ã§è¿½ã£ã¦ããã¾ãã®ã§ãå¦ã¹ãå 容ã¯å¤ãã¨æãã¾ããã¾ããèå¼±æ§ã£ã¦ã©ããã£ã¦æ¢ããã ããï¼ã«èå³ãããæ¹ã¯æ¯éãåãã¦ã¿ã¦ãã ããã
OSEDãåå¾ããã¾ã§ã®éã®ã
試é¨ã¾ã§ã®æºå
大ã¾ããªè©¦é¨å¯¾çé ç®ã¨ãã®ã¹ã±ã¸ã¥ã¼ã«(æé)ã¯ä»¥ä¸ã®éãã§ãã
â»EXP-301ã®ç»é²æã«ã¯ã90æ¥ã³ã¼ã¹ãé¸æãã¦ãã¾ãããå°ã æéããªãç¦ãã¾ããããæçµçã«ã¯ç´20æ¥æ®ãã¦è©¦é¨åæ ¼ã¾ã§éæã§ããã®ã§ãäºåç¥èãããã°90æ¥ã³ã¼ã¹ã§ãè¯ãã¨æãã¾ãã
試é¨å¯¾ç |
æé |
è£è¶³ |
---|---|---|
1.Udemy Exploit Development Tutorial for Hackers and Pentesters |
7~8æ | ã»Udemyã§åé¨ã§ããææã³ã¼ã¹ ã»Linuxãã¼ã¹ã®å 容ã ããROPã®åºç¤çãå¦ç¿å¯è½ |
2.EXP-301 TRAINING MATERIAL |
8~9æ | Exerciseã¨ExtraMilesãä½µãã¦å®æ½ |
3.EXP-301 CHALLENGE LABS |
9~10æ | 3ã¤ã®Challangeã§æ§æ |
1.Exploit Development Tutorial for Hackers and Pentesters
ä¸è¨ã®è£è¶³ã§ãè¨è¼ãããã¾ããããLinuxãã¼ã¹ã®Exploitéçºã®åºç¤çãªå 容ã§ãã®ã§å®å ¨ã«OSEDã®å 容ã¨åè´ããããã§ã¯ããã¾ãããã¾ããé常ã«åæ©çãªå 容ãå«ã¾ãã¦ããã®ã§ã復ç¿ã¨ããæå³ãå«ãã¦åè¬ãã¾ããã
åãã«ã¡ã¢ãªãå®è¡å¯è½ãã¡ã¤ã«ã®ä»çµã¿ãå¦ãã å¾ã«ãã¹ã¿ãã¯ãªã¼ãã¼ããã¼ã使ç¨ããæ»æææ³ãå¦ã¹ã¾ãã
ã¾ããé¢ç½ãã£ãã®ã¯DEPãASLRã®ãã¤ãã¹ä»¥å¤ã«ãRELRO(RELocation Read Only)ã¨å¼ã°ããããGOTãå«ãç¹å®ã®ã»ã¯ã·ã§ã³ãRead Onlyã«è¨å®ã§ããã»ãã¥ãªãã£æ©æ§ãããã¤ãã¹ããææ³ãå¦ã¹ããã¨ã§ãã
æçµçã«ãOSEDã«æ´»ããå 容ã¨ããã§ãªãå 容ãããã¾ãããå¦ã³ã¯å¤ãã£ãã§ãã
2.EXP-301 TRAINING MATERIAL
TRAINING MATERIALã®ä¸ã«ã¯Exerciseã¨ããåºæ¬åé¡ã¨ExtraMilesã¨ããçºå±åé¡ãåå¨ãã¾ããç§ã¯Exerciseã確å®ã«å®æ½ããExtraMilesã¯ä½è£ãããã°åãçµãã¨ããæ¹éã§è¡ãã¾ããã
æçµçã«ã¯ãã»ã¼ãã¹ã¦ã®ExtraMilesãå«ãã¦å®äºãã¾ããããä¸ã¤ã®Extra Mileã ãã¯ãé常ã«é£ããå®äºã«è³ãã¾ããã§ããã
ã¡ãªã¿ã«ãå®äºã§ããªãã£ãExtraMilesã«ã¯ãThis exercise is not for the faint heart.ãã¨ããã¡ãã»ã¼ã¸ãè¨è¼ããã¦ãã¾ãã訳ãã¨ããå¿èã®å¼±ã人ã¯ãé æ ®ãã ããããã¨ããã¸ã§ããã³ã¼ã¹ã¿ã¼ã®ãããªæ³¨ææ¸ãã«ãªã£ã¦ãã¾ããð¢
ç¶ãã¯ãå¿èãå æ°ã§æéã®ããæã«ããããã¨æãã¾ãã
3.EXP-301 CHALLENGE LABS
CHALLENGE LABSã¯3ã¤ã®èª²é¡ããæ§æããã¦ãã¾ãã課é¡ã«åãçµãéã«ã¯ã以ä¸ã®ãã¼ã«ã使ç¨ããã¨ãWinDbgã¨ãµã¼ãã¹èµ·åã®ããããä½æ¥ãã解æ¾ãããã®ã§ãå§ãã§ãã
å®éã®æ¼ç¿ã®å
容ã«ã¤ãã¦ã¯ããã¿ãã¬ããã®ã§è¨è¿°ãã¾ããããæå¾ã®ãã£ã¬ã³ã¸ã¯å°ã
é£ããã1é±é(å®è³ª30æéããã)ã»ã©æéããããã¾ããã
æ¬çªã®ä¸é¨ã®åé¡ã¨CHALLENGE LABSã®åé¡ããé£æ度ãæ§æã«ã¤ãã¦ä¼¼éã£ã¦ãããç¬åã§ããåããããã«ãªã£ã¦ããã¨è¯ãã¨æãã¾ããðª
試é¨å½æ¥ã®æµã
OSEDã®è©¦é¨ã¯ã47æé45åã®æ¼ç¿ã¨24æéã®ã¬ãã¼ãä½æã§æ§æããã¦ãã¾ãã
60ç¹ãåæ ¼ç¹ã¨ãªã£ã¦ããã2ã¤ã®èª²é¡ã¯30ç¹ãã¤ã1ã¤ã®èª²é¡ã¯40ç¹ã¨ãªã£ã¦ãã¾ããã¤ã¾ãã3ã¤ã®èª²é¡ã®ãã¡2ã¤ä»¥ä¸ãå®äºããã°åæ ¼ç¹ã«ã¯éãã¾ãã
試é¨å½æ¥ã®ã¿ã¤ã ã¹ã±ã¸ã¥ã¼ã«ã¯ä»¥ä¸ã®éãã§ãã
æ¥æ° | æå» | å 容 |
---|---|---|
day1 | 13:00 | åå¾ãã試é¨éå§ã課é¡1ããåãçµãã |
day1 | 17:00 | 課é¡1ãå®æãéãããROPã¬ã¸ã§ããã«å°ã æ¸æã£ããäºå®éãã«å®äºã |
day1 | 20:00 | 課é¡2ãå®æããã¡ãã¯ãé£ãããªãæé éãã«ããªãã ãã ã£ãå°è±¡ã |
day2 | 2:00 | 課é¡3ã®è§£æã«è¦æ¦ãé ã飽åããã®ã§ã2æéã»ã©ç¡ç ã |
day2 | 8:00 | 課é¡3ã®è§£æãå®äºãèå¼±æ§æ¢ãã®æ ã¸ã |
day2 | 18:00 | åå²ã®è§£æãããããçµäºãèå¼±æ§ããããããªå ´æã«ããããã¤ããã |
day2 | 22:00 | èå¼±æ§ã®çºè¦ãçµäºãéææã |
day3 | 2:00 | æ°ä»ãããéææã¨ã¨ãã«å¯ã¦ããã |
day3 | 8:00 | æå¾ã®èª²é¡ã«å°ã æéåã£ãããä½ã¨ãå®æãå ¨è©¦é¨å 容ã¯å®äºã |
day3 | 24:00 | ã¬ãã¼ãä½æå®äºãç´100æã®ã¬ãã¼ãã«ã |
- å ¨ã¦ã®èª²é¡ãçµããããéææã¯åã¾ãããçµãã£ãå¾ã«æ£æ©ããã¨ãã®ç©ºã¯ã¨ã¦ãéãæãã¾ãããð
- ã¬ãã¼ãæåºå¾ã1å¶æ¥æ¥ãããã§çµæãéä»ããã¦ãã¾ããã
çµãã£ã¦ã¿ã¦æããã¨
試é¨å 容ãTRAINING MATERIALã®è³æ/Exerciseã®å 容çãåå¼·ã«ãªãäºã°ããã§ããããã¯ãOffsecç³»ã®è©¦é¨ã¯è¦ããªãä¸çãåºãã¦ãããæ°ããã¾ããðª
è足ã§ã¯ããã¾ãããOSCE3ãåå¾ããããã®3è³æ ¼(OSED/OSWE/OSEP)ã®ãã¡Discordã«ç»é²ãã¦ããåæ ¼è ãæãå°ãªãã®ããOSEDã¨ãªãã¾ãã
â»OffSec社ã®ç®¡çãã¦ããDiscordãµã¼ãä¸ã§ã®åå¾çµæã¨ãªãã¾ãã人æ°ã«ã¤ãã¾ãã¦ã¯ã2023å¹´10æ26æ¥ã«åå¾ããå
容ã¨ãªãã¾ãã
â»OSCE3ã®å
容ã«ã¤ãã¦ã¯ãæ¯é
弊社エンジニアブログの記事ããåç
§ãã ããã
ãã¯ããä½ã¬ã¤ã¤ã®å 容ãå¤ãäºããã£ã¦ãåé¨ããã¥ãããã§ããã...ð¤
ã¾ã ã¾ã ãå®éã®èå¼±æ§ãæ¢ãã®ã«ã¯èº«ã«ã¤ãããã¦ããªãç¥èã ãããªã®ã§ãã¼ããã¤èå¼±æ§ã®çºè¦ãCVEãæ¡çªã§ããããã«ãªãããã§ããð¾
Appendixï¼ROPã®ç´¹ä»
OSEDã§ã¯ãåãæ±ããªãã¨è©¦é¨ã«è¨ããªãã¬ãã«ã§éè¦ãªROPã«ã¤ãã¦è£è¶³ã¨ãã¦èª¬æãããã¨æãã¾ãã
ä¸è¿°ããéããROPã¯ãå½ä»¤+RETå½ä»¤ããåå¨ããã¡ã¢ãªã¢ãã¬ã¹æå®ãç¹°ãè¿ããã®ã§ãããããã§ã¯ä½ãè¨ã£ã¦ããã®ãåãããªãã§ããã...ããã¾ããã
ããã°ã©ãã³ã°ææ³ã®ä¸ã¤ã§ããã¨ãããROPã§ãããæç« ã§èª¬æãããããåããè¦ãæ¹ãæ©ãã¨æãã¾ãã®ã§ã¹ã©ã¤ãã«èµ·ããã¦ã¿ã¾ãããä¸ã¤ã®ã¹ã©ã¤ããé²ããã®ãã¹ãããã¤ã³å®è¡ãä¸åé²ãã¦ããã®ã¨åãæä½ã¨ãã¾ãã
â»ã¹ã¿ãã¯ä¸ã®å¤ã¯æ¢ã«ã¹ã¿ãã¯ãªã¼ãã¼ããã¼ã«ãã£ã¦æ¸ãæãããã¦ãããEIPã®å¶å¾¡ãåå¾æ¸ã¿ã®ãã®ã¨ãã¾ãã
â»ã¡ã¢ãªã¢ãã¬ã¹ã®å¤ã«ã¤ãã¦ãç°¡ç¥åã®ããã«åãããããå¤ã«ãã¦ããã¾ãã®ã§ãå®éã®å¤ã¨ã¯ç°ãªãç¹ã«ã¤ãã¦ãäºæ¿ãã ããã
â»åæã¨ãã¦ã以ä¸ãç解ãã¦ããå¿
è¦ãããã¾ãã
- ãEIPã«ã¯æ¬¡ã«å®è¡ããæ©æ¢°èªã®ã¢ãã¬ã¹ãã»ããããã¦ãããã¨ãã
- ãRETå½ä»¤ã§ã¯ã¹ã¿ãã¯ä¸ã®å¤(ESPãæãå¤)ãPOPãã¦EIPã«æ ¼ç´ãã対象ã®ã¢ãã¬ã¹ã«JMPãã¦ãããã¨ãã
- ãPOPå®è¡å¾ã«ã¯ESPã®å¤ãå ç®ããã¦ãããã¨ãã
ãå½ä»¤+RETå½ä»¤ãã®çµã¿åããã¨ã¯ãã¹ã©ã¤ãä¾ã®ãadd eax, 0x08 + retããæãã¦ãã¾ãããããã®RETå½ä»¤ã§çµäºããæ©æ¢°èªã®ã¢ãã¬ã¹ãã¹ã¿ãã¯ä¸ã«ç©ã¿ä¸ããã¨ãå®è¡ããããå¦çãç¹°ãè¿ããã¨ãã§ãããããçè«ä¸ããããå¦çãå®è£ ã§ããããã«ãªãã¾ãã
ä¾ãã°ãEAXã¨EBXãæ¸ç®ãããããªå¦çãå®è¡ãããå ´åã¯ããsub eax, ebx + retãã®çµã¿åãããå®è¡ãã¦ããEXEãDLLçããæ¢ãåºããã¹ã¿ãã¯ã«ç©ãã°è¯ãã ãã§ãã(x86ã¢ã»ã³ããªã§ã¯ããsub eax, ebx + retãã¯æ©æ¢°èªã§è¡¨ãã¨ã0x29 0xd8 0xc3ãã¨ãªããããããã®16é²æ°ã®ç¾ åãä¿åãã¦ããã¢ãã¬ã¹ãæ¢ãã¾ãã)
ãã®ããã«ãæ©æ¢°èªãé£ç¶ãã¦å¦çããããã¨ã§ç®çãéæãã¦ããããã§ããå®éã«ã¯ã欲ããçµã¿åãããããã«è¦ã¤ããããã§ã¯ããã¾ããã®ã§ãéãããROPã¬ã¸ã§ããã®ä¸ã§ç®çã®å¦çãä½ã£ã¦ããå¿ è¦ãããã¾ãããã®ä½æ¥ãå®æ¢ãã«ä¼¼ã¦ãããé常ã«éãããã¬ã¸ã§ããã®ä¸ã§ç®çãéæããæã®åã³ã¯ã²ã¨ããã§ãã
ããã§ãåé¡ã§ãã以ä¸ã®ç°¡åãªROPãèªãã§ã¿ã¦ãã©ããªå¦çã«ãªãããèãã¦ã¿ã¦ãã ãããropã®å¤æ°å¤ã¯æ¨çä¸ã§ã¹ã¿ãã¯ã«å±éããã¦ãã¾ããåã¢ãã¬ã¹ã®æãæ©æ¢°èªã«ã¤ãã¦ã¯ãã³ã¡ã³ãã¢ã¦ããåèã«ãã¦ãã ããã
â»ã¹ã©ã¤ãåæ§ã«ã¡ã¢ãªã¢ãã¬ã¹ã«ã¤ãã¦ã¯å®éã®å¤ã¨ã¯ç°ãªãã¾ããã¾ããpack()ã«ã¤ãã¦ã¯å¤ããªãã«ã¨ã³ãã£ã¢ã³ã§å¤æ°ã«æ ¼ç´ãã¦ããã«éãã¾ããã®ã§ç¡è¦ãã¦ããã ãã¦å¤§ä¸å¤«ã§ãã
... rop += pack("<L", (0x10010101)) # pop ecx ; ret rop += pack("<L", (0x88888888)) rop += pack("<L", (0x10120101)) # add eax, ecx ; ret rop += pack("<L", (0x10010101)) # pop ecx ; ret rop += pack("<L", (0x77777878)) rop += pack("<L", (0x10120101)) # add eax, ecx ; ret ...
ããã«è§£èª¬ãã¦ãã¾ãã¾ãããä¸è¨ã¯ãadd eax, 0x100ããå®è¡ããããã®ROPã«ãªã£ã¦ãã¾ããROPã§ã¯ç¹å®ã®ã¬ã¸ã¹ã¿ã«å³å¤ãæ ¼ç´ããã¬ã¸ã§ãããå°ãªããã¤NULLãã¤ããå«ããããªãå ´åãå¤ã(ã¹ã¿ãã¯ãªã¼ãã¼ããã¼æã«NULLãã¤ããæååçµç«¯ã¨ã¿ãªããã¦ãã¾ã)ãããä¸è¨ã®ããã«åããã©ãããæ¹ãåã£ã¦ãã¾ãã
OSEDã®è©¦é¨ã§ã¯ãæçµçã«Windows APIãå®è¡ãã¦Shellcodeãçºç«ãããã®ã§ãä¸è¨ããããã£ã¨è¤éãã¤ã³ã¼ããé·ããªãã¾ããå°ãã§ãèå³ããããæ¹ã¯æ¯éãOSED試é¨ã§ä½æãã¦ã¿ã¦ä¸ãããð
æå¾ã«
æå¾ã¾ã§èªãã§ãã ãã£ã¦ãããã¨ããããã¾ãããç§äºãªãããOSCP/OSEPã¯æ¢ã«åå¾ãã¦ãããOSCE3ã¾ã§æ®ãã¯OSWEã®ã¿ã¨ãªãã¾ããã
OSCE3ãã«ãã¼ãç®æãã¦æ¥ã ç é½ãç¶ããå°ãã§ãè²¢ç®ã§ããããã«ç²¾é²ãã決æ表æã«ã¦ãæ¬è¨äºã®ç· ãã¨ããã¦ããã ãã¾ãã