Skip to main content

A simple DSL for S-Clustr

Project description

S-Clustr (Shadow Cluster) Simple

Python-3.9 Hacker_tool S-H4CK13 APT IOT OT IT Botnet Siemens-PLC

Game Air Battle

This is a game plugin that maps the game visuals to real-world lighting, allowing for malicious control to complete the game.

Start the game server:

$ python3 game.py

alt text

Start the floor simulation client (if you are connecting to real devices, it must be a 5-column by 6-row building), input and connect to the shadow cluster server.

alt text

$ python3 scctest.py

alt text

Start the shadow cluster client and connect to the game server:

python3 S-Clustr_Client.py
set rhost 192.168.0.109
set key 038c97dac0397d783c078df6b6b07efb
game 192.168.0.104 10011

alt text

After successfully connecting to the game server, the device will synchronize your game visuals in real time...
Perhaps playing this game on a displayed building would be even more fun...

Pseudo-compiler

alt text

1. Write the pseudocode into the input box and compile it; a clustr package will be generated in the ./sccopt directory.

2. Start the S-Clustr client and use the load command to execute the automation package. Example: load <key> <Path>

Description
Type Controlled Device Wired Wireless 4G Security Encryption Protocol
Embedded Arduino × × TCP/IP
Embedded Ai-Thinker AIR780E × × × TCP/IP
Embedded ESP8266 × × × TCP/IP
Embedded AT89C51 × × × TCP/IP
Embedded STM32[103fc6t6] × × × TCP/IP
PLC SIEMENS S7-1200 × × TCP/IP
PLC SIEMENS S7-200 × × TCP/IP
Controlled PC Platform Protocol Security Encryption
Windows TCP/IP Optional
Linux TCP/IP Optional
Mac OS TCP/IP Optional
Server Files Description
S-Clustr_Server Server
S-Clustr_Client Attacker Client
DebugDevice Simulates embedded device connecting to server
Generate One-click generation of embedded device programs
Testpc Windows host connecting to server
blacklist.conf Blacklist, marks IP groups that are prohibited from connecting
Server.conf Configuration parameters for the server
Version.conf Version information
Linux_Installer.sh Linux environment dependency installer
Windows_Installer.bat Windows environment dependency installer
Parameter_Description-EN.xls [English] Description of parameters in Server.conf
Parameter_Description-ZH.xls [Chinese] Description of parameters in Server.conf

S-Clustr Embedded Device Side

Arduino

Wired LAN Control

Prepare Materials

  1. Arduino UNO

Arduino UNO

  1. ENC28J60

ENC28J60

  1. 1-channel Relay Module 5V

Relay Module

  1. Dupont Wires

Dupont Wires

Wiring Diagram

Wiring Diagram

Wiring Diagram

4G Wireless Public Network Control

Prepare Materials

  1. Arduino UNO

Arduino UNO

  1. SIM900A or SIM800A

SIM900A

  1. 1-channel Relay Module 5V

Relay Module

  1. Dupont Wires (Female to Female)

Dupont Wires

  1. Mobile SIM Card

Mobile SIM is required because SIM800A and SIM900A support only 2G networks from Mobile, not Telecom or Unicom... However, the Airm2m AIR780e module should work with Unicom, so SIM series may not be needed as it is internally integrated.

Mobile SIM Card

Wiring Diagram

Simulates controlling relay behavior upon receiving signal from Arduino.

Wiring Diagram

Wiring Diagram

Don’t know how to code?... Use Generate.py to generate Arduino code.

ESP8266 (WIFI LAN Control)

Prepare Materials

  1. ESP8266

ESP8266

  1. 1-channel Relay Module 5V

Relay Module

  1. Dupont Wires

Dupont Wires

Wiring Diagram

Wiring Diagram

AIR780E (4G Wireless Public Network Control) [Recommended]

Notes

  1. This development board has been tested and indeed is faster and more stable than the SIM series.
  2. Install Luatools: For programming. [https://doc.openluat.com/wiki/37?wiki_page_id=4489]

Prepare Materials

  1. Air780e Development Board

There is a SIM card slot on the back.

Air780e Development Board

Air780e Development Board

  1. 1-channel Relay Module 5V

Relay Module

  1. Dupont Wires

Dupont Wires

Wiring Diagram

Wiring Diagram

Programming

Import the generated file into Luatools.

Import File

Select the core, provided in our Output\AIR780E\LuatOS-SoC_V1103_EC618.soc.

Select Core

Complete the programming according to the prompts. Note the three buttons on the board: Start, Reset, BOOT.

Buttons

AT89C51

Prepare Materials

  1. 51 Microcontroller Minimal System Development Board with CH340 Downloader

51 Microcontroller

  1. 1-channel Relay Module 5V

Relay Module

  1. Dupont Wires (Female to Female)

Dupont Wires

  1. SIM900A or SIM800A

SIM900A

  1. Mobile SIM Card

Mobile SIM Card

Wiring Diagram

Wiring Diagram

Generate一键生成烧录代码

Generate One-Click Programming Code

Run the command:

python3 Generate.py

Generate.py

Fill in the parameters. Note that 127.0.0.1 is incorrect; you should enter the public IP address of the server, which is the IP of the machine running S-Clustr_Server.py.

Input Parameters

The output programming code will be located in the directory .\Device\Output\Model.

S-Clustr Server

Note:

  1. The server must be on a public network. If your server is on a private network, you can consider port forwarding. The hacker's service defaults to port 9999, and the device service defaults to port 10000.
  2. The server and hacker client communicate with full encryption throughout. Encryption services are mandatory and cannot be disabled. Additionally, you can configure in the Server.conf file whether to provide encryption services when embedded devices or controlled PCs connect.
  3. For parameters in the Server.conf file that you do not understand, please refer to the detailed manual documentation.
  4. Each time the server starts, it generates a random 12-character key for authentication between the hacker and the controlled device to prevent unauthorized access by other hackers. You can manually specify the key (python3 S-Clustr_Server.py -keyh Maptnh -keyv Maptnh). Here, there are two keys for both the hacker and the controlled device: the first is a plaintext key, and if you find it too sensitive, you can use the subsequent temporary TOKEN as a key, which effectively prevents plaintext key exposure.

Server Configuration In this parameter, setting it to 1 enables encryption services for the controlled device, requiring the device to provide an authentication key for access; otherwise, access will be denied.

Server Configuration Detail

  1. This setup effectively prevents man-in-the-middle (MITM) sniffing of communication packets between the hacker client and the server, further preventing replay attacks and decryption of encrypted data.

Server Script Parameters

-lh: Bind to a specified local IP address, default is 0.0.0.0 -lpv: Set the local listening address for the device side, default port is 10000 -lph: Set the local listening address for the hacker side, default port is 9999 -keyh: Set the hacker side key, default is a randomly generated 12-character key -keyv: Set the device side key, default is a randomly generated 12-character key

Running the Server

python3 S-Clustr_Server.py

Server Running

S-Clustr Hacker Client

Note: The client operates interactively, similar to the Metasploit penetration testing framework.

Hacker Client Script Parameters

After entering, type help or ? or options to view the required settings: set rhosts <IP>: Set the IP address of the server set rport <Port>: Set the port of the server set id <number>: Select the ID number of the device to control, 0 means select all devices set pwr <state>: Control device status: Start [1], Stop [2], Query status [3]

Connecting the Hacker Client to the Server

python3 S-Clustr_Client.py

Hacker Client Screenshot

Query the current status of all devices

S-Clustr(V1.0.0)> set rhost 127.0.0.1
[*] rhost => 127.0.0.1
S-Clustr(V1.0.0)> set id 0
[*] id => 0
S-Clustr(V1.0.0)> set pwr 3
[*] pwr => 3

PS: You must provide the Key here, which determines whether you have permission to access the server. You can choose any key from the server.

image.png

S-Clustr(V1.0.0)> set key cf5cdc4798a72283a4c0c0b1ef2ef5da
[*] key => cf5cdc4798a72283a4c0c0b1ef2ef5da

Querying the Status of All Devices

S-Clustr(V1.0.0)> set id 0
[*] id => 0
S-Clustr(V1.0.0)> set pwr 3
[*] pwr => 3
S-Clustr(V1.0.0)> run
[*] Connecting to the server...
[*] Attempting to authenticate to the server [127.0.0.1:9999]
|   Device ID   |  Device Type  | Device State | Device Network |
|:-------------:|:-------------:|:-------------:|:---------------:|
|       1        |      None      |    Stopped     |   Disconnected   |
|       2        |      None      |    Stopped     |   Disconnected   |
|       3        |      None      |    Stopped     |   Disconnected   |
|       4        |      None      |    Stopped     |   Disconnected   |
|       5        |      None      |    Stopped     |   Disconnected   |
|       6        |      None      |    Stopped     |   Disconnected   |
|       7        |      None      |    Stopped     |   Disconnected   |
|       8        |      None      |    Stopped     |   Disconnected   |
|       9        |      None      |    Stopped     |   Disconnected   |
|       10       |      None      |    Stopped     |   Disconnected   |
|:-------------:|:-------------:|:-------------:|:---------------:|

We can see that the connection to the server was successful, and authentication was successful.

If we set an incorrect Key, the server will not authorize you.

image.png

image.png

Simulating controlled devices connecting to the server and controlling all devices through the hacker client.

image.png

All devices are online.

image.png

Starting All Devices

S-Clustr(V1.0.0)> set id 0
[*] id => 0
S-Clustr(V1.0.0)> set pwr 1
[*] pwr => 1
S-Clustr(V1.0.0)> run

image.png

image.png

Stopping All Devices

S-Clustr(V1.0.0)> set id 0
[*] id => 0
S-Clustr(V1.0.0)> set pwr 2
[*] pwr => 2
S-Clustr(V1.0.0)> run

image.png

Case Study: Controlled Device Accesses www.bing.com and Opens Calculator

Scenario:

After receiving the command, the controlled device should:

  1. Access the website www.bing.com.
  2. Open the calculator application.

1. Input the Controlled Device Key

Image

Ensure that the correct key is entered for the controlled device.

2. Successful Connection

Image

The device is successfully connected, and the hacker client has recognized it.

3. Controlling the Device

The hacker client successfully queries the device and performs the desired actions.

Image

4. Manual Documents

For more information and detailed configuration parameters, refer to the following documents:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s_clustr_dsl-1.3.7.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

S_Clustr_DSL-1.3.7-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file s_clustr_dsl-1.3.7.tar.gz.

File metadata

  • Download URL: s_clustr_dsl-1.3.7.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for s_clustr_dsl-1.3.7.tar.gz
Algorithm Hash digest
SHA256 f1621ae45bda70036d97259a9a3ad9cc3bd41e9d364aa4a3ddc01b5afefc6fd2
MD5 780c1a06238a649a1a824692b19db566
BLAKE2b-256 6891ca3aada2b3f2e2a0cbfa1d1787b7ea1582d516f0d5dc980516cdb1ba79ad

See more details on using hashes here.

File details

Details for the file S_Clustr_DSL-1.3.7-py3-none-any.whl.

File metadata

  • Download URL: S_Clustr_DSL-1.3.7-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for S_Clustr_DSL-1.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f467a290fa32815984fa16aa88e591a43322ff5bb6a658dd5b85e853c51c7971
MD5 d37de5649624e3473c9f3995de238d0a
BLAKE2b-256 5bdd2693ebc28e55e2031c05785448d77b37539d9b1bf59df4730189e4414a78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page