Python nmap port scanner

Поділитися
Вставка
  • Опубліковано 2 січ 2025

КОМЕНТАРІ • 241

  • @davidbombal
    @davidbombal  3 роки тому +28

    ================
    Scripts using regex:
    ================
    Socket method:
    github.com/davidbombal/red-python-scripts/blob/main/port_scanner_regex.py
    nmap method: github.com/davidbombal/red-python-scripts/blob/main/nmap_port_scanner.py
    ====================
    Scripts using IP address:
    ====================
    Socket method: github.com/davidbombal/red-python-scripts/blob/main/port_scanner_ip_obj.py
    nmap method: github.com/davidbombal/red-python-scripts/blob/main/nmap_port_scanner_ip_obj.py
    Menu:
    Python port scanner nmap and sockets: 0:00
    This is a journey: 0:20
    Sockets on Windows: 1:09
    Download and install Python: 1:40
    Run python socket port scanner: 2:40
    Test against a web server: 4:07
    Timeout to check connection: 5:00
    Kali Linux example: 5:25
    Test sockets Python script on Kali Linux: 6:06
    Catching mistakes: 6:42
    Sockets Python Code: 7:08
    nmap script on Kali: 7:38
    Troubleshooting nmap issues: 8:18
    Python nmap port scanner: 9:22
    Comparison of the scripts: 10:04
    Sockets script explanation: 10:50
    nmap Python script explanation: 13:25
    ================
    Connect with me:
    ================
    Discord: discord.com/invite/usKSyzb
    Twitter: twitter.com/davidbombal
    Instagram: instagram.com/davidbombal
    LinkedIn: www.linkedin.com/in/davidbombal
    Facebook: facebook.com/davidbombal.co
    TikTok: tiktok.com/@davidbombal
    UA-cam: ua-cam.com/users/davidbombal
    ================
    Support me:
    ================
    DavidBombal.com: CCNA ($10): bit.ly/yt999ccna
    Udemy CCNA Course: bit.ly/ccnafor10dollars
    GNS3 CCNA Course: CCNA ($10): bit.ly/gns3ccna10
    ======================
    Special Offers:
    ======================
    Boson software: 15% discount
    Link: bit.ly/boson15
    Code: DBAF15P
    Please note that links listed may be affiliate links and provide me with a small percentage/kickback should you use them to purchase any of the items listed or recommended. Thank you for supporting me and this channel!

    • @akeelomairi9911
      @akeelomairi9911 3 роки тому

      Hi David. Do you have a video about Python regular expression? Thanks!

    • @jewelbennett7325
      @jewelbennett7325 3 роки тому

      Ok Thank you

    • @aksdvlog1796
      @aksdvlog1796 3 роки тому

      Sir please checkout your email.

    • @fardinfaisalofficial
      @fardinfaisalofficial 3 роки тому

      Hello sir I'm from Bangladesh. Can you please make a video on how to crack wifi password using only a mobile device. It would be very helpful. I don't have any PC or Laptop.

    • @richardhead2.049
      @richardhead2.049 3 роки тому

      Thanks for doing this.

  • @lrmarquez80
    @lrmarquez80 3 роки тому +9

    Thanks David! This has been the toughest and most important part of my Pen-tester journey. I believe its important to understand what exactly the code is tying to do in order to be a great penetration tester. Learning how to integrate all the libraries that python has to offer has been my biggest challenge

  • @Khalevvv
    @Khalevvv 3 роки тому +4

    I love how much u go into detail when ur writing youre code and it makes it so much easier to understand

    • @DoktorIcksTV
      @DoktorIcksTV 3 роки тому

      I absolutely agree. Even as a beginner in Python, I basically understood everything.

  • @shaunnasworkshop
    @shaunnasworkshop 3 роки тому +2

    This is the first example of a port scanner I've found that works as advertised. The comments you placed in it make me thoroughly understand how it is working. Thank you so much for this.

  • @jamesgouveia5267
    @jamesgouveia5267 3 роки тому +5

    David thank you for the tutorials! As an aspiring Cybersecurity professional, these are invaluable!

  • @ABDR._.
    @ABDR._. 3 роки тому +23

    David Bombal is Amazing and Legendary Like Always ! Thank You so Much Mr.David ! 👏👏👏👏👏👏👍👍

    • @davidbombal
      @davidbombal  3 роки тому +4

      Thank you and you're welcome :)

  • @educastellini
    @educastellini 3 роки тому +2

    -Great content Professor David ... !!!
    -Python is practically a Swiss army knife, server for Pentest, Devnet, and many others.
    -I started to study for Python seriously by taking the very advanced Python courses on Udemy because I think about making a different version of the Quokka project but instead of using Flask use Django, and even the preparation for Python certification I think in doing, now the Devnet or the Python certification to PCAP that when you finish the course at the Cisco academy it comes out at half the value which is still going to be 150 dollars which is almost the value of the Brazilian minimum wage so I still can't do it without a job in the area.
    -Now I need to say one fact:
    -My wife studied nursing and thought about doing Cook in college, but I introduced her to Python and she is already in her second course and is learning Web now, and in the morning in Bed when I put this video she understood the codes and asked me about IP addressing , it was magical.
    -Thank you professor David ... !!!

  • @davidb_thetruth
    @davidb_thetruth 3 роки тому +3

    Great job as always David, I too love when people put in comments in their code to help newbies like myself learn how and (the big one) WHY, it does what you (hopefully) want it to. Thanks again.

  • @deepak.k5501
    @deepak.k5501 3 роки тому +1

    You are the man David, unlike others you are explaining what, why and how it works which is much needed to understand.

    • @davidbombal
      @davidbombal  3 роки тому

      Thank you Deepak. I really appreciate that :)

  • @ayanchakraborty76
    @ayanchakraborty76 3 роки тому +1

    Never seen such working and well explained programming in this (nmap and sockets) topic... Thanks david...... Big fan of yours ❤️❤️

  • @ramnikTDM
    @ramnikTDM 3 роки тому +1

    Sir My dream is become a CyberSecurity Engineer but I am not having that much money for the Expensive courses but have the passion for it.
    Sir you are my Inspiration.

    • @davidbombal
      @davidbombal  3 роки тому +2

      Never give up. Lots of free content available online these days.

  • @atiface5057
    @atiface5057 3 роки тому

    Thunkz alot. Sir david. Me I'm IT student from somali actually I learned more detail from this channel. Thunkz alot. Teacher

  • @BKRN01-89
    @BKRN01-89 3 роки тому

    I'm a cyber security student and I wish this video came out last year when I had to create a port scanner for a project but I used Scapy. Great video David !!

  • @MalMilligan
    @MalMilligan 3 роки тому +1

    Brilliant. I'm cracking the tab on your Udemy CCNA class tonight... ty !

  • @eternal_stoic_
    @eternal_stoic_ 2 роки тому

    thanks so much profesor David you teach in such a manner that makes me want to keep learning. THANKS

  • @fredtaylor260
    @fredtaylor260 3 роки тому +6

    Love your work David, you've really inspired me to get back into programming :) so inspirational

    • @davidbombal
      @davidbombal  3 роки тому +2

      Thank you Fred. Programming can be a lot of fun :)

  • @Jenko022
    @Jenko022 3 роки тому +1

    This content is fantastic and very well explained. I am so looking forward to following these tutorials into the advanced stages. Excellent work Sir.

  • @tisbutascratch9961
    @tisbutascratch9961 3 роки тому

    This man is giving out quality knowledge for free! What a legend!
    P.S. shout out to other legends like Networkchuck and of course, Man, The myth, The legend, Professor Messer!

  • @ABDR._.
    @ABDR._. 3 роки тому +1

    This is Very Cool Mr.David Bombal ! 👏👏👏👏👏👏👏👏👍👍👍🔥🔥

  • @hareinjayasekara8740
    @hareinjayasekara8740 3 роки тому

    This is really cool, these scripts can be useful at times when the NSE of Nmap are not much needed..

  • @wcman3842
    @wcman3842 2 роки тому

    thank you so much for this!!
    could barely find any scripts that worked on google, let stand with comments and explanations.

  • @aravbudhiraja
    @aravbudhiraja 3 роки тому

    A feature u cud add to the socket port scanner is to check the port and determine the default service. U cud add something like if port==21: print(f"Port {port} is open, this could be FTP") and a bunch of elifs after that.

  • @VideoGigs
    @VideoGigs 3 роки тому

    Great video!!! Adding your comments to the scripts is awesome to., If you don’t mind, I want to add to the python nmap script the ability to store results in a self-contained database. Also thinking on adding the ability to load/create scan policies too. My goal is to add this to my home network on a raspberry pi and use it as a network discovery tool. I will use a corn job to run the script multiple times a day. The Pi will also have a 5 inch LCD to display a dashboard of current hosts on the network and if they are authorised hosts or not. I plan to capture MACs, IP’s and Ports. If anyone is interested, I can share my project when its finished. Thanks again David for the script. It’s given me a-lot of ideas :-)

  • @jprince2453
    @jprince2453 3 роки тому

    Thx for the video i didn't know it have a library call nmap all these time i been using socket , thread and scapy this video is a good mine keep it up

  • @dencam
    @dencam 3 роки тому

    Saluti Engineer David,
    Always enjoy watching your videos.

  • @jacobkatzev1936
    @jacobkatzev1936 3 роки тому

    Ive recently started learning python thanks you so much for the help David!

  • @Biotoxic510
    @Biotoxic510 3 роки тому

    You are my inspiration! No words! just THANK YOU SO MUCH!!! Keep it up!!!

  • @Z3kyTw0
    @Z3kyTw0 3 роки тому

    Incredible info in these videos David. Superb as always !

  • @Firoz900
    @Firoz900 3 роки тому

    David Bombal...my inspiration. Thank you dear.

  • @prach2
    @prach2 3 роки тому

    nmap is good tool.
    I am using nmap in my job almost everyday to scan some particular ports on servers.
    As you were talking about red and blue team 😀 My job is kind of like being the blue team 🤔

  • @gamingunlimited9609
    @gamingunlimited9609 3 роки тому

    Just looking for it for a week & finally got it. ❤️

    • @davidbombal
      @davidbombal  3 роки тому +1

      Really happy to hear that! :)

  • @jrsstars4093
    @jrsstars4093 3 роки тому

    New intro is awesome!

  • @Paasj
    @Paasj 3 роки тому

    I am very interested in this David.. And automathation (however how's we write that) is something I need to focus on. Thank you for helping tons!! Rock on!!!!

    • @davidbombal
      @davidbombal  3 роки тому

      Really happy to hear that! And thank you for your support. I appreciate it :)

  • @Angel_Santiago27
    @Angel_Santiago27 3 роки тому +1

    I really enjoy this video, thank you for help us to improve our skills with python!

  • @younisahmed8618
    @younisahmed8618 3 роки тому

    Big fan from France 🇫🇷

  • @gstud210
    @gstud210 3 роки тому

    I need more videos like this! Keep up the good work!

  • @pcoulson7996
    @pcoulson7996 3 роки тому

    just installing python 3.10.1, and I don't have the option to check any of the two boxes, @ 2:12 . So I can't add to path.. Any advice, Please.

  • @shellgenius
    @shellgenius 3 роки тому

    Sir we need more videos of python pls upload a video we are glad

  • @ianleo3030
    @ianleo3030 Рік тому

    look i have just used threading and i have made it faster checking all of the ports in approximately 100 seconds and it is much better because it waits for a second not a half so the results can be even more accurate it works

  • @Equinox-b9k
    @Equinox-b9k 8 місяців тому +1

    Pls I need ur reply. Can i use that website of urs for practice

  • @thomasfields2082
    @thomasfields2082 3 роки тому

    So much better than the 10 year old book im trying to learn from.

  • @rajesha8626
    @rajesha8626 3 роки тому

    You always delight me,with your content !!! Thank you

  • @md.mazharulislam3493
    @md.mazharulislam3493 3 роки тому +1

    Thank you so much for your amazing and powerful content.

    • @davidbombal
      @davidbombal  3 роки тому +2

      Thank you! And you are welcome!

  • @sergioeduard4422
    @sergioeduard4422 3 роки тому

    Do you have a video on how to build a CV especially for the people with no experience, or could you please consider this subject in one of the following videos?

  • @AdeshMG
    @AdeshMG 3 роки тому

    Thanks a lot David. Still new @ python.. Got me more excited

    • @davidbombal
      @davidbombal  3 роки тому

      Really happy to hear that Adesh. So many cool things we can do with Python :)

  • @ashwinkannan1501
    @ashwinkannan1501 3 роки тому +1

    Amazing video for beginners

  • @edoardogribaldo2870
    @edoardogribaldo2870 3 роки тому

    I'm without words! Thank u Davidddd!!!

  • @ellmatic
    @ellmatic 3 роки тому

    Big fan from Netherlands 🇳🇱

  • @dsd7738
    @dsd7738 3 роки тому +1

    You are a legend as always

  • @kr4k3nn
    @kr4k3nn 3 роки тому

    This intro is dope

  • @fardinfaisalofficial
    @fardinfaisalofficial 3 роки тому +2

    Hello sir I'm from Bangladesh. Can you please make a video on how to crack wifi password using only a mobile device. It would be very helpful. I don't have any PC or Laptop.

  • @zoomtv4692
    @zoomtv4692 3 роки тому

    Thank u bro we need more for python hacker and surce code and remote please.

  • @rudranshsrivastava9040
    @rudranshsrivastava9040 3 роки тому

    Big fan from India❤️

  • @KeasLC
    @KeasLC 2 роки тому

    Thank you for the detailed video it really helped me a lot. If you wanted to add a geolocation or traceroute to this script how would you go about it? Any help on a direction would be much appreciated

  • @KaivalyaGurav
    @KaivalyaGurav 3 роки тому

    Python is universal language ❤️

  • @nawid1687
    @nawid1687 3 роки тому

    sir bombal version of Nmap!! Hell yeah! I'll try to make one too! Thanks!

    • @davidbombal
      @davidbombal  3 роки тому +1

      Go for it Nawid! These are very simple scripts and can definitely be improved :)

    • @nawid1687
      @nawid1687 3 роки тому

      @@davidbombal oh yeah, you've also helped me create a MAC changer aswell as a keylogger, i love the programming vids! keep them up! Best channel on youtube in terms of hacking and computer science!

  • @vitolim
    @vitolim 3 роки тому

    Very helpful and interesting.
    Thank you so much !

  • @universalponcho
    @universalponcho 2 роки тому

    This video has been super useful

  • @РоманСуворов-й2т
    @РоманСуворов-й2т 3 роки тому

    Good Lesson, Sang!

  • @kevinquinn4714
    @kevinquinn4714 3 роки тому

    Another great video, thank you David.

  • @puchomuc
    @puchomuc 2 роки тому

    Is the only downside of using the nmap module that you need to have it installed, or is there another advantage to using socket over nmap?

  • @vitusyu9583
    @vitusyu9583 3 роки тому

    Thanks David! that's very useful, for me to learn new stuff.
    Sorry to ask, by not going through your video series, what virtualization software you are using on your Windows laptop ?

  • @jasvinderkaurdeve8057
    @jasvinderkaurdeve8057 3 роки тому

    Sir, How can I improve my logic for coding! , or How can I make my logical thinking strong so that I am able to structure data as well as not reduce static programming.

  • @s.aravindh6227
    @s.aravindh6227 3 роки тому +1

    Super vedio 👍👍

  • @juliusrowe9374
    @juliusrowe9374 3 роки тому

    Great content David!

  • @rafy-ivanmorales3077
    @rafy-ivanmorales3077 3 роки тому

    Rafy-Ivan Morales
    0 seconds ago
    I'm a new student trying to learn, so I can become a programmer with python
    I see this video tutorial, it is very good.
    I would like to ask for your advice if you can and guide me on how I will add this 3
    in a Python script, I have:
    2. System should look for all the ports between the range of 1 to 1025
    3. If the Ports is open, it should create a file and add an entry for port number
    4. In case of any exception for instance “host is not available”, “host name could not be resolved” or
    due to any other error, you need to write that exception into the same file.
    Thank you and Merry Christmas.

  • @m_darkwell
    @m_darkwell 3 роки тому

    Thanks for the video keep up the great content 👍👍👍

  • @yttechnical7665
    @yttechnical7665 3 роки тому

    I'm your big fan sir

  • @Sristi-Misti
    @Sristi-Misti 3 роки тому

    Sir, Please can you tell me Which textbook is best for learning python as a beginner? I am also with W3school.

  • @ianleo3030
    @ianleo3030 Рік тому

    could threading be used to make this port scanner thing faster ?????

  • @iknasiuskon
    @iknasiuskon 3 роки тому

    thanks for the information, it is very useful for me, but is it possible if each video is accompanied by Indonesian subtitles because many people want to learn but have difficulty speaking English

  • @alejandrocarmonaligeon
    @alejandrocarmonaligeon 3 роки тому

    Great video. I liked it a lot!!

  • @godman1117
    @godman1117 3 роки тому

    Now I’m curious, is your port scanner better then mine?

  • @vampire09ist
    @vampire09ist 3 роки тому

    So is this useful? I don't understand the differences basically

  • @AB-kn2kj
    @AB-kn2kj 2 роки тому

    Awesome explanation

  • @bewolf88
    @bewolf88 3 роки тому

    hi david, first of all thank you for your job here.
    i have a question:
    your nmap script generate an error on my kali thats says: "import nmap , module not found error"
    i was thinking may because nmap was not intalled, but if i try to install nmap i recive an output that say me nmap is alredy installed on newest version, or if i write a pip-install it says that requirement is alredy satisfied..
    how i can found a way for run your script? thanks

  • @abrarmulla1196
    @abrarmulla1196 3 роки тому +1

    i love vids like this.

  • @oy9804
    @oy9804 3 роки тому

    we want oswap course 😊❤️

  • @rafy-ivanmorales3077
    @rafy-ivanmorales3077 3 роки тому

    I want to ask for help....I need to make a program with Python program that should test the given host and it should generate a list of
    all the TCP Open ports within the range of 1 to 1025. You are required to accomplish this task by using
    standard Python’s “socket” library. Following are the functional requirements:
    1. On execution of program system should prompt “Enter a host to scan”. User will provide a host
    name
    2. System should look for all the ports between the range of 1 to 1025
    3. If the Ports is open it should create a file and add an entry for port number
    4. In case of any exception for instance “host is not available”, “host name could not be resolved” or
    due to any other error you need to write that exception into same file
    5. You also need to record starting and ending date and time at the beginning and ending of file
    accordingly. It should also show the total time it took in port scanning process

  • @Leonidas-mx7lx
    @Leonidas-mx7lx 3 роки тому +1

    how you write your name like that? What s the program

  • @ChrisVernonBaran
    @ChrisVernonBaran 3 роки тому +2

    Thanks for this sir!

  • @jonnav3107
    @jonnav3107 3 роки тому

    I'm confused... Why do we have to stream the socket? I works even if you don't specify a TCP/UDP connection, and it also recognizes URLs and IPs without an IP module?!

  • @faizanashraf1367
    @faizanashraf1367 2 роки тому

    Hey David where to learn python for hacking and networking

  • @mohammedharish7776
    @mohammedharish7776 3 роки тому

    Put video about PoE it's important to know (CCNA)

  • @godofsyco4615
    @godofsyco4615 3 роки тому

    Its working 200%

  • @dhruvthakerindia
    @dhruvthakerindia 3 роки тому

    Sir, is nmap enough for checking network vulnerabilities or other tools required?

    • @davidbombal
      @davidbombal  3 роки тому +1

      I'll cover this in more detail in another video.

  • @johnsam3240
    @johnsam3240 3 роки тому

    Lovely Davi Bomba

  • @zabihullahghouri7194
    @zabihullahghouri7194 3 роки тому

    Sir plz upload a video on how to watch someone from video surveillance on nmap !

  • @shubhamkumar-xz9je
    @shubhamkumar-xz9je 3 роки тому

    sir make more python tools like dirbuster ,arp spoof or mitm

  • @carryminatiarmy7696
    @carryminatiarmy7696 3 роки тому

    Big fan form india

  • @77Blackwolf77
    @77Blackwolf77 3 роки тому

    Great video! Does anyone have any idea why both nmap and socket report that every port is open when I scan my home IP address? Plus, nmap takes quite a long time to scan each port too.

  • @snipzmattio5887
    @snipzmattio5887 3 роки тому

    Nice video, im subing

  • @griffinschreiber6867
    @griffinschreiber6867 Рік тому

    Excuse me, I am only asking because I couldn't find this information anywhere else, but what type of scan is the nmap script actually doing? (i.e, SYN half-open, TCP full, FIN, X-MAS etc.) I would be very grateful for any help.

  • @PreetisKitchenltr
    @PreetisKitchenltr 3 роки тому +1

    Sir I Used Threading For The Socket Method But I Am Getting An Error. In The Windows Machine I Can Scan 1-65535 Ports In 30 Seconds. But When I Use My Kali Machine I Get An Error: Can't Start New Thread. And Even If I Do From 1-100 Port Range, It Doesn't Run On Kali. Why And Any Solution??

  • @abdullahyc9797
    @abdullahyc9797 3 роки тому

    Please when I input cd python, it says the system cannot find the path specified

  • @wimnanoe5887
    @wimnanoe5887 3 роки тому

    Thank you again David

  • @thewhiterabbit661
    @thewhiterabbit661 3 роки тому

    Please show more python tuts!!!

  • @sayedgharieb633
    @sayedgharieb633 3 роки тому

    hey david , i was woundring if u suggest any book for python in cybersecurity and network

    • @davidbombal
      @davidbombal  3 роки тому +1

      Black Hat Python is a good start. But, that isn't just python.

    • @sayedgharieb633
      @sayedgharieb633 3 роки тому

      @@davidbombal thank you 😊

  • @dean6125
    @dean6125 3 роки тому

    High level and useful but find python syntax weird (used to C like languages really).

  • @amaradave
    @amaradave Рік тому

    Hello, sir. Can I use your codes on my personal project?