Pen Viva Ques
Pen Viva Ques
Pen Viva Ques
Experiment 1 : To install configure Android studio and Implement simple Android studio and
Implement simple Android APK.
What is Android?
Androidis a software package and Linux based operating system for mobile devices such as
tablet computers and smartphones.
It is developed by Google and is mainly used to write the android code even though other
languages can be used.
There are many code names of android such as Lollipop, KitKat, Jellybean ,etc.
What is Android Studio, advantage and who are the users of android studio?
Android Studio is the official Integrated Development Environment (IDE) for Android app
development.
Advantages:
APK stands for Android Package (sometimes Android Package Kit or Android Application
Package).
An APK file is the file format used to install the applications on the android operating system.
A program in android is first compiled, and then all its parts are packaged into one single file
to make it an APK file.
Different types of mobile applications platforms
Native Apps:
Native apps are built specifically for a particular mobile operating system (e.g., Android or
iOS)
Using platform-specific programming languages (Java/Kotlin for Android, Swift/Objective-C
for iOS).
Because developers build a native app for use on a particular device and its OS, it has the
ability to use device-specific hardware and software.
Web Apps:
Web apps are accessed through a mobile browser and are essentially websites optimized for
mobile devices.
They are developed using web technologies such as HTML, CSS, and JavaScript and are not
installed on the device.
Web apps are cross-platform and can run on any device with a compatible web browser.
Hybrid Apps:
Hybrid apps combine elements of both native and web apps. They are built using web
technologies (HTML, CSS, JavaScript) and wrapped in a native container.
Hybrid apps can be deployed across multiple platforms with minimal code changes, making
them cost-effective and efficient for development.
They have access to device features through plugins and APIs provided by frameworks like
Apache Cordova or Ionic.
Introduction of Android, features of Android
Introduction
Open Source
User Interface Customization
Multitasking
Notification System
Applications
Application Framework
Android Runtime
Platform Libraries
Linux Kernel
It can be represented as five different layers, as shown in the following architecture
diagram:
Applications –
Application Framework provides several important classes which are used to create an
Android application.
Application runtime –
It contains components like core libraries and the Dalvik virtual machine (DVM).
It provides the base for the application framework and powers our application with the
help of the core libraries.
Dalvik Virtual Machine (DVM) is a register-based virtual machine and specially designed
and optimized for android to ensure that a device can run multiple instances efficiently.
Platform libraries –
The Platform Libraries includes various C/C++ core libraries and Java based libraries.
such as Media, Graphics, Surface Manager, OpenGL etc.
to provide a support for android development.
Linux Kernel –
Android Debug bridge (ADB): ADB is a versatile command-line tool that allows developers
to communicate with an Android device or emulator connected to a computer.
Android Interface definition language (AIDL): AIDL is a language used to define remote
interface contracts in Android applications, particularly when implementing interprocess
communication (IPC) between different Android components.
Aapt: aapt is a command-line tool used to package and manipulate Android application
resources (such as icons, layouts, strings, etc.) within the APK (Android Package) file.
dexdump: dexdump is a command-line tool that allows developers to inspect the contents of
Android DEX (Dalvik Executable) files.
Dex: The dex tool is used to convert Java bytecode (.class files) into the DEX format.
An APK (Android Package) file is the package file format used by the Android operating
system for distributing and installing applications.
It contains all the necessary files and resources required to run the application on an Android
device, including compiled code (in DEX format), resources, assets, manifest file, and
certificates.
Q. Application Sandboxing and Signing:
Q. Build Process:
The Android build process involves compiling the source code, packaging resources, and
generating the final APK file for the application.
It typically includes tasks such as compiling Java/Kotlin source code into bytecode,
processing resources, running lint checks and signing the APK.
Q. Rooting:
Rooting refers to the process of gaining root access or administrative privileges on an Android
device, allowing users to modify system files, install custom ROMs, and access restricted
features.
Rooting can void the device warranty, expose it to security risks, and potentially cause
stability issues.
Q. Application Manifest File:
The Android application lifecycle refers to the sequence of states that an Android application
goes through during its lifetime, from creation to destruction.
The lifecycle includes states such as onCreate(), onStart(), onResume(), onPause(), onStop(),
and onDestroy(), which correspond to different stages of the app's execution.
The Application class is a base class in Android that represents the global application state
and is used to maintain application-wide resources, initialize components, and handle
lifecycle events.
1. Foreground process: A foreground process is a process with which the user is currently
interacting and using it.
2. Visible process: The user does not directly interact with this process, as the activity
corresponds to this process would be covered partially by another activity and the process
will be in the onPause() lifecycle state.
3. Service Process: A process is said to be a service process if it is in running state and
neither a foreground process and a visible process.
4. Background process: A background state in which the onStop() lifecycle method of
android is called by the system.
Q. Architecture of IOS Operating System
IOS is a Mobile Operating System that was developed by Apple Inc. for iPhones, iPads, and
other Apple mobile devices.
CORE OS Layer:
All the IOS technologies are built under the lowest level layer i.e. Core OS layer.
These technologies include:
Address Book Framework- The Address Book Framework provides access to the contact
details of the user.
Cloud Kit Framework- This framework provides a medium for moving data between your app
and iCloud.
Core Data Framework- This is the technology that is used for managing the data model of a
Model View Controller app.
Core Foundation Framework- This framework provides data management and service features
for iOS applications.
MEDIA Layer:
It enable all graphics video, and audio technology of the system. This is the second layer in the
architecture. The different frameworks of MEDIA layers are:
ULKit Graphics- This framework provides support for designing images and animating the
view content.
Core Graphics Framework- This framework support 2D vector and image-based rendering
and it is a native drawing engine for iOS.
Core Animation- This framework helps in optimizing the animation experience of the apps in
iOS.
Media Player Framework- This framework provides support for playing the playlist and
enables the user to use their iTunes library.
COCOA TOUCH:
COCOA Touch is also known as the application layer which acts as an interface for the user to work
with the iOS Operating system. It provides the following frameworks :
EvenKit Framework- This framework shows a standard system interface using view
controllers for viewing and changing events.
GameKit Framework- This framework provides support for users to share their game-related
data online using a Game Center.
MapKit Framework- This framework gives a scrollable map that one can include in your user
interface of the app.
PushKit Framework- This framework provides registration support.
An activity is a single, focused screen that users can interact with in an Android application.
To create an activity, you need to extend the Activity class or its subclasses
(AppCompatActivity, for example) and override lifecycle methods such as onCreate() to set
up the activity's user interface and initialize resources.
Activities are typically defined in the AndroidManifest.xml file using <activity> tags,
specifying attributes such as the activity's name, label, and launch mode.
Q. Filters
Intent filters are used to specify the types of intents that an activity, service, or broadcast receiver can
respond to.
Q. Displaying notifications.
Notifications are used to alert users about events or information, such as new messages,
updates, or reminders.
You can create and display notifications using the NotificationManager class.
Q. Broadcast User Interface
Broadcast receivers are components that listen for and respond to broadcast messages from
other applications or the system.
You can create broadcast receivers by extending the ‘BroadcastReceiver’ class and registering
them in the AndroidManifest.xml file or dynamically in code.
Q. Android UI Design
Android provides various UI components and layouts for designing user interfaces, including views,
layouts, and fragments.
Q. Views
‘Views’ typically refers to a user interface component or widget that is used to interact with the user.
Views are the building blocks of an Android app's UI, and they can include elements such as buttons,
text fields, images, and more.
Q. Layouts
Layouts define the arrangement and positioning of views.
Q. Fragments
Fragments are reusable UI components that represent a portion of a user interface or behavior. They
are often used to create flexible and modular UI designs that can adapt to different screen sizes and
orientations.
Q. Adapters
Adapters are used to bind data to views, such as populating a list or grid with data from a data source.
Q. Linking Activities Using intents.
Q. Android vulnerabilities
It refers to weaknesses or flaws in the Android operating system or applications that can be exploited
by attackers to compromise device security
Common Android vulnerabilities include:
Mobile application penetration testing is essential for identifying and addressing security
weaknesses and vulnerabilities in mobile applications.
It involves simulating real-world attacks and exploitation techniques to uncover potential
security flaws and assess the overall security posture of the application.
Q. The mobile application penetration testing methodology.
It follows a systematic methodology to identify and exploit security vulnerabilities in mobile
applications. Different phases in mobile application penetration testing methodology are:
Reversing the application refers to the process of analyzing and understanding the inner
workings of an Android application, including its source code, functionality, and security
mechanisms.
This process involves using tools like APKAnalyser, APKTool, dex2jar, JDGUI, and manual
analysis techniques to decompile, inspect, and understand the application's behavior.
Choose an Operating System: Select a suitable operating system for penetration testing, such
as Kali Linux, Parrot Security OS, or Ubuntu.
Install Virtualization Software: Install virtualization software like Oracle VirtualBox or
VMware to create virtual machines for testing.
Set Up Android Emulator: Install an Android emulator like Android Emulator, Genymotion,
or BlueStacks for simulating Android devices.
Configure iOS Simulator: If testing iOS apps, install Xcode on macOS to access the iOS
simulator.
Install Penetration Testing Tools: Install tools like Drozer, Frida, APKTool, and Burp Suite for
analyzing and testing mobile apps.
Configure Network Proxy: Set up a network proxy for intercepting and analyzing network
traffic from mobile devices or emulators.
Network Configuration: Configure mobile devices or emulators to use the proxy server for
network communication.
Documentation and Reporting: Develop templates and guidelines for documenting findings
and preparing penetration testing reports.
Q. Monkeyrunner
Monkeyrunner is a tool provided by the Android SDK for automated testing and interaction
with Android devices and emulators.
It allows testers to write scripts in Python to automate user interface interactions, such as
tapping, swiping, and entering text, for testing purposes.
Q. Genymotion
Genymotion is a popular Android emulator used by developers and testers for app
development and testing purposes.
It provides a fast and efficient emulation environment with support for various Android
versions, device configurations, and features, such as GPS simulation, camera emulation, and
network simulation.
Genymotion offers advanced features for testing and debugging Android applications, making
it a valuable tool for mobile app penetration testing.
Q. Assets – An asset is something that we are trying to protect. It can be property, information,
or even people
Q. Threats - A threat is something that can harm an asset that we are trying to protect. In mobile
device security, a threat is a possible danger that might exploit a vulnerability to
compromise and cause potential harm to the device. Types of threats - intentional, accidental
Q. Threat agents - Identify threat agents or actors who may exploit vulnerabilities to carry out attacks
against the application, such as hackers, insiders, competitors, or malicious users.
Threat agents will be able to perform the following actions: Access, Misuse, Disclose, Modify, Deny
access.
Q. Vulnerabilities - A security weakness within the system that might allow attackers to exploit it and
break the security of the device is called a vulnerability.
Q. Risk - The intersection between assets (A), threats (T), and vulnerabilities (V) is risk. , including
risk along with the probability (P) of occurrence of the threats might result in more value added to the
business: Risk = A x Tx Vx P.
Q. Approach to threat models.
In general, there are three approaches to a threat model:
• Software-centric: A risk mitigation focusing on software: Evaluates the application being modelled,
Determines the risk, Identifies controls to mitigate
• Asset-centric: Focusing on assets, this approach: Identifies assets to be protected, Classifies assets
based on data sensitivity and value potential, Determines an “acceptable risk” level
• Attacker-centric: Puts the user into the mindset of an attacker, Determines what is most at risk,
Needs to understand the concept of hacking, Must have the skill set of a hacker.
Identified Threats: The threat modeling process uncovers potential threats and vulnerabilities
within the system.
Vulnerability Prioritization: Threat modeling helps prioritize vulnerabilities based on their
severity and likelihood of exploitation.
Risk Assessment: By analyzing identified threats and vulnerabilities, threat modeling
facilitates risk assessment.
Security Controls: Threat modeling suggests appropriate security controls and
countermeasures to mitigate identified threats.
Q. Risk assessment.