Python 3 Programming Tutorial - Threaded port scanner

preview_player
Показать описание
Now that we've seen how to make a simple port scanner in Python 3, we've found that it is quite slow and cumbersome. So here, we tie in our knowledge of the threading module that we learned previously to dramatically improve our performance.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

Awesome videos! I really like Python as a language in its whole and these videos have helped me understand a lot of those intermediate programming concepts/features in Python that are sometimes difficult to work with/understand. I hope you post more often! Thanks for all the help!

empiresodemember
Автор

Ports 1 through 1024 are reserved for system protocols on a your computer. That's why you only had two ports showing up as open.

MorganFreemanIsLife
Автор

sentdex 
Do you realize that s.connect() does not actually return a connection (or any other) object? The close method is defined on the socket itself. so it should be s.close(), alternatively you could use the with statement eg. with s: s.connect((server, port))

P.S. it seems like you should close the socket prior to attempting to acquire the print_lock considering that it blocking could cause a delay in releasing the socket. Though probably an entirely unnecessary observation considering the number of available sockets and the low chance of the block being for any significant amount of time.

P.P.S. Glad I found your videos :)

FreeER
Автор

Hi . I love ur videos . Mostly. I got problem with this port scanner . It took almost 1 day to complete .

huffypufty
Автор

let's say I wanted to have a queue of threads for multiple definitions to run in, just waiting on standby. and when a definition is ran it grabs a unused thread, so not to interrupt another definition in the middle of running. then when nothing is running, your threads are on stand by again. basically how do I make your threader definition more dynamic, so I can throw a function at it instead of hard coding the function into it?

WalterBurkholder
Автор

Great tutorial! Can you do a series on how to talk to a node.js back-end with python?

anandachakraborti
Автор

Quick question, if you were to implement this as a module the first thing to call would be the for x in range(whatever range ) -- > t.start() section of the code right? so in essence starting the domino effect.

NetPwn
Автор

Love your videos, man. Can you explain how the pet scanner actually 'learns' that the port is open? IE: is it using SYN/SYN ACK? or something different?

MrCatinthehat
Автор

How can we get the scanner to read from a list fo targets of a file?

niprjct
Автор

i got up the point of test my port in windows. bij i got the following problem.
Traceback (most recent call last):
File "C:\Ronny\Netwerken\sever2.py", line 25, in <module>
main()
File "C:\Ronny\Netwerken\sever2.py", line 8, in main
s.bind((host, port))
OSError: [WinError 10048] Elk socketadres (protocol/netwerkadres/poort) kan normaal slechts één keer worden gebruikt.

Ques.: how can i get around this???

mafiaboy
Автор

Hi! in this specific example port 80 should always be open right?

kostasklimantakis
Автор

import sys
...
target = input("Enter URL or IP: ")

bean
Автор

Great job. I haven't looked up on ports yet, but it appears you have port 22 and 80 up on your site, and google has only 80 up

fairytail
Автор

I don't understand, why this port scanner will scan for open ports? Could you explain a bit why connecting to a random web-site reveals open ports?

computerscientist
Автор

How does multiplayer games find game hosts so fast?

kapilverma
Автор

Great tutorial!. (Dog distraction 6:28) 

californiaesnuestra
Автор

i realy like your videos they're great, you look like snowden btw

yunuskaya
Автор

bro im not sure i totally get what Queue means ..
like the thing i dont get is how the are the threads know like whom shold take which port
i tried my own version with out Queue [ coz as i was saying i didnt comprehend it and im not just gonna copy ur code..]
and what i did was deviding the number of ports with the number of threads but and there is ..
they dont run linearly .. i mean i[ it works but its not like 1, 2, 3, 4, 5, ]
coz one thread is going from 1-20 and another from 20-40

matanlll
Автор

how do i kill the thread after it's done scanning (python 3.8)? i ran this code, and it stayed stuck with an active thread infinitely

slashahood
Автор

Whats the differen between socket.SOCK_STREAM and DGRAM?

multigladiator