1
00:00:00,080 --> 00:00:02,340
In this lesson, we're going to very briefly

2
00:00:02,340 --> 00:00:05,160
cover the concept of an on-path attack.

3
00:00:05,160 --> 00:00:07,080
Now, an on-path attack is an attack

4
00:00:07,080 --> 00:00:08,340
where the penetration tester

5
00:00:08,340 --> 00:00:10,620
is able to put their workstation logically

6
00:00:10,620 --> 00:00:12,990
between two hosts during the communication

7
00:00:12,990 --> 00:00:15,720
in order to transparently capture, monitor,

8
00:00:15,720 --> 00:00:18,540
and relay the communications between those hosts.

9
00:00:18,540 --> 00:00:20,010
By placing themselves in the path

10
00:00:20,010 --> 00:00:21,720
between the client and the server,

11
00:00:21,720 --> 00:00:24,120
the attacker can intercept the authorization packets

12
00:00:24,120 --> 00:00:25,710
being sent and received

13
00:00:25,710 --> 00:00:28,530
and then use those to take over the authorized session

14
00:00:28,530 --> 00:00:30,720
between the client and the server.

15
00:00:30,720 --> 00:00:32,610
Now, there are many different ways of conducting

16
00:00:32,610 --> 00:00:34,890
an on-path or interception attack,

17
00:00:34,890 --> 00:00:37,770
including ARP poisoning, DNS poisoning,

18
00:00:37,770 --> 00:00:39,900
introducing a rogue wireless access point,

19
00:00:39,900 --> 00:00:42,540
or introducing a rogue hover switch.

20
00:00:42,540 --> 00:00:45,360
Once an on-path or interception attack has begun,

21
00:00:45,360 --> 00:00:48,660
you can then decide to replay or relay the attack.

22
00:00:48,660 --> 00:00:50,940
Replay of the data occurs when valid data

23
00:00:50,940 --> 00:00:52,560
is captured by the attacker

24
00:00:52,560 --> 00:00:54,390
and is then repeated immediately

25
00:00:54,390 --> 00:00:57,060
or is delayed and then repeated.

26
00:00:57,060 --> 00:01:00,240
Replay is a common technique in wireless network attacks,

27
00:01:00,240 --> 00:01:03,000
but it can also be used in wired networks too.

28
00:01:03,000 --> 00:01:04,680
For example, if we can capture

29
00:01:04,680 --> 00:01:07,050
an authentication handshake between two hosts,

30
00:01:07,050 --> 00:01:09,510
we can then replay it to the authentication server

31
00:01:09,510 --> 00:01:12,240
so that it will think we are an authenticated client too

32
00:01:12,240 --> 00:01:15,510
and give us access to the network or its resources.

33
00:01:15,510 --> 00:01:17,970
Relay, on the other hand occurs when an attacker

34
00:01:17,970 --> 00:01:20,160
is able to become a part of the conversation

35
00:01:20,160 --> 00:01:23,130
by inserting themself in between the two hosts.

36
00:01:23,130 --> 00:01:25,260
In this case, the attacker essentially becomes

37
00:01:25,260 --> 00:01:26,880
a proxy between two hosts,

38
00:01:26,880 --> 00:01:30,390
and they can read or modify any communications between them.

39
00:01:30,390 --> 00:01:31,223
When this occurs,

40
00:01:31,223 --> 00:01:33,750
anytime the client tries to get to the server,

41
00:01:33,750 --> 00:01:36,570
it is instead going from the client to the attacker,

42
00:01:36,570 --> 00:01:38,580
and from the attacker to the server.

43
00:01:38,580 --> 00:01:40,830
From this position, we can capture everything

44
00:01:40,830 --> 00:01:42,270
that's being sent between them

45
00:01:42,270 --> 00:01:46,080
including the usernames, passwords, and even bank balances.

46
00:01:46,080 --> 00:01:48,810
We can even change the data if we so desire.

47
00:01:48,810 --> 00:01:51,270
Remember, relay involves getting the information

48
00:01:51,270 --> 00:01:52,440
and then passing it on,

49
00:01:52,440 --> 00:01:56,580
or you can intercept it, change it, and then pass it on.

50
00:01:56,580 --> 00:01:58,980
The big challenge though with replay and relay

51
00:01:58,980 --> 00:02:01,680
occurs when encryption is enforced by the host.

52
00:02:01,680 --> 00:02:03,060
If the server, for example

53
00:02:03,060 --> 00:02:05,510
is using a strong encryption scheme like TLS 1.3,

54
00:02:06,840 --> 00:02:08,310
it's going to be very difficult

55
00:02:08,310 --> 00:02:10,560
or even impossible for us to intercept

56
00:02:10,560 --> 00:02:13,680
and craft the communication between these two hosts.

57
00:02:13,680 --> 00:02:15,420
To try and overcome this encryption,

58
00:02:15,420 --> 00:02:18,360
a technique known as SSL stripping was created.

59
00:02:18,360 --> 00:02:20,970
Since a lot of websites use SSL and TLS

60
00:02:20,970 --> 00:02:23,790
as a way to encrypt data between the client and the server,

61
00:02:23,790 --> 00:02:25,410
we can attempt to attack this

62
00:02:25,410 --> 00:02:27,240
by tricking the encryption application

63
00:02:27,240 --> 00:02:30,510
into presenting the user with an HTTP connection

64
00:02:30,510 --> 00:02:33,390
instead of an HTTPS connection.

65
00:02:33,390 --> 00:02:37,920
For instance, let's say you go to facebook.com using HTTPS,

66
00:02:37,920 --> 00:02:38,820
but an attacker was able

67
00:02:38,820 --> 00:02:41,040
to redirect or downgrade the request

68
00:02:41,040 --> 00:02:44,310
to use the regular HTTP connection instead.

69
00:02:44,310 --> 00:02:46,620
This would be considered SSL stripping,

70
00:02:46,620 --> 00:02:48,330
because now there is no encryption

71
00:02:48,330 --> 00:02:50,040
being used in that connection,

72
00:02:50,040 --> 00:02:52,830
and we can then capture all the data and read it.

73
00:02:52,830 --> 00:02:55,350
Now, if SSL stripping is impossible,

74
00:02:55,350 --> 00:02:58,770
then we can attempt to perform a downgrade attack instead.

75
00:02:58,770 --> 00:03:00,930
In a downgrade attack, the attacker attempts

76
00:03:00,930 --> 00:03:04,200
to have a client or server abandon its higher security mode

77
00:03:04,200 --> 00:03:06,600
in favor of a lower security mode.

78
00:03:06,600 --> 00:03:09,240
For example, if the client tries to connect to a server

79
00:03:09,240 --> 00:03:11,340
and negotiate a higher level of encryption

80
00:03:11,340 --> 00:03:14,160
like TLS 1.2 or 1.3,

81
00:03:14,160 --> 00:03:16,980
but they're connected through an intermediary attacker

82
00:03:16,980 --> 00:03:18,810
who's in an on-path position,

83
00:03:18,810 --> 00:03:21,510
that attacker may allow encryption to occur,

84
00:03:21,510 --> 00:03:24,000
so they'll see that little lock in their web browser

85
00:03:24,000 --> 00:03:28,140
but only at a lower level, such as using SSL 2.0,

86
00:03:28,140 --> 00:03:30,750
which is much easier for the attacker to crack.

87
00:03:30,750 --> 00:03:32,790
So that way the attacker can remain

88
00:03:32,790 --> 00:03:34,170
in the middle of the communications

89
00:03:34,170 --> 00:03:35,700
between the client and server

90
00:03:35,700 --> 00:03:37,650
and see everything that's going on.

91
00:03:37,650 --> 00:03:38,910
Now, it's important to mention

92
00:03:38,910 --> 00:03:42,870
that downgrade attacks don't only affect SSL and TLS though,

93
00:03:42,870 --> 00:03:44,940
it can actually be used with any kind of encryption

94
00:03:44,940 --> 00:03:49,140
or protection such as wifi, VPNs, and others.

95
00:03:49,140 --> 00:03:50,790
Anytime we have a client negotiate

96
00:03:50,790 --> 00:03:52,440
to a lower level of security

97
00:03:52,440 --> 00:03:54,450
that is still technically backwards compatible

98
00:03:54,450 --> 00:03:55,740
with that higher level,

99
00:03:55,740 --> 00:03:57,790
this is considered a downgrade attack

