‫Instructor: Hi, within this section,
‫we're going to focus on iOS reverse engineering process.
‫So as I have told you in the beginning of this course,
‫you will need a MacBook or MacOS for this section,
‫and also on top of that, you will need
‫a jailbroken iOS device as well.
‫However, this is for only practice.
‫So if you don't have any MacBook or any MacOS
‫operating device or if you don't have
‫any jailbroken iOS device,
‫then just don't skip this section, okay?
‫I really suggest you just watch it and take notes
‫because not only we are going to
‫learn about iOS reverse engineering in this section,
‫but also we're going to see some very important concepts
‫for all reverse engineering and for all
‫ethical hacking subjects as well, such as assembly,
‫such as hexadecimal, such as binary,
‫and some other terms as well.
‫So if you are looking to be an ethical hacker
‫or cyber security analyst, and if you're looking to
‫focus on mobile applications or mobile devices,
‫this section is a must for you.
‫So if you have a jailbroken device
‫and if you have a Mac, then it's very good
‫so you get to practice what we are gonna do
‫within the section, but if you don't, don't worry,
‫just watch it.
‫Okay, just watch the section and take notes.
‫Here you can see I have two folders on my desktop.
‫So these are apps that I have written
‫for this specific section.
‫And these apps actually detect if your device is jailbroken.
‫So if your device is jailbroken,
‫you must encounter some apps that are trying to understand
‫if you're on Jailbroken device or not.
‫And if you are, if they detect it,
‫they may prevent you from using their app.
‫So there are security reasons for that.
‫Okay, if you have administrator privileges
‫in your iOS device, then you can see all the details
‫of that app, like you can go to the data folder,
‫you can try to understand what's going on inside of the app,
‫and most of the app producers do not want that.
‫So as you can see, we have two options, one for Objective C
‫and one for Swift.
‫And I'm going to share the link with you as well.
‫So we're going to download this folders from here
‫like this Objective C version, and Swift version as well.
‫And we're going to actually try and bypass this detection
‫throughout this section.
‫So make sure you download those folders
‫and just double click on it and just double click
‫on the project file to open it.
‫And actually, there are some IPA files that I have created
‫inside of these folders as well.
‫So you don't have to open these files
‫and run it on your simulator, right?
‫Because we are not interested in the source code
‫at this point.
‫As we were doing in the Android reverse engineering section,
‫we are only interested in the final product.
‫So final product in here is the IPA folder
‫which you can see over here.
‫So this is detect jail IPA folder
‫and again, detect jail Swift IPA folder.
‫So you can find the latest version,
‫like latest product of this project
‫over here and over there once you download those.
‫And in fact, you don't even need to see the source code.
‫Okay, you don't even need to know the source code
‫because in real life, you won't know the source code,
‫you will only get the IPA
‫for security testing or for kind of penetration testing.
‫And then you're going to have to work with it.
‫So that's exactly what we are going to do
‫within this section.
‫We're going to install those IPAs in our jailbroken device
‫and we're going to test to see if
‫they detect our jail breaking
‫and they will detect most of the time.
‫And then we're going to try and bypass this jail breaking
‫detection to understand reverse engineering,
‫to understand app manipulation in iOS as well.
‫So make sure you download both of these applications,
‫both of these followers on your computer.
‫And the first thing that you should do is to install IPAs
‫on your jailbroken device.
‫So you have seen how to do that
‫in rooting and jail breaking section,
‫but if you have missed it for some reason,
‫then I'm just going to show you how it's done.
‫I'm going to connect my iPad, which is a jail broken iPad,
‫and then I'm going to use Cydia Impactor to install this IPA
‫on my iPad.
‫So this is my iPad over here, okay.
‫And as you can see, this is a very old version, like 9.3,
‫and I suggest you do the same,
‫if you want to jailbreak some device,
‫make sure it's kind of an old device
‫so that when it's a warranty expires,
‫it won't be a problem for you.
‫Don't do jail breaking with your daily devices.
‫So if you have missed the section for jail breaking
‫and if you want to do it right now,
‫just go back and watch it
‫because it's very easy, actually, you can't do it in
‫like a 30 minutes or something, by downloading some IPAs.
‫And now, we're going to install those IPAs on our iPad.
‫And in order to do that, I'm going to use Impactor.
‫So Impactor is Cydia impactor, actually, this is an app
‫that we can use to upload IPAs
‫to the devices that are connected to our MacBook
‫via USB or via USB-C.
‫So if you haven't downloaded it yet,
‫just go to cydiaimpactor.com, like this, okay.
‫You can easily download Cydia Impactor from this website
‫and install it.
‫This is a very small tool, but it's a very useful tool.
‫You use that to upload IPAs to your devices
‫even if they are not jailbroken, okay?
‫You can upload any IPA to any iOS device using this tool.
‫So this is a very good tool.
‫Make sure you download it anyhow
‫and you will use it eventually
‫if you're looking into learning this stuff, okay?
‫So I'm going to download it and show it to you
‫because it's already 20 megabytes, so it won't even
‫take our time.
‫So double click on it once it's done
‫and make sure you just drag the Impactor
‫to your applications folder and that's it.
‫So that's how you install it, okay?
‫And once you connect your device
‫like I have connected my iPad,
‫it will show up on the Impactor over here, okay?
‫Like this, and then you can drag and drop any IPA
‫to the Cydia Impactor to upload that IPA onto your device.
‫So when you do that, it will ask for some kind of password,
‫and this is your Apple ID password,
‫but you shouldn't give your own Apple ID password,
‫I'm gonna show you how.
‫So let me just bring in my IPA.
‫I'm gonna start with Objective C by the way,
‫just make sure you follow along.
‫I'm going to take this detect jail IPA
‫and copy it on my desktop,
‫and then drag and drop it on the Cydia Impactor app.
‫It will ask me for my iTunes email login.
‫So this is where people get suspicious as I've said before,
‫but if you have missed it,
‫you can actually give your own Apple ID over here
‫and then we will generate a one-time password to use
‫for this purpose only, so it will be perfectly safe.
‫And Cydia Impactor does not store any password,
‫they just send them only to the Apple.
‫But in order to be sure, and in order to be perfectly safe,
‫we will follow the Apple guidelines over here.
‫So Apple suggests if we are using a third party application
‫like that and if we have to give our password
‫in cases like this, then we have to go to appleid.apple.com.
‫This is where we can log in with our own Apple ID, okay,
‫with giving our own password.
‫And then, it will create some page for us,
‫you will see in a minute.
‫So let me give my two factor authentication number, okay.
‫It will show us a page
‫in which we can generate some app specific passwords.
‫So you can see that over here,
‫and once we click on that, it will just create a password
‫that I can use with third party apps.
‫And even if somebody gets hold on this,
‫we can delete it, okay, after we use it,
‫and they cannot log into your iCloud account
‫by using this password, and this is just for our use
‫and for third party apps only.
‫So let me just copy this and I'm going to pass this
‫in my iPad, in my Cydia Impactor, okay?
‫So let me just minimize this
‫and come over here and paste it.
‫I'm going to give my email first and then hit enter,
‫and paste the password and then say okay.
‫Once I do that, it will upload the IPA file to my desktop,
‫not my desktop, my iPad,
‫and it asks me to choose a profile,
‫for a reason, I have two,
‫most probably because I have a developer account as well.
‫And here you go.
‫Now we see the detect jail application on my iPad like this.
‫So this is how you actually install this detect jail
‫to your jailbroken device.
‫And if you come over here, as you can see there is a page
‫and it says that, test to go to second screen.
‫So think this application
‫as some kind of CTF like capture the flag.
‫And all we want to do in this capture the flag
‫is to go to the second screen.
‫But since we are in jailbroken device,
‫once we hit test, it will say Jailbreak, Hacker,
‫and it won't take us to the second screen.
‫So it's a very basic challenge, right?
‫All we want to do is to go to second screen,
‫and of course, you can find some other ways
‫to do that as well.
‫But what we are going to do throughout the section
‫is to understand how we can
‫actually manipulate this function, manipulate this method
‫so that this app will think
‫that our jailbroken device is not actually jailbroken.
‫So we're going to do that and we are going to
‫learn the basics of app manipulation
‫and the reverse engineering of iOS as well.
‫So make sure you download this detection app and make sure
‫you upload it to your device,
‫and make sure if you don't have any device or MacOS,
‫just stick to it and watch everything in this section.