From 6019bc2bf7a39c2cd50e19030ae8282842e560aa Mon Sep 17 00:00:00 2001 From: Ayushman Date: Fri, 1 Nov 2024 22:05:49 +0530 Subject: [PATCH 1/5] Added python file - NMAP Scanner --- Python/Nmap_Scanner.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Python/Nmap_Scanner.py diff --git a/Python/Nmap_Scanner.py b/Python/Nmap_Scanner.py new file mode 100644 index 000000000..5fbe38216 --- /dev/null +++ b/Python/Nmap_Scanner.py @@ -0,0 +1,16 @@ +import nmap + +nm = nmap.PortScanner() + +# scan a target host for open ports +nm.scan('localhost', arguments='-p 22,80,443') + +# print the state of the ports +for host in nm.all_hosts(): + print('Host : %s (%s)' % (host, nm[host].hostname())) + print('State : %s' % nm[host].state()) + for proto in nm[host].all_protocols(): + print('Protocol : %s' % proto) + ports = nm[host][proto].keys() + for port in ports: + print('port : %s\tstate : %s' % (port, nm[host][proto][port]['state'])) From c120ea91beeb89d0e190b483bedc0d545122dacf Mon Sep 17 00:00:00 2001 From: Ayushman Date: Fri, 1 Nov 2024 22:12:35 +0530 Subject: [PATCH 2/5] Added Python file - Nmap Scanner --- CONTRIBUTING.md | 6 ++++++ Python/Nmap_Scanner.py | 32 ++++++++++++++--------------- profiles/Ayushman Pal.md | 33 ++++++++++++++++++++++++++++++ scripts/hello_world_WannaCry016.py | 1 + 4 files changed, 56 insertions(+), 16 deletions(-) create mode 100644 profiles/Ayushman Pal.md create mode 100644 scripts/hello_world_WannaCry016.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7b0c41a5..27c51b89d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,9 @@ +#### Name: [Ayushman Pal](https://github.com/WannaCry016) + +- Place: Chennai, India +- Bio: Fullstack Developer | Mobile Game Developer | ML/AI Enthusiast +- GitHub: [WannaCry016](https://github.com/WannaCry016) + #### Name: [3mYouOL](https://github.com/3mYouOL) - Place: Iloilo, Philippines diff --git a/Python/Nmap_Scanner.py b/Python/Nmap_Scanner.py index 5fbe38216..430f581d0 100644 --- a/Python/Nmap_Scanner.py +++ b/Python/Nmap_Scanner.py @@ -1,16 +1,16 @@ -import nmap - -nm = nmap.PortScanner() - -# scan a target host for open ports -nm.scan('localhost', arguments='-p 22,80,443') - -# print the state of the ports -for host in nm.all_hosts(): - print('Host : %s (%s)' % (host, nm[host].hostname())) - print('State : %s' % nm[host].state()) - for proto in nm[host].all_protocols(): - print('Protocol : %s' % proto) - ports = nm[host][proto].keys() - for port in ports: - print('port : %s\tstate : %s' % (port, nm[host][proto][port]['state'])) +import nmap + +nm = nmap.PortScanner() + +# scan a target host for open ports +nm.scan('localhost', arguments='-p 22,80,443') + +# print the state of the ports +for host in nm.all_hosts(): + print('Host : %s (%s)' % (host, nm[host].hostname())) + print('State : %s' % nm[host].state()) + for proto in nm[host].all_protocols(): + print('Protocol : %s' % proto) + ports = nm[host][proto].keys() + for port in ports: + print('port : %s\tstate : %s' % (port, nm[host][proto][port]['state'])) diff --git a/profiles/Ayushman Pal.md b/profiles/Ayushman Pal.md new file mode 100644 index 000000000..33c3b77b2 --- /dev/null +++ b/profiles/Ayushman Pal.md @@ -0,0 +1,33 @@ +# Ayushman Pal + +### Location + +Chennai, INDIA + +### Academics + +- Pursuing Btech in Chemical Engineering at Indian Institute of Technology, Madras + +### Interests + +- Learning Enthusiast +- Music +- Python +- HTML/CSS/JS +- DSA (C++) + +### Skills + +- DSA +- Typing(with speed more than 140WPM) +- Java +- Git & GitHub +- Python + +### Projects + +- [Portfolio] https://github.com/WannaCry016 + +### Profile Link + +[Ayushman Pal](https://github.com/WannaCry016) \ No newline at end of file diff --git a/scripts/hello_world_WannaCry016.py b/scripts/hello_world_WannaCry016.py new file mode 100644 index 000000000..8e235769c --- /dev/null +++ b/scripts/hello_world_WannaCry016.py @@ -0,0 +1 @@ +print("Hello World") \ No newline at end of file From 7d18a27825d3df4664476c0cbb88a572074e50f3 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Fri, 1 Nov 2024 22:21:06 +0530 Subject: [PATCH 3/5] Info Stealer a tool to extract browser data, cookies from the victim'ssytem --- PROJECTS/Info-Stealers | 1 + 1 file changed, 1 insertion(+) create mode 160000 PROJECTS/Info-Stealers diff --git a/PROJECTS/Info-Stealers b/PROJECTS/Info-Stealers new file mode 160000 index 000000000..199f7e581 --- /dev/null +++ b/PROJECTS/Info-Stealers @@ -0,0 +1 @@ +Subproject commit 199f7e5811fbcdc68fdd67c441591d29cd0c93ee From 3b054ccf10e91e0c6658bf27b7a64baaad5205c2 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Fri, 1 Nov 2024 22:26:43 +0530 Subject: [PATCH 4/5] Image Scrapper from a website --- .../Readme.md | 6 ++ .../requirements.txt | 1 + .../scrap_img.py | 59 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 PROJECTS/Download_images_from_websites.py/Readme.md create mode 100644 PROJECTS/Download_images_from_websites.py/requirements.txt create mode 100644 PROJECTS/Download_images_from_websites.py/scrap_img.py diff --git a/PROJECTS/Download_images_from_websites.py/Readme.md b/PROJECTS/Download_images_from_websites.py/Readme.md new file mode 100644 index 000000000..9e60dd938 --- /dev/null +++ b/PROJECTS/Download_images_from_websites.py/Readme.md @@ -0,0 +1,6 @@ +# Scrap images from URL + +1. Dowmload Chrome Drive From Chrome. +2. Run scrap-img.py file `py scrap-img.py` +3. `Enter Path : E:\webscraping\chromedriver_win32\chromedriver.exe`
+ `Enter URL : https://dribbble.com/` \ No newline at end of file diff --git a/PROJECTS/Download_images_from_websites.py/requirements.txt b/PROJECTS/Download_images_from_websites.py/requirements.txt new file mode 100644 index 000000000..27bc3be5d --- /dev/null +++ b/PROJECTS/Download_images_from_websites.py/requirements.txt @@ -0,0 +1 @@ +selenium==3.141.0 \ No newline at end of file diff --git a/PROJECTS/Download_images_from_websites.py/scrap_img.py b/PROJECTS/Download_images_from_websites.py/scrap_img.py new file mode 100644 index 000000000..a5d8f11f4 --- /dev/null +++ b/PROJECTS/Download_images_from_websites.py/scrap_img.py @@ -0,0 +1,59 @@ +from selenium import webdriver +import requests as rq +import os +from bs4 import BeautifulSoup +import time + +# path= E:\web scraping\chromedriver_win32\chromedriver.exe +path = input("Enter Path : ") + +url = input("Enter URL : ") + +output = "output" + + +def get_url(path, url): + driver = webdriver.Chrome(executable_path=r"{}".format(path)) + driver.get(url) + print("loading.....") + res = driver.execute_script("return document.documentElement.outerHTML") + + return res + + +def get_img_links(res): + soup = BeautifulSoup(res, "lxml") + imglinks = soup.find_all("img", src=True) + return imglinks + + +def download_img(img_link, index): + try: + extensions = [".jpeg", ".jpg", ".png", ".gif"] + extension = ".jpg" + for exe in extensions: + if img_link.find(exe) > 0: + extension = exe + break + + img_data = rq.get(img_link).content + with open(output + "\\" + str(index + 1) + extension, "wb+") as f: + f.write(img_data) + + f.close() + except Exception: + pass + + +result = get_url(path, url) +time.sleep(60) +img_links = get_img_links(result) +if not os.path.isdir(output): + os.mkdir(output) + +for index, img_link in enumerate(img_links): + img_link = img_link["src"] + print("Downloading...") + if img_link: + download_img(img_link, index) +print("Download Complete!!") \ No newline at end of file From 1599b5d3b81888bf40401c80aac956deca69bf06 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Fri, 1 Nov 2024 22:31:14 +0530 Subject: [PATCH 5/5] Plagarism Checker --- PROJECTS/Plagarism_Checker/Readme.md | 24 +++++++++++++++++++ PROJECTS/Plagarism_Checker/plag.py | 36 ++++++++++++++++++++++++++++ PROJECTS/Plagarism_Checker/text1.txt | 5 ++++ PROJECTS/Plagarism_Checker/text2.tx | 5 ++++ 4 files changed, 70 insertions(+) create mode 100644 PROJECTS/Plagarism_Checker/Readme.md create mode 100644 PROJECTS/Plagarism_Checker/plag.py create mode 100644 PROJECTS/Plagarism_Checker/text1.txt create mode 100644 PROJECTS/Plagarism_Checker/text2.tx diff --git a/PROJECTS/Plagarism_Checker/Readme.md b/PROJECTS/Plagarism_Checker/Readme.md new file mode 100644 index 000000000..7e790723d --- /dev/null +++ b/PROJECTS/Plagarism_Checker/Readme.md @@ -0,0 +1,24 @@ +# Plagarism checker + + + +Python script for checking the amount of similarity between two (or more) text files. + +### Prerequisites + + + +Sklearn module +Installation: + +``` +$ pip install -U scikit-learn +``` + +### How to run the script + + + +``` +$ python plag.py +``` diff --git a/PROJECTS/Plagarism_Checker/plag.py b/PROJECTS/Plagarism_Checker/plag.py new file mode 100644 index 000000000..f4e48a1a5 --- /dev/null +++ b/PROJECTS/Plagarism_Checker/plag.py @@ -0,0 +1,36 @@ +#pip install -U scikit-learn +#Make sure all the .txt files that need to be checked are in the same directory as the script +import os +from sklearn.feature_extraction.text import TfidfVectorizer +from sklearn.metrics.pairwise import cosine_similarity + +user_files = [doc for doc in os.listdir() if doc.endswith('.txt')] +user_notes = [open(_file, encoding='utf-8').read() + for _file in user_files] + + +def vectorize(Text): return TfidfVectorizer().fit_transform(Text).toarray() +def similarity(doc1, doc2): return cosine_similarity([doc1, doc2]) + + +vectors = vectorize(user_notes) +s_vectors = list(zip(user_files, vectors)) +plagiarism_results = set() + + +def check_plagiarism(): + global s_vectors + for student_a, text_vector_a in s_vectors: + new_vectors = s_vectors.copy() + current_index = new_vectors.index((student_a, text_vector_a)) + del new_vectors[current_index] + for student_b, text_vector_b in new_vectors: + sim_score = similarity(text_vector_a, text_vector_b)[0][1] + student_pair = sorted((student_a, student_b)) + score = (student_pair[0], student_pair[1], sim_score) + plagiarism_results.add(score) + return plagiarism_results + + +for data in check_plagiarism(): + print(data) \ No newline at end of file diff --git a/PROJECTS/Plagarism_Checker/text1.txt b/PROJECTS/Plagarism_Checker/text1.txt new file mode 100644 index 000000000..d99a481fd --- /dev/null +++ b/PROJECTS/Plagarism_Checker/text1.txt @@ -0,0 +1,5 @@ +Nature is the endless expanse of life forms, beauty, resources, peace and nourishment. Every bud that grows to a flower, every caterpillar that flies with the wings of a butterfly and every infant who faces the world as a human, owes its survival and sustenance to nature. In addition to providing resources for our daily needs of food, clothing and shelter, nature also contributes to different industries and manufacturing units. Paper, furniture, oil, gemstones, petrol, diesel, the fishing industry, electrical units, etc. all derive their basic components from nature. + +It can be said that nature drives the process of converting everything that is natural on earth into most of the things that are artificial. Nature also maintains the continuity between the different spheres on Earth. Owing to the multiple elements obtained from nature, with a growing population, the need to meet demands is increasing every day. At an equal pace is rising the level of air, water, soil and noise pollution as a result of the universal dependence on technology. + +While it is necessary to keep up with industrialization, it is an urgent need now to restore stability in nature. People are trying to curb the level of pollution and stop the exhaustion of natural resources. However, more awareness and implementation is a must at the individual and community levels. We must always remember it is us who depend on nature for survival and not the other way round. \ No newline at end of file diff --git a/PROJECTS/Plagarism_Checker/text2.tx b/PROJECTS/Plagarism_Checker/text2.tx new file mode 100644 index 000000000..4141f6824 --- /dev/null +++ b/PROJECTS/Plagarism_Checker/text2.tx @@ -0,0 +1,5 @@ +Great lengths of mountains, thriving ecosystems, the ever-spreading sky together with the lithosphere, hydrosphere and atmosphere create a saga called “Nature”. Rich both in terms of its scenic beauty and replenishing resources, nature accounts for supporting life in different shapes and forms on our planet. + +Every member of the living world obtains its life support from nature. Nature guides the cycling of air, water and life between the different constituents or spheres on Earth. The treasures in nature not only provide for our basic requirements of survival but also fuel the raw materials to support factories and industries on which the modern world primarily runs. + +Since the population is increasing at an exponential rate largely in India and many parts of the world, the “use” of resources has now turned to depletion. Adding to this, are the excessive levels of atmospheric and environmental pollution. Industrial wastes, unchecked use of vehicles, illegal cutting of trees, poaching of animals, nuclear power plants and many more are contributing to the disruption of the natural systems and global warming. \ No newline at end of file