ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๊ฐœ์š”

Drozer๋Š” FSecureLABS์—์„œ ๊ฐœ๋ฐœํ•œ ์•ˆ๋“œ๋กœ์ด๋“œ ๋™์  ๋ถ„์„ ํ”„๋ ˆ์ž„์›Œํฌ๋กœ PC์™€ ๋””๋ฐ”์ด์Šค ์‚ฌ์ด์˜ Agent๋ฅผ ํ†ตํ•ด ์•ฑ์˜ ์ทจ์•ฝ์„ฑ์„ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ๋“œ๋กœ์ € ์ „์— Mercury๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ์‚ฌ์šฉ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ์˜ ๋ณด์•ˆ์„ฑ์„ ํ…Œ์Šค ํ•˜๊ธฐ ํ•˜๊ธฐ ์œ„ํ•œ ํ‘œ์ค€์œผ๋กœ ๋ถˆ๋ ธ์„ ๋งŒํผ ์˜ค๋žœ ๋ช…์„ฑ์„ ๊ฐ€์ง€๊ณ  ์žˆ์ง€๋งŒ ํ˜„์žฌ๋Š” ์ถ”๊ฐ€์ ์ธ ๊ฐœ๋ฐœ์„ ์ค‘๋‹จํ•œ ์ƒํƒœ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

 

๋“œ๋กœ์ € ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•ด์„  ํŒŒ์ด์ฌ 2.7๋ฒ„์ „์„ ์‚ฌ์šฉํ•ด์•ผ ๋˜๊ธฐ ๋•Œ๋ฌธ์— "์•„๋‚˜์ฝ˜๋‹ค"ํ™˜๊ฒฝ์— ๊ตฌ์ถ•ํ•˜์—ฌ ๋ณ„๋„์˜ ๋ถ„๋ฆฌ๋œ ์˜์—ญ์— ์„ค์น˜ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

*์•„๋‚˜์ฝ˜๋‹ค ํ™˜๊ฒฝ๊ตฌ์ถ• ํ•˜๋‹จ ํฌ์ŠคํŒ… ์ฐธ๊ณ 

guleum-zone.tistory.com/136

 

์•„๋‚˜์ฝ˜๋‹ค(Anaconda) ์„ค์น˜

๊ฐœ์š” Anaconda๋Š” ์ˆ˜๋ฐฑ ๊ฐœ์˜ ํŒจํ‚ค์ง€๋ฅผ ํฌํ•จํ•˜๊ณ  ์žˆ๋Š” ๋ฐฐํฌํŒ์œผ๋กœ ๊ธฐ์กด์˜ ํŒŒ์ด์ฌ์—์„œ๋Š” pip๋ผ๋Š” ์†Œ์ˆ˜์˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์ง€๋งŒ Anaconda๋ฅผ ์ด์šฉํ•˜๋ฉด ์ด์™ธ์˜ scipy, pandas, numpy ๋“ฑ ๋จธ์‹ ๋Ÿฌ๋‹, ๋ฐ์ดํ„ฐ ๋ถ„

guleum-zone.tistory.com

ํ•˜๋‹จ์˜ ๋งํฌ์— ์ ‘์†ํ•˜์—ฌ ๋กœ์ปฌ PC์— ์„ค์น˜ํ•  "drozer-2.4.4._win32_msi" ์™€ ๋””๋ฐ”์ด์Šค ๋‚ด๋ถ€์— ์„ค์น˜ํ•  "drozer-agent" ํŒŒ์ผ 2๊ฐ€์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

์„ค์น˜๋œ 2๊ฐ€์ง€ ํŒŒ์ผ์„ ํ™•์ธํ•ด ์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์„ค์น˜ ์ค‘๊ฐ„์— ํ•ด๋‹น ํŒŒ์ผ์„ ์•…์„ฑํ”„๋กœ๊ทธ๋žจ์œผ๋กœ ํƒ์ง€ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์กด์žฌํ•˜๋Š”๋ฐ ๋ฌด์‹œํ•˜๊ณ  ๊ณ„์† ์ง„ํ–‰ํ•ด์ฃผ์„ธ์š”

 

Android ๋‹จ๋ง๊ธฐ์ธ ๊ฒฝ์šฐ 
# adb install drozer-agent-2.3.4.apk

์‚ฌ์šฉ์ž์˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ ์„ค์น˜๋œ ์•ฑ๊ณผ ๋””๋ฒ„๊น…์„ ์ˆ˜ํ–‰ํ•  Agent ํŒŒ์ผ์„ Nox ํ™”๋ฉด์œผ๋กœ ๋“œ๋ž˜๊ทธ ์•ค ๋“œ๋กญ ๋˜๋Š” adb install ๋ช…๋ น์„ ํ†ตํ•ด ์„ค์น˜ ํ•ด์ฃผ์‹œ๋ฉด ํ™”๋ฉด๊ณผ ๊ฐ™์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

 

์„ค์น˜๋œ ์•ฑ์„ ์‹คํ–‰์‹œ์ผœ ๋ณด์‹œ๋ฉด ์ƒ๋‹จ์˜ ํ™”๋ฉด์ด ๋‚˜ํƒ€๋‚œ๊ฒƒ์„ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

ํ™”๋ฉด์˜ ํ•˜๋‹จ์„ ๋ณด์‹œ๋ฉด ON OFFํ•  ์ˆ˜ ์žˆ๋Š” ๋ฒ„ํŠผ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ON์œผ๋กœ ์„ค์ •์„ ํ•ด์ฃผ์‹œ๋ฉด ์ž์‹ ์˜ PC์™€ ํ†ต์‹ ํ•˜๊ธฐ ์œ„ํ•œ ์ž„์˜ ํฌํŠธ์ธ 31415 ํฌํŠธ๊ฐ€ ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.

 

์ด์ œ PCํ™˜๊ฒฝ์—์„œ ์„ธํŒ…์„ ํ•ด์ฃผ์…”์•ผ ๋ฉ๋‹ˆ๋‹ค. ๋‚˜๋จธ์ง€ msi ์ด๋ฆ„์œผ๋กœ ๋˜์–ด ์žˆ๋˜ setup ํŒŒ์ผ์„ ๋ˆŒ๋Ÿฌ ์„ค์น˜ํ•ด ์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

์ด ๋ถ€๋ถ„์€ ๊ฐ ํ™˜๊ฒฝ๋งˆ๋‹ค ์กฐ๊ธˆ์”ฉ ์ƒ์ดํ•˜๋‹ˆ ์ข€ ๋” ๊ฒ€์ƒ‰ํ•ด๋ณด์‹œ๊ณ  ์ง„ํ–‰ํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. ์ € ๊ฐ™์€ ๊ฒฝ์šฐ์—๋Š” ์•„๋‚˜์ฝ˜๋‹ค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ python2 ๋ฒ„์ „๋Œ€์™€ python3 ๋ฒ„์ „๋Œ€ 2๊ฐ€์ง€ ์˜์—ญ์„ ๊ตฌ์ถ•ํ•ด ๋’€์Šต๋‹ˆ๋‹ค.

 

์•„๋‚˜์ฝ˜๋‹ค๋ฅผ ์‚ฌ์šฉ ์ค‘์ด์‹  ๋ถ„๋“ค์€ ์ƒ๋‹จ์˜ ์‚ฌ์ง„์ฒ˜๋Ÿผ ์„ค์น˜๋œ ์˜์—ญ์—์„œ python 2.7 ๋ฒ„์ „๋Œ€์˜ ํด๋” ๊ฒฝ๋กœ๋ฅผ ๋ณต์‚ฌํ•˜์—ฌ ํ•˜๋‹จ์— ๋ถ™์—ฌ ๋„ฃ์–ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

๊ฒฝ๋กœ๋ฅผ ๋ถ™์—ฌ ๋„ฃ์–ด ์ฃผ์‹œ๊ณ  ์„ค์น˜๋ฅผ ๋งˆ๋ฌด๋ฆฌํ•ด์ฃผ์‹œ๋ฉด ์„ค์น˜๋Š” ๋์ž…๋‹ˆ๋‹ค.

 

์ปค๋งจ๋“œ ์ฐฝ์„ ํ†ตํ•ด "drozer" ๋ช…๋ น์„ ์ž…๋ ฅํ•ด๋ณด์‹œ๋ฉด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์˜ต์…˜๋“ค์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

 

์ž์‹ ์˜ ๋””๋ฐ”์ด์Šค(Noxํ™˜๊ฒฝ)์™€ ํ†ต์‹ ํ•˜๊ธฐ ์œ„ํ•ด์„  ํฌํŠธ ํฌ์›Œ๋”ฉ์„ ํ•ด์ฃผ์…”์•ผ ๋ฉ๋‹ˆ๋‹ค. adb ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ์ธ์•ˆ์›ƒ tcp:31415 ํฌํŠธ๋ฅผ ํ™œ์„ฑํ™”ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

๋“œ๋กœ์ €๋ฅผ ์ปค๋„ฅํŠธ ํ•˜๊ธฐ ์ „์— ์•ž์„œ ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋“ค์„ ์„ค์น˜ํ•ด ์ฃผ์…”์•ผ ์—๋Ÿฌ ์—†์ด ์ง„ํ–‰์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ์œ„์ฒ˜๋Ÿผ ํ•œ ์ค„๋กœ ํ•œ ๋ฒˆ์— ์„ค์น˜ํ•˜์…”๋„ ๋˜๊ณ  ํ•˜๋‹จ์ฒ˜๋Ÿผ ํ•˜๋‚˜์”ฉ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•ด ์ฃผ์…”๋„ ๋ฉ๋‹ˆ๋‹ค.

pip install protobuf
pip install pyOpenSSL
pip install twisted
pip install service_identity

 

ํฌํŠธ ํฌ์›Œ๋”ฉ ์„ค์ •๋„ ์ง„ํ–‰ํ•ด๋’€์œผ๋‹ˆ ๋””๋ฐ”์ด์Šค(Nox)๋กœ ์—ฐ๊ฒฐํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์ƒ๋‹จ์˜ ํ™”๋ฉด์ฒ˜๋Ÿผ ๋“œ๋กœ์ € ์ฝ˜์†”์ด ๋‚˜ํƒ€๋‚˜๋ฉด ์„ฑ๊ณต์ ์œผ๋กœ ์„ค์น˜๊ฐ€ ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋‚˜๋จธ์ง€ ์ถ”๊ฐ€์ ์ธ ๋ช…๋ น์–ด ํ™œ์šฉ ์‚ฌ์ง„์€ ํฌ์ŠคํŒ… ์ค€๋น„๋˜๋Š” ๋ฐ๋กœ ์˜ฌ๋ฆฌ๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

๋“œ๋กœ์ € ์ฝ˜์†”์—์„œ list ๋˜๋Š” ls ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅ ํ•ด๋ณด์‹œ๋ฉด ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ๋ช…๋ น์–ด ๋ฆฌ์ŠคํŠธ๋“ค์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

dz> ls
app.activity.forintent        Find activities that can handle the given intent
app.activity.info             Gets information about exported activities.
app.activity.start            Start an Activity
app.broadcast.info            Get information about broadcast receivers
app.broadcast.send            Send broadcast using an intent
app.broadcast.sniff           Register a broadcast receiver that can sniff particular intents
app.package.attacksurface     Get attack surface of package
app.package.backup            Lists packages that use the backup API (returns true on FLAG_ALLOW_BACKUP)
app.package.debuggable        Find debuggable packages
app.package.info              Get information about installed packages
app.package.launchintent      Get launch intent of package
app.package.list              List Packages
app.package.manifest          Get AndroidManifest.xml of package
app.package.native            Find Native libraries embedded in the application.
app.package.shareduid         Look for packages with shared UIDs
app.provider.columns          List columns in content provider
app.provider.delete           Delete from a content provider
app.provider.download         Download a file from a content provider that supports files
app.provider.finduri          Find referenced content URIs in a package
app.provider.info             Get information about exported content providers
app.provider.insert           Insert into a Content Provider
app.provider.query            Query a content provider
app.provider.read             Read from a content provider that supports files
app.provider.update           Update a record in a content provider
app.service.info              Get information about exported services
app.service.send              Send a Message to a service, and display the reply
app.service.start             Start Service
app.service.stop              Stop Service
auxiliary.webcontentresolver          Start a web service interface to content providers.
exploit.jdwp.check            Open @jdwp-control and see which apps connect exploit.pilfer.general.apnprovider Reads APN content provider
exploit.pilfer.general.settingsprovider    Reads Settings content provider
information.datetime          Print Date/Time
information.deviceinfo        Get verbose device information
information.permissions       Get a list of all permissions used by packages on the device
scanner.activity.browsable    Get all BROWSABLE activities that can be invoked from the web browser
scanner.misc.native           Find native components included in packages
scanner.misc.readablefiles    Find world-readable files in the given folder
scanner.misc.secretcodes      Search for secret codes that can be used from the dialer
scanner.misc.sflagbinaries    Find suid/sgid binaries in the given folder (default is /system).
scanner.misc.writablefiles    Find world-writable files in the given folder
scanner.provider.finduris     Search for content providers that can be queried from our context.
scanner.provider.injection    Test content providers for SQL injection vulnerabilities.
scanner.provider.sqltables    Find tables accessible through SQL injection vulnerabilities.
scanner.provider.traversal    Test content providers for basic directory traversal vulnerabilities.
shell.exec                    Execute a single Linux command.
shell.send                    Send an ASH shell to a remote listener.
shell.start                   Enter into an interactive Linux shell.
tools.file.download           Download a File
tools.file.md5sum             Get md5 Checksum of file
tools.file.size               Get size of file
tools.file.upload             Upload a File
tools.setup.busybox           Install Busybox.
tools.setup.minimalsu         Prepare 'minimal-su' binary installation on the device.

๋“œ๋กœ์ € ๊ฐ€์ด๋“œ

labs.f-secure.com/assets/BlogFiles/mwri-drozer-user-guide-2015-03-23.pdf

๊ณต์œ ํ•˜๊ธฐ ๋งํฌ
Comment