hacking-university-mobile-phone-amp-app-hacking-amp-complete-beginners-guide-to-learn-linux-hacking-mobile-devices-tablets-game-consoles-apps-amp-precisely-hacking-freedom-and-data-driven-book-5
hacking-university-mobile-phone-amp-app-hacking-amp-complete-beginners-guide-to-learn-linux-hacking-mobile-devices-tablets-game-consoles-apps-amp-precisely-hacking-freedom-and-data-driven-book-5
By Isaac D. Cody
QUICK TABLE OF CONTENTS
This book will contain 2 manuscripts from the Hacking Freedom and Data
Driven series. It will essentially be two books into one.
Hacking University Senior Edition covers a everything you need to know about
Linux
Both books are for intended for beginner’s and even those with moderate
experience with Hacking Mobile Devices and with Linux.
Hacking University: Sophomore Edition
By Isaac D. Cody
Copyright 2016 by Isaac D. Cody - All rights reserved.
This document is geared towards providing exact and reliable information in regards to the topic and issue
covered. The publication is sold with the idea that the publisher is not required to render accounting,
officially permitted, or otherwise, qualified services. If advice is necessary, legal or professional, a practiced
individual in the profession should be ordered.
- From a Declaration of Principles which was accepted and approved equally by a Committee of the
American Bar Association and a Committee of Publishers and Associations.
In no way is it legal to reproduce, duplicate, or transmit any part of this document in either electronic means
or in printed format. Recording of this publication is strictly prohibited and any storage of this document is
not allowed unless with written permission from the publisher. All rights reserved.
The information provided herein is stated to be truthful and consistent, in that any liability, in terms of
inattention or otherwise, by any usage or abuse of any policies, processes, or directions contained within is
the solitary and utter responsibility of the recipient reader. Under no circumstances will any legal
responsibility or blame be held against the publisher for any reparation, damages, or monetary loss due to
the information herein, either directly or indirectly.
The information herein is offered for informational purposes solely, and is universal as so. The presentation
of the information is without contract or any type of guarantee assurance.
The trademarks that are used are without any consent, and the publication of the trademark is without
permission or backing by the trademark owner. All trademarks and brands within this book are for
clarifying purposes only and are the owned by the owners themselves, not affiliated with this document.
Disclaimer
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or
by any means, including photocopying, recording, or other electronic or mechanical methods, without the
prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews
and certain other noncommercial uses permitted by copyright law.
Table of Contents
Introduction
Jailbreaking iOS
Rooting Android
NES
PlayStation
PS2
PS3
Xbox
Xbox 360
PC Emulators
Conclusion
Introduction
Thank you for downloading the book “Hacking University: Sophomore Edition”. If you are
reading this, than either you have already completed “Hacking University: Freshman Edition” or you
believe that you already have the hacking skills necessary to start at level 2. This eBook is the definitive
guide for building your hacking skill through a variety of exercises and studies.
As explained in the previous book, hacking is not a malicious activity. Hacking is exploring the
technology around us and having fun while doing so. This book’s demonstrations will mainly focus on
“unlocking” or “jailbreaking” a variety of devices, which is in no way illegal. However, performing
unintended servicing or alterations of software and hardware may possibly void any warranties that you
have. Continue at your own risk, as we hold no fault for damage that you cause. However, if you wish to
gain real control over the phones and game consoles that you own, continue reading to see how top hackers
employ their trade.
History of Mobile Hacking
Phone hacking, also known as Phreaking, has a peculiar history dating back to the 1950’s.
Phreaking was discussed at length in the 1st book, so it will only be briefly recalled here. After phone
companies transitioned from human operators to automatic switchboards, a dedicated group of experimental
“phreakers” found the exact frequencies and tones that can “hack” the switchboards. The act grew into a
hobby and culture of individuals who could make long distance calls for free or eavesdrop on phone lines.
When landlines became more complicated and cell phones took over, phreaking died out to be replaced by
computer hacking.
The first cellphone hackers simply guessed the passwords for voicemail-boxes because the cell
phone owners rarely ever changed their PIN from the default. With a simple number such as “0000” or
“1234” as a passcode, hackers can effortlessly gain access to the voicemail-box and can listen in on any
message.
Another technique, known as “spoofing”, allows an attacker to change the number that shows on
the caller-ID. By impersonating a different number, various attack strategies with social engineering
possibilities are available.
With the advent of flip-phones mobile devices became smaller and more efficient. Although some
dedicated hackers could flash new ROMs onto stolen phones or read text messages with complicated
equipment, the early cell phones did not have too much sensitive data to steal. It wasn’t until phones
became more advanced and permanently tied to our online life that cell phone hacking became a lucrative
field.
With the early 2000’s Blackberry phones and the later 2000’s iPhones advancing cellular
technology to be on par with personal computers, more of our information was accessible from within our
pockets. Security is often sacrificed for freedom and ease-of-use, so hackers were able to exploit the weak
link of mobile technology fairly easily.
How are hackers able to break into the mini-computers in our pockets? Through mostly the same
techniques that hackers use to break into regular desktop PCs- software vulnerabilities, bugs, social
engineering, and password attacks.
Most mobile hacks are low-level stories of celebrities getting their private pictures stolen or risqué
messages being leaked. Typically these attacks and hacks come about because of the technological
ineptitude of celebrities and their less-than-best security habits. Every once in a while, though, the spotlight
will shine upon big-name jobs, such as Hillary Clinton’s email server leaks, or Edward Snowden and his
disclosure of classified government information. Events like these show just how critical security is in all
facets of digital life- and a person’s phone should never be the device that facilitates a hacking attack on
them.
Perhaps the most widely discussed phone hack in recent news would be the San Bernardino
terrorist attack of 2015 and the resulting investigation. After a couple killed 16 and injured 24 more in the
California town, both assailants were killed in the aftermath and an investigation began of the two’s
background. Farook, one of the shooters, had a county-issued iPhone 5C that investigators believed would
contain additional evidence surrounding the attacks. Additionally, having access to the device would mean
that the FBI could investigate any communications into and out of the phone, possibly revealing any active
terrorist groups or influences.
However, the iPhone was password protected and up to date with iOS’s advanced security features
that guaranteed the government could not access the contents of the phone. The NSA, FBI, and other
government groups could not break the protection, so they demanded Apple provide a backdoor in iOS for
the FBI to access data. Apple refused, stating such a backdoor would provide hackers, viruses, and
malware a vector through which to target all iOS devices indiscriminately.
Tensions ramped up between the FBI and Apple, but Apple stood its ground long enough for the
government to seek help elsewhere. Finally on March 28th, 2016, the phone was cracked by 3rd party group
of hackers for a million US dollars. How the group successfully broke the unbreakable is not fully known,
but it is believed that a zero-day vulnerability (a vulnerability that nobody knew about) was used to gain
access to the iOS.
The whole scenario showed that the government is not above civilian privacy- they will use all
resources at their disposal to gain access to our devices. While most agree that the phone needed to be
unlocked as a matter of national security, it still holds true that if Apple were to comply with the
government than groups like the NSA and FBI would have direct links to all iOS devices and their data (a
clear breach of trust). Mobile phone security will continue to be a hot issue in the coming years, so learning
how to protect yourself by studying how hackers think will save you in the long run.
Security Flaws in Mobile Devices
Mobile devices including phones and laptops are especially vulnerable to the common IT
problems. However the portability of the handy devices only amplifies the variety of attack vectors. Wi-Fi
points often exist in coffee shops, public eateries, and libraries. Free and open Wi-Fi is always helpful,
except they open up mobile devices to data interception and “man-in-the-middle” attacks.
For example, say a hacker creates a public Wi-Fi point. By naming it something inconspicuous
such as “Starbucks free Wi-Fi”, people will be sure to connect with their phones and laptops. At this point,
the hacker has installed Kali Linux (refer to “Freshman Edition” for more info) and also connected to the
compromised internet. They run a packet capture program and steal online banking information in real time
while the victims thinks nothing is wrong. Security minded individuals should always remember that open
Wi-Fi hotspots are dangerous, and they should only ever be connected to for simple browsing or with a
VPN running.
Social engineering plays a large part in mobile hacking as well. Phone users usually forget that phones
can get viruses and malware just as PCs can, so the user is often off-guard and willing to click links and
download Trojan horses when browsing from their phone. The following demonstration (courtesy of
http://wonderhowto.com) takes advantage of an Android device on the same network (we’re in a Starbucks)
and gives control to the hacker.
1. Start a laptop with Kali Linux and the metasploit application installed.
9. Now you’ll need to deliver the exploit to your victim. You could come up to them and
ask “hey, have you tried Starbuck’s free game app for Android? It’s pretty fun”. With
their permission, you could email them the application. When they download and start
it on their phone, return to your laptop and type exploit into the metasploit console.
The two devices will communicate and you will be given control over parts of the
phone.
The lesson learned is to never install any app that seems strange or comes from an irreputable source.
Later in the book, especially when talking about jailbreaking and rooting, we will install lots of “unverified”
applications. Ultimately there is no real way to know if we are installing a legitimate app or a Trojan horse
like above. When it comes to unofficial applications, you must trust your security instincts and only install
from trusted sources.
Heartbleed is a famous 2014 OpenSSL bug that affected half a million web servers and also hit nearly
50 million Android devices. The vulnerability allowed hackers to read data stored in memory such as
passwords, encryption keys, and usernames by overflowing the buffer of TLS encryption. So massive was
the impact that devices everywhere needed emergency patches to protect themselves. OpenSSL resolved
the vulnerability as quickly as possible, and Android vendors issued an update that patched the problem.
QuadRooter is an emerging vulnerability detected in Qualcomm chipsets for Android devices. Through
a disguised malicious app, a hacker can gain all device permissions without even requesting them.
Currently it is estimated that 900 million Android devices are vulnerable and at the time of writing not all
carriers have released patches to remedy the issue. Staying safe from QuadRooter means updating as soon
as patches are released and to refrain from installing suspicious applications.
Not just Android is affected by hackers, for the iPhone 6 and 6S running iOS9 versions under 9.3.1 can
have their pictures rifled through even if there is a passcode or fingerprint enabled. Here is the process.
Follow along to see if your phone is vulnerable.
3. Siri will ask what to search for, respond with “@yahoo.com”, at “@att.net”,
“@gmail.com”, or any other email suffix.
4. Siri will display relevant results, so find a full email address among them. Press firmly
on the address (3D touch) and then press “add new contact”.
5. By then “adding a photo” to our new “contact”, we have access to the entire picture
library.
This is reminiscent of an earlier iOS9 bug that could totally unlock a phone without a passcode. You
can do this hack on unupdated iOS9.
3. Say anything.
5. Reminders will launch, long press the one you just created and click “share”.
7. Enter any name, then tap on the name to create a new contact.
8. Tap choose photo, and you can then press the home button to go to the home screen
while unlocked.
Most vulnerabilities such as the two mentioned are patched almost as soon as they are discovered,
which is why they will not work on an updated iOS9.
Finally, there is one final tactic that a hacker can use to break into a phone if they have physical
possession of it. If a hacker really wants to gain access to a mobile device, they can do so at the cost of
deleting all data. Through a factory reset, a hacker will erase absolutely everything on the device including
the password and encryption, but they will be able to use the device or sell it to somebody else.
1. Shut off the phone, connect it to a computer with iTunes, and boot the iPhone into
recovery mode (hold power button and home buttons at same time until recovery mode
it shown).
2. On iTunes, click the “restore” button that pops up to delete all data and claim the
phone as your own.
Every Android device has a different button combination to enter recovery mode, so research your
phone’s model. We will demonstrate factory resetting an Android phone with the most common
combination.
1. Shut off the phone and boot it into recovery mode. The power button and volume
down button held together is a common combination.
2. Use the physical buttons (sometimes volume up and down) to navigate the menu.
Select factory reset and confirm.
Unlocking a Device from its Carrier
Phones and other mobile devices are often “locked” to a specific carrier, meaning the device cannot
have cell service from any other company. The locked phone is essentially held hostage by the carrier-
unless you follow through with an unlocking process. Carriers can help you through the process, but you
usually need a good reason to have the device unlocked (traveling to areas without coverage, military
deployment, contract has expired and you are switching). Stolen devices cannot be unlocked. The cheapest
phones you can find on eBay are sometimes stolen, and carriers may refuse to unlock if they have the
device filed as lost or stolen.
It is important to note that phones run on networks (GSM and CDMA) that limit the number of
carriers a phone can operate on- a mobile device’s network cannot be changed at all, but the carrier that
operates on the same network CAN be changed.
Most unlocks require the phone to be fully payed off, have an account in good standing, and you
must not exceed too many unlocks in one year. The process involves gathering all information about the
phone (phone number, IMEI, account information, account holder information), proving you own it, and
requesting the device be unlocked through phone call or internet form. Sadly, some carriers simply cannot
be unlocked. The most popular cell carriers are listed here.
The networks that different phones operate on actually vary, so you’ll need to do a little research to
find out what networks a phone can run on. The networks listed above are the most popular ones that are
used on different carrier’s devices. The unlock process may prove difficult, but phone unlocking stores
exist that can go through the process for you.
Securing your Devices
As previously explained, older versions of operating systems retain many bugs and exploits.
Especially with phones always install the latest updates as soon as possible.
One of the reasons that the San Bernardino phone was so hard to crack was because of Apple’s
inherent encryption that is enabled when there is a passcode present. What this means for the security-
minded iPhone owner is that having a passcode ensures fantastic protection. So long as a passcode is
enabled, the phone is also encrypted. Simple hacks cannot extract data that is encrypted, and that is why the
FBI had to pay for an alternative exploit.
Readers of the previous book will remember that encryption is the scrambling of data to dissuade
access. Only people with the correct password can decode the jumbled text. Just as with desktops,
encrypting your mobile phone will protect it from unauthorized access. All iPhones (with newer updates)
automatically encrypt when passcode is enabled. Android phones running OS 6.0 and above are encrypted
automatically, but those running older operating systems must enable the feature manually (“settings”,
“security”, “encrypt phone”). Encrypted phones will run slower, but they will be more secure. Even some
text messaging apps (WhatsApp) can encrypt text messages that are sent.
If a hacker or agency were to get possession of the device, though, there is still one trick that gives
opposition the upper hand. Even phones with passcodes and encryption still readily show notifications on
the lock screen by default. Say, for instance, a hacker has possession of the phone and they attempt to login
to your online banking. Without the password, though, the attacker can still send a verification code to the
phone and see it on the lock screen. Nullify lock screen problems by disabling the notifications entirely.
On iDevices go through “settings”, “control center”, and then turn “Access to Lock Screen” off. On an
Android progress through “settings”, “sound and notifications”, then turn “while locked” to off.
Say there is an app installed on your mobile device and you suspect that it may contain a Trojan
horse or have malicious intent. The app may have been installed from a 3rd party, or you may have your
suspicions that Facebook is collecting data on you. Luckily on both iPhone and Androids you can turn off
specific app permissions to restrict the amount of access the app has. Just as when you install an app it
requests permission for, say, microphone, camera, and contacts, you can revoke those permissions at any
time.
Android phones edit permissions (in Marshmallow 6.0) in the settings app. The “apps” tab shows
all apps installed, and by clicking the settings button in the top right you can select “app permissions”. The
next screen shows every accessible part of your Android, such as camera, contacts, GPS, etc… You can
edit each category and change which apps have permission to use them. It is always recommended that
apps only be given the least amount of permissions necessary to perform their tasks, so disable anything
that you don’t use or don’t need.
iOS has debatably better app permission methods, as it only requests use of a peripheral when the
app wants to use it. Security-minded individuals can take the hint that a request for permissions at an odd
time would obviously mean nefarious activity is taking place. Nonetheless app permissions can be taken
away too, through the “privacy” tab in “settings”. Just as with Android, tapping on a category shows all
apps that use that function and give you the option to revoke the permissions.
Malware and viruses still exist for mobile devices. Phones and tablets can be secured by installing
an antivirus app from a trusted source. Some attackers like to disguise Trojan horses as antivirus apps,
though; only download apps that seem reputable and have good reviews. Don’t be against paid antivirus
apps, either, because they are usually the ones that work best.
Modding, Jailbreaking, and Rooting
Contemporary devices are locked down, running proprietary software, and closed to customization.
The act of modding a device to gain additional functionality has a slew of different names; on iPhones the
modding process is commonly known as “Jailbreaking”, on Android phones it is known as “rooting”, and
on video game consoles the action is referred to as just “modding”.
Hackers enjoy modding their hardware to increase the amount of freedom it gives them. For
example, iPhones only have one layout, icon set, set of ringtones, and very few customization settings.
Android phones have decent customization, but some settings are set in stone and unchangeable. Rooting
adds more customization and allows apps to interact with the core filesystem for unique features.
Commonly people root and jailbreak for extra apps and games. Modding game consoles allows them to run
full- fledged operating systems or even play backup games from burned discs. Below we will discuss the
benefits, downsides, and features of modding a few popular devices. Once again it is important to note that
you may void a warranty by altering your gadgets. Also, modding has a small risk of ruining the hardware
permanently (bricking); this makes the technology unusable. We are not responsible for damages, so do the
demonstrations at your own risk and proceed cautiously.
Jailbreaking iOS
The iPhone is conceivably the most “hacked” device because of the limited customizability and
strict app store guidelines that Apple imposes. Some groups love the simplicity of the iPhone in that regard,
though, while adept technological experimenters would rather have full control. If one jailbreaks their
iPhone, they gain access to the minute details usually locked away and unchangeable. Suddenly they can
change the pictures on the icons, how many icons are in a row, animations, what the lockscreen layout looks
like and much more. Furthermore, a jailbroken iPhone is not restricted to just the “Apple Store”, there are
other free app stores that Jailbroken iPhones can download applications from. The range of functions that
these new and “banned” apps bring to you certainly make jailbreaking worth it.
There are a few restrictions though, as Apple tries to deter jailbreaking through patching their iOS.
To see if your iDevice is able to be jailbroken, you will need to know which version of iOS you are running.
From the “Settings” app, tap “General” and then “About”. Note the version number and check
https://canijailbreak.com, a popular website that lists the jailbreakable versions of iOS. Each version of iOS
will have a link to the tool that will help jailbreak the iDevice.
“Tethered” jailbreaks are conditional jailbreaks that require you to boot the iDevice with the help of
a computer. A tethered jailbreak could possibly damage your phone if started without the aid of a PC, and if
your battery dies away from home than the phone is basically unusable even after a charge. This is
obviously not the best solution, so consider if a “tethered” jailbreak is worth the trouble to you. Some
versions of iOS are able to be untethered, though, which is ideal in nearly all situations.
Before starting any jailbreak, make a backup of your phone data just in case something goes wrong
or you wish to return to a normal, unjailbroken phone.
Pangu / Evasi0n
1. Download the application you need to your computer.
7. Follow any on-screen prompts. You will need to follow any instructions the
application gives you, including taking action on the desktop computer or iDevice.
Each iDevice may or may not be jailbreakable, but generally most iPhones and iPads can be exploited
so long as they are not running the newest iOS update. But attempting to jailbreak a device which is
definitely known to not work may result in a totally bricked device.
A jailbroken iPhone’s best friend is Cydia, the “hacked” appstore. Cydia allows you to add repositories
and download applications. A repository is a download storage that contains applications and
modifications. In order to download a few specific apps, you will have to add the repository to Cydia.
Each version of Cydia may have slightly different default repositories, this process below is how you check
the installed repos and add new ones:
Repositories are typically URLs, and you can find them in a variety of places. You can internet search
for “best Cydia repos” or just find an alphabetical list and search for good ones. Be careful of adding too
many sources, though, because that will slow down the Cydia app as it tries to contact each server and get
the app lists regularly. Some of the best sources include:
BigBoss
ModMyI
iSpazio
Telesphoreo Tangelo
Ste
ZodTTD
The previous sources are usually default, but here are some that you might have to add manually:
iHacksRepo (http://ihacksrepo.com)
SiNful (http://sinfuliphonerepo.com)
iF0rce (http://apt.if0rce.com)
InsanelyiRepo (http://repo.insanelyi.com)
BiteYourApple (http://repo.biteyourapple.net)
Customizing the icons and colors of iOS is possibly the most used feature of a jailbroken iOS. The two
best apps to change out parts of iOS are Winterboard and Anemone. Search for these two apps within
Cydia and install them. Now you can search through the repositories for a theme you want to apply.
Winterboard themes in particular can be entire cosmetic changes that replace every bit of the iOS with new
colors, content, and icons. For a new set of icons only, just search for icon packs.
Apps that change the look of iOS are aesthetically pleasing, but they can often conflict and cause bugs
within the operating system. Some themes and icon sets may crash apps or cause the phone to restart
occasionally. This is an unfortunate side effect of compatibility and newer developers with poor code, so
use themes at your discretion.
There are too many Cydia apps to count, so here is a short list of a few popular ones and why you
should consider downloading them.
iCaughtU takes a snapshot when your device’s passcode is entered incorrectly. Catch
snoopers and thieves in the act.
iFile allows you to actually interact with the files on your iDevice. This is a feature
built into Android that is mysteriously missing in iOS.
Tage/Zephyr are two apps that allow customization of multitasking gestures. You can
make, say, swiping in a circle launch your text messages to save time. Tage is the
newest app, but older devices may need to run Zephyr.
Activator allows you to launch apps or start iOS features with buttons such as triple
tapping home or holding volume down.
TetherMe creates a wireless hotspot without having to pay your carrier’s fee for doing
so.
The app possibilities are endless. You can take hours just searching through Cydia to find your favorite
tweaks and modifications. Once again be warned that installing too many may bog down iOS and cause it
to crash, so install sparingly.
Another benefit to jailbreaking comes about through the games that can be played. While there are a
few game “apps” that are available for download through Cydia, the main attraction for gamers are certainly
emulators. Emulators are apps that imitate game consoles so their games can be played on iOS, usually for
free. The process to play emulated games is somewhat difficult, but major steps will be explained below.
Please note that the steps will vary as per emulator, game, and device.
2. The source may or may not be included on your specific device, so search for
“RetroArch”. If it does not show, add the source
http://buildbot.libretro.com/repo/cydia or possibly http://www.libretro.com/cydia,
restart the app and search again.
3. Download and install RetroArch.
4. Launch the app, navigate to “Online Updater”, and update every entry starting from the
bottom.
6. Go back to the main menu, “Load Core”, then select the Playstation entry that we just
downloaded.
Now we need to obtain a ROM (game file). ROMs are digital backups of the games we play. There is
nothing illegal about putting your PS1 game CD into your computer and making an .iso backup with a tool
like PowerISO (http://poweriso.com) or IMGBurn (http://www.imgburn.com). Basically you install one of
the aforementioned programs, launch it, insert your PS1 disc into the CD drive, and then create an .iso file
with the program. Finally, with a PC program such as iFunBox (http://www.i-funbox.com/), you can
transfer that .iso onto your iOS device.
The above process is fairly confusing, and hackers usually want to emulate games they don’t already
own. An astute hacker can download a ROM straight from the internet to their iOS device, but the legality
of this action varies depending on country and state. We do not condone illegally downloading ROMs, but
the process must be explained for educational purposes. Some websites such as CoolROM
(http://coolrom.com), romhustler (http://romhustler.com), and EmuParadise (http://emuparadise.me) offer
PS1 rom downloads for free, and a curious individual can search there for just about any ROM game they
want. After downloading the file, another app such as iFile is needed to place the downloaded ROM in the
correct folder. Install iFile from Cydia, navigate to where your browser downloads files (it varies based on
browser, but try looking in var/mobile/containers/data/application to find your browser’s download path).
Copy the file, then navigate to /var/mobile/documents and paste it there.
Lastly after the long process restart RetroArch, tap “Load Content”, “Select File”, and then tap the
game’s .iso. You will now be playing the game.
iPhone emulation is difficult. There is no easy way to download ROMs and put them where they need
to be. You must also be careful while searching for ROMs on the internet, because many websites exist
solely to give out viruses to unsuspecting downloaders. Also, the emulators on iPhone are poor compared
to Android, so the above process may not even work well for you. In this case, consider downloading
another PS1 emulator from Cydia. RetroArch is capable of playing a few other systems too, just replace
Playstation steps above with your console of choice. Ultimately, though, if your game crashes or fails to
start there is not much you can do. Consider looking into PC emulation, as it is much easier to emulate old
console games on Windows.
Overall, jailbreaking iOS is a great hacking experience with many new options for iOS devices.
Consider jailbreaking, but be wary of voiding warranties.
Rooting Android
Rooting an Android phone involves mostly the same process as jailbreaking, however since
Android OS runs on a plethora of different phones, tablets, and mini-computers, there is a lot of research
involved in determining if your device is rootable. Generally, older devices have been out longer and are
therefore usually rootable since developers and hackers have had the chance to exploit the technology
more. It is extremely important that you figure out if your device is even rootable to begin with or there is a
great chance of bricking it. One tool we will discuss for rooting is “Kingo Root”, and at the moment you
can check the compatibility list (http://www.kingoapp.com/android-root/devices.htm) to see if your device
is specifically mentioned.
Why might you want to root your Android device? Just as with jailbreaking, rooting grants access
to the intricacies of the operating system. Some apps in the Play store require rooted phones because parts
of the app interact with locked settings in the OS. A few cell phone carriers also block access to features of
Android, and hackers like to root their phones to have the freedom to use their device as it was intended.
The default apps installed on Android devices take up too much room, and they often bog down a device; a
rooted Android can remove default apps. Finally, many hackers are distraught with a Google-based
operating system and the amount of data it collects on the user, so the tech-savvy rooter can “flash” a new
operating system that is free from spyware and Google’s prying eyes.
Once again, make a backup of your device and be prepared to follow directions exactly as to not brick it.
Make doubly sure that you can root your specific device. We’re going to follow the steps for KingoRoot
(https://www.kingoapp.com/), but follow your specific app’s procedure.
4. Follow any on-screen or on-device prompts. Your phone may restart multiple times.
After rooting, there are a few interesting things you can now do. Firstly, you can delete that obnoxious
and space-hogging bloatware that comes preinstalled on Android. Second, you are now free to use
whatever features of the device that you like. For example, newer Galaxy phones have Wi-Fi hotspot
tethering built-in, but some carriers lock the feature behind a price that you must pay monthly. With a
rooted Galaxy, you are free to download apps (Barnacle Wi-Fi Tether on Play Store) that do the tethering
for you and without asking the carrier for permission.
There is no “Cydia” equivalent for Android rooting, because you can download and install .apk files
from anywhere. By just searching on the internet for Android .apk files, you can find whole websites
(https://apkpure.com/region-free-apk-download) dedicated to providing apps for Android. The only change
you need to make to your device to enable installation of .apk files is to enter the “settings” and tap the
“security” tab. Check the box “allow installation of apps from sources other than the Play Store” and close
settings. Now you can download any .apk and install it, most of which you might not need to be rooted for.
Rooting provides apps with additional control over the operating system, any many apps that you may
have tried to download form the Play Store claim that root is required in order for full functionality- those
apps are usable now.
Emulation on Android devices is somewhat easier due to removable SD cards. If you own an SD card
reader, you can transfer .iso files easily with Windows. Emulating games is a great way to play older
console titles, and here is the easiest way on Android OS.
1. Download the ePSXe app. It may not be available in the Play Store, so search on the
internet for an .apk file, then install it.
2. You will also need PS1 BIOS files. You can rip them from your Playstation console
yourself (http://ngemu.com/threads/psx-bios-dumping-guide.93161/) or find them on
the internet (http://www.emuparadise.me/biosfiles/bios.html). The legality of
downloading BIOS is confusing, so make sure that it is legal to download BIOS
instead of ripping them from your console.
3. Lastly, rip or download the PS1 rom you want to play on your device. See the section
about emulating on iOS for tips on how to rip your own ROMs or obtain other backups
online.
4. Configure ePSXe by pointing it to your BIOS files. Then pick the graphics settings
your device can handle. Navigate to the location of your ROM and launch it to begin
enjoying PS1.
Gaming on an Android is fun, if not difficult due to the onscreen buttons blocking your view of the
games. Android has built-in functionality for wired Xbox controllers that are plugged in via USB port. If
your Android device has a full size USB port, you can just plug the Xbox controller in directly and it will
work. If you have a phone with an OTG (smaller) port, you will need to purchase an OTG to USB female
adapter. With a rooted device the Bluetooth can be taken advantage of fully. The app “SixaxisPairTool”
will pair a PS3 controller for wireless gaming. You’ll just need the app on your phone, the PC version
application on your computer, a PS3 controller, and a cable to connect it to the computer.
4. Copy the “Bluetooth address” from the phone to the “Current Master” box on the PC
application. Click update.
5. Unplug the PS3 controller and turn it on. It should search for a PS3 to sync to, but the
address that is programmed will lead to your Android device. Enjoy the wireless
gaming!
Deep Android customization comes from the Xposed Framework. After installing
(http://repo.xposed.info/module/de.robv.android.xposed.installer), you are free to customize your device
through “modules” (https://www.androidpit.com/best-xposed-framework-modules) that edit the tiniest
specifics of Android. This is the feature that makes Android much more customizable than iOS.
If you can’t get the device to work perfectly to your liking, you can always flash a new operating
system. This procedure is more dangerous than rooting, and each new OS might not be compatible with
your device. As always, do some internet research to find out if your particular device is compatible with
the operating system you are thinking about flashing. CyanogenMod (http://www.cyanogenmod.org/) is a
popular Android variant developed by the original Android team. Some devices can even support a Linux
distro, making for an extremely portable yet functional device. We won’t discuss the specifics of flashing
here, but you can find plenty of tutorials and guides on the websites of the custom OS builds that you find.
There are other great rooted apps, such as those that manage specific permissions (PDroid,
Permissions Denied), and apps that remove ads (AdAway), but these apps are commonly taken down and
blocked by federal governments. The only way to get one of these apps is to find it uploaded on an apk
website, or to use a VPN/Proxy to fake your location as another country.
Conclusively, rooting Android gives almost limitless possibilities. You can truly have complete
control over your device after rooting or flashing a new OS. Be very careful when making modifications,
because there is a great chance of voiding warranty or even bricking the technology. The benefits received,
however, are almost too great for hackers and modders to give up.
Risks of Mobile Hacking and Modification
Hacking on or infiltrating another mobile device falls under the same legal dubiousness as PC and
server hacking- some states and federal governments consider hacking illegal, regardless of whether a
phone or computer is involved.
Remember the hacker’s manifesto, though, where a hacker is benevolent because they are only
curious. Some see carriers and phone manufacturers guilty of restricting access to a device, so hackers
attempt to correct the situation through jailbreaking and modding- making the devices truly their own.
An individual probably will never go to jail for simple modifications of their own devices.
Hackers only void their warranties by jailbreaking and rooting. Bricking is a possibility too, but that is a
personal consequence and not a legal one.
Tampering with other people’s devices without permission could be dangerous and illegal, though,
and many courts will consider it an invasion of privacy. Hackers must always protect themselves with the
same strategies laid out in the previous book (VPN, proxies, hiding identity, using “burner” devices, TOR,
etc…).
Overall, so long as hackers are ethical and proceed with benevolent intent, there are not too many
risks involved with experimentation. Large profile crimes will not go unnoticed, however. And no matter
how skillfully a hacker can protect themselves, as seen by the San Bernardino incident, if the crime is large
enough than governments will assign large amounts of resources to oppose the hacker. Hack with caution
and always stay ethical.
Modding Video Game Consoles
Video game consoles have been modded since the beginning of living room entertainment. In the
NES era, some unlicensed companies produced games by flashing their software onto empty cartridges and
bypassing copy-protection. Modding became the norm for subsequent consoles as well, as many readers
might remember tales of PlayStations that could play burned discs, or Wiis that could read games from SD
cards. If the reader has never had the pleasure of seeing a hacked and modded console in person, I assure
them that it is a marvel of hacking knowledge and skill. Just about every game console can be altered in
some way that improves its function, and this chapter will go through some of the popular modifications
and how to perform them. For reference there are two types of mods- hardmods and softmods. Hardmods
are nearly irreversible physical changes to a console such as those that involve soldering modchips.
Software are mods to the software of a console, such as PS2’s FreeMCBoot memory card hack.
Most console hacks require additional components, soldering proficiency, or specific software.
Note that a twitchy hand or missed instruction can break a very expensive console, so ensure that you can
complete the modification without error before attempting. There are websites and people that can perform
the mods for you for a fee just in case it seems too complex, so weigh your options and pick what you feel
the most comfortable with.
NES
While most people grew up playing a NES, there is no doubt that the console is extremely difficult
to play on modern LCD and LED televisions. Either the new televisions do not have the needed hookups,
or the quality looks awful traveling through antiquated wires and inefficient graphics chips. Luckily there
exists a mod to enable the NES to output video and audio through HDMI- a huge step up that increases the
graphical quality of the old console.
https://www.game-tech.us/mods/original-nes/ contains a $120 kit (or $220 for installation too) that
can be soldered to a working NES.
Such is the case with most mods for the NES and other older consoles. Daughterboards or
additional components have to be bought and soldered accordingly to increase functionality. Revitalizing
older consoles with modding is a fun pastime that many hackers enjoy.
PlayStation
A modchip is a piece of hardware with a clever use. In the original PlayStation 1, a modchip can be
installed that allows you to play burned discs. This means that a hacker can download a ROM of a game
off of the internet, burn it to a CD, and then be able to play it on the original hardware without trouble and
without configuring difficult emulators. Modchips work by injecting code into the console that fools it into
thinking that the inserted disc has successfully passed disc copy protection. Thus a modchip needs to be
soldered to the motherboard. On the PlayStation it is a fairly easy process.
1. You will need a modchip corresponding to your PS1 model number. http://www.mod-
chip.net/8wire.htm contains the most popular modchip- make sure your SCPH matches
the compatible models. (We will be using the 8 wire mod.)
2. Disassemble the PS1, take out all the screws, remove the CD laser, remove everything
and get the bare motherboard onto your soldering station. Take pictures of the
deconstruction process to remind yourself how to put everything back together later.
1. Place a piece of tape over the sensor so discs can spin while the tray is open. While
opening and closing the tray you can see the button that the lid pushes to tell the
console it is closed. Tape it up so the console is always “closed”.
2. Put a legitimate disc into the tray and start the console.
3. The disc will spin fast, and then slow down to half speed. While it is halved, quickly
swap the legitimate disc for the burned copy. The process is quick and must be done in
less than a second.
4. The burned disc will spin at full speed and then slow down to half to scan for copy
protection. As soon as it slows, swap it back for the real PS1 disc.
5. Watch the screen, and as soon as it goes black switch back again to the burned disc and
close the tray. The fake disc will now play.
Both of these methods are how mods were done for years, but a new product entered the market which
simplifies PS1 hacking. The PSIO (http://ps-io.com/) is a piece of hardware that allows the PS1 to read
games from an SD card. For a fee the creator will install the handy device onto your PlayStation and
simplify playing bootleg and backup games forevermore.
PS2
The PlayStation 2 remained a popular console for years after the last games were produced. Although
there exist hardware mods and complicated procedures, the easiest way to hack the PS2 console is to buy a
memory card. FreeMcBoot (FMCB) is a software exploit that hijacks the “fat” PS2 and allows custom
software to execute through a softmod. You can simply buy a FMCB memory card online for 10 dollars, or
you can create one yourself. You’ll need a fat PS2, a copy of AR Max EVO, a blank memory card, and a
USB flash drive.
3. Navigate to the media player and access “next item” to load FREE_MCBOOT.ELF on
the flash drive. Press play.
4. Follow the instructions and FreeMCBoot will install on the memory card.
5.
Now FreeMCBoot will have tons of great software preinstalled- all you have to do start the PS2 with
the modded memory card inserted and FreeMCBoot will temporary softmod your console. Playing backup
games is fairly easy as well.
1. Have the .iso file of the game you want to play on the computer.
2. Download the ESR disc patcher (www.psx-scene.com/forums/showthread.php?
t=58441), run it and patch the .iso.
3. Burn a blank DVD with the modified .iso. ImgBurn is a great program for this.
4. Put the disc into the PS2, start the PS2, FreeMCBoot will load. Navigate to the ESR
utility on the menu. Launch it and the game will start.
PS3
The Playstsation 3 started out with functionality that allowed operating systems such as Linux to be
installed- turning a simple game console into a home computer. Hackers exploited “OtherOS” and
“jailbroke” the PS3. A modded device is capable of playing backup/downloaded games and “homebrew”
(indie) software. There are conditions that restrict the number of PS3 consoles that can be modded though.
Only PS3s with a firmware version 3.55 and below can be modified; you can check this through “Settings”,
“System”, and then “System Information”. If your PS3 happens to be updated beyond this point there is not
much that you can do to downgrade, and 3.55 PS3s are very expensive on eBay. We won’t explain the
downgrade process, but do research on the E3 Flasher to bring your version number to 3.55.
If your version number is below 3.55 the software must be updated to the correct version. DO
NOT let the PS3 do this automatically, or it will update past 3.55 and ruin our chances of modding. Instead
you will need to download the 3.55 update
(http://www.mediafire.com/download/dp6uhz4d15m3dll/ofw+3.55.rar, but the link may change), create a
folder on a blank flash drive called PS3. Inside that folder create an UPDATE folder. Extract the 3.55
update into the UPDATE folder and plug it into your PS3. Start PS3 recovery mode by holding down the
power button until you hear 3 total beeps. Recovery mode will start, and you will need to plug in a
controller to interact with the menu. Choose “update”, follow onscreen directions, and the PS3 will update
from the USB drive. You’ve now upgraded to 3.55.
To install custom firmware on your 3.55 PlayStation 3, follow the process below.
1. Reformat your USB drive to FAT32 to clear it off completely.
2. Create a PS3 folder on the drive, then an UPDATE file within it.
4. Put the update files onto the flash drive, boot into recovery mode, and install
PS3UPDAT.PUP. You now have custom firmware.
Playing games on a custom PS3 is a straightforward process using a tool called MultiMAN. The
application runs on the custom firmware and allows backing up and playing games. First, obtain a copy of
MultiMAN version 4.05 and up
(http://www.mediafire.com/download/16dbcwn51gtzu47/multiMAN_ver_04.78.02_STEALTH_%2820160328%29.zip
link may change), as these versions support the CFW that we installed. Extract it and put the files on a USB
drive, plug it in and start the modded PS3. In the “Game” section, select “Install Packages Files”, then
install the MultiMAN pkg file. The application will be installed.
One great feature of MultiMAN is making backups of discs right on the PS3. Rent a game or borrow
one from a friend, start MultiMAN, put a disc in the system, and the application will show you the game.
Access the options, and choose to “copy”. The game will be copied to the internal HDD and be playable
through MultiMAN without the disc. If you have downloaded copies of games, then MultiMAN will also
recognize them when they are plugged in via external hard drive, and you will be able to play them.
Overall there are limitless possibilities on PlayStation 3 custom firmware, and this book can never hope
to document them all. Be careful when flashing, and always triple check the procedures and research.
http://www.ps3hax.net/archive/index.php/t-18606.html contains a great guide for installing custom
firmware and playing backup games; check the website before following through with installing CFW.
There are a few other things to worry about, such as connecting to the internet on a CFW PS3. Sony servers
collect information on internet connected PS3s, and they could have the ability to remotely disable a PS3
that they detect running CFW. All of that aside, enjoy the hacking process and congratulate yourself for
attempting something particularly difficult and dangerous.
Xbox
The original Xbox is a popular console to hack because of the easy method and multiple features
gained from modification. You will need a flash drive, the Xplorer360 program (http://www.xbox-
hq.com/html/article2895.html), the hack files (http://www.1337upload.net/files/SID.zip, link may change- if
it does search for XBOX softmod files), a controller with a USB port, and a game that can exploit. Splinter
Cell works with the above files. Here is the softmod guide.
2. Plug USB into PC, extract the downloaded softmod files, and open Xplorer360.
3. Click “drive”, “open”, “hard drive or memory card”. Partition 0 will be the USB.
4. Drag the extracted softmod files into the 360 program and they will be put onto the
USB.
5. Plug the USB into the Xbox and move the files over onto the internal HDD.
6. Start the game and load the save data (the softmod). Follow the onscreen prompts to
hack the Xbox.
With the softmodded Xbox you can do plenty of neat media center things, such as play video and audio, or
even use emulators. Check online for all possibilities.
Xbox 360
Xboxes with a dashboard before 7371 (kernel 2.0.7371.0) are hackable, those with a later version must use
the “RGH” method. Exploited 360s can run backup games and homebrew applications. The process
(known as JTAG) is too difficult and varied to cover completely here, so we’ll only go over a brief
overview. The motherboard that your 360 has determines which process to follow, so pay close attention.
1. Assemble necessary parts (1 DB-25 connector, 1 DB-25 wire, a 1n4148 diode, 3 330
ohm resistors (xenon motherboards)).
3. Plug DB-25 connector into computer and dump the “nand” using software in the link.
Here is a great video of the 360 hacking process. Be careful, because this 360 and the PS3 hack are
very dangerous and could brick the consoles.
What to do with a Bricked Device
Sometimes a modification fails. Even though a device may seem lost, they are not always totally
bricked. Once you’ve given up on a device and are ready to throw it in the trash, consider the following
options.
Try flashing again. Maybe the process will complete fully this time and make the
device usable again.
If a jailbreak failed, boot into recovery mode and try restoring from a computer with
iTunes.
Research the problem and exactly where it went wrong. Maybe other people have had
the same situation and resolved it.
If the device is under warranty you can make a plausible excuse for why it isn’t
working. (iPhone got overheated so now it doesn’t boot!)
Scrap the device for parts. Just because one part is broken doesn’t mean everything else
is.
If you don’t have a console or are too nervous to mod them, you could always use your PC to play
console games. Emulators on PC are great for any hacker with a strong computer. Computers and their
high powered graphics processing capabilities open up emulation of more modern systems, such as
PlayStation 2, Dreamcast, or even something as new as the Xbox 360. Refer to the table below for a few of
the best PC emulator programs that you can download.
Some of the above emulators might be depreciated or gone when you read this, but at the current
date these are the best programs that you can download for Windows in terms of emulation. Certainly the
more modern consoles, such as Xbox 360, require the equivalent of a supercomputer to run well; older
consoles like the N64 are emulated almost perfectly on more basic hardware.
Conclusion
The world of mobile hacking, jailbreaking, rooting, console modding, and emulation is a peculiar
one. Customization and freedom are available to those that can achieve it, but hacking is always a
dangerous task with serious consequences. Only warranties and contracts are at stake with personal
hacking, but hacking others can catch the attention of authorities.
Always remember to hack ethically, or at least stay hidden and protect yourself for more fiendish
actions. Ultimately though, aren’t mobile carriers and console makers the despicable ones for locking away
true ownership of the devices that we buy? Thank you for purchasing and reading this book. Be sure to
leave feedback if you’d like to see more hacking guides.
Hacking University Senior Edition
Linux
BY ISAAC D. CODY
Table of Contents
Introduction
History of Linux
Benefits of Linux
Linux Distributions
Ubuntu Basics
Installing Linux
Managing Directories
Apt
More Terminal Commands
Useful Applications
Administration
Security Protocols
Scripting
I/O Redirection
This document is geared towards providing exact and reliable information in regards to the topic and issue
covered. The publication is sold with the idea that the publisher is not required to render accounting,
officially permitted, or otherwise, qualified services. If advice is necessary, legal or professional, a practiced
individual in the profession should be ordered.
- From a Declaration of Principles which was accepted and approved equally by a Committee of the
American Bar Association and a Committee of Publishers and Associations.
In no way is it legal to reproduce, duplicate, or transmit any part of this document in either electronic means
or in printed format. Recording of this publication is strictly prohibited and any storage of this document is
not allowed unless with written permission from the publisher. All rights reserved.
The information provided herein is stated to be truthful and consistent, in that any liability, in terms of
inattention or otherwise, by any usage or abuse of any policies, processes, or directions contained within is
the solitary and utter responsibility of the recipient reader. Under no circumstances will any legal
responsibility or blame be held against the publisher for any reparation, damages, or monetary loss due to
the information herein, either directly or indirectly.
The information herein is offered for informational purposes solely, and is universal as so. The presentation
of the information is without contract or any type of guarantee assurance.
The trademarks that are used are without any consent, and the publication of the trademark is without
permission or backing by the trademark owner. All trademarks and brands within this book are for
clarifying purposes only and are the owned by the owners themselves, not affiliated with this document.
Disclaimer
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or
by any means, including photocopying, recording, or other electronic or mechanical methods, without the
prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews
and certain other noncommercial uses permitted by copyright law.
Introduction
This book will explicate upon the benefits of switching to Linux, as well
as serve as a beginners guide to installing, configuring, and using the most
popular distribution. Then, the terminal command line will be explained to tell
how to take advantage of the OS in ways not possible in other systems. Truly
there are many advantages to be gained by switching to Linux, and you just
might find a suitable primary OS to use on your computers by reading this book.
History of Linux
Then, 3rd party organizations took the base Linux product and added their
own high level software and features to it, thereby creating Linux
“distributions”. Linux remains a free hobby project even through today, and thus
the kernel is continuously receiving updates and revisions by Torvalds and the
community. Throughout the 2000s, many other 3rd parties saw the usefulness of
the Linux environment and they began to incorporate it into their production
environments and corporations. Today, Linux is known for being highly used in
servers and business settings with a small dedicated desktop following. Working
towards the future, the kernel has reached a level of popularity where it will
never die out. Large companies revel in Linux because of its advantages and
usefulness, and so the kernel and various distributions will always exist as the
best alternative operating system.
Benefits of Linux
First, Linux is free. The background of GNU places Linux into a “free
and open source” mentality where most (if not all) of the software shipping with
Linux is free. Free and open source (FOSS) refers to two things- the software is
both monetarily free and the source code is also transparent. FOSS differs from
proprietary software in that everything is open with FOSS, and there are no
hidden spyware, fees, or catches involved with using it. The software is often
more secure because anybody can contribute to the readily available source code
and make it better. Because Linux and most of the software you can download
for it is free, it is a fantastic operating system for small businesses or individual
users on a budget. Certainly no quality is sacrificed by not charging a fee,
because the Linux project and its various distributions are community-driven and
funded through donations. Compare this to the cost of Windows, which is often
many hundreds of dollars for the OS alone. Microsoft Office is a popular
document writing program suite, but it also prices high. Free alternatives to
these programs exist in Linux, and they definitely compare in quality to the big
name products.
Perhaps the best benefit to using Linux is the speed. Low system
requirements mean that computers that are normally slow and groggy on
Windows will be zippy and quick on Linux. Users frustrated with computer
slowdowns can replace their OS for a more responsive experience. Furthermore,
Linux can be installed on older computers to reinvigorate them. So even though
that old laptop may be too outdated for the newest version of Windows, there
will probably be a distribution of Linux that will squeeze a few more years of
useful life out of it.
Overall, Linux beats out the mainstream operating systems in many areas.
All of these things definitely make Linux the better choice for your computer,
and you should use it to gain access to these revered features. Artists, hackers,
creative individuals, small business owners, techies, non-techies, and just about
everyone can find something to like about Linux. The wide range of
distributions means there is something for everyone, so install Linux today to see
what you can gain from it.
Linux Distributions
Linux Mint is a highly used OS in the Linux world. “Powerful and easy to
use”, Mint contains FOSS and proprietary software as well with the purpose of
being a complete experience for Linux beginners. While not totally Linux-like,
Mint is an excellent choice for a first-time alternate operating system. It
consistently ranks among the most used operating systems ever, and its default
layout is very similar to Windows facilitating a smooth transition into the Linux
world.
Debian is one of the oldest Linux distributions, being created in 1993.
Combining with the Linux philosophy, Debian keeps stability and solidity as the
guiding development principal. Certainly the amount of time Debian has been
around is an indicator of refinement, so those seeking an experience free of bugs
and glitches can turn to Debian. Free and open source software also has a home
in Debian, because most of the software contained within is FOSS. This does
not mean that you are limited, though, because there is an official repository of
non-free software for proprietary programs such as Adobe Flash. Debian is a
decent choice for beginners, but Ubuntu still stands as the best introductory OS.
Install Debian for stability, FOSS, and a wholly Linux experience.
Slackware is an OS that goes back even further than Debian. It stays close to
the original Linux intent, meaning that you will have to install your own GUI
and program dependencies. Because of that fact, Slackware is mostly for
intermediate Linux users, as beginners will be confused at the unfamiliar
methods. However, if you want to experience a Linux distribution that is closer
to the UNIX roots, Slackware can provide for you.
Arch Linux is another distribution, but one that is mostly designed for
experienced users. The OS comes as a shell of a system that the user can
customize to their liking, by adding only the programs and services that they
want. Because of this, Arch is difficult to set up, but a rewarding and learning
experience as well. By building your own personal system, you will understand
the deeper Linux concepts that are hidden from you on the higher level
distributions. Install this advanced OS after becoming very comfortable with the
basics.
And finally, there is an abundance of other unique distributions that are worth
mentioning. In the following list, we will talk about a few of them. Just note
that there are so many distributions, this entire book could be filled describing
each and every niche use.
Positively the number of operating systems based off of the Linux kernel is
astounding. With a huge amount of choices, you might be confused as to where
to start and how to install it. When in doubt (and as we will demonstrate
shortly), install Ubuntu or one of its variants. The OS is great for beginners and
makes the Linux transition smoother. But as you increase in skill and wish to
learn more about Linux, you can always install another operating system.
Booting Into Linux
If you are ready to take the plunge into a Linux based distribution, the first
thing you must do is back up your files. Overwriting the OS on your hard drive
will erase any data contained within, meaning you must back up any pictures,
music, or files you wish to keep after the transition. Use an external hard drive,
or an online data storage site (such as Google Drive) to temporarily hold your
files. We are not responsible for you losing something important, back it up!
Next we will need to choose an OS. This book will use Ubuntu 16.04 as
an extended example, and it is recommended you do the same. Navigate to
Canonical’s official website (http://www.ubuntu.com) and acquire a copy of the
OS. You will download the image from the site to your computer.
Download a tool for writing the image file. For DVDs install Imgburn
(http://www.imgburn.com/), and for flash media download Rufus
(https://rufus.akeo.ie/). The most common method of OS installation is to use a
4GB USB drive, and it is more recommended. Insert your media, start the
appropriate program, select the OS image that was downloaded, and begin the
writing process. It will take some time, as the image needs to be made bootable
on the media. When it is finished, you can shut down your computer fully.
This is the point to make double sure you are ready to install Linux.
Check that your files are backed up, understand that you will be erasing your
current OS, and preferably have a Windows/OSX install disc handy in case you
decide to switch back. If you are indeed ready to switch, continue.
With the installation media still inserted, turn on your computer. The first
screen that you will see is the BIOS / UEFI POST screen, and it will give a
keyboard button that you should press to enter setup. This screen shows every
time you boot, but you probably pay no attention to it. Press the indicated key to
enter the BIOS setup. If you are too slow, the screen will disappear and your
usual OS will begin to load. If this happens, simply shut the computer back
down and try again.
Once within the BIOS / UEFI, you will have to navigate to the “boot
order” settings. Every computer’s BIOS / UEFI is slightly different, so we
cannot explain the process in detail. But generally you can follow button
prompts at the bottom of the screen to understand how to navigate. After
arriving at the boot order settings, place your boot medium at the top of the list.
As an example, if you used a USB drive, then you would see its name and have
to bring it to the top of the list. These settings control the order in which the PC
searches for operating systems. With our boot medium at the top of the list, it
will boot into our downloaded Linux image instead of our usual OS. Save your
settings and restart the computer. If everything was done correctly the computer
will begin to boot into Ubuntu.
But if something goes wrong, try troubleshooting it with these tips:
“No boot media found” – Did you “drag and drop” your Linux
image onto the media instead of writing it? Without explicitly
telling the computer it is bootable, it will not know what to do
with the data files on the media. Alternatively, you could have a
corrupted download, or an incomplete write. Try downloading
the image again and making another installation.
But most of those problems are rare or simply due to user error. Linux has
high compatibility and is relatively easy to install/use past the initial installation.
The typical user will have Ubuntu boot successfully at this point, and they will
be presented with a working computing environment.
The desktop you see is referred to as a “Live CD”, which is pretty much a
demonstration of the OS and how it works. You have not actually installed the
OS to your hard drive yet, as it is still running directly from your boot media. It
is a chance for you to test out Linux without actually removing your primary OS,
so take the opportunity to explore how Linux distributions work.
Ubuntu Basics
Furthermore, there is a bar at the top of the screen that works like the
“menu” bar of other operating systems. This is where drop-down menus such as
“file”, “edit”, “help”, etc… will appear once a program is active.
On the desktop, you will see an “Install Ubuntu 16.04 LTS” icon. Double
clicking it will launch an application that makes installation very easy. If you are
not connected to the Internet, do so now by plugging in an Ethernet cord or by
connecting to Wi-Fi from the top right icon. Select your language and click
“continue”. The next prompt will ask whether you would like to download
updates and install third-party software during the OS installation. These
options are highly recommended for beginners, so check them and click
“continue”.
The application will move on to another screen asking for your install
method. There are various options, such as erasing the disk altogether, installing
alongside your primary OS, or updating a previous version of Linux. Select an
option that works best for you. If you are still hesitant about making a full
switch, elect to install Ubuntu as your secondary OS. That option will allow you
to choose which OS to boot into after the BIOS screen. Nevertheless, select
your option and click “install now”.
While Ubuntu installs, you can specify a few other options, such as your
time zone, computer name, account name, and password. The entire installation
should not take too long, but it will take long enough that your computer should
be plugged in (if it is a laptop). After finishing, the OS will require a reboot.
Congratulations, you now have a usable Linux system on your computer.
Throughout the next chapters in this publication we will focus on Linux
concepts, how do achieve certain tasks, and how to further your knowledge of
your system.
Managing Hardware and Software
However, powerful graphics cards and other specific hardware will need
proprietary drivers from that company to function to full efficiency. Because
although your graphics card works by default with Linux, the secret and often
hidden technology within can only be fully utilized with that company’s
software. On Ubuntu the process is straightforward- open the “additional
drivers” application and let the OS search for you. After determining whether
you have the devices, it will ask you which version of the driver to use. Follow
any on-screen prompts to enable the 3rd party drivers. For any devices that do
not appear, do Internet research on the manufacturer’s website to determine
whether they released a specific Linux driver that you can download.
Software is another aspect of Linux that excels over Windows. Much like
an Apple computer, Ubuntu has an app store of sorts from which you can search
through repositories of applications that are compatible with your device to
download and install with just a few clicks. Just search for the “Ubuntu
Software Center” from dash to open the application. From there you can browse
individual categories such as “Games”, “Office”, or “System” for a list of
programs, or you can search directly by name. After finding a program, click on
it and then queue up the download by clicking “install”. After authenticating
yourself the software will automatically download and install. From there, the
application can be run by searching for it in the dash.
Another method of installing software is available through the terminal,
but we will discuss that later. Ubuntu is not totally limited to software found in
the app store, because programs downloaded from the Internet can also be
installed. Once again, we will touch on that subject after discussing the
terminal.
Directories, another name for folders, work the same as they do in other
operating systems. Folders hold files, and you must be currently accessing a
directory in order to interact with the files inside of it. You can use the terminal
command “cd” to change directory and move about the file system. As an
example, typing “cd Desktop” from the Home folder will transfer you to that
folder. Now using “ls” will not show anything (unless you added files to the
desktop). To back out, type “cd ..”. Practice navigating around the file system
in this fashion; cd into a directory and ls to view the files.
Because you are typing commands, Linux expects your input to be exact.
If you misspell a command it will simply not work, and if you type a folder or
file incorrectly it will try to reference something that does not exist. Watch your
input carefully when using the terminal.
Opening a file is done with a different command – “.”. The period is used
to start the specified file, so if you were attempting to open a picture it could be
done like so: “./house.png”. Both the period and the slash are necessary, as it
denotes that you are running a file within the current directory. When you run a
file it will be opened with the default application assigned to the file type, so in
the case of a picture it will most likely be opened in an image viewer.
You can also create and remove directories and files through terminal as
well. For this example navigate to the Home directory. As a shortcut you can
type “cd ~” to change the directory to your Home, because the tilde key is short
for “the current user’s home”. Make a directory with the “mkdir” command;
type, “mkdir Programming” to create a new folder with that title. You can CD
into it, or you can go to the GUI and enter it to prove that you have indeed
created a new folder. Now remove that directory by going Home and typing
“rmdir Programming”. Without hesitation, Linux will remove the specified
directory. Similarly, using “rm” will remove the specified file.
Linux has a design philosophy that many users are not used to. In
Windows and OSX, the OS will almost always double check that you want to
commence with an action such as deleting a file or uninstalling a program.
Linux distributions believe that if you are imitating an event, you definitely
mean to follow through with it. It will not typically confirm deleting something,
nor will it display any confirmation messages (file successfully deleted). Rather,
the absence of a message indicates the process completed successfully. While
the philosophy is somewhat dangerous (because you could potentially ruin your
OS installation without warning), it serves as a design contrast to other operating
systems. Linux gives you complete control, and it never tries to hide anything or
obscure options because they might be too complicated. It takes some time to
get used to, but most users agree it is a welcome change to be respected by the
technology they own.
This does not compromise security, however, because any critical action
requires the “sudo” command as a preface. Sudo stands for “super user do”,
meaning that the user of the highest permissions is requesting the following
command. Any sudo entry will require an administrator password, so malicious
software or un-intending keyboard spammers cannot accidently do damage
without knowing the password first. A lot of the commands we use in this book
require sudo permissions, so if the command fails to complete with a message
explaining it does not have enough permissions you can retry with sudo.
Apt
Learning the terminal opens up computer functions that are not available
through the GUI. Also, you can shorten the amount of time it takes to do many
things by typing it instead. Take, for instance, the amount of work required
installing a program. If you wanted to download the Google Chromium browser,
you would have to open the software center, type in the name of the program,
locate the correct package, mark it for installation, and execute the action.
Compare that to typing “sudo apt-get install chromium-browser” into the
terminal. With that one command, Ubuntu will save you many minutes.
The usefulness of apt extends beyond that, as you can use it to update
every single application on your system with a few commands. Use “apt-get
update” to refresh the repository, then use “apt-get upgrade” to have every
application upgrade itself to the newest version. Windows OS users should be
envious at this easy process, because updating a Windows programs requires
uninstalling and reinstalling with the newest version.
As time goes by, you might need to update the Ubuntu version. Every
year there is a new release, and it can be installed with “apt-get dist-upgrade”.
Staying up to date with the newest fixes and additions ensures your Linux
system will be working healthy for a long time. You might have even noticed
that installing and updating the system does not require a reboot; a feature that
contributes to Linux computer’s lengthy uptimes and stability. Lastly, removing
an application is done with “apt-get remove” followed by the package name.
To run the programs that we install we can either search for them from the
dash, or we can just type the package name into the terminal. Typing
“chromium-browser” will launch it just the same as double clicking its icon
would. Some programs must be started from the command line by typing the
package name exclusively because the package does not show up in a dash
search. Overall utilizing the terminal is a time-saver and a great way to practice
moving away from slow and cumbersome graphical user interfaces.
Here are a few more basic terminal commands that you should internalize and
put to use in your system. Fully understanding the basics will provide a decent
foundation upon which to build on later.
Some commands have “tags” or “switches” associated with them. These are
the letters preceded by dashes. They all do different things, and learning which
switches to use for what purpose is best found through that command’s manual
pages. See the advanced section for opening the manual.
One of the most useful programs from the command line, nano is a simple
text editor that can be used to edit files and quickly make changes to settings or
scripts. It is accessed by typing “nano” into a command line. You can type a file
as needed and then press ctrl+x to save and quit. As you save, you will give it
the name and file extension associated with it; notes.txt will create a text file
with the name “notes”. Alternatively, you can edit a file by typing “nano
notes.txt”. In that example, we open notes in the editor and display its contents
in an editable state.
Nano may be very simple, but it is undoubtedly powerful and a time saver for
quick changes and file creation.
Connecting to Windows / Mac Computers
[share]
browsable = yes
guest ok = yes
read only = no
You might also need to see files from other operating systems in the
Ubuntu computer. Firstly, open the Ubuntu file explorer. From the menu bar,
click “files”, and then select “connect to server”. In the resulting box, type the
URL of the share you wish to access. It could be an ftp address
(ftp://ftp.test.com), an http address (http://test.com), or a share address
(smb://share/Folder). Without any additional hardware or setup, you can see the
files this way.
For most users, however, creating shares and joining domains is far
beyond the connectivity needs. Simple file sharing is much better done through
USB drive transfers or a service such as Dropbox. Indeed Dropbox can be
installed on the big three operating systems and files can be synced between
them with no additional setup. On Ubuntu either download the .deb file directly
from the website, install it from the software center, or use “sudo apt-get install
nautilus-dropbox” to obtain the application. Within the Dropbox folder, place
any files that you wish to transfer between computers and it will automatically
be downloaded and updated on all other Dropbox computers you own.
Using other operating systems is not complicated when you connect them
together. So long as the computers are on the same network you can create file
shares, join them into a domain, or use a simple service such as Dropbox.
Useful Applications
Here is a list of the best Applications for your Ubuntu system that will help
you get the most out of your computer.
Creativity – Aud
acity, GIMP
And for programs that help with usability, there are so many varied choices
that it depends on what you are trying to accomplish. The best way to discover a
program is to search on the internet for a functionality you wish to add. For
example, if you are searching for a quick way to open and close the terminal you
might come across the program “Guake”. Or if you are wanting audio within the
terminal it might recommend “Cmus”. Finding the perfect applications for you
is part of the customization aspect of Linux, and it makes every install a little
more personal for each user.
Administration
If you are looking for a “Control Panel” of sorts, you can find shortcuts to
administrative tools such as network, printing, keyboard, appearance, and more
from within the “System Settings” application. Some Ubuntu variants use
“Settings Manager” or just “Settings” for the same purpose.
As for services, you might have noticed we use the “service” command to
change their status. So starting a web server would be done with “service
apache2 start”, restarting it done by replacing start with restart, and stopping it
by replacing start with stop. Finding a list of services is done with “service –-
status-all”. Services are daemons, or background tasks that are continuously
running. They can be gathering data, running a service such as Bluetooth and
Wi-Fi, or waiting for user interaction.
Security Protocols
One feature brought over from UNIX is file permissions. Every file has a
set of permission- the owner, group, and rights. The command “chown” changes
the owner of a file, “chgrp” changes the group, and “chmod” changes the rights
associated with the file. Discovering the permissions of a file or folder is done
by typing “ls -l filename”. It will return an initially confusing line such as “- rw-
rw- r--”. “R” means read, “W” stands for write, and the third option is “X” for
execute. The three sets are respectively owner, group, and other. So our
example file above has read and write permissions set for the owner and its
group, but only read permissions for other users. This means that the owner and
the group he belongs to (most likely sudo users) have permission to both access
the file and change its contents, but other users on the network or PC can only
view the contents and not edit it. Script files will need to have the X in order to
be executed, and without it they cannot be run.
Most people will only need to use the “chmod” command to change the
permissions of files they wish to use. We use the command and a set of numbers
to set the permission of the file. “chmod 777 test.sh” makes the file readable,
writable, and executable by all users anywhere because each specification
(owner, group, other) has the number 7 attached to it. Numbers determine the
permissions that entity has, and the number used is calculated like so:
Start with the number 0.
Add 4 for adding readability.
Add 2 for write-ability.
Add 1 for executable-ness.
The number you have left determines the permissions.
Security within Linux expands beyond just permissions. Ensure that you
practice good security practices, and that you are following common sense in
regards to security- install only needed programs, do not follow all internet
advice, do not use sudo too often, use passwords, use encrypted networks, keep
software up to date, encrypt important files, and make regular backups. As a
final word of advice, look into using a distribution with SELinux, a module that
supports AC and other security policies.
Scripting
To start a script, create a new file “script.sh” within nano. The first line
must always be “#!/bin/bash” to mark it as a bash script. Type the following
lines for your first script.
read name
echo “Hey, $name. Here is your current directory, followed by the files.”
Pwd
Ls
Save the script. Now we have to set the permissions to allow it to be run.
Use “sudo chmod 777 script.sh”, and then run the script with “./script.sh”. So
long as you copied the script exactly, it will ask for your name and then show
you your directory and files. Take the concept and expand it further in your own
scripts. You can run commands from installed programs as well, so you can
write a script that automatically joins a domain, or one that connects to the
network specified. Shutting down remote computers is a great automatic task as
well.
Scheduling tasks for a certain time can be done with the Cron system
daemon. It is installed be default on some systems, but if not “sudo apt-get
install cron” can be used. Start the service with “service cron start” and create a
new crontab file with “crontab -e”. Select nano as your text editor. At the
bottom of the created file, add a new line with our scheduled task. The format
goes as follows:
0 12 * * * ~/script.sh
This will run the script.sh found in the Home directory every day at noon.
30 18 25 12 * /usr/bin/scripts/test.sh
And this will run test.sh within the /usr/bin/scripts directory at 6:30 on
Christmas day every year.
Now extracting that same archive can be done with “tar –xzvf
name.tar.gz”. You will notice that the –c was replaced with an –x, and this
indicates extraction. Once again if you are dealing with bzip2 files use the –j
switch instead.
And the most requested terminal tip involves copy and pasting.
Attempting to paste a line into the terminal results in the strange character ^v.
The keyboard shortcut is not configured to work in the terminal, and that is why
the strange combination is displayed. To actually paste, right click and select the
option; or use the key combination shift+insert. Copy in the same way, but with
ctrl+insert instead. While it might be okay to copy and paste terminal
commands from the Internet (provided you understand the risk and know what
they are doing in the command), do not try to paste from this publication. The
formatting introduced through the medium in which you are reading it might
have inserted special characters that are not recognized by the terminal, so it is
best if you do not copy and paste, but rather you should type manually any
commands presented.
Linux has a hidden feature that not many users know about. Files are
displayed to the user when you visit that directory or type ls, but actually not all
of the files are viewable this way. In Linux if you name a file with a period as
the first character it will be marked as hidden. Hidden files are not normally
visible by common users, and it acts as a way to protect configuration files from
accidental editing/deleting/so forth. To see those files, we only need to add the –
a tag to our ls search. In the GUI press ctrl+h in a directory to reveal the secret
content. And as you create scripts and other configuration files consider hiding
them with the period as a form of user protection.
Any command within terminal can be interrupted or quit with the ctrl+d
key combination. Use it to stop a lengthy process or to exit out of a
program/command that you do not understand.
function cdls () {
cd "$@" && ls
}
After writing your aliases, save the file and restart the computer. Your
new commands are then available for use.
That file we edit, .bashrc, is the configuration file for the Ubuntu
terminal. Besides making aliases we can also use it to customize our terminal
settings, such as color, size, etc... A quick tip is to uncomment the
“#force_color_prompt=yes” by removing the # and ensuring “yes” is after the
equals. This adds color to the terminal, making certain words different colors.
More options are available when you open a terminal, right click on it, and select
profiles followed by profile preferences. Through the tabs here you can
customize the font, size, colors, background colors, and much more.
Customization of the terminal is recommended if you are going to be using it a
lot, because it helps to be comfortable with the tools you will work with.
I/O Redirection
Input and output are normally direct, but by using I/O redirection we can
do more with the terminal. As an example, the “cat” command (concatenate)
followed by a file will output that file to the screen. Running cat by itself opens
a parser where any line that is input will be immediately output (use ctrl+d) to
quit. But with I/O redirection hotkeys (<, >, <<, >>, |) we can redirect the output
to another source, such as a file. And “cat > test.txt” will now put the standard
output in that new file. Double signs signify appending, so “cat >> test.txt” will
place the output at the end of the file rather than erasing the contents at the
beginning.
The vertical line character, or the “pipe”, uses another form of I/O
redirection to take the output of one command and directly insert it into the input
of another. “ls | sort –r” would take the output of ls and sort it into a backwards
list. We redirected the output and gave it to another command to accomplish
this.
And finally, the “grep” command is used very often within I/O redirection.
Grep can search for a certain string within a specified file and return the results
to standard output. Using redirection, this output can be put into other
commands. An interesting feature of Linux to note is that object is a file, even
hardware. So our CPU is actually a file that stores relevant data inside of it, and
we can use grep and other tools to search within it. That example is fairly
advanced, but here is a simpler instance:
And it will search within the file for that specific word. I/O redirection
can become a complicated process with all of the new symbols and commands,
but it is a feature that you can incorporate into your scripts and daily use that
often allows for certain features and functions of Linux to be done in a single
line.
Linux and the terminal are difficult concepts to fully master. But with
practice and continuing dedication you will be able to perform masterful feats of
computing and do helpful tasks that are not possible in Windows or OSX.
Learning more about commands and how to use them certainly helps in this
regard, so persist in your studies of new commands and their use. Positively the
only command you actually need to memorize is “man”, a command that will
show the manual pages and documentation of any other command specified.
The manual pages show switches, examples, and the intended use of every
command on your system. Use the tool to your advantage and gain intimate
knowledge of your system.
More Linux Information
The “Linux file system” refers to the main layout of the files and folders
on your computer. If you continue to “cd ..” in the terminal, or if you click the
back button on the GUI until it goes no further you will stumble upon the “root”
directory. The folders here, bin, boot, etc, usr, and so on are how your hardware
and settings are configured. Each folder has a specific purpose and use, and you
can understand them by exploring the contents. As an example, user data is
stored in home, but user programs are stored in usr. Because of how diverse and
complicated the file system actually is it will not be discussed here, but if you
wish to learn more do an Internet search or read the documentation associated
with your operating system.
Linux systems are often used for purposes other than desktop use.
Dedicated machines run variants of Linux because of the power and stability it
provides. Even our cars have a Linux kernel running to keep track of error codes
and help mechanics.
Servers often have Linux installed because of reliability and the functions
the distributions have within them. For instance, Linux machines are used as
firewalls because the “iptables” application provides excellent port blocking and
intelligent filtering. You yourself can run a firewall on your system with the
application as well, thus gaining business-level software for free. In this way,
Linux is also great for networking. The machine can act as a switch, router,
DNS server, DHCP server, and more just by installing the relevant applications.
And finally, Linux systems are not limited to the interfaces we have seen
insofar. Every distro has its preferred desktop environment, but the interface can
be extremely customized to the individual’s preference. There are even file and
web browsers for the terminal, which is greatly helpful for those using SSH or
remote computing. All-in-all, you should try out different DE’s by installing
them and configuring them to your liking.
What Next and Conclusion
How you continue depends on what you want to do with your Linux
distribution. For casual browsing and simple use, continue with Ubuntu and
install the programs you need. For more adventurous people, consider installing
a new distribution to see what each has to offer. Those wishing to learn even
more deeply about Linux can install one such as Arch or DSL to build their own
unique OS from scratch. Administrators and power users can install a server
version of a distro to build their own Linux network, or they can consider
changing over their environment from other operating systems to entirely free
ones.
Isaac D. Cody is a proud, savvy, and ethical hacker from New York City. After
receiving a Bachelors of Science at Syracuse University, Isaac now works for a
mid-size Informational Technology Firm in the heart of NYC. He aspires to
work for the United States government as a security hacker, but also loves
teaching others about the future of technology. Isaac firmly believes that the
future will heavily rely computer "geeks" for both security and the successes of
companies and future jobs alike. In his spare time, he loves to analyze and
scrutinize everything about the game of basketball.