Mark Cohen posted a while back about enabling syslog on the iPhone for the sole purpose of logging to a Splunk instance on your laptop. This hack is a follow up to that post, and extends it slightly to include logging of the pages browsed by Safari on the phone. WARNING: If you brick your phone, you can still use it as an ergonomic pot-scraper. Splunk won’t be responsible for you going off and getting your $600 $400 piece of joy stuffed, but we’ll be happy to log the event.
Let’s get dirty. Go into settings..general..auto-lock and set locking to ‘never’. This will keep the phone on while you hack around on it. Keeping the phone on and connected to the network will drain your battery like nobody’s business, so make sure you plug in the charging cable.
Now install AppTap. Follow the instructions, and come back here when you are all done.
Using the AppTap installer on the phone, install the Community Sources, BSD Subsystem, Term-vt100, OpenSSH, Tinyproxy, and UIctl apps, in that order. UIctl will let you stop and start sshd on the phone. Launch it now to see if sshd is running. Click on the ‘load’ button if it’s not.
Ping your phone from your computer with its IP address. You can use the terminal on the phone to grab the IP address:
# ifconfig en0
en0: flags=8863 mtu 1500
inet 10.0.1.194 netmask 0xffffff00 broadcast 10.0.1.255
ether 00:1c:b3:f0:0b:a6
#
Ssh to the phone from your terminal. The default root password is ‘dottie’.
foobar:~ kord$ ssh root@10.0.1.194
root@10.0.1.194's password:
Last login: Wed Oct 10 13:45:22 2007 from 10.0.1.191
# hostname
Kord's iPhone
#
Now add a syslog.conf file to /etc/:
bash-3.2# echo "*.* @10.0.1.191" > /etc/syslog.conf
bash-3.2# cat /etc/syslog.conf
*.* @10.0.1.191
Obviously, you’ll want to use the IP address of the machine
Read More...