banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

Shocking Python Automation Scripts You Must Try (3)

  1. The AutoImage downloader is a key challenge in collecting image data for computer vision projects. As Andrew Ng said, if you can collect a large dataset, then the algorithm doesn't matter. Data plays a crucial role in improving model performance and accuracy.
# Import the required modules and functions
from simple_image_download import simple_image_download as simp

# Create a response object for handling image downloads
response = simp.simple_image_download

# Set the keyword
keyword = "Dog"  # Specify the keyword for downloading images as "Dog"

# Download images
try:
    response().download(keyword, 20)  # Call the download method, trying to download 20 images with the keyword "Dog"
    print("Images downloaded successfully.")  # If the download is successful, output a success message
except Exception as e:
    print("An error occurred:", e)  # If an exception occurs during the download process, output the error message

image

  1. Port Scanner Let's talk about network security!
    In computer networks, a port is a communication endpoint that allows different processes or services to connect and exchange data over the network. Ports are identified by numbers and are associated with specific protocols.
# Import the socket library for network connections
import socket
# Import the PrettyTable library for generating tables to make the output more readable
from prettytable import PrettyTable

# Define a dictionary containing common ports and their potential security vulnerabilities
vulnerabilities = {
    80: "HTTP (Hypertext Transfer Protocol) - for unencrypted web traffic",
    443: "HTTPS (Secure HTTP) - for encrypted web traffic",
    22: "SSH (Secure Shell) - for secure remote access",
    21: "FTP (File Transfer Protocol) - for file transfers",
    25: "SMTP (Simple Mail Transfer Protocol) - for email transmission",
    23: "Telnet - for remote terminal access",
    53: "DNS (Domain Name System) - for domain name resolution",
    110: "POP3 (Post Office Protocol version 3) - for email retrieval",
    143: "IMAP (Internet Message Access Protocol) - for email retrieval",
    3306: "MySQL - for MySQL database access",
    3389: "RDP (Remote Desktop Protocol) - for remote desktop connections on Windows",
    8080: "HTTP alternate port - commonly used as a secondary port for HTTP",
    8000: "HTTP alternate port - commonly used as a secondary port for HTTP",
    8443: "HTTPS alternate port - commonly used as a secondary port for HTTPS",
    5900: "VNC (Virtual Network Computing) - for remote desktop access",
    # More ports and their security vulnerabilities can be added as needed
}

# Define a function to display open ports and their potential security issues
def display_table(open_ports):
    table = PrettyTable(["Open Port", "Potential Security Issues"])
    for port in open_ports:
        vulnerability = vulnerabilities.get(port, "This port has no known vulnerabilities associated with common services")
        table.add_row([port, vulnerability])
    print(table)

# Define a function to scan common ports on the target host
def scan_top_ports(target):
    open_ports = []  # List to store open ports
    top_ports = [21, 22, 23, 25, 53, 80, 110, 143, 443, 3306, 3389, 5900, 8000, 8080, 8443]  # Define 15 common ports
    for port in top_ports:
        try:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.settimeout(1)  # Set connection timeout
            result = sock.connect_ex((target, port))
            if result == 0:
                open_ports.append(port)
            sock.close()
        except KeyboardInterrupt:
            sys.exit()
        except socket.error:
            pass
    return open_ports

# Main function
def main():
    target = input("Please enter the URL or IP address of the website to scan: ")
    open_ports = scan_top_ports(target)
    if not open_ports:
        print("The target host has no open ports.")
    else:
        print("Open ports and their related potential security issues:")
        display_table(open_ports)

# If this script is run directly
if __name__ == "__main__":
    main()

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.