WEBVTT - This file was automatically generated by VIMEO

1
00:00:10.700 --> 00:00:13.800
 Hello, welcome back to section. 3 2

2
00:00:13.800 --> 00:00:16.400
 Section 3 is a Hands-On module in

3
00:00:16.400 --> 00:00:19.900
 which we'll be taking a look at the different. Use case scenarios and

4
00:00:19.900 --> 00:00:22.400
 different payloads articles used in order

5
00:00:22.400 --> 00:00:25.200
 to perform session, hijacking. So let's get

6
00:00:25.200 --> 00:00:28.200
 started with the first attack. This is known

7
00:00:28.200 --> 00:00:30.400
 as cookie hijacking via cross-site scripting.

8
00:00:31.600 --> 00:00:34.500
 So typically, in order to perform this attack, you

9
00:00:34.500 --> 00:00:37.400
 would need a vulnerable web site, which is

10
00:00:37.800 --> 00:00:39.700
 impacted by reflected, plus XK.

11
00:00:41.100 --> 00:00:44.300
 Even though we will not deep dive into, what is reflected across a scripting in

12
00:00:44.300 --> 00:00:47.300
 just take an overview. So, typically in

13
00:00:47.300 --> 00:00:50.100
 this sort of attack, what really happens is that the

14
00:00:50.100 --> 00:00:53.600
 value that is being submitted to the web website. It's

15
00:00:53.600 --> 00:00:56.100
 actually passed as it is without sanitizing, the

16
00:00:56.100 --> 00:00:59.200
 input against any malicious content, and it will

17
00:00:59.200 --> 00:01:02.700
 be added as part of the HTML, document itself.

18
00:01:04.100 --> 00:01:07.800
 Unless and until it is malicious. They may not be in a Major Impact.

19
00:01:07.100 --> 00:01:10.800
 But in case of the scenarios where

20
00:01:10.800 --> 00:01:13.400
 the input is, somebody's JavaScript, it will be appended

21
00:01:13.400 --> 00:01:17.000
 to the HTML document itself and we to be executed. Now,

22
00:01:16.300 --> 00:01:19.400
 let's take a look at the hands on.

23
00:01:23.400 --> 00:01:24.100
 so, this is

24
00:01:25.300 --> 00:01:28.100
 a dummy website that I've created for demo purpose, only.

25
00:01:29.400 --> 00:01:32.400
 So in this particular scenario, we have a variable in

26
00:01:32.400 --> 00:01:35.500
 the get parameter error, that is actually

27
00:01:35.500 --> 00:01:38.500
 one Rebel to the critical size scripting. So

28
00:01:38.500 --> 00:01:40.000
 let's take a look. How does this work?

29
00:01:42.100 --> 00:01:46.100
 So, whatever values I would be able to pass on this parameter. It

30
00:01:45.100 --> 00:01:47.400
 will be actually reflected.

31
00:01:52.300 --> 00:01:55.300
 So as you see whatever, I have type it is fast

32
00:01:55.300 --> 00:01:58.400
 as it is. Now, let's think of something much

33
00:01:58.400 --> 00:01:59.200
 more malicious.

34
00:02:12.200 --> 00:02:15.400
 So long as we can see that actually we

35
00:02:15.600 --> 00:02:18.600
 see up from an alert that is generated

36
00:02:18.100 --> 00:02:21.300
 because of the script that we have provided with

37
00:02:21.300 --> 00:02:21.500
 you.

38
00:02:24.200 --> 00:02:26.100
 So, let's take a look at the source code also.

39
00:02:30.300 --> 00:02:33.300
 So, as we see the malicious script as been appended to

40
00:02:33.300 --> 00:02:34.500
 the content of the body.

41
00:02:36.800 --> 00:02:40.100
 Due to this while rendering HTML document,

42
00:02:39.200 --> 00:02:42.200
 you'll actually parse step-by-step. And

43
00:02:42.200 --> 00:02:45.400
 when it reaches the Melissa JavaScript, it will also gets

44
00:02:45.400 --> 00:02:46.100
 executed.

45
00:02:49.600 --> 00:02:52.400
 So, let's quickly jump out the developer tool.

46
00:02:52.400 --> 00:02:52.900
 Also.

47
00:02:56.800 --> 00:02:59.200
 So as we can see, we have a

48
00:02:59.200 --> 00:03:02.700
 PHP session already been generated once we visited the website.

49
00:03:02.400 --> 00:03:05.900
 So now let's perform

50
00:03:05.900 --> 00:03:08.400
 some more payloads, which can

51
00:03:08.400 --> 00:03:11.300
 actually take out the cookie value.

52
00:03:12.500 --> 00:03:15.800
 So, instead of alert director one. I'm

53
00:03:15.800 --> 00:03:18.800
 just trying to use the JavaScript command document

54
00:03:18.800 --> 00:03:19.400
 dot cookie.

55
00:03:23.100 --> 00:03:26.200
 So what is cool too? Is that it's going to parse the document that

56
00:03:26.200 --> 00:03:29.100
 is a website and the cookie dough is being generated.

57
00:03:31.100 --> 00:03:34.200
 So, as we can see, the particular PHP value has been

58
00:03:34.200 --> 00:03:37.600
 alerted. So as

59
00:03:37.600 --> 00:03:40.300
 you can see the impact because of an another,

60
00:03:40.300 --> 00:03:43.200
 the best attack that is cross-site scripting. This

61
00:03:43.200 --> 00:03:47.200
 attack is actually leverage in order to hijack sessions. So

62
00:03:46.300 --> 00:03:49.600
 by hijacking, that means attacker has

63
00:03:49.600 --> 00:03:52.600
 to take this particular value and

64
00:03:52.600 --> 00:03:55.600
 actually use it on its own browser.

65
00:03:55.400 --> 00:03:57.900
 So, how can we actually do that?

66
00:03:59.800 --> 00:04:02.200
 So what are the common methodologies that

67
00:04:02.200 --> 00:04:05.200
 attackers use is social engineering? So what they

68
00:04:05.200 --> 00:04:06.400
 will want to do, is that

69
00:04:07.700 --> 00:04:10.700
 Create a malicious payload in

70
00:04:10.700 --> 00:04:13.300
 which the moment the user tries to click on

71
00:04:13.300 --> 00:04:16.100
 it. It will open up on its own browser. And

72
00:04:16.100 --> 00:04:19.000
 as we saw in this particular case, it was able to fetch the

73
00:04:19.300 --> 00:04:22.700
 dog cookie. Also and taking that cookie,

74
00:04:22.700 --> 00:04:25.400
 they will be downloading it

75
00:04:25.400 --> 00:04:28.300
 on their own web server. So how can that be done?

76
00:04:30.300 --> 00:04:34.900
 Whatever purposes have already, copy-pasted the payload. So

77
00:04:34.900 --> 00:04:35.800
 as you can see.

78
00:04:37.300 --> 00:04:40.400
 An attacker can use any real-time attack such as Pine

79
00:04:40.400 --> 00:04:43.100
 URLs. So these are URLs that are short in

80
00:04:43.100 --> 00:04:46.400
 nature, but actually when they would be

81
00:04:46.200 --> 00:04:49.600
 addressed by the browser, will actually expand

82
00:04:49.600 --> 00:04:53.300
 to and proper full fledge URL. So

83
00:04:52.400 --> 00:04:55.400
 if we send any of these short

84
00:04:55.400 --> 00:04:58.400
 URLs to any of the victim, they will not even know

85
00:04:58.400 --> 00:05:01.300
 what is behind this and most of the time it is

86
00:05:01.400 --> 00:05:04.300
 quite right to assume from the attackers point of view that

87
00:05:04.300 --> 00:05:06.600
 they will click on it and they can

88
00:05:06.800 --> 00:05:09.100
 Actually, take the cookie. It's

89
00:05:09.100 --> 00:05:12.300
 what I've done is that I've added additional commands for

90
00:05:12.300 --> 00:05:15.200
 that. So what I have done is that, in my own

91
00:05:15.200 --> 00:05:16.000
 local system.

92
00:05:17.100 --> 00:05:20.800
 For demo purposes. I have quit when an attacker page, which

93
00:05:20.800 --> 00:05:21.900
 is running on PHP.

94
00:05:23.200 --> 00:05:27.000
 Under that. What I've done is that I've created a get parameter, which

95
00:05:26.100 --> 00:05:29.500
 is actually priced the document value.

96
00:05:30.700 --> 00:05:33.400
 And on the back end also created a notepad which

97
00:05:33.400 --> 00:05:36.900
 will actually save every session ID. So

98
00:05:36.900 --> 00:05:39.400
 if I am able to send to multiple people and

99
00:05:39.400 --> 00:05:42.500
 they run the same website and the click on it, all

100
00:05:42.500 --> 00:05:44.400
 those cookies would be stored on my notepad.

101
00:05:45.900 --> 00:05:48.100
 But an actual scenario, it is pretty much

102
00:05:48.100 --> 00:05:51.500
 sure. That this document out location would

103
00:05:51.500 --> 00:05:55.000
 be redirected to a different website,

104
00:05:54.300 --> 00:05:57.500
 that's owned by The Tackle themselves where

105
00:05:57.500 --> 00:06:00.200
 they will be actually storing all those sessions in real

106
00:06:00.200 --> 00:06:00.500
 time.

107
00:06:02.400 --> 00:06:05.200
 And apart from that, there's one of the pillows that I put the

108
00:06:05.200 --> 00:06:08.200
 moment. This particular trip side, redirects to

109
00:06:08.200 --> 00:06:11.500
 this location with attacker page. Also created an

110
00:06:11.500 --> 00:06:15.000
 additional redirect. For example, in this scenario. It

111
00:06:14.500 --> 00:06:17.400
 will go back to facebook.com

112
00:06:25.500 --> 00:06:28.100
 So, let's see what happens if a

113
00:06:28.100 --> 00:06:29.300
 person clicks on the link.

114
00:06:31.500 --> 00:06:34.800
 So this is the particular note pad that I have created in

115
00:06:34.800 --> 00:06:37.100
 which we actually store all of the Scoobies in

116
00:06:37.100 --> 00:06:40.500
 real time. As you can see. It is already stored.

117
00:06:40.100 --> 00:06:43.100
 This particular pH P value.

118
00:06:45.200 --> 00:06:49.500
 So in this way, an attack can actually store

119
00:06:49.500 --> 00:06:52.100
 all the cookies in real time and uses on the

120
00:06:52.100 --> 00:06:56.200
 website just by copying this value and

121
00:06:56.200 --> 00:06:59.300
 actually going to the developer tool and replacing, the cookie

122
00:06:59.300 --> 00:07:02.700
 value in that way. You'll be able to hijack the session. Now

123
00:07:02.700 --> 00:07:05.400
 just to be sure, let's reiterate the scenario again.

124
00:07:05.400 --> 00:07:08.700
 We have a user who's actually trying

125
00:07:08.800 --> 00:07:10.800
 to access a website.

126
00:07:11.800 --> 00:07:14.800
 And we also have an attacker in which you. So

127
00:07:14.900 --> 00:07:17.500
 initially the tiger is trying to send

128
00:07:17.900 --> 00:07:19.900
 a payload using social engineering methodology.

129
00:07:21.400 --> 00:07:24.400
 Maybe via Twitter or any other messenger case.

130
00:07:24.600 --> 00:07:27.300
 So, once the user clicks on the

131
00:07:27.300 --> 00:07:30.400
 link, the request will redirect the web server.

132
00:07:32.500 --> 00:07:35.300
 And the payload is executed and the response is sent

133
00:07:35.300 --> 00:07:38.500
 back and you to that what is going to happen. The

134
00:07:38.500 --> 00:07:41.400
 attached payload is going to send back the cookie

135
00:07:41.500 --> 00:07:43.000
 the hijack fashion to that account.

136
00:07:44.400 --> 00:07:46.200
 That's it for this video. Thank you.
