WEBVTT
Kind: captions
Language: en

00:00:00.280 --> 00:00:05.839 align:start position:19%
hi everyone thanks for watching Lori
wired and in this video we're going to

00:00:03.399 --> 00:00:14.799 align:start position:19%
be deconstructing the info. pist within
iOS

00:00:08.300 --> 00:00:20.000 align:start position:19%
[Music]
applications now pist stands for

00:00:17.480 --> 00:00:24.080 align:start position:19%
property list and the info. pist is a
special kind of property list that

00:00:22.080 --> 00:00:28.720 align:start position:19%
contains the main metadata and
configuration data inside of iOS

00:00:26.199 --> 00:00:33.160 align:start position:19%
applications so this is really important
if you're trying to reverse enger or do

00:00:31.000 --> 00:00:37.360 align:start position:19%
some security analysis on an iOS
application and it's probably kind of

00:00:35.280 --> 00:00:40.920 align:start position:19%
the main starting point that you'll do
if you're trying to dig into an

00:00:38.960 --> 00:00:43.600 align:start position:19%
application so let's get right into it
and let's see what they look like now

00:00:42.399 --> 00:00:48.199 align:start position:19%
we're going to take a look at a couple
examples so let's get into our first one

00:00:46.360 --> 00:00:52.800 align:start position:19%
I'm going to be looking at the Fila file
manager which is an application that is

00:00:50.280 --> 00:00:57.399 align:start position:19%
commonly installed on jailbroken devices
and I have my IPA file right here

00:00:55.680 --> 00:01:02.000 align:start position:19%
remember this is the main application
type for iOS applications and I've

00:00:59.960 --> 00:01:06.640 align:start position:19%
already extracted the contents and I
have another video on how to extract all

00:01:04.439 --> 00:01:10.680 align:start position:19%
the contents and go through and find the
entry point of iOS applications if

00:01:08.640 --> 00:01:14.560 align:start position:19%
you're not sure but I already have my
folder here so let's get into it and

00:01:12.439 --> 00:01:19.960 align:start position:19%
let's find our info. P
list so let's go into our application

00:01:17.560 --> 00:01:25.720 align:start position:19%
bundle and remember there are a lot of
different pists inside of here but we

00:01:22.560 --> 00:01:28.200 align:start position:19%
are looking for info. pist specifically
and you'll just kind of have to remember

00:01:27.000 --> 00:01:33.880 align:start position:19%
this name because it's always going to
be named this inside of the applic

00:01:30.799 --> 00:01:38.720 align:start position:19%
bundle so I have my info. P list right
here and let's open it up and let's just

00:01:36.560 --> 00:01:44.200 align:start position:19%
take a look at what are the contents of
this I'm going to open this in notepad++

00:01:41.640 --> 00:01:49.560 align:start position:19%
and you'll notice that this looks like
kind of a ton of junk bites but that's

00:01:47.040 --> 00:01:54.600 align:start position:19%
because property lists come in two
formats so the first is going to be an

00:01:51.920 --> 00:01:59.200 align:start position:19%
XML property list which if you open that
up in notepad++ you're going to see a

00:01:56.600 --> 00:02:03.159 align:start position:19%
nice pretty XML file but if you open up
a binary property list in just regular

00:02:01.439 --> 00:02:07.239 align:start position:19%
notepad or anything it's going to look
like a lot of junk and you see some

00:02:04.799 --> 00:02:11.400 align:start position:19%
keywords in here but it's not super
helpful now you can recognize a binary

00:02:09.599 --> 00:02:16.360 align:start position:19%
property list obviously because of the
junk bites inside of here but also

00:02:13.640 --> 00:02:19.840 align:start position:19%
because of the BP list header at the top
which just stands for binary property

00:02:18.120 --> 00:02:23.640 align:start position:19%
list now if you're running on Mac and
you open up a binary property list it

00:02:21.560 --> 00:02:27.360 align:start position:19%
automatically decodes it for you but if
you're running on like Linux or Windows

00:02:25.440 --> 00:02:31.200 align:start position:19%
or any other operating system you just
have to perform a little bit of manual

00:02:28.920 --> 00:02:35.280 align:start position:19%
decoding which is easy to do and there's
a lot of libraries for it in python or

00:02:33.360 --> 00:02:39.800 align:start position:19%
Java or probably the language of your
choice so let's write a quick python

00:02:37.440 --> 00:02:46.440 align:start position:19%
script and let's do some manual decoding
of this binary property

00:02:41.680 --> 00:02:50.840 align:start position:19%
list I'm going to use the pist lib which
is just a library inside of python and

00:02:49.080 --> 00:02:54.440 align:start position:19%
let's open up a terminal and let's open
up some python so let's start writing

00:02:52.599 --> 00:02:58.480 align:start position:19%
our quick python script so I'm going to
open up my python

00:02:56.440 --> 00:03:05.360 align:start position:19%
terminal and first of all I'm going to
import the pist Library into my program

00:03:01.680 --> 00:03:09.879 align:start position:19%
I'm going import pist lib and I'm also
going to do some magic with Json to

00:03:07.360 --> 00:03:13.480 align:start position:19%
decode and printify the Json object that
we get so I'm going to import that

00:03:11.599 --> 00:03:19.159 align:start position:19%
Library as
well and I'm currently in the directory

00:03:16.879 --> 00:03:25.120 align:start position:19%
of my application bundle so all I need
to do is just open this file and then

00:03:20.879 --> 00:03:31.760 align:start position:19%
decode the pist so I'm going to do with
open my info.

00:03:28.319 --> 00:03:36.640 align:start position:19%
pist and then we're going to read the
bytes and I'm do as file

00:03:36.799 --> 00:03:45.720 align:start position:19%
pointer and I'm going to store that pist
into a variable so that we can decode it

00:03:42.080 --> 00:03:52.200 align:start position:19%
later so I'm going to do pist
data equals pist lib Dot and then it's

00:03:50.360 --> 00:03:56.799 align:start position:19%
going to take the file pointer as an
argument to the

00:03:53.799 --> 00:04:01.920 align:start position:19%
function so let's do load and then I
have my file pointer right here and now

00:04:00.000 --> 00:04:07.400 align:start position:19%
all of that data is just stored inside
of pist data so if I want to do this I

00:04:04.519 --> 00:04:12.120 align:start position:19%
can print pist data simply to the
console and we have the plain text for

00:04:10.360 --> 00:04:16.840 align:start position:19%
it now but it's in a really terrible
format and there is no spacing inside of

00:04:14.760 --> 00:04:21.479 align:start position:19%
this so you could take this and put this
inside like notepad++ or something and

00:04:18.919 --> 00:04:26.520 align:start position:19%
then use the JS tool for example to pry
this or you can optionally do this in

00:04:23.639 --> 00:04:32.560 align:start position:19%
Python directly as well and I am going
to do that so I'm going to print once

00:04:29.960 --> 00:04:38.840 align:start position:19%
again and then I'm going to do
json. dump string and then it's going to

00:04:36.320 --> 00:04:45.199 align:start position:19%
take my pist
data and I'm going to do indent equals 4

00:04:42.600 --> 00:04:49.520 align:start position:19%
we'll just do that and let's see if that
gives us a nice pretty output to work

00:04:47.520 --> 00:04:56.280 align:start position:19%
with looks like I've got a syntax error
I I typed index instead of indent that's

00:04:53.479 --> 00:05:00.759 align:start position:19%
okay we will fix
that

00:04:58.039 --> 00:05:04.479 align:start position:19%
indent and there we go now we have a
nice looking property list that we can

00:05:02.520 --> 00:05:08.960 align:start position:19%
actually read so I'm going to go to the
top here and then let's just throw this

00:05:05.880 --> 00:05:14.320 align:start position:19%
into something like notepad++ I'm going
to grab all of my pist

00:05:11.560 --> 00:05:18.919 align:start position:19%
data pretty
long and we'll put that in notepad++

00:05:16.880 --> 00:05:23.520 align:start position:19%
instead of the binary format so this is
going to be a lot nicer to read and if

00:05:21.840 --> 00:05:29.280 align:start position:19%
we want to we can even set the language
to be Json since that's what it

00:05:26.880 --> 00:05:33.880 align:start position:19%
is so now remember we have two kinds of
P lists the XML and then the Json type

00:05:32.120 --> 00:05:38.800 align:start position:19%
which we actually decoded which is the
binary property list but we can put it

00:05:35.600 --> 00:05:43.039 align:start position:19%
in a Json format so now once we actually
have the property list open you're going

00:05:40.840 --> 00:05:47.160 align:start position:19%
to see all of these different key value
pairs inside of this remember these are

00:05:45.280 --> 00:05:52.720 align:start position:19%
all the configurations for this
particular application now what I mean

00:05:49.440 --> 00:05:57.479 align:start position:19%
by key value we have key and then value
and then key and then value and then so

00:05:54.759 --> 00:06:00.840 align:start position:19%
on inside of this entire file right here
now once we actually have our property

00:05:59.160 --> 00:06:05.520 align:start position:19%
list open we can take a look at the
values that are of interest to us one

00:06:03.240 --> 00:06:09.360 align:start position:19%
such value might be the CF bundle
display name this is going to be the

00:06:07.199 --> 00:06:14.599 align:start position:19%
name that's displayed on the home screen
for this application which is just going

00:06:11.039 --> 00:06:19.199 align:start position:19%
to be filza in this case another one of
absolute interest to us is going to be

00:06:16.160 --> 00:06:23.800 align:start position:19%
the CF bundle executable and this is
naming a Macco that is inside of this

00:06:22.000 --> 00:06:28.080 align:start position:19%
application bundle that's going to be
the entry point to the application as

00:06:25.800 --> 00:06:32.919 align:start position:19%
well as contain all of the associated
executable code for this application

00:06:30.639 --> 00:06:39.120 align:start position:19%
bundle now you might notice that a lot
of the keywords in here are prefixed

00:06:35.720 --> 00:06:44.000 align:start position:19%
with CF or NS now these just mean that
they're uh apis methods classes or

00:06:41.919 --> 00:06:49.479 align:start position:19%
constants that are part of the main
framework for the IOS operating system

00:06:46.880 --> 00:06:53.479 align:start position:19%
so CF stands for core foundation and NS
stands for Next Step let's move on

00:06:51.759 --> 00:06:57.800 align:start position:19%
inside this property list and let's find
some points of interest that might be

00:06:55.120 --> 00:07:00.879 align:start position:19%
helpful for some Dynamic analysis so if
you're trying to Analyze This

00:06:59.400 --> 00:07:07.280 align:start position:19%
application by running it and seeing
what happens so I'm going to find the

00:07:03.400 --> 00:07:13.520 align:start position:19%
app transport let's search
that Transport Security now this is a

00:07:11.479 --> 00:07:17.639 align:start position:19%
really important security configuration
for Network traffic and this does a lot

00:07:15.919 --> 00:07:21.960 align:start position:19%
of different stuff but mainly it
disables the ability to use Clear text

00:07:19.919 --> 00:07:26.919 align:start position:19%
traffic so if you're trying to analyze
this application there might be a lot of

00:07:24.120 --> 00:07:31.199 align:start position:19%
clear text plane HTTP traffic that you
can simply connect burp Suite to or

00:07:29.039 --> 00:07:34.680 align:start position:19%
something else and be able to listen to
any of the traffic on this application

00:07:33.560 --> 00:07:37.680 align:start position:19%
without having to worry about
certificates at all so that's really

00:07:36.360 --> 00:07:41.720 align:start position:19%
important if you're trying to do some
Dynamic analysis and see what kind of

00:07:39.879 --> 00:07:47.000 align:start position:19%
network traffic this application
performs moving on to some hardware and

00:07:45.039 --> 00:07:51.479 align:start position:19%
device requirements for being able to
run this application we can see we have

00:07:49.319 --> 00:07:55.720 align:start position:19%
the minimum operating system version is
going to be

00:07:53.039 --> 00:08:00.199 align:start position:19%
7.0 and we should have some Hardware
requirements and operating system

00:07:57.879 --> 00:08:04.960 align:start position:19%
requirements this is only going to run
on iPhone OS so it's not going to run on

00:08:02.240 --> 00:08:09.199 align:start position:19%
Mac OS for example and then if we keep
going through let's see if we have any

00:08:07.039 --> 00:08:14.720 align:start position:19%
other data that might be relevant for
some Dynamic

00:08:11.280 --> 00:08:18.919 align:start position:19%
analysis Let's see we have required
device capabilities there can be a lot

00:08:16.680 --> 00:08:24.039 align:start position:19%
of different values inside of here but
this one in particular is requiring it

00:08:21.400 --> 00:08:28.000 align:start position:19%
to run on rb7 other requirements might
be making sure it has a camera or

00:08:26.159 --> 00:08:32.200 align:start position:19%
something else like that it's making
sure that the device is physically

00:08:29.919 --> 00:08:35.240 align:start position:19%
capable of running this application so
those are some of the important tags

00:08:33.719 --> 00:08:39.080 align:start position:19%
that you might want to take note of for
dynamic analysis let's move on to some

00:08:37.680 --> 00:08:43.399 align:start position:19%
different ones that are related to
static

00:08:40.519 --> 00:08:45.800 align:start position:19%
analysis now let's see let's go up and
I'm going to pick out something that

00:08:44.480 --> 00:08:51.320 align:start position:19%
looks
important okay this is a very important

00:08:48.480 --> 00:08:57.200 align:start position:19%
kind of tag now if you notice we have
this and then this usage description now

00:08:55.120 --> 00:09:01.800 align:start position:19%
this is saying different capabilities
that the application is going to request

00:08:59.720 --> 00:09:06.160 align:start position:19%
and then the corresponding value is
going to be the text or the string that

00:09:04.040 --> 00:09:11.320 align:start position:19%
gets printed to the user when this
application is trying to request those

00:09:08.200 --> 00:09:16.000 align:start position:19%
permissions so this is trying to request
access to the photo library and then

00:09:13.800 --> 00:09:19.920 align:start position:19%
it's going to display to save photos and
videos to photo library which is the

00:09:18.000 --> 00:09:24.519 align:start position:19%
justification for why this application
is saying it wants access to your photo

00:09:22.360 --> 00:09:28.440 align:start position:19%
library and then it's up to the user do
they want to accept or do they want to

00:09:26.160 --> 00:09:32.200 align:start position:19%
decline this request this is going to be
really important for for malare analysis

00:09:30.360 --> 00:09:37.680 align:start position:19%
in particular if you're trying to find
the potential capabilities of this

00:09:35.120 --> 00:09:44.200 align:start position:19%
application now let's move on to another
part of this application let's see let's

00:09:40.920 --> 00:09:49.680 align:start position:19%
look at CF bundle URL types now this is
naming different custom URL schemes that

00:09:47.120 --> 00:09:53.560 align:start position:19%
are able to trigger this application now
this is important since it enables

00:09:51.600 --> 00:09:59.640 align:start position:19%
communication between different
applications on the iOS device and it's

00:09:56.720 --> 00:10:04.200 align:start position:19%
registering what URL can be used used to
trigger this particular application that

00:10:01.880 --> 00:10:11.200 align:start position:19%
means that with this CF bundle URL
scheme set to filza if another

00:10:07.959 --> 00:10:15.600 align:start position:19%
application did something like
filza and then linked to some different

00:10:13.519 --> 00:10:20.160 align:start position:19%
part inside of this application the
operating system would actually trigger

00:10:17.320 --> 00:10:25.320 align:start position:19%
this application to run and deep link it
to whatever part that this URL is

00:10:22.800 --> 00:10:30.600 align:start position:19%
actually trying to point to so let me
get rid of this now one interesting

00:10:28.519 --> 00:10:34.920 align:start position:19%
thing to not is that there is actually a
vulnerability with custom URL schemes

00:10:33.360 --> 00:10:39.320 align:start position:19%
and this is part of the reason that they
switch to using Universal links instead

00:10:37.440 --> 00:10:44.440 align:start position:19%
the vulnerability is that any
application could register any custom

00:10:41.519 --> 00:10:48.560 align:start position:19%
URL scheme so if that application let's
say it's a malicious application is

00:10:46.560 --> 00:10:53.760 align:start position:19%
installed on the device and it's trying
to register filza as a custom URL scheme

00:10:51.920 --> 00:10:57.959 align:start position:19%
and then another application is trying
to trigger fils a file manager they're

00:10:56.360 --> 00:11:02.040 align:start position:19%
actually going to trigger the malicious
application that is protect tending to

00:10:59.560 --> 00:11:06.600 align:start position:19%
be filza based off of that custom URL
scheme so now if you use Universal links

00:11:04.959 --> 00:11:10.040 align:start position:19%
it does a lot more verification on the
server side to make sure that it's

00:11:08.480 --> 00:11:13.440 align:start position:19%
actually triggering the right
application now let's take a look at

00:11:11.760 --> 00:11:17.160 align:start position:19%
another example just to make sure that
you've got your head around the info. P

00:11:15.320 --> 00:11:21.399 align:start position:19%
list and all of the points of interest
inside of it so I'm going to open up a

00:11:19.839 --> 00:11:25.920 align:start position:19%
malware
example and we'll go inside of our

00:11:23.800 --> 00:11:31.519 align:start position:19%
payload inside of our application bundle
this is going to be named photograph

00:11:27.959 --> 00:11:35.279 align:start position:19%
demo and here is our info. pist special
file so I'm going to open this up and

00:11:33.480 --> 00:11:40.440 align:start position:19%
let's see if it's a binary pist or an
XML pist and it looks like it is indeed

00:11:38.360 --> 00:11:44.399 align:start position:19%
an XML property list so we can go ahead
and just read all of the code inside of

00:11:42.200 --> 00:11:49.519 align:start position:19%
here plain text and then again we have
our key value pairs just like we did in

00:11:47.160 --> 00:11:54.560 align:start position:19%
our binary property list but in XML
format instead of Json again we have our

00:11:52.399 --> 00:12:00.959 align:start position:19%
CF bundle name which is going to be set
to photograph demo and then we should

00:11:57.240 --> 00:12:00.959 align:start position:19%
have our CF bundle EX

00:12:01.920 --> 00:12:08.680 align:start position:19%
executable inside of here yes we do
which is also set to photograph demo so

00:12:06.800 --> 00:12:12.680 align:start position:19%
that means there's going to be a Maco
named photograph demo which is going to

00:12:10.959 --> 00:12:17.680 align:start position:19%
be the enter point and contain all of
the executable code and again we have

00:12:15.519 --> 00:12:22.399 align:start position:19%
our required device capabilities which
we are again requiring rv7 for this

00:12:20.240 --> 00:12:28.120 align:start position:19%
application to be able to run and a
minimum operating system version of

00:12:25.199 --> 00:12:33.000 align:start position:19%
10.0 and one other interesting thing to
note for static analysis would be the CF

00:12:30.800 --> 00:12:38.760 align:start position:19%
bundle identifier now this is going to
be a unique identifier for every single

00:12:36.399 --> 00:12:42.959 align:start position:19%
application this is the one for this
particular application and then the fils

00:12:40.639 --> 00:12:47.480 align:start position:19%
a file manager will have its own unique
identifier as well from the CF bundle

00:12:45.440 --> 00:12:51.600 align:start position:19%
identifier tag let's just go through our
info. P list and let's see if there's

00:12:49.240 --> 00:12:55.199 align:start position:19%
anything interesting inside of here it's
actually pretty short so there's not too

00:12:53.040 --> 00:12:59.440 align:start position:19%
much to look at I think the only main
thing of interest is this NS contacts

00:12:58.000 --> 00:13:03.920 align:start position:19%
usage description
now remember anything that ends in usage

00:13:01.519 --> 00:13:08.360 align:start position:19%
description is the application trying to
request a permission to be able to

00:13:05.839 --> 00:13:13.160 align:start position:19%
access any sensitive user data such as
photos or contacts or anything like that

00:13:11.279 --> 00:13:18.120 align:start position:19%
this one in particular is trying to
access the user's contacts and it's

00:13:15.480 --> 00:13:22.600 align:start position:19%
giving this justification string as to
why it wants to access those

00:13:20.320 --> 00:13:26.560 align:start position:19%
contacts so this is the corresponding
string that they're using as the

00:13:24.360 --> 00:13:31.279 align:start position:19%
justification for why they need access
to the context so this looks like it's

00:13:28.880 --> 00:13:37.760 align:start position:19%
in Korean I do not speak Korean so I
will use Google

00:13:33.920 --> 00:13:43.120 align:start position:19%
translate let's just do Korean
English and enter in and see what our

00:13:40.000 --> 00:13:48.040 align:start position:19%
justification is so it's saying contacts
permission is

00:13:45.079 --> 00:13:52.800 align:start position:19%
required seems legit I would definitely
give permission if they just said it's

00:13:50.240 --> 00:13:56.759 align:start position:19%
required okay now there's a lot of other
metadata inside of the info. pist and

00:13:54.959 --> 00:14:00.519 align:start position:19%
you can find any values that are of
interest to you but this covers a lot

00:13:58.800 --> 00:14:04.279 align:start position:19%
lot of the points of interest for
reverse engineering as well as

00:14:02.320 --> 00:14:07.519 align:start position:19%
performing security analysis on an
application so thanks so much for

00:14:05.800 --> 00:14:12.600 align:start position:19%
watching Lori wired everyone in this
video we covered the info. pist inside

00:14:09.959 --> 00:14:17.600 align:start position:19%
of iOS applications we saw how there
could be both XML or binary property

00:14:15.320 --> 00:14:21.880 align:start position:19%
lists and we had to perform an extra
step for decoding binary property lists

00:14:20.440 --> 00:14:27.759 align:start position:19%
we also looked at a lot of the different
key value pairs inside of the info. pist

00:14:25.279 --> 00:14:31.720 align:start position:19%
and found the main executable as well as
different network security settings

00:14:29.920 --> 00:14:35.000 align:start position:19%
custom URL schemes and a lot of
different other metadata that's of

00:14:33.360 --> 00:14:39.040 align:start position:19%
Interest so thanks so much for watching
Lori wired everyone and I'll catch you

00:14:36.480 --> 00:14:39.040 align:start position:19%
in the next

00:14:49.960 --> 00:14:54.559 align:start position:19%
[Music]

00:14:54.720 --> 00:14:57.720 align:start position:19%
video

