owasp-mastg icon indicating copy to clipboard operation
owasp-mastg copied to clipboard

Reading system log with socat does not work (anymore?)

Open gl4nce opened this issue 3 years ago • 4 comments

As described here: https://github.com/OWASP/owasp-mstg/blob/master/Document/0x06b-Basic-Security-Testing.md

There you find the following command:

iPhone:~ root# socat - UNIX-CONNECT:/var/run/lockdown/syslog.sock

I tried it on my iPhone (iOS 14.2) but I get always the following error message: no such file or directory.

Maybe it does not working anymore on iOS 14.2? Or I am doing something wrong?

gl4nce avatar Mar 29 '21 15:03 gl4nce

This might well be, have you verified if the file is in deed there? have you tried to search for the file from the root / with e.g. "find"?

This and further research might help;

https://www.reddit.com/r/jailbreakdevelopers/comments/ene6ua/ios_13_read_syslog/

Please let us know if you find the cause, thanks for reporting!

cpholguera avatar Mar 30 '21 06:03 cpholguera

Thanks for your answer.

The file is missing. Looks like the whole directory structure was changed. I already read the post on reddit but doesn't work for me either (oslog does not exist anymore). Looks like on iOS 14 something changed.

$ ls /var/run
fudinit mDNSResponder= syslog= vpncontrol.sock= lockdown.sock printd=

gl4nce avatar Mar 30 '21 08:03 gl4nce

Seems we might need to update that section. Thanks for pointing it out!

You can also use ideviceinstaller, which is part of the package libimobiledevice in brew. Then you can access the system logs once you connect the iOS device via USB. Console.app on macOS also works fine.

sushi2k avatar Apr 16 '21 13:04 sushi2k

Thanks for the information @sushi2k!

I could get it working. These are my steps (frida and libimobiledevice required; used macOS). All steps are done on the macOS Console.app.

  1. Get the PID for the target app with frida-ps -U
  2. Run idevicesyslog with the PID you got from the step before: idevicesyslog -p $PID
  3. Do dynamic testing on the target app and check the log entries

gl4nce avatar Apr 16 '21 14:04 gl4nce