In this video I'm going to show you how to use Python to capture packets of the wire.
We're going to use Python scripts so that we can programmatically run wire shock to capture packets
of the wire and then display something in this genus free topology.
I have an a boon to host an ether Switch switch.
That's the bolting switch in genus 3 at Cisco.
IOW switch and a Cisco IOW router the road is running multiple routing protocols so we should be able
to capture SPF messages and EAI GOP messages on this happened to host the switch is going to be generating
multiple messages such as DTP CTP SDP.
So those once again should be captured by the soon to host.
So again what we're going to do is run why a shock on the boon to host but specifically t shock and
an application called Pi shock which allows us to leverage t shock and interact with t shock using python.
Now there many ways to do this but this is a very simple way to get started.
So again I'm going to show you how to use Python to programmatically manipulate t shock to capture packets
and display information to us.
Not cloud gives us internet access so this a to host is connected to the Internet because I want to
show you how to download applications from the Internet.
So as an example I can ping Google from the sibling to host it received an IP address from the Nat cloud.
So again paying say Google dot com that ping succeeds because we have Internet connectivity from the
boon to host through the switch via the Net cloud on to my physical network and onto the Internet
okay.
So the first thing we want to do is install t shock before doing that.
I'm going to update you put two references it's recommended that you update your references before installing
software making sure that the references are good that you have the most up to date information.
So my Ubuntu references have been updated so I'm going to use the command apt get install t shock.
Now this is once again an a bunch to host so I'm going to be using a book to commands.
In this example I'm going to specify yes to install the software and that'll essentially download t
shock from the Internet and install it on my computer.
I'm going to allow non super users to capture packets even though that's not exactly necessary here.
I'm running as root on the spoon to client so the commands we've run are apt get install t shock and
before that I used app to get update.
Now I'm using an a boon to host here.
Python 3 top 5 is ready installed.
You could use apt get install Python and specify a python version to install so I could use commands
such as apt get install Python 3 top 5 but notice I've already got Python 3 top 5 installed so I've
already got Python installed.
The next thing to install is Pip 3.
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
using Python 3.
It's recommended today that you use Python 3 Python 2 is going to be end of life very soon.
So we want to use Python 3 rather than Python 2 and Pi shock runs with Python 3.
You have to use a legacy version of Pi shock if you want to use Python 2.0 7.
It's all we're doing here once again is connecting to the Internet and installing Pip.
So again that's the command we used up get install Python 3 Pip I'll add all these commands below this
video so you can follow the commands if you like.
Okay Pip three's installed so now I can use the command Pip 3 install pi shock.
This will install pi shock on my computer supply shock is now installed and what I could do as an example
is run ti shock and notice t shock is now capturing packets I can see you know SPF packet I can see
spanning tree I can see a GOP and so forth so I've been able to successfully run T shock and capture
packets pi shock doesn't run here we're going to call pi shock from within a python script or directly
from within Python.