Python Port Scanner Open To Closed In Hindi

Python Port Scanner Open To Closed In Hindi

Python Hacking

Python Port Scanner Open To Closed In Hindi:- ” Coding an Advanced Port Scanner  Aaj Ham Is Post Mai Sikhne Wale Hai Python Port Open To Closed Scanner Kaise create Kare Wo Bhi Step By Step And Ham Isme Kali Linux Inbuilt Commends Bhi Dekhne Wale Hai |

Hamne Previous Post Ye Dikha Tha Ki Particular Port Open Hai Ya Closed Agar Aapne Previous Post Ko Nhi Dekha Hai To Pahle Us Post Ko Jarur Dekhe |

Python Port Scanner In Hindi

Important Notice:- Friends Ye Python Hacking Course Keval Education Purpose ke Liye Hai Or Iska Istemal keval Education Ke liye hi Kare Naki kisi ko Nuksan Pauchane Ke Liye Agar Aap Kuch Wrong Karte Hai To Aap Hi Jimmedar Honge |

Python Port Scanner Open To Closed In Hindi

Friends Ham Aaj Is Post Mai Ye Learn Karne Wale Hai ki Kisi Bhi Computer Ya Website Ka Port Open Hai Ya Nhi |

What is Port Scanning? Port Scanning Kiya Hai

Port Scanning Ka Istemal Target Ke Open Ports Ke Bare Mai Pata Lagana Hota Hai Sath Hi Yeh Bhi Pata Kiya Jata Hai Ki Target Computer Par Kis Type Ki Services Run Ho Rahi Hai | Jaise Kisi Hacker Ka Target Computer Hai Tab Port Scanning Ki Help Se Hacker Targeted Computer Mai Open Ports And Chal Rahi Services Ke Bare Mai Information Collect Karta Hai Or Iska Istemal System Hack Karne Ke Liye Kiya Jata Hai |

Step 1:- Open Kali Linux

Sabse Pahle Aapko Kali Linux Open Karna Padega | Agar Aapne Abhi Tak Kali Linux ko Virtual Mai Install Nhi Kiya Hai To Mere Previous Post Ko Read Kar Sakte Hai Kali Linux Ko Virtual Box Mai Install Kar Sakte Hai |

Kali Linux Ko Open Karne Ke Bad Aapke Terminal Emulator Ko Open Karna Padega Uske Liye Aapko Keval Terminal Par Click Karna Hai |

Aap Upper Diye Gaye Image Ko Dekh Sakte Hai Hamne Terminal Ko Open Kar Liya Hai |

Step 2:- Coding an Advanced Port Scanner

Ab Ham Python Ki Help Se Advanced Port Scanner Create Karne Wale Hai | Ab Tak Hamne Jo Bhi Dekha Hai Wo Isliye Dekha Hai Taki Hamko Understand Karne Mai Koi Bhi Dikkat Na Ho Isliye Ham Ab Port Scanner Ke Liye Coding Kar Rahe Hai |

Ab Aapko Python File Create Karne ke Liye nano advancescanner.py likh kar enter press karna hai | Jaise ki Maine upper Diye Gaye Image Mai Dikhaya hai |

Aap Upper Dekh Sakte Hai Hamne 3 file ko Import kiya hai inke bare niche bataya gaya hai |

  • socket:- Socket Keval Ek Abstraction Hota Hai | Jo 2 Computers Ke Bich Ke Connection ke terminal ko Represent Karta Hai | Ye TCP/IP Network Mai Ek Connection Point Ko Represent Karta Hai |
  • optparse:- optparse ko ham isliye istemal Karte hai taki command-line ko parsing Kar sakte hai |Yani Ke Kisi Bhi Big Name Ko Short Name Mai Convert Kar Sake |
  • Threading:- Python Threading ka Meaning Hai Ki Ek Cost-Effective Tarike Se Ek Behtar Program Ka Nirman Kiya Jaye Jisme Ki Program se Tuta Har Ek Thread Ka Ek Particular Work Karne Mai Understand Ho |

Aap Upper Image Ko Dekh Sakte Hai Hamne connScan Se Ek function ko Create Kiya hai Jo Host And Port ko Arrugment Ke Rup Mai Leta Hai |

connScan Function Ke Bad Ab Aapko portScan Function Create Karna Hai Jaise Maine Upper Di Gayi Image Mai Dikhaya Gaya Hai |

portScan Function Host Ka Name Leta Hai Or Fir Use Scan Karta Hai Scan Karne Ke Bad Host Address Provide Bhi Karta Hai |

Aap Dekh Sakte Hai Hamne Main() Function Bhi Create Kar Liya Hai Joki Hamne Isme Threading Add Kiya Hai Matlab Ki -H Means Host And -p Means Port Ko Define Kiya Hai Aap Upper Dekh Sakte Hai Program ko |

Ab Tak Jo Bhi Hamne Coding Ki Hai Wo Alag Alag Function Ko Create Karne Ke Liye Ki Hai Or Un Function Ko Understand Karne ke Liye Ki Hai |

Advancescanner.py Full Coding

#!/usr/bin/python

from socket import *
import optparse
from threading import *

def connScan(tgHost , tgtPort):
	try:
		sock = socket(AF_INET , SOCK_STREAM)
		sock.connect((tgtHost,tgtPort))
		print(f"[+]{tgtPort} tcp Open")
	except:
		print(f"[-]{tgtPort} tcp Closed")
	finally:
		sock.close()

def portScan(tgtHost , tgtPorts):
	try:
		tgtIP = gethostbyname(tgtHost)
	except:
		print("Unknown Host {tgtHost}")
	try:
		tgtName = gethostbyaddr(tgtIP)
		print(f"[+] Scan Results For :{tgtName[0]}")
	except:
		print(f"[-] Scan Results For : {tgtIP}")
	setdefaulttimeout(1)
	for tgtPort in tgtPorts:
		t = Thread(target=connScan , args=(tgtHost , int(tgtPort)))
		t.start()


def main():
	parser = optparse.OptionParser('Usage of Program : ' + ' -H <target host> -p <target port>')
	parser.add_option('-H', dest = 'tgtHost' , type='string', help='specify target Host')
	parser.add_option('-p', dest = 'tgtPort' , type='string', help='specify target ports seperated by comma')
	(options,args) = parser.parse_args()
	tgtHost = options.tgtHost
	tgtPorts = str(options.tgtPort).split(',')
	if (tgtHost == None) | (tgtPorts[0]==None):
		print(parser.usage)
		exit(0)
	portScan(tgtHost,tgtPorts)

if __name__== '__main__':
	main()

Ab Aapko Is File Ko Save Karna Hai Joki Aapko CTRL + O Press Karna Hai And Uske Bad Aapko Enter Press Karna Hai And Enter Press Karne Ke Bad Aapko Program se Bahar Nikal Ne Ke Liye CTRL + X Press Karna Hai |

Program Se Bahar Aane Ke Bad Aapko python3 advacescanner.py Likh Kar Enter Press Karna Hai or check Karna Hai Koi Error To Nhi Hai |

Aap Upper Image Ko Dekh Sakte Hai Jab Maine Program Ko Run Kiya To -H Yani Host And -p Yani Port Number Enter Karne ke Liye Kah Rha Hai | Ab Mai Is Program Ko Test Kart Karte Hai Wo Bhi Kisi Website par |

Finishing And Testing Our Scanner

Ab Aapko Program Ko Test Karne ke Liye Kisi Bhi Computer Ya Website Ka IP Add Address And Check Karne Ke Liye Ip Address Chahiye | Agar Aapko Nhi Pata Hai To Aap Meri Previous Post Dekh Sakte Hai |

First Ham Check Karte Hai Aapne Computer Par

Aap Upper Dekh Sakte Hai Maine Pahle To python3 advancescanner.py – H IP_Address -p Port_Number Enter Kiya Hai Jo Ki Output Bhi Aap Dekh Sakte Hai Yani ki Mere Sare Jo Port Number Hai Wo Closed Hai |

Second Ham Check Karte Hai Aapni Ya Kisi Ki Bhi Website Par

Aap Upper Dekh Sakte Hai Maine Pahle To python3 advancescanner.py – H masterprograming.com -p 135 Enter Kiya Hai Jo Ki Output Bhi Aap Dekh Sakte Hai Yani ki 135 Port Number Closed Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *