.Figure 9-11
mobile
root
• root
• dottie
• alpine
SSH Client Software for Windows
root
Download at Boykma.Com
HACK
# 9.04
chapter 09
.Figure 9-12
.Figure 9-13
.Figure 9-14
Download at Boykma.Com
[Hack #1.05]
.Figure 9-15
.Figure 9-16
/private/var/root/
Download at Boykma.Com
HACK
# 9.04
.Figure 9-17
/private/var/root/
.Figure 9-18
→→ssh root@
Download at Boykma.Com
.Figure 9-19
.Figure 9-20
.Figure 9-21
Download at Boykma.Com
HACK
# 9.04
For a gentle introduction to the Unix shell used by Mac OS X, see d Learning Unix for Mac OS X Tiger,
by Dave Taylor (O’Reilly).
[Hack #11.06]
make
•
•
/etc/hosts
dps17-2:~ $ sudo pico /etc/hosts
find missing
direCtories
And files
cd•
cd /var/
mobile/Media/
ls
•
pwd•
•
find / -name
"<file name>"
Download at Boykma.Com
.Figure 9-22
/etc/hosts
dps17-2:~ $ ping iphone
PING iphone (192.168.22.99): 56 data bytes
64 bytes from 192.168.22.99: icmp_seq=0 ttl=64 time=328.536 ms
64 bytes from 192.168.22.99: icmp_seq=1 ttl=64 time=85.387 ms
^C
iphone ping statistics
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 85.387/206.962/328.536/121.575 ms
dps17-2:~ $ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/dstolarz/.ssh/id_rsa): <press enter>
Enter passphrase (empty for no passphrase): <press enter>
Enter same passphrase again: <press enter>
Your identification has been saved in /Users/dstolarz/.ssh/id_rsa.
Your public key has been saved in /Users/dstolarz/.ssh/id_rsa.pub.
The key fingerprint is:
f1:d7:1a:aa:d9:f3:7c:1b:66:17:05:05:a7:ca:ce:90
The key's randomart image is:
+ [ RSA 2048] +
| ooo|
| + |
| . . .|
| o o o .|
| S E = |
| * o .|
| . + + .|
| + o.o |
| o .oo |
+ +
dps17-2:~ dstolarz$ ssh root@iphone mkdir -p .ssh
root@iphone's password: alpine
Download at Boykma.Com
HACK
# 9.04
dps17-2:~ $ cat .ssh/id_rsa.pub | ssh root@iphone 'cat >> .ssh/authorized_keys'
root@iphone's password: alpine
dps17-2:~ $ ssh root@iphone
dps-3G:~ root#
→
dps-3G:~ # ssh
The authenticity of host 'perceptdev.com (208.97.133.135)' can't be established.
RSA key fingerprint is da:86:84:d0:c0:66:20:17:58:da:b8:86:a1:3b:1f:72.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'perceptdev.com,208.97.133.135' (RSA) to the list of known
hosts.
Password: <type password here>
Linux perceptdev 2.6.24.2-grsec-p4-peon-1.1.2-grsec #1 SMP Wed Feb 20 15:30:29 PST
2008 i686 GNU/Linux
[perceptdev]$ exit
logout
Connection to perceptdev.com closed.
perceptdev.com
dps17:~ $ ssh root@iphone
dps-3G:~ # ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/var/root/.ssh/id_rsa): <press enter>
Enter passphrase (empty for no passphrase): <press enter>
Enter same passphrase again: <press enter>
Your identification has been saved in /var/root/.ssh/id_rsa.
Your public key has been saved in /var/root/.ssh/id_rsa.pub.
The key fingerprint is:
e6:68:35:95:ac:7e:d0:e4:27:5a:08:e2:01:4b:1b:59 root@dps-3G
The key's randomart image is:
+ [ RSA 2048] +
| +oE |
| = . . |
| o o . = |
| . o . B |
| . S = . |
| * = o |
| o + . |
| . . |
+ +
Download at Boykma.Com
dps-3G:~ # ssh mkdir -p .ssh
Password:
dps-3G:~ # cat .ssh/id_rsa.pub | ssh \
'cat >> .ssh/authorized_keys'
Password: tsXE9Z3J
dps-3G:~ # ssh
Last login: Sun Feb 15 13:34:27 2009 from 24.24.166.171
Linux perceptdev 2.6.24.2-grsec-p4-peon-1.1.2-grsec #1 SMP Wed Feb 20 15:30:29 PST
2008 i686 GNU/Linux
__
[perceptdev]$
Test
/private/
var/mobile/Library/
dps-3G:~ # ls /private/var/mobile/Library/
AddressBook/ Carrier\ Bundles/ Maps/
SafeHarbor/
Application\ Support/ ConfigurationProfiles/ MobilePhone/ Stocks/
BossPrefs/ Cookies/ Notes/ Voicemail/
Caches/ Cycorder/ Operator\ Bundle.bundle@ Weather/
Calendar/ Keyboard/ Preferences/ WebClips/
CallHistory/ Logs/ SMS/ WebKit/
Carrier\ Bundle.bundle@ Mail/ Safari/ YouTube/
dps-3G:~ # ls -l /private/var/mobile/Library/AddressBook/
total 1512
-rw-r r 1 mobile mobile 1119232 Feb 14 18:09 AddressBook.sqlitedb
-rw-r 1 mobile mobile 423936 Feb 15 12:16 AddressBookImages.sqlitedb
perceptdev.com
drwx 5 iphonehacks pg233143 4096 2009-02-10 15:43 Maildir
dps-3G:~ # scp /private/var/mobile/Library/AddressBook/ \
:~/
AddressBook.sqlitedb 100% 1093KB 218.6KB/s 00:05
dps-3G:~ # ssh ls -l
total 1108
-rw-r r 1 iphonehacks pg233143 1119232 2009-02-15 15:34 AddressBook.sqlitedb
dr-xr-x 2 iphonehacks dhapache 4096 2009-02-10 15:24 logs
drwx 5 iphonehacks pg233143 4096 2009-02-10 15:43 Maildir
Download at Boykma.Com
HACK
# 9.05
[Hack #11.02]
[Hack #11.03]
rootmobile
root
mobile
[Hack #11.01]mobile
mobile
9.05:HACK
Download at Boykma.Com
.Figure 9-23
.Figure 9-24
.Figure 9-25
Download at Boykma.Com
HACK
# 9.05
chapter 09
.Figure 9-26
To connect to the iPhone itself, you should connect to “localhost” or 127.0.0.1 and login d [Hack #9.04].
iSSh
.Figure 9-27
Download at Boykma.Com
.Figure 9-28
Other Options
.Figure 9-29
.Figure 9-30
Download at Boykma.Com
HACK
# 9.06
9.06:HACK
[Hack #1.05]
.Figure 9-31
→
afp://IP_ADDRESSIP_ADDRESS
rootalpinedottie
passwd
/var/root/
Download at Boykma.Com
.Figure 9-32
MacFUSE
[Hack #9.04]
.Figure 9-33
root
mobile
.Figure 9-34
→
Download at Boykma.Com
HACK
# 9.06
chapter 09
If you usually mount your iPhone on a home/ofce network, you can set a static (xed) IP address d
in the Wi-Fi networks settings. In this case, we’ve given the iPhone the address 192.168.22.99
on our network so that it will always have the same address when we try to mount it.
root
mobileroot/alpinemobile/alpine[Hack #9.04]
path
.Figure 9-35
.Figure 9-36
[Hack #11.02]
[Hack #11.04]
Download at Boykma.Com
.Figure 9-37
.plist
Linux, Windows, and other OSs
9.07:Hack
Easily Manage All the Network Services
on Your iPhone
[Hack #9.04][Hack #9.06]
[Hack #9.10]
[Hack #9.05]
[Hack #8.06]
Download at Boykma.Com
HACK
# 9.08
.Figure 9-38
9.08:HACK
Install findme
.
[Hack #1.04]
findme/usr/bin
Make sure you have curl and sed.
Curlsed
[Hack #11.01]findme
[Hack #1.04]
Create a tweet shell script.
HACK
#9.08
Download at Boykma.Com
curl basic user username:password data status=`/usr/bin/findme \
| sed "s/.*<Latitude>/<Latitude>/" \
| sed "s/<\/Longitude>.*/<\/Longitude>/"` \
/>Those single quotes are “`” (grave accents), which should be on the same key as “~” (tilde).
d
findme
chmod 755 tweet.
[Hack #11.03]./System/Library/LaunchDaemons
com.apple.daily.plistcom.sadun.tweet.plist
•
•
• /var/root/bin/tweet/.
•
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" " /><plist version="1.0">
<dict>
<key>Label</key>
<string>com.sadun.tweet</string>
<key>ProgramArguments</key>
<array>
<string>/var/root/bin/tweet</string>
</array>
<key>StartInterval</key>
<integer>600</integer>
</dict>
</plist>
<Latitude>39.711611</Latitude><Longitude>-104.902137</Longitude>"
If you’re traveling across the country, and want to share, change your start interval to 15 minutes
d
or half an hour and use a public Twitter account. (Remember to reboot after making changes to the
launch daemon.)
Download at Boykma.Com
HACK
# 9.09
9.09:HACK
[Hack #9.08]
[Hack #1.04]
.Figure 9-39
.Figure 9-40
Download at Boykma.Com
.Figure 9-41
[Hack #9.08]
.Figure 9-42
Download at Boykma.Com
HACK
# 9.10
9.10:HACK
.Figure 9-43
[Hack #9.04]
/etc/nano lighttpd.conf
dir-listing.activate = "enable"
server.document-root = "/Library/WebServer/"
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png",
".mp3" => "audio/mpeg"
)
/Library/WebServermkdir -p /Library/WebServer
/Library/
Webserver//var/mobile/Media
Download at Boykma.Com
index.html
/Library/WebServer/
lighttpd -f /etc/lighttpd.conf
[Hack #11.03]
.Figure 9-44
9.11:Hack
Connect to Your iPhone or iPod touch from
Outside Your Home/Ofce Network
[Hack #2.06]
The AT&T mobile network, and probably other mobile networks, have rewalls that severely d
restrict incoming connections to your phone. Therefore, you won’t be able to serve web pages
when you aren’t on a Wi-Fi network.
Download at Boykma.Com
HACK
# 9.11
.Figure 9-45
Download at Boykma.Com
.Figure 9-46
[Hack #9.10]
.Figure 9-47
all
Download at Boykma.Com