WEBVTT - This file was automatically generated by VIMEO

1
00:00:09.100 --> 00:00:12.100
 Welcome back in this but it is light. It would take a

2
00:00:12.100 --> 00:00:16.300
 look at two different types of issues session persistence. As

3
00:00:16.300 --> 00:00:20.000
 we previously looked at assume protocol being stateless. We

4
00:00:19.200 --> 00:00:22.800
 need to find mechanisms in order to pursue sessions.

5
00:00:22.800 --> 00:00:25.700
 So that each user can be declared by

6
00:00:25.900 --> 00:00:28.000
 and the response can be sent from the server.

7
00:00:28.800 --> 00:00:31.600
 So in this module, you will not be taking a look at the development

8
00:00:31.600 --> 00:00:34.300
 per se, but just to identify the

9
00:00:34.300 --> 00:00:37.600
 common concerns and to understand how we can leverage those

10
00:00:37.600 --> 00:00:39.900
 mechanisms and attack two scenarios.

11
00:00:41.100 --> 00:00:44.600
 So, the common types of search implementation that we see are

12
00:00:44.600 --> 00:00:47.300
 via cookies, followed by such and

13
00:00:47.300 --> 00:00:50.600
 Heidi pass where the URL and last being threatened

14
00:00:50.600 --> 00:00:53.100
 forms. So, let's take a look at

15
00:00:53.100 --> 00:00:56.800
 the first case scenario cookies. So, what are cookies? The

16
00:00:56.800 --> 00:00:59.400
 cookies are a small file, which is actually

17
00:00:59.400 --> 00:01:02.900
 being downloaded to your computer via the browser. This

18
00:01:02.900 --> 00:01:05.400
 is something that is used by the server covid-19

19
00:01:05.400 --> 00:01:08.300
 the user so that they can access different

20
00:01:08.300 --> 00:01:09.400
 services and resources.

21
00:01:10.800 --> 00:01:12.500
 Now, let's look at a small demo.

22
00:01:18.500 --> 00:01:21.100
 So, as you can see, this is a small code snippet that I've

23
00:01:21.100 --> 00:01:26.800
 written for PHP, cookie based, social management. So

24
00:01:26.800 --> 00:01:27.600
 let's try to

25
00:01:28.700 --> 00:01:31.900
 Dig deep into the developer tools, so

26
00:01:31.300 --> 00:01:33.300
 just press F12.

27
00:01:38.300 --> 00:01:41.300
 So just formed the demo purpose. I will clear out

28
00:01:41.300 --> 00:01:42.600
 all the existing cookies.

29
00:01:44.500 --> 00:01:46.200
 Now, let's try to refresh the page.

30
00:01:48.400 --> 00:01:51.400
 As we can see, a cookie has not been set on

31
00:01:51.400 --> 00:01:53.800
 the first request, and it was generated.

32
00:01:55.100 --> 00:01:58.300
 So what does that mean? A particular file has been downloaded to

33
00:01:58.300 --> 00:02:01.900
 your computer with the cookie. Having the name user with

34
00:02:01.900 --> 00:02:04.300
 the value of the username itself and

35
00:02:04.300 --> 00:02:07.100
 that as a expiry date for a given time. In this

36
00:02:07.100 --> 00:02:09.200
 particular scenario. It is for a date.

37
00:02:10.300 --> 00:02:12.600
 Now, let's try to access the request again.

38
00:02:14.200 --> 00:02:17.400
 As you can see, on subsequent requests that could be

39
00:02:17.400 --> 00:02:20.300
 was sent to the server. And for each request, it was able

40
00:02:20.300 --> 00:02:21.200
 to identify.

41
00:02:23.400 --> 00:02:25.300
 Who the user is actually tanker request?

42
00:02:27.200 --> 00:02:30.500
 So one of the common advantages of the scenario is that even

43
00:02:30.700 --> 00:02:33.700
 if the user actually closes

44
00:02:33.700 --> 00:02:36.700
 the browser itself since the

45
00:02:36.700 --> 00:02:39.500
 cookie is stored on the computer, the server can

46
00:02:39.500 --> 00:02:42.200
 actually recognize for each request. Let's try to figure that

47
00:02:42.200 --> 00:02:42.600
 out.

48
00:02:44.200 --> 00:02:47.700
 I'm just trying to open up a new window and

49
00:02:47.900 --> 00:02:50.600
 setting out the request. Again in

50
00:02:50.600 --> 00:02:53.700
 this scenario. We can see on the first request itself. The

51
00:02:53.700 --> 00:02:56.200
 so was able to identify who the user was.

52
00:02:57.400 --> 00:03:01.000
 Unlike the previous scenario where I cleared out cooking and

53
00:03:00.100 --> 00:03:03.400
 on the first request, it was not able to validate the

54
00:03:03.400 --> 00:03:04.200
 cookie itself.

55
00:03:06.400 --> 00:03:09.800
 I will look at the advantages for this. This is something can

56
00:03:09.800 --> 00:03:12.800
 be used for each request and

57
00:03:12.800 --> 00:03:15.300
 two-person session for a longer duration since the

58
00:03:15.300 --> 00:03:17.700
 cookie can always have a long expiry time.

59
00:03:19.400 --> 00:03:22.500
 And Second, Use case would be what we saw in

60
00:03:22.500 --> 00:03:25.100
 the demo. That if the user, even though equals out the

61
00:03:25.100 --> 00:03:28.300
 processor, you can always login back since as

62
00:03:28.300 --> 00:03:31.900
 long as assertion is valid or the cookie is alive. Patient,

63
00:03:31.900 --> 00:03:34.400
 x 5 time, so session will be

64
00:03:34.400 --> 00:03:37.200
 reactivated. There are some drawbacks to that.

65
00:03:37.200 --> 00:03:40.300
 Also. The first drawback would be the user can

66
00:03:40.300 --> 00:03:42.400
 always maintained, only one user session.

67
00:03:43.600 --> 00:03:46.400
 In case their applications web user has

68
00:03:46.400 --> 00:03:49.700
 multiple accounts. Since the cookie will actually

69
00:03:49.200 --> 00:03:52.400
 be dragged back and you can always

70
00:03:52.400 --> 00:03:55.400
 login using only one browser. There

71
00:03:55.400 --> 00:03:58.800
 are alternative ways to do. So we be using different browsers or

72
00:03:58.800 --> 00:04:02.000
 actually using incognito mode can be used. Second

73
00:04:01.400 --> 00:04:04.600
 drawback is that if the cookies are not actually secured

74
00:04:04.100 --> 00:04:07.400
 in terms of the properties, then there

75
00:04:07.400 --> 00:04:10.500
 are additional web attacks such as cross-site scripting that

76
00:04:10.500 --> 00:04:13.200
 can be used to leverage and steal those cookies.

77
00:04:13.400 --> 00:04:16.800
 To something. We'll be taking a look at the handout section.

78
00:04:16.700 --> 00:04:19.200
 Now, let's look at the

79
00:04:19.200 --> 00:04:22.100
 second scenario where this cookie or

80
00:04:22.100 --> 00:04:25.400
 the session ID itself as is being passed both

81
00:04:25.400 --> 00:04:25.900
 the URL.

82
00:04:28.500 --> 00:04:31.700
 So this is again one such demo in which the

83
00:04:31.700 --> 00:04:34.800
 small code snippet, which shows that on

84
00:04:34.800 --> 00:04:37.600
 each request or unique be free session ID

85
00:04:37.600 --> 00:04:40.400
 is being signed to the server and which is something that

86
00:04:40.400 --> 00:04:41.200
 will be used.

87
00:04:42.400 --> 00:04:44.200
 So, these are the scenarios where?

88
00:04:45.600 --> 00:04:48.400
 Browser. Or the end-users client. Might

89
00:04:48.400 --> 00:04:52.200
 not support cookies. These are very useful on those scenarios. The

90
00:04:52.200 --> 00:04:55.700
 way we can see for each request for new session ID would be generated

91
00:04:55.700 --> 00:04:58.700
 and the same value would be used for the particular

92
00:04:58.900 --> 00:04:59.900
 user login session.

93
00:05:01.900 --> 00:05:04.600
 So the major advantage would be that multiple or

94
00:05:04.600 --> 00:05:07.300
 parallel sessions can be used. Since for

95
00:05:07.300 --> 00:05:10.400
 each request, a new such an ID would be generated and

96
00:05:10.400 --> 00:05:13.200
 these are mostly used in the cases where cookies are

97
00:05:13.200 --> 00:05:14.400
 not being supported.

98
00:05:15.400 --> 00:05:18.300
 Similarly, there are drawbacks to this as well. First off,

99
00:05:18.300 --> 00:05:21.500
 by could be that if the session is being closed or

100
00:05:21.500 --> 00:05:24.300
 the browser is closed, user cannot login since it was

101
00:05:24.300 --> 00:05:28.100
 maintained for that particular tab. So window, in

102
00:05:28.100 --> 00:05:31.000
 second drawback is that since the

103
00:05:31.300 --> 00:05:34.500
 session ID itself is being passed for the URL. So

104
00:05:34.500 --> 00:05:37.600
 all the web request is being logged over the access logs

105
00:05:37.900 --> 00:05:40.700
 or there might be additional devices and

106
00:05:40.700 --> 00:05:44.200
 actually cash each and every request

107
00:05:43.200 --> 00:05:44.800
 and store them.

108
00:05:45.200 --> 00:05:48.500
 That way, it is information disclosure where an active session

109
00:05:48.500 --> 00:05:51.500
 might be disclosed for any user or any attacker.

110
00:05:52.600 --> 00:05:55.100
 Now, let's take a look at Alaska scenario where I

111
00:05:55.100 --> 00:05:56.500
 need them for me is being used.

112
00:06:01.700 --> 00:06:04.100
 So this is under such code snippet in which we

113
00:06:04.100 --> 00:06:06.400
 are using a need inform. Now, let's try to

114
00:06:07.600 --> 00:06:10.600
 to inspect the form itself just for demo purposes have

115
00:06:10.600 --> 00:06:12.500
 actually pre-fill the form values.

116
00:06:14.200 --> 00:06:18.000
 If I use a developer tab, and actually I try to inspect the form I

117
00:06:17.200 --> 00:06:20.400
 do. See now. There are different text

118
00:06:20.400 --> 00:06:23.300
 Fields as shown incredible. And

119
00:06:23.300 --> 00:06:26.900
 that's an additional hidden field which is actually generating a

120
00:06:26.900 --> 00:06:28.000
 PHP session value.

121
00:06:30.500 --> 00:06:33.300
 So now let's take a look what happens if you submit the phone.

122
00:06:35.500 --> 00:06:37.900
 You do see that the form was submitted with the 200 response.

123
00:06:39.200 --> 00:06:42.200
 So we just click on the file itself. We can see what

124
00:06:42.200 --> 00:06:43.200
 has been submitted.

125
00:06:44.200 --> 00:06:47.100
 So, we have been successfully been able to submit all

126
00:06:47.100 --> 00:06:50.200
 the values along with the nitin field, which is actually maintaining this

127
00:06:50.200 --> 00:06:50.700
 session.

128
00:06:53.100 --> 00:06:56.200
 This particular scenario is quite similar to what we saw in

129
00:06:56.200 --> 00:06:59.300
 the previous scene where the session ID was being passed for

130
00:06:59.300 --> 00:07:00.000
 the URL.

131
00:07:01.200 --> 00:07:04.900
 You can be used for same, multiple parallel sessions where

132
00:07:04.900 --> 00:07:07.200
 each and every request has to be sent over

133
00:07:07.200 --> 00:07:10.300
 the form itself. And since it is generated over

134
00:07:10.300 --> 00:07:14.200
 the form itself. There's no need for cookie. So, wherever

135
00:07:13.300 --> 00:07:16.700
 an end user is using an unsupported browser.

136
00:07:17.600 --> 00:07:20.100
 This is something, can we use to in order

137
00:07:20.100 --> 00:07:22.300
 to maintain such and persistence?

138
00:07:23.600 --> 00:07:26.100
 We do have a similar topic as to the

139
00:07:26.100 --> 00:07:29.300
 last scenario where if the particular browser is being

140
00:07:29.300 --> 00:07:32.200
 closed. The session would be terminated and the

141
00:07:32.200 --> 00:07:35.100
 user again would be to re-authenticate and open up a

142
00:07:35.100 --> 00:07:35.700
 new session.

143
00:07:36.800 --> 00:07:39.300
 I wanted to talk back. Is that each? And

144
00:07:39.300 --> 00:07:42.300
 every request has to be sent via, post method won't lie.

145
00:07:42.100 --> 00:07:46.100
 So what does that mean? We cannot have any hyperlinks at

146
00:07:46.100 --> 00:07:49.300
 the same time. We cannot secure any of those resources such as

147
00:07:49.300 --> 00:07:52.500
 images or videos, because everything has

148
00:07:52.500 --> 00:07:53.900
 to be sent via post body.

149
00:07:55.200 --> 00:07:57.900
 No, nothing could notice is that this particular method?

150
00:07:59.100 --> 00:08:02.900
 Is to be very hardly seen in today's modern web development. Is

151
00:08:02.900 --> 00:08:05.800
 something that was being used way back when

152
00:08:05.100 --> 00:08:08.400
 the WWE actually started whether web

153
00:08:08.400 --> 00:08:09.400
 development was me.

154
00:08:10.700 --> 00:08:13.600
 Just kind of a. Somebody got this section cookies

155
00:08:13.600 --> 00:08:16.500
 actually use in order to maintain persistence or

156
00:08:16.500 --> 00:08:17.200
 a long time.

157
00:08:18.200 --> 00:08:21.300
 In case, if those are not secured properly, there are

158
00:08:21.300 --> 00:08:24.700
 certain attacks that can be used in order to steal those groupies itself

159
00:08:24.500 --> 00:08:27.500
 and others mechanism, such as

160
00:08:27.400 --> 00:08:30.800
 passing the session over the URL. Or

161
00:08:30.800 --> 00:08:33.500
 over an intercom. Something can be used

162
00:08:33.500 --> 00:08:36.600
 whenever a browser or the client will

163
00:08:36.600 --> 00:08:39.400
 not support use of cookies, but these are

164
00:08:39.400 --> 00:08:41.200
 actually susceptible to Common attacks.

165
00:08:42.400 --> 00:08:44.400
 That is why this video. Thank you.
