Linux Apache MySQL Php LAMP Server

MySQL

What is MySQL?

MySQL is an open-source relational database management system (RDBMS) that is widely used for managing and organizing data in a structured manner. Developed and maintained by Oracle Corporation, MySQL uses Structured Query Language (SQL) to handle database tasks such as data retrieval, insertion, updating, and deletion.

What It’s Used For

MySQL is versatile and can be used in a variety of contexts:

  1. Web Applications: It’s commonly used in conjunction with PHP and Apache in the LAMP (Linux, Apache, MySQL, PHP/Perl/Python) stack for developing web applications.
  2. Data Storage: It stores data in a tabular format, which is suitable for applications requiring structured data storage, such as CRM systems, e-commerce sites, and content management systems (CMS).
  3. Analytics and Reporting: Businesses use MySQL to store and query large datasets, performing operations like complex joins, aggregations, and reporting.
  4. Application Development: Developers use MySQL for backend databases in applications due to its reliability and performance.
  5. Business Applications: It supports enterprise-level applications and ERP systems by managing large volumes of transactional data.

Institutions That Use MySQL

MySQL is used by a wide range of institutions:

  1. Tech Companies: Many tech giants and startups use MySQL, including Facebook, Twitter, and Google, for various internal systems and services.
  2. Educational Institutions: Universities and research organizations use MySQL for managing research data, student records, and educational content.
  3. Financial Institutions: Banks and financial services use MySQL for transactional data, customer management, and compliance-related applications.
  4. Government Agencies: Government departments use MySQL for managing public records, administrative data, and service delivery systems.
  5. Healthcare: Hospitals and clinics use MySQL for patient records, appointment scheduling, and medical data management.

Security and Vulnerabilities

Security:

  1. Access Control: MySQL supports user authentication and permissions, allowing administrators to control who can access or modify data.
  2. Encryption: It offers data-at-rest and data-in-transit encryption options to protect sensitive information.
  3. Audit Logging: It can log queries and changes to monitor and detect suspicious activity.
  4. Security Updates: Regular updates and patches are released to address security vulnerabilities.

Vulnerabilities:

  1. SQL Injection: Like other SQL-based systems, MySQL can be vulnerable to SQL injection attacks if applications do not properly sanitize user input.
  2. Misconfigurations: Incorrectly configured MySQL installations can lead to security issues, such as unauthorized data access.
  3. Outdated Versions: Running outdated versions without the latest security patches can expose the database to known vulnerabilities.
  4. Backup Security: If not properly secured, backup files can be a target for data breaches.

Resources

Here are some useful resources for learning more about MySQL:

  1. MySQL Official Website – The main site for downloads, documentation, and product information.
  2. MySQL Documentation – Comprehensive documentation covering installation, configuration, and usage.
  3. MySQL Tutorial – A resource for learning MySQL through tutorials and examples.
  4. MySQL Forums – A place to ask questions and engage with the MySQL community.
  5. MySQL Security Best Practices – Guidelines and recommendations for securing MySQL installations.

This overview should give you a solid understanding of MySQL, its uses, and its security aspects.

Coding Web Development Security Software Scripting Applications

Kandi PHP Web Crawler

The “Kandi 1.0 PHP Web Crawler” script is a versatile tool for web scraping, SEO analysis, and content management. It leverages PHP’s capabilities to automate the crawling process, analyze web structures, and report results. By integrating with various web technologies and tools, it supports a range of applications from SEO audits to server performance monitoring, making it a valuable asset for Full Stack Web Developers and Software Engineers.

Applications

The “Kandi 1.0 PHP Web Crawler” script is a robust web scraping tool designed to automate the extraction of links from a specified website. Leveraging PHP code and a range of web technologies, it provides valuable insights into website structures, helps monitor page loading times, and can be integrated into broader SEO and web development workflows.

Applications in Web Development and Engineering

  1. Web Scraping and Crawling:
    • Web Scraper: This script functions as a web scraper, systematically navigating a website to collect data such as internal and external links.
    • Bot Creation: Automate the collection of web data, useful for bots that interact with web pages or aggregate information.
  2. Search Engine Optimization (SEO):
    • Page Ranking and Rating: Analyze and improve SEO strategies by understanding the structure and link distribution within a website.
    • SEO Audit: Use the crawler to perform SEO audits by identifying broken links and analyzing internal link structures.
  3. Content Management Systems (CMS) and WordPress:
    • CMS Integration: Integrate the crawler with CMS platforms to automatically generate sitemaps or monitor content updates.
    • WordPress: Extract data from WordPress sites to analyze link structures or verify internal linking practices.
  4. Security and Vulnerability Assessment:
    • Security Monitoring: Identify potential vulnerabilities in link structures or page access, aiding in the assessment of web security.
    • Vulns and Vulnerabilities: Automate the discovery of security issues related to page accessibility or link integrity.
  5. Web Design and Development:
    • HTML and CSS: Analyze how links are structured within HTML and styled with CSS, ensuring consistent design practices across pages.
    • Page Loading: Monitor page loading times for performance optimization, a critical aspect of web development.
  6. Server and Database Management:
    • LAMP Server: Utilize the script on LAMP (Linux, Apache, MySQL, PHP) servers to integrate with other server-side processes and data management tasks.
    • MySQL: Extract URLs and store them in a MySQL database for further analysis or reporting.

How It Functions

Initialization and Setup

  • Form Handling:
    • User Input: Accepts a URL from the user through a form, validating the input to ensure it’s a proper URL format.
  • Timing:
    • Performance Metrics: Records the start and end times of the crawling process to calculate and display the elapsed time, providing insights into the crawler’s performance.

Crawling Process

  • Queue Management:
    • URL Queue: Manages a queue of URLs to visit, starting with the user-provided URL and expanding to include discovered links.
    • Visited URLs: Keeps track of URLs already processed to avoid duplicate crawling and ensure efficient execution.
  • HTML Content Retrieval:
    • cURL: Uses PHP’s cURL functions to fetch HTML content from each URL, handling errors and HTTP response codes to ensure valid data retrieval.
  • Link Extraction:
    • DOM Parsing: Utilizes PHP’s DOMDocument and DOMXPath classes to parse HTML and extract hyperlinks.
    • URL Resolution: Converts relative URLs to absolute URLs, maintaining consistency in link handling.
  • Depth Limitation:
    • Crawl Depth: Restricts the depth of crawling to prevent excessive or unintended traversal of the website, which can impact server performance.

Results and Reporting

  • Results Compilation:
    • Page Count: Counts the total number of unique pages crawled, providing a quantitative measure of the crawl’s scope.
    • Elapsed Time: Calculates the total time taken for the crawl, giving a performance metric for efficiency.
  • Display:
    • Web Interface: Outputs results to a web page, displaying crawled URLs, any encountered errors, and a summary of the crawl, including page count and elapsed time.

Technical Integration and Considerations

  1. Bash Scripting and Shell:
    • While not directly part of this script, bash scripting can be used in conjunction with the crawler for tasks such as scheduling crawls or processing results.
  2. Page Loading and Monitoring:
    • Page Loading: Assess the time taken to load pages, which can be crucial for performance optimization and user experience.
  3. Security:
    • Error Handling: Implements error handling to manage potential security issues during data retrieval, ensuring robust operation.
  4. CSS and HTML:
    • Style and Design: Ensures that crawled links and results are presented in a clear and styled format using CSS, enhancing the usability of the results.
  5. Netcat and Server Interactions:
    • Server Interactions: While netcat is not used here, understanding server interactions and monitoring are important for integrating this script into broader server management tasks.

Download: Kandi_1.0.zip (47.58kb)

Coding Web Development Security Software Scripting Applications

Simple Visitor Logger 2.0

Simple Visitor Logger 2.0

A simple and easy to use php Visitor Logger that saves log files in an easy to work with file and directory structure. You can customize every aspect of the logger and it adds the new Google Maps link to the Visitor Geo-Location Information. I also activated the Referring URL for this Public Version as well.

This is a Public Demo and Not Available For Download.
If you’re interested in a copy, find me.

Coding, Security & Web Development

Senya 2.0 MySQL Database Editor

Senya – MySQL Database Editor

Sleek and easy to use MySQL Database Editor.
Enter Server Configuration Manually Or Automatically From File.

By: K0NxT3D
Version: 2.0.1
URL: http://www.seaverns.com/senya/
File: Senya_2.0.zip
Senya 2.0 Files:
index.php – Main Page
display_table.php – Display MySQL Tables
update.php – Update MySQL Tables
style.css – Default Style
saved_hosts.txt – Example Autoload Configuration File

K0NxT3D

Senya 1.0 Cross Domain WordPress Data Mining Utility

Сеня 1.0 (Senya 1.0)

Senya 1.0 Cross Domain WordPress Data Mining Utility

Сеня 1.0 – K0NxT3D 2024
Back End WordPress Utility

Features:

  • Edit WordPress Database.
  • Edit WordPress User Tables.
  • Edit WordPress User Information.
  • Display WordPress Domain and Associated Admin Email Addresses Across Multiple Domains.

A simple and easy to use PHP/HTML Based MySQL Back End Connection Utility with Editing Capabilities and Email Harvesting across Multiple Domains.

Download

Facebook Data Centers Project

I collect a lot of data and data mining is just one of those things that I enjoy.
I build Web Crawlers and Web Scrapers often, but I really love tracking other
bots, some of which I’ve “known” for decades now.

With the ever expanding Facebook Empire, I’ve been catching a lot of the
hits from FacebookExternalHit,
[ facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php) ]
and while Facebook it’self is being overrun by nefarious bots and hacked accounts,
their problem is my solution.

The majority of the hits from FacebookExternalHit have preceded an attack, which tells me several things.
1: Facebook For Developers has given nefarious actors an edge on the Facebook user and I won’t go into detail on that, but I can make better informed security decisions based on what can be done from that side of the platform.

2: I can test my security software on both Facebook and my websites by simply posting a link to Facebook and this is really handy in my line of work. I get to see which Data Center the bot is coming from (GeoLocation), how many bots that particular Data Center has (Interesting Data There) and how fast the reaction time is, which helps determine the software being used and in which manner it’s being used.

3: Most Importantly, it gives me reasons to build new software.

So, I built this database for such purpose as to collect more data on the situation and there’s some interesting patterns developing. While it’s not exactly something I feel the urge to release, it’s worth sharing.

FBDC uses Php and MySQL, a pretty simple database and small file sizes (I like small files).
The User Input Form Works.. Ikr, a form that works??
It has a few things left to work out on the user input; I’m a big fan of getting my hands dirty,
so Updating the Data Center / BotInfo is being done via phpmyadmin until I build a better form.
Here’s a few screenshots:

FBDC - Facebook Data Centers and FacebookExternalHit Bot Collected Data

FBDC – Facebook Data Centers and FacebookExternalHit Bot Collected Data – Main Menu

 

FBDC - Facebook Data Centers and FacebookExternalHit Bot Collected Data

FBDC – Facebook Data Centers and FacebookExternalHit Bot Collected Data – Data Center List

 

FBDC - Facebook Data Centers and FacebookExternalHit Bot Collected Data

FBDC – Facebook Data Centers and FacebookExternalHit Bot Collected Data – BotInfo List

 

FBDC - Facebook Data Centers and FacebookExternalHit Bot Collected Data

FBDC – Facebook Data Centers and FacebookExternalHit Bot Collected Data – User Input Form

 

FBDC - Facebook Data Centers and FacebookExternalHit Bot Collected Data

FBDC – Facebook Data Centers and FacebookExternalHit Bot Collected Data – Because There HAS to be a Hacker Theme too.

Cybercriminals Weaponizing Open-Source SSH-Snake Tool for Network Attacks

SSH-Snake, a self-modifying worm that leverages SSH credentials.

Original Article : The Hacker News

A recently open-sourced network mapping tool called SSH-Snake has been repurposed by threat actors to conduct malicious activities.

“SSH-Snake is a self-modifying worm that leverages SSH credentials discovered on a compromised system to start spreading itself throughout the network,” Sysdig researcher Miguel Hernández said.

“The worm automatically searches through known credential locations and shell history files to determine its next move.”

SSH-Snake was first released on GitHub in early January 2024, and is described by its developer as a “powerful tool” to carry out automatic network traversal using SSH private keys discovered on systems.

In doing so, it creates a comprehensive map of a network and its dependencies, helping determine the extent to which a network can be compromised using SSH and SSH private keys starting from a particular host. It also supports resolution of domains which have multiple IPv4 addresses.

“It’s completely self-replicating and self-propagating – and completely fileless,” according to the project’s description. “In many ways, SSH-Snake is actually a worm: It replicates itself and spreads itself from one system to another as far as it can.”

BotNet CNC Control Hacker Inflitration Exploits Vulnerabilities SSH TCP Bots Hardware Software Exploited

BotNet CNC Control Hacker Infiltrates & Exploits Vulnerabilities Vie SSH TCP Both Hardware Software Exploited

Sysdig said the shell script not only facilitates lateral movement, but also provides additional stealth and flexibility than other typical SSH worms.

The cloud security company said it observed threat actors deploying SSH-Snake in real-world attacks to harvest credentials, the IP addresses of the targets, and the bash command history following the discovery of a command-and-control (C2) server hosting the data.

How Does It Work?

These attacks involve active exploitation of known security vulnerabilities in Apache ActiveMQ and Atlassian Confluence instances in order to gain initial access and deploy SSH-Snake.
“The usage of SSH keys is a recommended practice that SSH-Snake tries to take advantage of in order to spread,” Hernández said. “It is smarter and more reliable which will allow threat actors to reach farther into a network once they gain a foothold.”

When reached for comment, Joshua Rogers, the developer of SSH-Snake, told The Hacker News that the tool offers legitimate system owners a way to identify weaknesses in their infrastructure before attackers do, urging companies to use SSH-Snake to “discover the attack paths that exist – and fix them.”

“It seems to be commonly believed that cyber terrorism ‘just happens’ all of a sudden to systems, which solely requires a reactive approach to security,” Rogers said. “Instead, in my experience, systems should be designed and maintained with comprehensive security measures.”

Netcat file transfer chat utility send receive files

Netcat file transfer chat utility. Easily Send & Receive Files Local & Remote.

“If a cyber terrorist is able to run SSH-Snake on your infrastructure and access thousands of servers, focus should be put on the people that are in charge of the infrastructure, with a goal of revitalizing the infrastructure such that the compromise of a single host can’t be replicated across thousands of others.”

Rogers also called attention to the “negligent operations” by companies that design and implement insecure infrastructure, which can be easily taken over by a simple shell script.

“If systems were designed and maintained in a sane manner and system owners/companies actually cared about security, the fallout from such a script being executed would be minimized – as well as if the actions taken by SSH-Snake were manually performed by an attacker,” Rogers added.

“Instead of reading privacy policies and performing data entry, security teams of companies worried about this type of script taking over their entire infrastructure should be performing total re-architecture of their systems by trained security specialists – not those that created the architecture in the first place.”

The disclosure comes as Aqua uncovered a new botnet campaign named Lucifer that exploits misconfigurations and existing flaws in Apache Hadoop and Apache Druid to corral them into a network for mining cryptocurrency and staging distributed denial-of-service (DDoS) attacks.

The hybrid cryptojacking malware was first documented by Palo Alto Networks Unit 42 in June 2020, calling attention to its ability to exploit known security flaws to compromise Windows endpoints.
As many as 3,000 distinct attacks aimed at the Apache big data stack have been detected over the past month, the cloud security firm said. This also comprises those that single out susceptible Apache Flink instances to deploy miners and rootkits.

“The attacker implements the attack by exploiting existing misconfigurations and vulnerabilities in those services,” security researcher Nitzan Yaakov said.

Apache Vulnerability Update Available!

Apache Vulnerability Update Available!

“Apache open-source solutions are widely used by many users and contributors. Attackers may view this extensive use as an opportunity to have inexhaustible resources for implementing their attacks on them.”

Russian Hackers Have Infiltrated U.S. Household and Small Business Routers

Hacker News:
Russian Hackers Have Infiltrated U.S. Household and Small Business Routers, FBI Warns
Original Article: MSN News

The FBI has recently thwarted a large-scale cyberattack orchestrated by Russian operatives, targeting hundreds of routers in home offices and small businesses, including those in the United States.

These compromised routers were used to form “botnets”, which were then employed in cyber operations worldwide.

The United States Department of Justice has attributed this cyberattack to the Russian GRU Military Unit 26165. Countermeasures undertaken by authorities ensured that the GRU operators were expelled from the routers and denied further access, ABC News reported.

The GRU deployed a specialized malware called “Moobot,” associated with a known criminal group, to seize control of susceptible home and small office routers, converting them into “botnets” — a network of remotely controlled systems.

The Justice Department, in an official statement, explained, “Non-GRU cybercriminals installed the Moobot malware on Ubiquiti Edge OS routers that still used publicly known default administrator passwords. GRU hackers then used the Moobot malware to install their own bespoke scripts and files that repurposed the botnet, turning it into a global cyber espionage platform.”

Utilizing this botnet, Russian hackers engaged in various illicit activities, including extensive “spearphishing” campaigns and credential harvesting campaigns against targets of intelligence interest to the Russian government, such as governmental, military, security and corporate entities in the United States and abroad.

Botnets pose a significant challenge for intelligence agencies, hindering their ability to detect foreign intrusions into their computer networks, Reuters notes.

In January 2024, the FBI executed a court-approved operation dubbed “Operation Dying Ember” to disrupt the hacking campaign. According to the Department of Justice, the FBI employed malware to copy and erase the malicious data from the routers, restoring full access to the owners while preventing further unauthorized access by GRU hackers.

FEDOR was designed as an android able to replace humans in high-risk areas, such as rescue operations,” Andrey Grigoriev, director of Russia's Advanced Research Fund, said.

FEDOR was designed as an android able to replace humans in high-risk areas, such as rescue operations,” Andrey Grigoriev, director of Russia’s Advanced Research Fund, said.

Seaverns Web Development Coding Security Applications and Software Development Bex Severus Galleries Digital Art & Photography

Quick Nmap – Host Scanning With Nmap Made Easy

Quick Nmap Scanning Utility Framework

This script provides a basic framework for a quick and easy Nmap scanning utility. Designed for rapid security checkups, it leverages the Zenity tool to create a graphical user interface (GUI) that simplifies the process of running common Nmap scans. This script does not require sudo privileges, making it suitable for environments where elevated permissions are restricted. However, it does have a minor bug that affects user interaction with the script descriptions.

  • Options Array: Defines a list of common Nmap scan options, each associated with a descriptive label.
  • Zenity Dialogs:
    • The zenity --list command presents a GUI list for selecting Nmap options.
    • The zenity --entry command prompts the user to input a URL.
  • Command Execution:
    • Constructs the full Nmap command using the selected options and entered URL.
    • Uses eval to execute the constructed Nmap command.
    • Displays the command being executed using another Zenity dialog.

The Code:


#!/bin/bash
# Quick Nmap - K0NxT3D
# Here's The Framework For A Project I Put
# Together For Quick Response Security Checkups.
# BUGS: Clicking The Description Will Process As Command.
# Click The Actual Command In This Example & Then The URL.

# Function to display error message and exit
    show_error() {
    zenity --error --text="$1" --title="Error"
    exit 1
}

# Function to display Nmap options list and prompt for URL
    get_nmap_options() {
# List of Nmap options
    options=(
    "[Ping Remote Host]" " -p 22,113,139" \
    "[Quick scan]" " -F" \
    "[Intense scan, all TCP ports]" " -p 1-65535 -T4 -A -v" \
    "[Scan all TCP ports (SYN scan)]" " -p- -sS -T4 -A -v" \
    "[Scan UDP ports]" " -sU -p 1-65535" \
    "[Full Scan, OS Detection, Version]" " -A" \
    "[Scan All Ports On Host]" " -sT -n -p-" \
    "[Scan with default NSE Scripts]:" " -sC" \
    "[TCP SYN port scan]" " -sS" \
    "[UDP Port Scan]" " -sU" \
    "[Scan For HTTP Vulnerabilities]" " -Pn -sV -p80 --script=vulners" \
    "[Nmap Help]" " -h")

# Display list of options and prompt for selection
    selected_option=$(zenity --list --title="Quick Nmap - K0NxT3D" --column="Options" "${options[@]}" --height 500 --width 500 --text="Select Options:")
        [ -z "$selected_option" ] && show_error "No Option Selected."

# Prompt for URL
    url=$(zenity --entry --title="Enter URL" --text="Enter URL To Scan:")
        [ -z "$url" ] && show_error "URL Not Provided."

# Execute Nmap command
    nmap_command="nmap $selected_option $url"
    echo "Executing Command: $nmap_command"
    zenity --info --text="Executing Nmap command:\n$nmap_command"
    eval "$nmap_command"
}

# Display GUI for Nmap options and URL input
get_nmap_options

Bug Description

  • Description Bug: The script’s current implementation has a bug where clicking on a description in the Zenity list triggers an attempt to run the description as a command first. This results in an error message being displayed before the actual Nmap command is executed. While this does not significantly affect the performance or functionality of the script, it is noted as a minor inconvenience.

Advanced Usage

  • Enhanced Functionality: Users who are familiar with Nmap can modify and extend this framework to include additional scanning options or integrate more advanced features.
  • Proxy and Anonymity: The script is compatible with tools like torsocks and proxychains for executing Nmap scans through proxies, enhancing privacy and bypassing geographical restrictions.

This script serves as a convenient starting point for running common Nmap scans with a user-friendly interface, while also allowing for customization and enhancement based on individual needs.

Seaverns Web Development Coding Security Applications and Software Development Bex Severus Galleries Digital Art & Photography

Apache Security Update Jammy Apache2 Php Linux Ubuntu/Raspberry Pi x64 | x32 RPI 3 – 4

Apache Security Update Jammy Apache2 Php Linux Ubuntu/Raspberry Pi x64 | x32 RPI 3 – 4

I certainly get a lot of attacks and nothing is ever really “Secure”.
That being said, there are some serious vulnerabilities running around, you might want to do some updating to your Apache Servers and Php.
After a recent batch of installs, I was able to exploit both Apache2 and Php pretty easily, so this will be common.

To test for the recent list of vulnerabilities and open exploits on Your Own Machines, you can run:

nmap -Pn -sV -p80 --script=vulners -oN output.txt 127.0.0.1

If you’re running several hosts:
nmap -Pn -sV -p80 –script=vulners -oN output.txt 192.168.1.0/24
This will scan your local network for any vulnerable hosts and sure enough, the new upgrades had some issues.

The Fix:

Linux Ubuntu (x64):

sudo add-apt-repository ppa:ondrej/apache2
sudo add-apt-repository ppa:ondrej/php

sudo apt update -y
sudo apt upgrade -y

This will work in just about every case – Except with the RPI3 Series.
This one’s a little longer, but it works and you can thank me later.

RPI 3B+ (x32/Jammy)

sudo apt-get install software-properties-common

Just In Case..

Apply Fix:

curl https://packages.sury.org/php/apt.gpg | sudo tee /usr/share/keyrings/suryphp-archive-keyring.gpg >/dev/null

echo "deb [signed-by=/usr/share/keyrings/suryphp-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/sury-php.list

curl https://packages.sury.org/apache2/apt.gpg | sudo tee /usr/share/keyrings/suryapache2-archive-keyring.gpg >/dev/null

echo "deb [signed-by=/usr/share/keyrings/suryapache2-archive-keyring.gpg] https://packages.sury.org/apache2/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/sury-apache2.list

sudo apt update -y
sudo apt upgrade -y

sudo systemctl restart apache2

Resources:
Sury.ORG (Highly Recommended)
https://sury.org/

NMap: (Do You Even Web?)
https://nmap.org/