Have you ever wanted to run a Linux shell on your iOS device to transfer files, write shell scripts, or simply to use Vi to develop code or edit files? Now you can, with a project called iSH that is currently available as a TestFlight beta for iOS devices.
iSH is a project created by Theodore Dubois that aims to bring a Linux shell to iOS devices using a usermode x86 emulator. iSH is built on the Alpine Linux distro, which is designed to have a small footprint, be secure, and easy to use with little or no distracting bells and whistles.
To install iSH on an iOS device, you first need to install the TestFlight app, which allows you to install beta programs. Once TestFlight is installed go to the https://testflight.apple.com/join/97i7KM8O page and click on the "Start Testing" button as shown in the image below. This will open the TestFlight app where you can Accept the invitation to join the beta of iSH.
Once iSH is installed, you can open it like any other iOS app and will be greeted with a ash shell where you can begin executing commands and installing other packages using the APK package manager.
As iSH is still fairly new and is being run under an emulator, not all Linux programs are currently available and some are still being worked on such as SSH. iSH, though, already comes with some of the standard programs you would expect in a Linux environment such as Vi, wget, zip/unzip, and tar. A full list of built-in commands can be found at the end of the article.
You can learn more about how to install other packages in iSH using the next section.
Installing packages in iSH using APK
Alpine Linux uses the APK package manager to install programs and their associated dependencies.
Using APK is very easy and can be used to search for available packages, install a package, list currently installed packages, r remove an existing one, and more. Below are some sample commands that can help you get started installing new programs into iSH.
To list installed packages, type apk info, which will output a list of installed packages in iSH.
To search for a new package to add, type apk search [package_name]. For example, to search for PHP you would type apk search php.
To install a package, type apk add [package_name]. For example, to install PHP you would type apk add php and to install Python you would type apk add python.
Finally to remove an installed package, type apk del [package_name]. For example, to delete PHP you would enter apk delete php.
Transferring files between iSH and iCloud
Now that you can you actually develop and potentially pen test in the future from your iOS device, it would be useful to be able to easily transfer files to and from an iSH install.
When iSH is installed, it will create a new Location in the Files app so that you can access the iSH file system and send files to other storage locations that are configured such as iCloud Drive, the phone's storage, or DropBox if it's installed.
To transfer a file from iSH, select the files you wish to copy and tap the send button and then tap "Save to Files". From there you will be prompted for the location to save the files to.
Unfortunately, transferring files from other locations to iSH using Files does not appear to be working as of yet. For now, you can use wget to transfer files to iSH.
Available /bin/ command:
arch ash base64 bbconfig busybox cat chgrp chmod chown conspy cp date dd df dmesg dnsdomainname dumpkmap echo ed egrep false fatattr fdflush fgrep fsync getopt grep gunzip gzip hostname ionice iostat ipcalc kbd_mode kill link linux32 linux64 ln login ls lzop makemime mkdir mknod mktemp more mount mountpoint mpstat mv netstat nice pidof ping ping6 pipe_progress printenv ps pwd reformime rev rm rmdir run-parts sed setpriv setserial sh sleep stty su sync tar touch true umount uname usleep watch zcat
Available /usr/bin/ commands:
awk basename beep blkdiscard bunzip2 bzcat bzip2 cal chvt cksum clear cmp comm cpio crontab cryptpw cut dc deallocvt diff dirname dos2unix du dumpleases eject env expand expr factor fallocate find flock fold free fuser getconf getent groups hd head hexdump hostid iconv id install ipcrm ipcs killall ldd less logger lsof lsusb lzcat lzma lzopcat md5sum mesg microcom mkfifo mkpasswd nc nl nmeter nohup nproc nsenter nslookup od passwd paste patch pgrep pkill pmap printf pscan pstree pwdx readlink realpath renice reset resize scanelf seq setkeycodes setsid sha1sum sha256sum sha3sum sha512sum showkey shred shuf smemcap sort split ssl_client strings sum tac tail tee test time timeout top tr traceroute traceroute6 truncate tty ttysize udhcpc6 unexpand uniq unix2dos unlink unlzma unlzop unshare unxz unzip uptime uudecode uuencode vi vlock volname wc wget which whoami whois xargs xxd xzcat yes
Comments
jt2k - 5 years ago
Awesomeness. Thank you.
Dominique1 - 5 years ago
This looked promising, but just reading the T.O.S. in the snapshot above is raising RED FLAGS all over. Geez, these companies want our money AND our data too. #NowBlacklisted
tbodt - 5 years ago
Apple forces that TOS on me, because of the analytics built into TestFlight. I don't want your money OR your data.
EdwardG - 5 years ago
FYI just tried the testflight link on an iphone and it says the Beta is full.
tbodt - 5 years ago
I just removed a bunch of testers who hadn't used the app, try now.
EdwardG - 5 years ago
2 months later, but I just signed up. Thanks!
HonestQiao - 5 years ago
That's a great App. I love it. Thank you.
But there have some bugs.
1. tux:catn't start
#apk add tmux
#tmux
lost server
2. vim:can't create temp directory
#apk add vim
#vim
:r! echo $RANDOM
E485: Can't open file /tmp/vBIcBdH/1
you can try the following commands in vim:
:echo fnamemodify(tempname(), ":p:h") "cmd1
:call mkdir(fnamemodify(tempname(), ":p:h")) #cmd2
:call mkdir("[the result of cmd1]")
:r! mkdir "[the result of cmd1]"
tbodt - 5 years ago
Thanks for the report! The tmux bug is known and is caused by missing unix domain socket support. I just fixed the vim bug and the fix will be in the next build.
HonestQiao - 5 years ago
good job!
Z3R0_Day - 4 years ago
I keep getting this error when I use NMAP why?
nmap -v -A www.we
aretheminc.com
Starting Nmap 7.70 ( https://nmap.org ) at 2019-09-30 13:38 UTC
NSE: failed to initialize the script engine:
could not locate nse_main.lua
stack traceback:
[C]: in ?
QUITTING!
Boio8010 - 4 years ago
How do I exit the vi editor? I'm using this on my iphone 10x... I created a .txt file, then opened it with vi, entered some text... Now I don't know how to exit the editor
tbodt - 4 years ago
Press escape then :q. Escape looks like ⎋.
Ezy05 - 3 years ago
Please help!! Once Ive downloaded the ISH beta, I’m not seeing its coming pre-installed with the apk package manager and I’m having issues trying to download it within ISH, Any suggestions? Thanks