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.”

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/