1
00:00:00,210 --> 00:00:05,550
In this video I'm going to show you how to use Python to capture packets of the wire.

2
00:00:05,550 --> 00:00:11,490
We're going to use Python scripts so that we can programmatically run wire shock to capture packets

3
00:00:11,490 --> 00:00:16,590
of the wire and then display something in this genus free topology.

4
00:00:16,590 --> 00:00:19,970
I have an a boon to host an ether Switch switch.

5
00:00:20,010 --> 00:00:24,050
That's the bolting switch in genus 3 at Cisco.

6
00:00:24,060 --> 00:00:31,140
IOW switch and a Cisco IOW router the road is running multiple routing protocols so we should be able

7
00:00:31,140 --> 00:00:37,890
to capture SPF messages and EAI GOP messages on this happened to host the switch is going to be generating

8
00:00:37,890 --> 00:00:43,390
multiple messages such as DTP CTP SDP.

9
00:00:43,560 --> 00:00:46,560
So those once again should be captured by the soon to host.

10
00:00:47,400 --> 00:00:56,520
So again what we're going to do is run why a shock on the boon to host but specifically t shock and

11
00:00:56,940 --> 00:01:04,960
an application called Pi shock which allows us to leverage t shock and interact with t shock using python.

12
00:01:04,980 --> 00:01:08,340
Now there many ways to do this but this is a very simple way to get started.

13
00:01:08,910 --> 00:01:15,000
So again I'm going to show you how to use Python to programmatically manipulate t shock to capture packets

14
00:01:15,030 --> 00:01:17,470
and display information to us.

15
00:01:17,520 --> 00:01:23,700
Not cloud gives us internet access so this a to host is connected to the Internet because I want to

16
00:01:23,700 --> 00:01:29,970
show you how to download applications from the Internet.

17
00:01:30,110 --> 00:01:37,790
So as an example I can ping Google from the sibling to host it received an IP address from the Nat cloud.

18
00:01:38,070 --> 00:01:48,350
So again paying say Google dot com that ping succeeds because we have Internet connectivity from the

19
00:01:48,370 --> 00:01:55,270
boon to host through the switch via the Net cloud on to my physical network and onto the Internet

20
00:01:58,450 --> 00:01:58,750
okay.

21
00:01:58,760 --> 00:02:04,910
So the first thing we want to do is install t shock before doing that.

22
00:02:04,910 --> 00:02:12,110
I'm going to update you put two references it's recommended that you update your references before installing

23
00:02:12,110 --> 00:02:18,520
software making sure that the references are good that you have the most up to date information.

24
00:02:18,590 --> 00:02:27,750
So my Ubuntu references have been updated so I'm going to use the command apt get install t shock.

25
00:02:27,770 --> 00:02:33,020
Now this is once again an a bunch to host so I'm going to be using a book to commands.

26
00:02:33,020 --> 00:02:41,850
In this example I'm going to specify yes to install the software and that'll essentially download t

27
00:02:41,850 --> 00:02:47,280
shock from the Internet and install it on my computer.

28
00:02:47,280 --> 00:02:53,970
I'm going to allow non super users to capture packets even though that's not exactly necessary here.

29
00:02:53,970 --> 00:03:01,290
I'm running as root on the spoon to client so the commands we've run are apt get install t shock and

30
00:03:01,290 --> 00:03:04,650
before that I used app to get update.

31
00:03:04,650 --> 00:03:07,520
Now I'm using an a boon to host here.

32
00:03:07,650 --> 00:03:11,460
Python 3 top 5 is ready installed.

33
00:03:11,460 --> 00:03:18,420
You could use apt get install Python and specify a python version to install so I could use commands

34
00:03:18,420 --> 00:03:27,730
such as apt get install Python 3 top 5 but notice I've already got Python 3 top 5 installed so I've

35
00:03:27,730 --> 00:03:29,690
already got Python installed.

36
00:03:29,710 --> 00:03:32,680
The next thing to install is Pip 3.

37
00:03:32,680 --> 00:03:42,820
Now what I'm going to do is install Pip and in this case I want to get Python 3 pup I'm going to be

38
00:03:42,820 --> 00:03:44,160
using Python 3.

39
00:03:44,170 --> 00:03:50,770
It's recommended today that you use Python 3 Python 2 is going to be end of life very soon.

40
00:03:50,830 --> 00:03:59,230
So we want to use Python 3 rather than Python 2 and Pi shock runs with Python 3.

41
00:03:59,230 --> 00:04:05,680
You have to use a legacy version of Pi shock if you want to use Python 2.0 7.

42
00:04:05,820 --> 00:04:11,820
It's all we're doing here once again is connecting to the Internet and installing Pip.

43
00:04:11,970 --> 00:04:19,380
So again that's the command we used up get install Python 3 Pip I'll add all these commands below this

44
00:04:19,440 --> 00:04:24,810
video so you can follow the commands if you like.

45
00:04:25,500 --> 00:04:32,200
Okay Pip three's installed so now I can use the command Pip 3 install pi shock.

46
00:04:32,550 --> 00:04:44,700
This will install pi shock on my computer supply shock is now installed and what I could do as an example

47
00:04:44,700 --> 00:04:52,080
is run ti shock and notice t shock is now capturing packets I can see you know SPF packet I can see

48
00:04:52,080 --> 00:05:00,750
spanning tree I can see a GOP and so forth so I've been able to successfully run T shock and capture

49
00:05:00,750 --> 00:05:08,850
packets pi shock doesn't run here we're going to call pi shock from within a python script or directly

50
00:05:08,850 --> 00:05:09,870
from within Python.
