All language subtitles for 15. Sockets

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Welcome to your final module.

Before we start working on scripts.

So this last module is a very important one because we have to define what sockets are.

So we're gonna be using sockets to connect to nodes together.

Really that's it.

A more layman's terms what we're doing is we're going to use sockets to connect to an open port an IP

address.

So you're going to see this when we build a port scanner.

You're also going to see this later on in the exploit development portion of the course where we have

to reach out to a specific port an IP address establish a connection and send malicious data.

So what we're going to do here is we're going to just build out a simple socket script and we're going

to connect to an open port with that script and it'll start to make sense.

And then when you see it in the next video when we build out the port scanner make a little bit more

sense and you see it again in the course you're going to say hey I remember that we use sockets for

connecting to ports.

So here's what we're gonna do.

We're going to make a file and call the file s dot pi.

You can call it whatever you want just do not call it socket dot pi if you call it socket that pie you're

going to run into issues because it's going to think it is a socket.

So we need to define a couple of things first.

So we're going to do is we're going to of course shebang of top do our been Python 3 and we're going

to import socket so remember importing is important.

We have to import socket up here at the top.

Now let's define a couple of variables.

So the first variable we're gonna say is host and we're just going to give that our local address here

of 1 2 7 0 0 1.

This is our local host.

And we're going to define port.

And I'm just gonna get mine all sevens.

You can give it whatever you'd like here.

And I'm going to define another variable like this as equals socket dot socket socket.

Dot a f net socket dot SOC underscore string.

Now this looks long and intimidating.

Please do not be intimidated by this.

We are just making our life easier on ourselves.

So we're defining a variable that stores all this into one.

And this is very very common when it comes to sockets.

The syntax here is very common.

So we're saying is hey we want s to equal socket dot socket and this socket a f iiNet socket SOC stream.

So if iiNet just think about that as IP V for we're connecting over an IP V for connection socket that

SOC stream.

You could just think of this as a port.

So I find it IPD for SOC stream.

It's a port.

So let's say we want to make a connection.

We're going to say s dot connect.

Now connect is just another part of the socket module.

So we're going to make a connection here.

So if you think about this we're using all this and then dot connect.

Right.

So we're declaring this.

And then we have these two parameters here a socket a finite socket Sox stream.

So the F iiNet.

We need to say hey let's make this a our host variable and then this one our port variable and we could

in theory just put in 7 7 7 7 and 1 2 7 0 0 1.

But it's just easier to find those in a variable up top and then use them later to connect.

So I'm going to go ahead and save this and then I'm going to open up a new terminal in a new window

here and I'm going to utilize a tool that we have not used before.

And this tool is called net cat and we'll use this later on in the course quite a bit.

So we'll say net cat and I'm just going to say and DLP.

This means I'm going to establish a listening port I'm going to listen on Port seven seven seven seven

for a connection.

So you see here it says hey we're listening on any interface for all sevens you have to worry too much

about this right now where to go into detail on net cat at a later time but all we're doing right now

is we're waiting for anybody to connect to us.

Now here we're sitting at our local host of 1 2 7 0 0 1.

So we need to establish that connection which is what we're going to do with this script.

Now the script does nothing.

It establishes a connection and that is it.

So let's go ahead and take a quick look where it is going to say Python 3 s stop pi do that come over

here and you see that we have established connection made.

And then the connection closed.

We didn't tell it to do anything.

There's nothing here to say hey keep this connection open send over some data do anything at all.

We just said hey make a connection really quick.

And it did.

It made a connection from 1 2 7 0 0 1 to 1 2 7 0 0 1 we connected yourselves but with this script we

had successfully achieved what we wanted to which was to utilise sockets to connect one node to another

node that's it.

So we're gonna build upon this whole thing here in the next lesson we're going to build a port scanner.

It's going to be a bad port scanner but it's still going to be a great lesson.

So let's go ahead and just take a look at that port scanner and I'll catch it in the next video.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.