Skip to content

SecureMarshmallow/SecureMarshmallow_iOS_V3

Repository files navigation

์‚ฌ์šฉ์ž์˜ ๊ฐœ์ธ์ •๋ณด๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ : SecureMarshmallow๐Ÿ”“

iOS Badge Xcode Badge

ํŒ€ ์†Œ๊ฐœ

๋ฐ•์ค€ํ•˜ ๋„์›์ค€ ์–‘์ง€์€
@jjunhaa0211 @one3147 @wldms615
PM, iOS, Web Web Sec, Dev iOS Sec

์ฃผ์š” ๊ธฐ๋Šฅ

์•ˆ์ „ํ•œ ๋ฉ”๋ชจ ๋ฐ ์‚ฌ์ง„ ์ €์žฅ

  • ์ผ์ƒ ์†์— ๊ผญ ๊ธฐ์–ตํ•ด์•ผ ํ•˜๋Š” ์ผ๋“ค, ๋˜๋Š” ์ผ์ •๋“ค์„ ๋ฉ”๋ชจ๋กœ ๊ธฐ๋กํ•ด ๊ด€๋ฆฌํ•˜์„ธ์š”. ๐Ÿ–Œ๏ธ
  • ์ผ๋ฐ˜์ ์ธ ๋ฉ”๋ชจ์™€ ๋‹ค๋ฅด๊ฒŒ ์•”ํ˜ธํ™”๋˜๋Š” ํŒจ์Šค์›Œ๋“œ๋ฅผ ํ†ตํ•ด ๊ด€๋ฆฌ๋ฉ๋‹ˆ๋‹ค. ๐Ÿ”
  • ๋ณด๊ด€ํ•ด์•ผํ•˜๋Š” ์‚ฌ์ง„๋“ค๋„ SecureMarshmallow๋ฅผ ํ†ตํ•ด ์•ˆ์ „ํ•˜๊ฒŒ ๊ด€๋ฆฌํ•˜์„ธ์š”. ๐Ÿ”
  • ํŒจ์Šค์›Œ๋“œ์™€ ๊ฐ™์€ ์ธ์ฆ ์ ˆ์ฐจ๋ฅผ ํ†ตํ•ด ์‚ฌ์ƒํ™œ์„ ๋ณดํ˜ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ”‘

๋””๋ฐ”์ด์Šค์˜ ๋ณด์•ˆ ๊ด€๋ฆฌ

  • ๋””๋ฐ”์ด์Šค์˜ ์ƒํƒœ๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ ๊ด€๋ฆฌํ•˜์„ธ์š”. ๐Ÿ“ฑ
  • URL์˜ ์•ˆ์ „์„ฑ์„ ๊ฒ€์ฆํ•˜์„ธ์š”. โš ๏ธ
  • ๋„คํŠธ์›Œํฌ, ๋””๋ฐ”์ด์Šค ๋ฐฐํ„ฐ๋ฆฌ, ์ €์žฅ ๊ณต๊ฐ„ ๋“ฑ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ํŽธํ•˜๊ฒŒ ํ™•์ธํ•˜์„ธ์š”. โœ…

์นจ์ž… ํƒ์ง€ ๋ฐ ์ถ”์ 

  • ๋‚ด ๊ธฐ๊ธฐ์— ์นจ์ž…ํ•œ ๊ธฐ๋ก์„ ํ™•์ธํ•˜์„ธ์š”. ๐Ÿ’ก
  • ๋‚ด ๊ธฐ๊ธฐ๋ฅผ ๋Œ€์ƒ์œผ๋กœ ์Šคํฌ๋ฆฐ์ƒท์„ ์‹œ๋„๋˜์—ˆ๋Š” ์ง€ ํ™•์ธํ•˜์„ธ์š”! ๐Ÿ”ฅ

๋™์ž‘ํ™”๋ฉด

แ„†แ…ฆแ„‹แ…ตแ†ซ แ„†แ…ฆแ„†แ…ฉแ„…แ…ตแ„‰แ…ณแ„แ…ณ แ„‰แ…กแ„Œแ…ตแ†ซแ„Žแ…ฎแ„€แ…ก
๋ฉ”์ธ ํ™”๋ฉด ๋ฉ”๋ชจ ํ™”๋ฉด ์‚ฌ์ง„ ํ™”๋ฉด
แ„‰แ…ฅแ†ฏแ„Œแ…ฅแ†ผ แ„‹แ…ขแ†ธแ„‹แ…งแ†ฏแ„€แ…ตแ„Žแ…ฎแ„Œแ…ฅแ†จ แ„‡แ…ฉแ„‹แ…กแ†ซแ„‰แ…ฅแ†ฏแ„†แ…งแ†ผ
์„ค์ • ํ™”๋ฉด ์—ด๋ฆผ ์ถ”์  ์ ์šฉ ๊ธฐ์ˆ 
แ„‡แ…ขแ„แ…ฅแ„…แ…ต แ„Œแ…ฅแ„Œแ…กแ†ผแ„€แ…ฉแ†ผแ„€แ…กแ†ซ แ„†แ…ฆแ„†แ…ฉแ„‚แ…ขแ„‡แ…ฎแ„Œแ…กแ†จแ„‰แ…ฅแ†ผ
๋ฐฐํ„ฐ๋ฆฌ ํ™•์ธ ์ €์žฅ๊ณต๊ฐ„ ํ™•์ธ ๋ฉ”๋ชจ ๋‚ด์šฉ

๊ธฐ์ˆ  ์Šคํƒ

๐Ÿ”จSnapKit

  • ๊ฐ„๊ฒฐํ•œ layout์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉ

๐Ÿ”งThen

  • ์ฝ”๋“œ๋ฅผ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ๋ณด๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉ

๐Ÿ”IOSSecuritySuite

  • ๊ธฐ๋Šฅ

  • ํƒˆ์˜ฅ ํƒ์ง€ ๋ชจ๋“ˆ

    • ๊ธฐ๊ธฐ๊ฐ€ ํƒˆ์˜ฅ์ด ๋˜์–ด์žˆ๋Š”์ง€ ์•„๋‹Œ์ง€ ํ™•์ธ
  • ์—ฐ๊ฒฐ๋œ ๋””๋ฒ„๊ฑฐ ๊ฐ์ง€๊ธฐ ๋ชจ๋“ˆ

  • ์•ฑ์ด ์—๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ ์‹คํ–‰๋๋Š”์ง€ ์•„๋‹Œ์ง€ ํ™•์ธ

  • ๋ฆฌ๋ฒ„์Šค ์—”์ง€๋‹ˆ์–ด๋ง ๋„๊ตฌ ๊ฐ์ง€

ํƒˆ์˜ฅ ๊ฐ์ง€ ๋ชจ๋“ˆ

  • True/False ๋ฐ˜ํ™˜
if IOSSecuritySuite.amIJailbroken() {
	print(โ€œThis device is jailbrokenโ€)
} else {
	print(โ€œThis device is not jailbrokenโ€)
}
  • ์–ด๋–ค ๊ฒฝ๋กœ๋กœ ํƒˆ์˜ฅ ๋˜์—ˆ๋Š”์ง€ ์•Œ๊ณ ์‹ถ์„ ๋•Œ ์‚ฌ์šฉ
  • ํŒŒ์ผ ๊ฒฝ๋กœ ํ™•์ธ ๊ฐ€๋Šฅ
let jailbreakStatus = IOSSecuritySuite.amIJailbrokenWithFailMessage()
if jailbreakStatus.jailbroken {
print(โ€œThis device is jailbrokenโ€)
print(โ€œBecause: (jailbreakStatus.failMessage)โ€)
} else {
print(โ€œThis device is not jailbrokenโ€)
}
  • ๊ณผ๊ฑฐ์— ํƒˆ์˜ฅ ํ–ˆ์—ˆ๊ณ , ์ง€๊ธˆ๋„ ํƒˆ์˜ฅ์ด ๋˜์–ด์žˆ๋Š” ๊ฒฝ์šฐ
let jailbreakStatus = IOSSecuritySuite.amIJailbrokenWithFailedChecks()
if jailbreakStatus.jailbroken {
if (jailbreakStatus.failedChecks.contains { $0.check == 
.existenceOfSuspiciousFiles }) && (jailbreakStatus.failedChecks.contains 
{ $0.check == .suspiciousFilesCanBeOpened }) {
print(โ€œThis is real jailbroken deviceโ€)
}
}

๋””๋ฒ„๊ฑฐ ํƒ์ง€๊ธฐ

  • ๋””๋ฒ„๊ฑฐ ํƒ์ง€๊ธฐ ๋ชจ๋“ˆ
let amIDebugged: Bool = IOSSecuritySuite.amIDebugged()
  • ๋ชจ๋“  ๋””๋ฒ„๊ฑฐ๋ฅผ ๊ฑฐ๋ถ€
IOSSecuritySuite.denyDebugger()
  • ์—๋ฎฌ๋ ˆ์ดํ„ฐ(๊ฐ€์ƒ๋จธ์‹ ) ํƒ์ง€ ๋ชจ๋“ˆ
let runInEmulator: Bool = IOSSecuritySuite.amIRunInEmulator()
  • ๋ฆฌ๋ฒ„์Šค ์—”์ง€๋‹ˆ์–ด๋ง ๋„๊ตฌ ๊ฒ€์ถœ๊ธฐ ๋ชจ๋“ˆ
var amIReverseEngineered = Securing.IOSSecuritySuite.AmIReverseEngineered() ? true : false;

๐Ÿ“€RealmSwift

  1. SQLite์™€ CoreData๋ณด๋‹ค ์ž‘์—… ์†๋„๊ฐ€ ๋น ๋ฅด๊ณ 
  2. Cross Platform์„ ์ง€์›ํ•ด์„œ ์•ˆ๋“œ๋กœ์ด๋“œ OS์™€ DB ํŒŒ์ผ์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๊ณ 
  3. Realm Studio๋ฅผ ํ†ตํ•ด์„œ DB ์ƒํƒœ๋ฅผ ํŽธํ•˜๊ฒŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ๊ณ 
  4. ์ง๊ด€์ ์ธ ์ฝ”๋“œ๋กœ ์ž‘์—…ํ•  ์ˆ˜ ์žˆ๊ณ 
  5. Rx๋ฅผ ์ง€์›ํ•˜๋Š” RxRealm์ด ์กด์žฌ

โš ๏ธLLDB

  • LLVM์ด ์ปดํŒŒ์ผํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋””๋ฒ„๊น…ํ•  ๋•Œ ์“ฐ๋Š” ํˆด
  • ํ”„๋กœ์ ํŠธ์˜ ์ปดํฌ๋„ŒํŠธ ์ค‘ ๋””๋ฒ„๊น…๊ณผ ๊ด€๋ จ๋œ LLVM์˜ ์„œ๋ธŒ ํ”„๋กœ์ ํŠธ
  • LLDB ๋ณด๊ณ ์„œ

๋™์ž‘ ํ™”๋ฉด

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2023-10-04.at.23.48.14.mp4

About

๐Ÿ”’Local Marshmallow ๐Ÿ”‘

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages