Adb Shell Commands Cheat Sheet



The most exhaustive & definitive Android glossary.

Commands

ADB: Android Debug Bridge. A utility to link the commands in the android through PC. (How to install & setup?)

  • adb.exe can be taken from the SDK (already included in the android SDK). It is in the platform-tools folder. Acess help by typing “adb help”
  • adb shell logcat = to know the log while flashing (for debugging)

ADK: Android Development Kit, used for development purposes.

Most Complete ADB Cheat Sheet, You can also issue an activity manager command directly from adb without entering a remote shell. For example: adb shell am start -a android.intent.action.VIEW For a list of all the available shell programs, use the following command: adb shell ls /system/bin Help is available for most of the commands. # adb start-server. Check if you device is found # adb devices. Create a full backup of your phone and save to the computer. Restore a backup to your phone. Push and flash custom ROMs and zips from your computer. Try to access a terminal # adb shell. ADB Cheat Sheet. GitHub Gist: instantly share code, notes, and snippets. Adb shell screenrecord -time-limit #Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes). Adb shell screenrecord -rotate # Rotates 90 degrees adb shell screenrecord -verbose.

Commands

AOSP: Short for Android Open Source Project, and when the term is used in ROM descriptions, it usually indicates that the ROM in question is based on the Android source code provided by Google itself, and not on some other ROM project or a company’s firmware.

APN: Access Point Name, a computer protocol that normally allows computer users to access Internet using mobile phone network.

Baseband: In communications and signal processing, the baseband describes signals and systems whose range of the frequencies measured from close to 0 hertz to a cut-off frequency, a maximum bandwidth or highest signal frequency. It is sometimes used to describe frequencies starting close to zero

BLN: (Back Light Notifications) This feature turns the touchkey backlights into a notification led. Requires a kernel mod.

Boot Loader: State in which the device can be flashed from RSD with an appropriate .sdk file that reprograms the phone into a specific ROM or update. This is typically a last resort when the recovery screen cannot be reached to make a much simpler and less risky solution

Boot Loop: simply means something is preventing the phone from completting it’s boot cycle and is stuck between the boot animation and the unlock screen, creating a looped animation. This is often fixed by either reloading a Nandroid, or reflashing a rom from the Boot Loader.

Brick or Bricked: Jargon for a completely unrecoverable device, (no more than a brick or paperweight) Refer: What is Bricking?

Bug or Software Bug: An error or flaw in software that produces a failure or unexpected/unwanted result. Typically created from incorrect code, this is why some Roms are better and smoother running than others because certain developers have taken the time to input bug-free code

Busybox: BusyBox is a single multicall binary that packages the functionality of most widely used standard Unix tools. BusyBox provides a fairly complete environment for any small or embedded system.

CID : The Carrier ID is a number embedded in your Phone’s SPL that identifies whether your phone is a network branded. Refer how to network unlock?

Dalvik: is the cryptic name of the virtual machine (VM) in Android, and it’s the basis for running apps (with the .apkfilename extension) on the platform. Before Android apps are launched, they’re converted into the compact Dalvik Executable (.dex)format, which is designed to be suitable for systems that are constrained in terms of memory and processor speed. Dalvik was originally written by Dan Bornstein, who named it after the fishing village of Dalvík in Eyjafjörður, Iceland, where some of his ancestors lived.

Dalvik Cache: Simply put it is the cache used by Dalvik, and it’s the result of Dalvik doing optimizations of running apps. Some Android ROMs allow you to move the Dalvik cache to your SD card, in order to free up internal storage.

De-odex: Apk files have respective odexes that devs use to supposedly save space. Deodexing means you convert it back to a .dex file and put it back inside the apk. This allows you to easily replace files (not having to worry about odexes), but the main point was to deodex services.jar so that you can change all text to different colors (such as the clock color to white) and to deodex services.jar, you need to deodex everything. Refer what are odex & deodex files?

ext2/ext3/ext4 = filesystem used by Linux kernel, it’s like FAT, FAT32 or NTFS on windows. Ext2 is the oldest type of extended file system, and Ext4 is the newest.

Flash or Flash Memory: a program technology that can be electrically erased and reprogrammed.

Flash or Flashing: Associated with installing a Firmware or recovery.

Firmware: A phone’s firmware is basically its operating system. A “firmware update” means that the operating system, the software that controls the phone, is updated.

  • Stock Firmware or Stock Rom : The one that comes bundled. it’s the version of the operating system the phone’s manufacturer delivers.
  • Custom Firmware or Custom Rom : An unofficial customization of stock Rom usually unlocking more features. Refer Custom Roms Wiki
  • CyanogenMod or CM: A very popular and powerful Custom Rom based on latest version of Android built from Scratch
  • MIUI: Another very popular Custom Rom that is more beautiful than apple’s iOS. Made using CM as base.

JIT: The Just-in-Time Compiler. Released with Android 2.2, it’s a method of greatly speeding up apps in Android on the software side.

Kernel: The governor of the CPU usage and battery output, one can upload custom Kernels to achieve greater performance of their device at the cost of battery life.

Modes: The different modes in which an android phone can be booted

  • Recovery Mode: Home + Power button, on this boot mode, we can open shell to flash image. Create Backup and Restore. Signature
  • Download Mode: State in which the droid phone can be flashed from Odin with an appropriate .sdk file that reprograms the phone into a specific ROM or update. This is typically a last resort when the recovery screen cannot be reached to make a much simpler and less risky solution.
  • Fastboot: is a tool used to flash system images (.img files) from a command line on your PC. .img files are created when you do NANDroid backups. Not applicable to all devices.

Nandroid or Nandroid Backup: A file typically created in the custom recovery program, such as SPRecovery, that is a carbon copy of whatever state your phone is in before a drastic change is made. the file then can be moved onto or off of the SD card for later use in case something should go wrong in the ROM or Update, or a Boot Loop occurs.

OS: Operating system, i.e. Windows Vista or MAC or Android or iOS

OTA: Over The Air, a method transferring data, usually the term use on activity update (download)

Overclocking: Speeding up the CPU past the factory presets to achieve a faster and more responsive device. Needs a kerned modification.

Overvolting/UnderVolting: Changing the voltage levels associated with CPU

QR code: A black-and-white barcode that, when scanned by your phone, can open a web link, point to an application in the Market, etc.

Radio: This is not a radio with which you can listen to music. We are referring to the phone’s communication radio. All mobile phones have a radio, which allows the phone the ability to transmit and receive radio waves, such as phone calls. You can update the radio firmware on your phone by flashing an updated radio image (via recovery)

Recovery: A recovery program that is often used to apply updates, Roms, or create a back up or restore a backup file.

  • Stock Recovery: The one that comes bundled with your phone.
  • Custom Recovery: A custom recovery offers much more than the stock recovery (How to)
  • ClockworkMod: Undoubtedly the most pular custom recovery.
  • SPR or SPRecovery: A recovery program that is often used to apply updates, ROMs, or create a back up or restore a backup file
  • Cyanogenmod Recovery: Yet another type

Reset (hard, soft): The rebooting of the phone. A soft reset is turning your phone off and on, or pulling the battery. A hard reset also is referred to as a factory reset, and wipes your personal information from the device.

ROM: Read Only Memory, a program used to make changes to anything from the look of the home screen, to icons to custom boot animation. Though this term is used more in association of a firmware on Android.

Root (as in access): Common word associated with giving a user “super user” access to their phones programming and other various aspects that would normally not be possible, also known as ‘Jailbreak’ for iPhone’s but much easier. Refer Advantages of rooting your phone

Root (as in location): The ‘root’ of a folder or drive is the top most area of that location. In windows, C: is the ‘root’ of your hard drive. The ‘root’ of your SD card just means you haven’t moved into any sub-folders.

RSD or RSD lite: Remote Software Download, Motorola’s own tool in flashing virtually any type of program, (so long as its in .sbf form) to the Android OS

Scripts : Scripts are text files that contain a list of commands to perform. Instead of typing each command out multiple times, a script can be run that will initiate all steps listed in the script.

  • Dark tremor’s a2sd : A script that can move your apps to sd card. (How to)
    • Apps2SD = The process of moving / save the application to SD card addition to internal memory.
    • Cache2SD = The process of transferring / storing cache from ROM to SD card.
  • V6 Supercharger : A very popular script to charge up your phone.

SetCPU: This is a popular application for overclocking or underclocking your phone’s processor, making it faster or slower. It may require a special kernel in order to work.

Shell or SSH: Secure shell or ssh is a network protocol that allows data to be exchanged using a secure channel between two networked devices.

Stock: Simply means an unaltered state, such as when you first purchase your phone or when you do a factory reset.

SU: “Super user” or root permissions

Tethering: The act of using your smartphone’s data to provide Internet access to another device, such as a laptop. Can be done via wireless or a USB cable.

Theme: A set of icons, backgrounds and app trays that change the aesthetics of the overall look of a device and its applications. Generally needs a deodexed Rom.

TUN/TAP: Refers to a network TUNnel, operates within layer 3 packets, or IP packets. Packets sent by a system via a TUN/TAP device are delivered to a user-space program that attaches itself to the device. A user space program may also pass packets into a TUN/TAP device. In this case TUN/TAP device delivers (or “injects”) these packets to the operating system’s network stack thus emulating their reception from an external source.

Underclocking: Slowing down the CPU mainly to limit battery usage.

XDA: The popular android developers forum.

.apk or APK’s: An .apk file extension denotes an Android Package (APK) file. An .apk file can be opened and inspected using common archive tools. Synonymous with IPA in the iPhone (iPhone), SISdi Symbian s60, or JAR in the BB (for BB users) and other java-based devices.

.dex file: Compiled Android application code file. Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically translating compiled applications written in the Java programming language.
.sbf: Summation Briefcase File

.tar: Similar to a zip file, a tar file archives multiple files into one file

.tgz: TGZ files are commonly used as install packages for Slackware Linux.

Android Versions:
Ice Cream Sandwich: Android version 4 (not yet released)
Android 3.X – Honeycomb
Android 2.3-2.4 – Gingerbread
Android 2.2 – Froyo
Android 2.0/2.01/2.1 – Eclair
Android 1.6 – Donut
Android 1.5 – Cupcake

Did we leave out any? Drop a comment.

References: 12

What is a Reverse Shell?

A reverse shell is a kind of shell in which the target machine communicates back to the attacking machine. The attacking machine has an open listener port on which it receives the connection, by which code execution or command execution can be achieved.

A reverse shell or a connect-back shell is the only way to gain remote shell access across a NAT or firewall. When an attacker wants a remote shell, a machine controlled by him will connect to a remote host and requests for a shell session, and this is called a bind shell.

But what if the remote machine is not directly accessible. It can be many reasons for that. Let’s assume that the remote host has not a public IP address or it is protected by any type of firewall that blocks incoming connection using a firewall. In that situation, a reverse shell can be used, where the target machine initiates or creates an outgoing connection to a listening attacker host and sends the shell session to the attacker machine.

Here I include a reverse shell cheat sheet that contains many reverse shells for different methods or different programming languages like, PHP reverse shell, Netcat reverse shell, Python reverse shell, etc. This will help to run an appropriate payload on target from detected available software or binaries.

Here we used follwing IP address and Port for demo perpose,

Adb Shell Commands Cheat Sheet

  • IP address: 192.168.1.2
  • Port: 4545

Bash Reverse shell

Python Reverse Shell

Netcat Reverse Shell

PHP Reverse Shell

Perl Reverse Shell

Ruby Reverse Shell

Java Reverse Shell

Java Code:

Power-Shell Reverse Shell

AWK Reverse Shell

Socat Reverse Shell

On Attacker Machine(Listener):

On Vitim Machine:

xTerm Reverse Shell

NODE.JS Reverse Shell

Adb Shell Commands Cheat Sheet Pdf

TELNET Reverse Shell

1)

Adb Commands

2)