> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/shark-jack-display/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/shark-jack-display/configuration-duckyscript.md).

# Configuration DuckyScript

## BATTERY

The `BATTERY` command returns the charging state; either Charging or Discharging.

## CONNECTION\_CHECK

The `CONNECTION_CHECK` command set verifies internet connectivity by performing a two-stage reachability test. It validates both direct IP connectivity and DNS resolution, utilizing settings defined in your configuration file. This command set includes; `CONNECTION_CHECK`, `CONNECTION_CHECK_IP`, and `CONNECTION_CHECK_DOMAIN`.

#### Behavior

The command executes the following checks sequentially:

1. IP Reachability: Attempts to `ping` the IP address defined in `config.txt` under `CONNECTION_CHECK_IP`. If the ping fails, the command outputs "No Internet" and exits with a status of `1`.
2. DNS Resolution: Following a short delay, it attempts to `ping` the domain name defined in `config.txt` under `CONNECTION_CHECK_DOMAIN`. If this ping fails, the command outputs "No DNS" and exits with a status of `1`.

If both checks succeed, the command outputs "Connected" and exits with a status of `0`.

#### Configuration Requirements

To function correctly, ensure the following options are configured in your `config.txt`:

| **Option**                | **Description**                                             |
| ------------------------- | ----------------------------------------------------------- |
| `CONNECTION_CHECK_IP`     | The target IP address to verify basic network reachability. |
| `CONNECTION_CHECK_DOMAIN` | The target hostname to verify DNS resolution capabilities.  |

## GET\_LED

The `GET_LED` command returns the current static color state of the Shark Jack LED.

{% hint style="info" %}
This command reports the current static brightness state. If the LED is actively running a pattern (e.g., blinking, breathing, or cycling colors), this command may not accurately reflect the transient state.
{% endhint %}

### Example

```bash
LED_STATE=$(GET_LED)
if [ "$LED_STATE" == "Red" ]; then
    SCREEN_WRITE "LED is currently Red"
fi
```

## GET\_NETMODE

The `GET_NETMODE` command will return the current NETMODE.

### Example

```bash
MODE=$(GET_NETMODE)
if [ "$MODE" == "DHCP_SERVER" ]; then
    SCREEN_WRITE "DHCP Server"
fi
```

## RANDOMIZE\_MAC

The `RANDOMIZE_MAC` command generates and assigns a new, random MAC address to the `eth0` network interface.

#### Example

To use this command in a payload to anonymize the device's network identity:

```bash
# Randomize the MAC address
RANDOMIZE_MAC
```

## SSH Commands

DuckyScript for the Shark Jack Display include the following SSH commands; `START_SSH`, `STOP_SSH`, `SSH_STATUS`, `ENABLE_SSH` and `DISABLE_SSH`.

### START\_SSH

Starts the OpenSSH Server daemon immediately for the current runtime session.

### STOP\_SSH

Stops the active OpenSSH Server daemon immediately. Any active SSH connections will be terminated.

### SSH\_STATUS

Queries and returns the operational status of the OpenSSH Server daemon (e.g., whether it is running or stopped).

### ENABLE\_SSH

Configures the OpenSSH Server daemon to launch automatically during the system boot sequence, and then starts the service immediately for the current session.

### DISABLE\_SSH

Removes the OpenSSH Server daemon from the system boot sequence so it does not persist across restarts, and immediately terminates the running service.

## NTP Commands

DuckyScript for the Shark Jack Display include the following NTP commands; `SYNC_TIME`, `ENABLE_NTP` and `DISABLE_NTP`.

{% hint style="info" %}
An accurate system clock via NTP is critical for network devices. Without it, fallback boot dates cause SSL/TLS handshakes to fail, blocking secure connections to cloud backends or APIs. Furthermore, correct timestamps are vital for log correlation, ensuring accurate timelines during security forensics and incident response.
{% endhint %}

### SYNC\_TIME

Forces an immediate, one-time time synchronization with an upstream NTP pool.

### ENABLE\_NTP

Configures the system time daemon to launch automatically during system startup, and starts the service immediately for the current runtime session to keep the clock synced in the background.

### DISABLE\_NTP

Removes the system time daemon from the boot sequence so it does not start on a reboot, and immediately terminates the running background service.
