Python nmap port scanner

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2024

ความคิดเห็น • 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
    TH-cam: th-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 ปีที่แล้ว +24

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

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว +4

      Thank you and you're welcome :)

  • @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.

  • @ayanchakraborty76
    @ayanchakraborty76 3 ปีที่แล้ว +1

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

  • @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 ... !!!

  • @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 :)

  • @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

  • @eternal_stoic_
    @eternal_stoic_ 2 ปีที่แล้ว

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

  • @brendanroach3237
    @brendanroach3237 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 !!

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว

      Thank you for watching!

  • @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 :)

  • @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.

  • @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.

  • @MalMilligan
    @MalMilligan 3 ปีที่แล้ว +1

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

  • @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.

  • @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 ?

  • @wcman3842
    @wcman3842 2 ปีที่แล้ว

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

  • @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?

  • @hareinjayasekara8740
    @hareinjayasekara8740 3 ปีที่แล้ว

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

  • @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!

  • @rafy-ivanmorales3077
    @rafy-ivanmorales3077 2 ปีที่แล้ว

    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.

  • @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

  • @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 !

  • @ABDR._.
    @ABDR._. 3 ปีที่แล้ว +1

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

  • @Firoz900
    @Firoz900 3 ปีที่แล้ว

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

  • @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

  • @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 :)

  • @ashwinkannan4652
    @ashwinkannan4652 3 ปีที่แล้ว +1

    Amazing video for beginners

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว

      Thank you for watching!

  • @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

  • @rafy-ivanmorales3077
    @rafy-ivanmorales3077 2 ปีที่แล้ว

    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

  • @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 🤔

  • @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.

  • @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

  • @dencam
    @dencam 3 ปีที่แล้ว

    Saluti Engineer David,
    Always enjoy watching your videos.

  • @Equinox-b9k
    @Equinox-b9k 6 หลายเดือนก่อน +1

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

  • @younisahmed8618
    @younisahmed8618 3 ปีที่แล้ว

    Big fan from France 🇫🇷

  • @shellgenius
    @shellgenius 3 ปีที่แล้ว

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

  • @gamingunlimited9609
    @gamingunlimited9609 3 ปีที่แล้ว

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

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว +1

      Really happy to hear that! :)

  • @Angel_Santiago27
    @Angel_Santiago27 3 ปีที่แล้ว +1

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

  • @gstud210
    @gstud210 3 ปีที่แล้ว

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

  • @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 :-)

  • @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?

  • @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.

  • @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 :)

  • @universalponcho
    @universalponcho 2 ปีที่แล้ว

    This video has been super useful

  • @rajesha8626
    @rajesha8626 3 ปีที่แล้ว

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

  • @dsd7738
    @dsd7738 3 ปีที่แล้ว +1

    You are a legend as always

  • @edoardogribaldo2870
    @edoardogribaldo2870 3 ปีที่แล้ว

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

  • @vampire09ist
    @vampire09ist 3 ปีที่แล้ว

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

  • @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!

  • @ellmatic
    @ellmatic 3 ปีที่แล้ว

    Big fan from Netherlands 🇳🇱

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว

      Welcome Netherlands!!!

  • @kr4k3nn
    @kr4k3nn 3 ปีที่แล้ว

    This intro is dope

  • @jrsstars4093
    @jrsstars4093 3 ปีที่แล้ว

    New intro is awesome!

  • @thomasfields2082
    @thomasfields2082 3 ปีที่แล้ว

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

  • @abrarmulla1196
    @abrarmulla1196 3 ปีที่แล้ว +1

    i love vids like this.

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว

      Happy to hear that Abrar!

  • @vitolim
    @vitolim 3 ปีที่แล้ว

    Very helpful and interesting.
    Thank you so much !

  • @AB-kn2kj
    @AB-kn2kj 2 ปีที่แล้ว

    Awesome explanation

  • @godman1117
    @godman1117 3 ปีที่แล้ว

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

  • @РоманСуворов-й2т
    @РоманСуворов-й2т 3 ปีที่แล้ว

    Good Lesson, Sang!

  • @kevinquinn4714
    @kevinquinn4714 3 ปีที่แล้ว

    Another great video, thank you David.

  • @johnsam3240
    @johnsam3240 3 ปีที่แล้ว

    Lovely Davi Bomba

  • @dean6125
    @dean6125 3 ปีที่แล้ว

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

  • @zoomtv4692
    @zoomtv4692 3 ปีที่แล้ว

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

  • @s.aravindh6227
    @s.aravindh6227 3 ปีที่แล้ว +1

    Super vedio 👍👍

  • @yttechnical7665
    @yttechnical7665 3 ปีที่แล้ว

    I'm your big fan sir

  • @zabihullahghouri7194
    @zabihullahghouri7194 3 ปีที่แล้ว

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

  • @mohammedharish7776
    @mohammedharish7776 3 ปีที่แล้ว

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

  • @juliusrowe9374
    @juliusrowe9374 3 ปีที่แล้ว

    Great content David!

  • @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!

  • @ianleo3030
    @ianleo3030 ปีที่แล้ว

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

  • @godofsyco4615
    @godofsyco4615 3 ปีที่แล้ว

    Its working 200%

  • @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

  • @KaivalyaGurav
    @KaivalyaGurav 3 ปีที่แล้ว

    Python is universal language ❤️

    • @davidbombal
      @davidbombal  3 ปีที่แล้ว

      Agreed - it is fantastic

  • @alejandrocarmonaligeon
    @alejandrocarmonaligeon 3 ปีที่แล้ว

    Great video. I liked it a lot!!

  • @faizanashraf1367
    @faizanashraf1367 2 ปีที่แล้ว

    Hey David where to learn python for hacking and networking

  • @amaradave
    @amaradave ปีที่แล้ว

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

  • @m_darkwell
    @m_darkwell 3 ปีที่แล้ว

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

  • @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.

  • @wimnanoe5887
    @wimnanoe5887 3 ปีที่แล้ว

    Thank you again David

  • @rogereales
    @rogereales ปีที่แล้ว

    Great content

  • @edicsonsanchez2641
    @edicsonsanchez2641 3 ปีที่แล้ว

    Espectacular, mis respetos

  • @ChrisVernonBaran
    @ChrisVernonBaran 3 ปีที่แล้ว +2

    Thanks for this sir!

  • @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.

  • @RahulBhakat01
    @RahulBhakat01 3 ปีที่แล้ว

    Thanks Guruji

  • @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.

  • @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.

  • @shubhamkumar-xz9je
    @shubhamkumar-xz9je 3 ปีที่แล้ว

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

  • @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?!

  • @اسامة-س6ش
    @اسامة-س6ش 3 ปีที่แล้ว

    thank you David

  • @Leonidas-mx7lx
    @Leonidas-mx7lx 3 ปีที่แล้ว +1

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

  • @carryminatiarmy7696
    @carryminatiarmy7696 3 ปีที่แล้ว

    Big fan form india

  • @godofsyco4615
    @godofsyco4615 3 ปีที่แล้ว

    Love u
    Its work in termux alsoo

  • @utensilapparatus8692
    @utensilapparatus8692 3 ปีที่แล้ว

    nice and clean

  • @MrTheAlexy
    @MrTheAlexy 3 ปีที่แล้ว

    why everybody keeps saying you should not run telnet as even say having telnet is misconfig? well, let me give you a use case, lets say you have a remote gear without OOB, that is all management connection happens from inband, in case of network bottleneck or outage telnet tolerates drops. You might have already have all the traffic encrypted which mitigates the need of SSH. You might have a local jump host from which you establesh connection, you can restrict your telnet access to one host only.... it really depends on teh design and traffic flow.

  • @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 😊