Learn the art of Android malware analysis and become an expert in identifying and mitigating threats to Android devices. In this video, we'll take you through the process of analyzing Android malware, from setting up a safe environment to analyzing malware samples. You'll learn how to use various tools and techniques to reverse-engineer and understand the behavior of malicious apps, and how to stay one step ahead of the threats. Whether you're a security enthusiast, a researcher, or a professional looking to enhance your skills, this video is perfect for anyone looking to become an expert in Android malware analysis. With this knowledge, you'll be able to protect yourself and others from the growing threat of Android malware and stay safe in the digital world.
In this course, you will look at Android
malware. So, you will able to analyze
malware by the end of this course and
learn how to find out information about
any Android program, see if it is
malicious or not malicious, and you'll
be able to investigate any any Android
pro for
possible activity. Now for example in
this course we'll look at an application
that has a real
threat real malicious software called
Finsspy which not too much is known
about it. It is some trion or malicious
pro that has been used actively
to hack into phones. So Finsspy
and we look at how to find out if an
application contains Finsspy or other
possible malware.
And also we'll take a look at
fingerprinting which we'll explain later
throughout the course to be able to find
more about the application online.
You'll be able to look into the
application about what it's doing and
such kind of information. We use an open
source tool called
pithas and this is an free tool. So you
don't need to pay anything. It's just a
free tool you can use to analyze any
Android software, any Android app. So
you don't really need any prior
knowledge for this course. Of course, if
you have some technical knowledge about
Android, about APKs, that will really
help to understand
better. So in this course, we'll analyze
Android malware. We are going to
investigate the malware and learn how to
get information out of Android malware.
What you'll want to know is that most
Android
malware pretends to be a normal
application. So people install the
normal application on their Android
phone or on their tablet Android device
and this application is malicious and
then in fact the phone or or tablet
takes it over or does malicious things
and any application on Android is called
an APK. Android application package is
the meaning but you can just remember
APK
so on your phone you if you have an
Android phone or Android tablet there's
many different APKs and those are
applications so a lot of files with
extension APK you'll see I downloaded
some here you can find many APKs online
of course you can use the Google Play
Store to get them but also third party
websites you can find
any a click downloads and you'll have
the and then you can download the APKs.
So I have here
APKpure.com
and you can just search for APK
downloads and download any Android
application to analyze
it. Of course, you can also download
them out of your
phone, but you might as well download
them from these third party websites or
from the company websites. You can often
find the AP key APK as well. So you see
if I go to this
one, click
downloads, download
APK and then you can get
the file on different websites. So I
before I used APK pure but there's many
different websites where you can
download APKs and you can think of them
similar to uh on Windows computers you
have XA files which is executables on
Mac you have DMG files as
executables and on Android you have APK
files so APKs are just programs and one
thing to remember that APK that is our
starting point so you need an
application apk to analyze it if it is
malware or
not. And we're going to use a tool
called Pitus. So Pitus is an open-
source analysis tool. It's an online
tool where you can upload your APK and
find lots of different information about
it. So if I go to
the browser, I click new tab and then I
go to the website
beta.pus.org. So
that's so we go to the
website
beta.pitter.org. So this
website and you'll see this screen pop
up with two bars here on the left query
and on the right uh
APK. So on the right is where we want to
be. So in this bar you can click
browse sect your Android file your
Android program any APK you'll see they
have a limit of size so it has to be
smaller than that but you can upload it
for analysis
so if I click browse I can then select
any APK I
downloaded bear in mind the size and
click upload.
and it will start to analyze that APK
for potential threats. So for potential
malicious activity and the website is
beta.pitus.org as you saw before on the
screen. Now this can take a while
because it will upload the APK and
analyze it. So you can grab a coffee
while this process is taking place.
So in
theis tip APK analysis you can find some
more information for example the package
name the app name something about the
version if the app has been frosted so I
mentioned before that applications can
be frosted in that way it's verified
that it comes from the vendor in this
case this application is not frosted so
it can have been manipulated with so
frosting you'll See here, this can be
important if you want to be sure that
the app has not been messed with by any
malicious actor. So in this case is not
frosted. So we know that it can be
risky. You see on the top there's
different tabs and also on the left top
you'll see a thread level. So which is
provided by virus total. So from 0 to
63 we can go to threads intel and you
can find some information about when it
has
been published the
timeline. So obviously this timeline is
kind of weird because it's been first
first APK in 1981. So I really doubt
it. You'll see how long the certificate
is valid. So like 10 years
more and a link to the virus total scan.
So if you click on that link you can
find that virus total didn't
find malware in this APK. Doesn't mean
it doesn't exist or it's not malicious
but at least virus total com didn't find
anything. So that's in the thread intel
tab. You can find
some information like that.
Now another very useful one is the
behavioral analysis tab. So if you go to
this tab you'll see the permissions the
app has. For example this app can write
external storage. It can manage accounts
credentials and some other permissions.
So depending on the app that can be
necessary or not. So perhaps the app is
using GPS location, but the app is like
a file manager or a pain program or
maybe even a simple alarm clock. So then
it's like would be really weird if it's
using the GPS location. So you can check
the permissions in here of your
APKs
and some APKs
malicious they can have a lot of
permissions that obviously they want as
much permissions as possible. So that's
something you might find in a malicious
APK or it might be suspicious depending
on the type of APK that it has certain
permissions like in the case of an alarm
clock with a GPS location. That would be
really weird. Or perhaps making calls
when it's an alarm clock app.
So you might find some suspicious
activity
there. If you scroll down, you'll see
thread analysis. So you'll see things
the app is doing. For example, this one
is modifying the voice voice for you and
other things the app can do or might be
doing. So depending on the app, that
might be something that would be weird.
If you scroll down further, there is a
behavioral analysis step where showing
that things the app is actually doing.
For example, we mentioned that this app
is doing something with the GPS
location. And if you click on the little
I, you can see the Java classes, so the
programming code files that are
requesting the GPS location. So you'll
see different piles here. Location card
controller, location retrieved callback,
Google Play location service. So
depending on what you're interested in.
So you can find different things. For
example, it's making web connections in
several classes. So URL HTTP clients and
some other
files. And you'll see it can do
different things. For example, TCP
socket network connection. And there's
quite a lot of files, code files that
are
actually connecting with the
internet. So that is in the behavioral
analysis. you can find some more
information about which classes or which
Java files are using that permission. So
in this way using the top here the
behavioral analysis we can find out more
about how the app is
behaving. Another tab that is very
useful is the network analysis tip. So
if we go to that tab you can see the
countries where
the is actually connecting to. So this
app connects to the United States
to Netherlands and also to Germany. So
if you find perhaps the app is
connecting to to countries
you might not expect, that would be
really weird. And so yeah, you can find
some information in the network analysis
step. For example, it might be
connecting to China or to Brazil or
Australia. And depending on the app, it
might not be the suspected or expected
behavior depending on what kind of app
it is and where the company is located.
So in this case, it's two locations. So
it might be that it
has servers or computers on two
different continents just for having
faster connections to their customers.
But that really depends on the kind of
app and it might be it has app for
example on the other side of the globe.
So would be a bit weird or maybe it has
connections all over the
place. It really depends on on the
company vendor and what is the expected
behavior and a lot of behavior you can
find in the behavior tab. If you go to
network analysis, you can also scroll
down and find out the actual website
that the app is connecting to. So in
this case, you'll see it's connecting to
lots of Amazon sites and some cloud
site and yeah, you can see
where the application will connect to.
Aside from the map, you'll see the
actual servers, the domain names that
the app connects
to, also the specific URLs that they are
connecting to. So, and that you can do
for any APK, right? So, if you go to the
website, you can upload your APK and
find out all that kind of information
using this analysis tool.
So if you click on
fingerprints, you'll see here file sums.
So what is a file sum? You'll see all
these like codes here. These codes are
called digits or hashes. And there's
different programs that can create these
digits. So what is these digits? The
idea of digist is to given any input
which can be just a message or text
create some code which is called a digit
code. So in this case you'll see it's
created these digit codes
here
and this digit codes is created using an
algorithm. Algorithm is a computer
program. So there's a computer program
that creates the digitist. Now this is a
very simple example in which the
algorithm is basically
just in the alphabet sum all the numbers
and that creates a unique digits. Now of
course this is a very
simple programs very simple algorithm in
the real world there's different
algorithms that are much more advanced
to create these unique digitist. A
digist is always unique. So given an
input the output so given an input it
goes to the hash function or the
algorithm the program and that creates
this gibberish
output and that is unique for every bite
makes a unique difference. So here we
have a small changes in
the you'll see the digits changes
completely. You can try that on your
own. For example, if you go to
duck.com showed you in the pitus report,
it has different functions or different
algorithms, different programs. All of
this is just the same algorithm, program
hash function. We talk about the same
thing. So that is the the program in
between. So given the input, it creates
this gibberish
output. So for example, we can do MD5.
So we can say MD5
hello and it will tell you on
duck.com the digist. If we make a small
I can zoom in just to make it more
readable. So given the input it creates
that gibberish output the MD5 sum. Now
we can make a small change here for
example capital
H and you'll see the digits changes
completely. One thing to notice is that
the digits is always the same length. So
if we write some more
here you'll see it doesn't change the
digits length. So every program has a
unique length which is also what you see
in the report. So MD5 you'll see has a
shorter length than the
SSH1. Obviously we can also use the SSH1
program. So if you go to that website
again and we type
SSH1 you'll see it creates a completely
different hash because the program it's
using is different. So it has a
different program
here. The algorithm or the hash program
is different. That's why it creates a
different output. And so of course
there's different programs that you
can let me just remove
that. Okay, let's just ignore it. So
there's different programs here that can
be that create those hashes. But one
thing to notice is that a hash is
basically a unique identifier. So
given given an
input, let me close that. Given
anut it creates a unique output and that
can be for any file. So it can be just a
text message but you'll know that
everything in the computer is just data.
So anything can be hashed. Can be a
music file, MP3 file, it can be a video
file, it can be downloadable file in
this case an APK file, Android program.
You can also calculate the digits over
that. And you'll see bit does it
automatically. And why is that
important? Because we it's a unique
identifier for your program. So you can
search the internet for similar files.
I'll show you about that in the next
lecture.
Now we can also do some hunting. So if
we click on the fingerprints
tab, you'll see some fingerprints here
like MD5, SSH1, SSH 256 and also the
file size. So you can search for the
so-called hash. So this is a code that
has been generated using the APK files
input. And of course there's different
ways to generate these codes. So
different programs can generate
different
outputs. This is just a code that
represents the app. So you can search on
that. For example, if you click search
the internet, it will open a new tab and
search for that hash. So called hash
which is basically the
application. And you'll see okay for
this one there is no result.
You can of course also search the other
hashes and you'll see okay this hash
this application seems to be Amazon
Prime for Android. So by searching for
the hash you can also find information
online sometimes if if it's malicious or
anything like that. Hash is always
generated from a file or from input. So
any input they do a calculation and
calculate the hash which then looks like
this. And every hash is unique. So just
by searching for the hash you can also
find information by
similarity. Now if you scroll down
you'll see so you can search there's a
little glass here that you can use to
search for similar examples. So in this
case no results and we can use the other
glass find similar samples. Also for
this one there is no results but it
might be that when you search for them
either on pitus or on Google using those
file
sums that you find
information about is this application
malicious or not. So this by searching
by
similarity. Now in this case it didn't
find any threats here right
automatically. So for
some programs it might ident
automatically identify some
threats. For example, here is the
analysis report of another APK of
another Android program wire which is a
popular chat app but apparently it has
been messed with. So you'll see here
20/6 malicious. So it does seem to be
malicious. And if we go to the thread
tell tap you'll see hey there is fin spy
for androids. So okay that's hunting
match. So if if it's malicious it might
come with some hunting matches and
you'll see that okay the names of that
and we can search the internet for what
is this fin spy doesn't sound too good
right? So let's take a look what is fin
spy paste and go and you'll see it is
some
fileware you'll see it's some spyware
spy so
this APK is obviously
malicious you can find that here also
you can search for the fingerprint as I
showed before so if I click fingerprints
we can search for the internet for that
file sum and you'll
It shows that it is
malicious. So you'll see some website
that
okay. So you can search for that online
for those
hashes. But thread intel is of course
most obvious because it says hunting
matches and you might automatically find
what kind of manipulation they did with
the how how they made the program
malicious.
So in this case they added Finsspy
malware to their APK which then allows
them to think take over their
phone. So it says some information
here. It seems to be some
government
malware that has been used around the
world.
So yeah, that that is one possible
threat that you might find if this has
been messed with. Of course, there can
be all kind of
malicious that they added to the APK and
you can find that in the threat intel
activity. Now, one thing to notice is
that they only show that if you
register. So if you go to this website
and click sign in, you can log in and
then they will show that threat intel
hunting match information. If you don't
log in, then they don't show that. So,
that's something to keep on mind
that they will only show that for logged
in users. So, make sure that if you're
interested in that, click on sign in and
then login with GitHub
[Music]
to to find that information. Now, GitHub
account is free. So, you can create a
new one if you don't have one or if you
don't want to use your normal GitHub
account and then find the then it will
show you hunting matches if it found
one. So possible malicious software that
they included in
the so it can be fin spy but it can also
be
other software. It can also be that they
made their own software. In that case,
it won't be a hunting match. But you
would be able in behavior analysis to
find that okay, it does look malicious.
And also the malicious score on top, it
would show as
zero. So if you go to beta.pus.org,
or just for clarity that is
beta.pit.org. On the bottom of the
screen, there's the website URL. So, if
you go to that
website on the left, you'll have the
uh you you have the query fields.
So, on the left
here, we can search. You'll see a little
search bar here as well. So we can
search for example all the samples
available on pitus. So other people
analyze APKs as well and you can search
those reports or you can search for
specific threats.
So let's do
that. So if you go to the query and just
type asterisk as a query. So just an
asterisk and press
enter. You'll see if you scroll down a
lot of different APKs that have been
analyzed. For example, there's here
com.kingo.app. Some kingo root app. If
you scroll down, you'll see different
APKs. For example, this one 10 cent
seems to be malicious 27 score. So, we
can click on it to see the report for
this app. And you'll see this is a has
been a malicious app.
Perhaps if we go to thread intel, it it
shows a high score, but it doesn't show
here the information. We might need
login for that. We can go to behavioral
analysis to see what it's doing. Network
analysis. In this case, doesn't show
anything there. It can happen. So, if
you just search go
to beta.pitfest.org network and search
for
asterisk. You can scroll down in those
results and find out apps that have been
analyzed in the past and also their
thread score. So you can easily or
somewhat easily find malicious programs
in
there that other people found. So some
samples with
reports for example there's this
one some Arabic
program you'll see it has quite a high
uh malicious score now you can go
through the tops to see what's it's
doing in the behavior for example so
this is doing something with sec with
messages message service SMS or text
messages
just can go network analyzis and you'll
see this one is just connecting with the
United
States and you can find some different
things about what it's doing. So
obviously a lot with text messages in
this
app something with network as well. We
could go to the network analyzis tab and
scroll down and you'll see where it is
connecting.
So yeah, you can find different apps on
on here and analyze them and find
out some examples of APKs that other
people analyzed in the
past. For example, network analyzes and
you'll see this one is also connecting
to
Germany. There's some different websites
where it is connecting.
We can go to threat analyzis and you'll
see this has some kind of bank
rule. Obviously it's malicious this
APK and of course you can further
analyze it by going through these
steps. You might also search
for a certain threat. So if you type
thread name you can search for anything
containing a certain thread.
For example, we had fin spy
before and the malware. So asterisk
around it and like
this. So let me show you more clear. So
we type thread name with
underscore asterisk bins spy asterisk
and
search. And you'll see in this case
there have been no results for that. But
it doesn't mean that it doesn't exist,
right? because we had an app that had
that Finsspy uh malware included. It's
just that it isn't not included in the
samples that you showed for. So, by just
typing the asterisk enter, it has some
samples where you can take a look
around. Of course, if you have the
APK, you can click browse and select
your APK, click upload, and it will
analyze it for you to see if that APK is
malicious or at least if you can find
indications that that app is
malicious. Okay, so this is the analyzis
report of some APK which seems to be
Iranian.
You'll see it has a malicious score of
14. So obviously this seems to be
malicious. Now first step is the
fingerprints tab. So we can the app APK
every APK has a unique identifier which
before you learned how to calculate
that. Now we can search on the internet
for example Google. Click on the little
G and find
out. We can find the fingerprint
online. You'll see we can't find it.
online.
So, we don't really find about it any
information. You'll see some more
identifiers here that we can search. So,
nothing there on PitFus
either. Let's go over to the threat
intel tab.
So, tells us some basic things like
virus total has a score of 14. We can
click on the link, head over to virus
total
website and it says okay someious
activity. So it seems to have some
spyware on it. It's
malicious is included according to
Kasperski as
well. So a lot of different antivirus
vendors will tell you that this APK is
malicious.
Can click on
details. See about when this is created
also the
app can find some more. Now search for
relations different IP addresses that
might be so internet
addresses not that
special. We can go to the behavior tab
and see it's making network request. So
some basic information but basically the
antivirus companies will tell you that
this particular APK is malicious. It
says a score of
14. So it's either it seems to
be a SMS spy and SMS or spy agents. So
we can search on that for pithas and we
might find some other applications that
contain that spyware. In this case, it
seems quite many applications contain
that spyware. So, SMS spy and spy
agents. So, obviously this is a clear
example
of Android
application. The name indicates text
messaging SMS. So, might do something
with
that. We can go APK analyzis and it's
not a frosted app. So the vendor is not
it this this program doesn't actually
come from the vendor from the company.
It is some malicious actor. So by
frosted we can check if at least the APK
is distributed by the
company. Some things it's might has
permissions
for. Now we can go to the code analysis
tab. You'll see some general
stuff. the behavioral analyzis which
usually very interesting. So it can read
text messages, send text messages,
receive text messages, read contacts.
Now I don't know what this app is
supposed to do, but it seems to be able
to read text messages. You'll see some
random permissions like internet, Wi-Fi,
but it seems to be particularly
interested in text messaging for some
reason. You'll see some other things it
can do. this application and also for
example if we click
on sending SMS you'll see two classes
can actually send text messages I don't
know if this application is supposed to
do that but it can do that also it
connects to the
internet we can go to the network
analyzis and you'll see this app is
connecting to
and the United States. So, might be a
bit weird, you know, why would the app
connect to
Azerban or an Iranian
app. We can see if we scroll down, it's
connecting to some.tk domain. Now, TK
are free internet domains
that exist and you'll see they connect
to
red.php. Now, a red is a remote access
tool. If you search for red or remote
access
tool, okay, there's some in my language,
but we can also find uh on English, for
example, on Wikipedia. So, I'll head
over to the English
Wikipedia. Okay, I sorry, I thought
there was an English Wikipedia, but
there's English results explaining
what what a remote access tool
is. What is a for example a mega fee
block will explain you that it gives the
software that gives the person full
control over the device remotely. So
this is a very obvious case of where is
the report of malware because it has a
red.php. Now red obviously remote access
uh tool. So it gives the attacker
complete access over the phone. You also
notice that they use atk domain. So that
is the free domain that anyone can
register without giving their
credentials. So I believe that is
DK and on the TK
website anyone can get a free
address. So you'll see free for all and
also meaning free of money. So any
malicious actor can create or apparently
do create websites using that
domain and then of course they use a red
and it has / zeus. So we can also search
for zeus maybe that is the
red square. So if I search for zeus
red and you'll see yes remote access
tool botnet. So that is the type
of malware that they use the
Zeusnet which gives them complete
control over the software. Now, okay,
some images of rats,
but you can find out
more about it online if you search for
the Zeus botnet. So, perhaps this
website and it will tell
you this is malware that steals banking
information. Okay, this is not very good
to install that app then. So we can
analyze any app using this pitus website
on euro an network analyzis can be very
useful. You might discover what kind of
request is doing. So in this case it's
very obvious zeus/ red and when you
search that we find out that this is
actually remote access
tool. Now also you can of course do
behavioral analyzes. You can look at the
malicious score. So there's different
ways to get information that the or
different indicators that the
application is malicious.
So in this case the thread intel we saw
virus total score of 14. So in the
little red box
here fingerprints didn't really give us
too
much. And the analyzis told at least
it's not frosted. So that's not a good
thing. It can be means it has been
messed
with. In the behavioral analyzis, we
found out it's sending text
messages and also that it's doing
something with the web that might not
need to do that and with text messaging
and in a network analyzis of course we
found really clearly that it's
connecting with Azerbajan and also that
it's using the connecting to this
website which has red.php which is
remote access tool. So we can find out
in URL analyzis also that it's
malicious. But even if we use the
previous tops with the virus score then
we would know that this application is
malicious. So you can do this kind of
analyzis with any application you have
on your phone or your
tablet or you can download this
application from stores. So for example
WhatsApp you can go WhatsApp
APK and find it. for example, WhatsApp
APK, you can download it and then go to
the pithus.org website and upload it to
analyze it. Now, obviously, if you use a
third party store, you can easily
download your
APKs. So, if you find any APK on the
internet on a third party
marketplace,
can check them here and analyze if they
are malicious. Now, if you want to
change the apps on your actual device,
you can use a tool called ADB, Android
debugger, which is a tool that
programmers often use, then run the
command ADB pool with a link to your
APK. So, that will download the APK from
your actual device. So, from either your
Android phone or your Android
tablet and obviously you need be
installed. So for that you would need to
install ADB and also you would need to
allow uh USB debugging uh by going to
settings the application phone button go
to build number seven times stop and
enable USB debugging
um and download the ADB tools. So either
for Windows
um for Mac OS or for um for Linux. So
I'll attach this URL that you can uh
work with with ADB if you want to
download your actual APKs from your
device and analyze those. Um if you use
third party marketplaces, you can also
uh check APKs there or if someone sends
you an APK by text messages, you can
check out what is that actually doing.
You can analyze it now using that tool.