WEBVTT - This file was automatically generated by VIMEO

1
00:00:10.400 --> 00:00:14.200
 Everyone welcome back to the last section of this course as

2
00:00:14.200 --> 00:00:18.100
 we have seen various attack scenarios in both Urban Network as

3
00:00:17.100 --> 00:00:20.500
 to how an attacker can hijack session. Now,

4
00:00:20.500 --> 00:00:22.800
 let's try to understand. How do you secure them?

5
00:00:24.100 --> 00:00:27.400
 I will start out by saying that such an it should be

6
00:00:27.400 --> 00:00:31.000
 treated as passwords. The reason being that the

7
00:00:30.200 --> 00:00:33.800
 way we treat complexity of the password to

8
00:00:33.800 --> 00:00:36.500
 ensure that they are not

9
00:00:36.500 --> 00:00:39.600
 following any dictionary patterns or it

10
00:00:39.600 --> 00:00:42.400
 is not something that is guessable by

11
00:00:42.400 --> 00:00:45.600
 any attacker that way. You have to ensure that

12
00:00:45.600 --> 00:00:48.100
 decision IDs that are generated are

13
00:00:48.100 --> 00:00:48.800
 quite random.

14
00:00:49.700 --> 00:00:52.300
 So if you remember particular example that we

15
00:00:52.300 --> 00:00:55.700
 look in the Hands-On section where our

16
00:00:55.700 --> 00:00:58.600
 session IDs at a typical pattern in the form of

17
00:00:58.100 --> 00:01:01.800
 dates. So, given

18
00:01:01.800 --> 00:01:04.700
 a certain amount of time, an attacker can

19
00:01:04.700 --> 00:01:07.400
 actually reduce what is a pattern in

20
00:01:07.400 --> 00:01:10.300
 a small window by doing. So, what's

21
00:01:10.300 --> 00:01:13.600
 going to happen now is that the attacker can generate new

22
00:01:13.600 --> 00:01:14.500
 session IDs?

23
00:01:15.500 --> 00:01:18.200
 Now paste on the vulnerability that our website might

24
00:01:18.200 --> 00:01:21.500
 process. We be a session fixation attack

25
00:01:21.900 --> 00:01:24.200
 or a Brute Force attack. Any

26
00:01:24.200 --> 00:01:28.000
 of those scenarios can actually give an attacker certain

27
00:01:27.200 --> 00:01:30.500
 amount of time to actually send

28
00:01:30.500 --> 00:01:33.600
 those new IDs to the server and

29
00:01:33.600 --> 00:01:36.500
 to check if those sessions are

30
00:01:36.500 --> 00:01:39.800
 actually valid or not. There should be no reason

31
00:01:39.900 --> 00:01:42.500
 for the developers who generate the

32
00:01:42.500 --> 00:01:45.100
 session ID themself or to create a

33
00:01:45.300 --> 00:01:48.900
 Curtain of the room, all of the common Frameworks

34
00:01:48.200 --> 00:01:52.800
 that exist in the market. We p.net PHP

35
00:01:52.800 --> 00:01:55.900
 or any search primary languages. Those

36
00:01:55.900 --> 00:01:58.500
 Frameworks to handle such an ID is quite well

37
00:01:58.500 --> 00:02:01.700
 by that. I do means saying that

38
00:02:01.700 --> 00:02:04.400
 they do generate a random session ID.

39
00:02:05.400 --> 00:02:08.500
 Unlike the wonderful website that we saw in the demo, where

40
00:02:08.500 --> 00:02:11.500
 it was only numbers. And along with the pattern.

41
00:02:11.400 --> 00:02:14.300
 These Frameworks will actually help

42
00:02:14.300 --> 00:02:18.300
 generate a random number using both alphabets

43
00:02:17.300 --> 00:02:20.400
 and numbers. The

44
00:02:20.400 --> 00:02:23.700
 same time. They also give an high entropy in

45
00:02:23.700 --> 00:02:26.600
 terms of the size by doing. So,

46
00:02:26.900 --> 00:02:29.600
 what's gonna happen now is that those

47
00:02:29.600 --> 00:02:32.800
 random generated long strings, quite

48
00:02:32.800 --> 00:02:33.800
 hard to Brute Force.

49
00:02:34.500 --> 00:02:37.700
 Reason being just to remember this important

50
00:02:37.700 --> 00:02:40.900
 fact that session ID is actually valuable

51
00:02:40.200 --> 00:02:43.100
 elements valid, you ought

52
00:02:43.100 --> 00:02:47.000
 to Brute Force. Our large string, with all of these possibilities is

53
00:02:46.200 --> 00:02:49.200
 going to take quite a long time. And

54
00:02:49.200 --> 00:02:52.700
 by that time, we should have additional measures

55
00:02:52.200 --> 00:02:54.200
 to expire the session.

56
00:02:55.500 --> 00:02:58.600
 And even though a user session

57
00:02:58.600 --> 00:03:02.300
 IDs actually being guests after sudden

58
00:03:01.300 --> 00:03:04.300
 were of time, but attacker can

59
00:03:04.300 --> 00:03:06.300
 no longer use it.

60
00:03:09.200 --> 00:03:12.600
 Sort of attack that we actually looked was where the session ID

61
00:03:12.700 --> 00:03:15.500
 was being passed in the URL. Now,

62
00:03:15.500 --> 00:03:18.100
 what will happen in two scenarios. We

63
00:03:18.100 --> 00:03:21.800
 really don't want any attacker sitting in an open Cafe

64
00:03:21.200 --> 00:03:24.700
 to sniff bar. You are, or

65
00:03:24.700 --> 00:03:28.000
 there are scenarios where end users actually share

66
00:03:27.200 --> 00:03:30.700
 any existing URL to

67
00:03:30.700 --> 00:03:33.000
 the friends or colleagues or social media?

68
00:03:33.900 --> 00:03:36.200
 Unknowingly such an ID being

69
00:03:36.200 --> 00:03:39.500
 present in the URL. Now, becomes a very big threat

70
00:03:39.300 --> 00:03:42.800
 because we don't know if an attacker is actually a

71
00:03:42.800 --> 00:03:45.500
 waiting for all of these social

72
00:03:45.500 --> 00:03:48.400
 media guys, post any search warrants.

73
00:03:49.600 --> 00:03:52.200
 Second problem would be since all

74
00:03:52.200 --> 00:03:55.800
 these websites communicate with each other. So

75
00:03:55.800 --> 00:03:58.500
 these session IDs sent as

76
00:03:58.500 --> 00:04:01.400
 part of the referee header. Also, get logged

77
00:04:01.400 --> 00:04:04.500
 at multiple destinations way

78
00:04:04.500 --> 00:04:07.600
 our app. So we'll also behave is that any

79
00:04:07.600 --> 00:04:10.500
 user accessing the URL gets

80
00:04:10.500 --> 00:04:12.400
 logged into the access law.

81
00:04:13.600 --> 00:04:16.500
 So given a scenario where the server itself

82
00:04:16.500 --> 00:04:19.800
 is compromised and all the URLs

83
00:04:19.800 --> 00:04:23.000
 are being locked in the access logs. That occur are

84
00:04:22.100 --> 00:04:25.600
 no longer needs to wait for a while and website or

85
00:04:25.600 --> 00:04:28.900
 any social easily tactics. He

86
00:04:28.900 --> 00:04:32.000
 can just go ahead and access the log and

87
00:04:31.300 --> 00:04:34.300
 get fresh new available session

88
00:04:34.300 --> 00:04:34.800
 IDs.

89
00:04:36.400 --> 00:04:39.500
 So one of the common scenario that you have seen is because there

90
00:04:39.500 --> 00:04:42.400
 are rappers, they use HTTP cat

91
00:04:42.400 --> 00:04:45.500
 method. The problem with that method is that all

92
00:04:45.500 --> 00:04:48.400
 the parameters will always be sent as part of the URL.

93
00:04:48.400 --> 00:04:51.300
 So, one simple way to medicate them

94
00:04:51.400 --> 00:04:54.900
 would always be to use post method, post

95
00:04:54.900 --> 00:04:57.300
 method ensure that the

96
00:04:57.300 --> 00:04:59.500
 request is being sent as part of the body.

97
00:05:00.400 --> 00:05:03.700
 And a much, much better approach would always be

98
00:05:03.200 --> 00:05:06.800
 to use cookies. So as we saw

99
00:05:06.800 --> 00:05:09.800
 in our initial videos, cooking

100
00:05:09.800 --> 00:05:12.900
 is a file which actually get stored on

101
00:05:12.900 --> 00:05:15.700
 the browser. Now, there is no need for

102
00:05:15.500 --> 00:05:18.400
 any vulnerability, we present

103
00:05:18.400 --> 00:05:19.100
 in the URL.

104
00:05:20.300 --> 00:05:23.100
 104 common attack went to that. We

105
00:05:23.100 --> 00:05:26.600
 saw was specialization where a particular

106
00:05:26.600 --> 00:05:29.700
 session ID was generated and

107
00:05:29.700 --> 00:05:32.800
 being given to the victim.

108
00:05:32.200 --> 00:05:35.600
 And that particular session ID was fixed

109
00:05:35.600 --> 00:05:36.900
 as part of the vulnerability.

110
00:05:37.700 --> 00:05:40.100
 So, there lies the actual issue where the

111
00:05:40.100 --> 00:05:43.100
 server was not actually regenerating a session ID.

112
00:05:45.200 --> 00:05:48.800
 If the developer was smart enough to ensure that once

113
00:05:48.200 --> 00:05:52.000
 a person is trying to reopen ticket or

114
00:05:51.100 --> 00:05:55.100
 a session ID is actually expired. Then

115
00:05:54.300 --> 00:05:57.800
 we ensure that a new random session

116
00:05:57.800 --> 00:06:00.300
 ID is generated. So that itself will

117
00:06:00.300 --> 00:06:03.500
 actually fixed a lot of session fixation

118
00:06:03.500 --> 00:06:04.000
 attacks.

119
00:06:05.700 --> 00:06:07.600
 That's it for this video. Thank you.
