Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Communication Protocol

NesterShell uses an HTTP cookie-based communication protocol to exchange encrypted commands and responses between the client and server, making the traffic appear as normal web traffic.

Tip

Because all communication happens through cookies, you can inject a generated web shell at the start of any existing server page without modifying the visible content of that page. The web shell processes cookie-based commands before the page content is rendered, remaining completely invisible to users viewing the page.


1. Protocol Structure

1.1 Request Structure (Client → Server)

FieldSizeDescription
Initialization Vector16 bytesRandomly generated IV for AES-CBC encryption
Transit Password16 bytesEncrypted session authentication
Command Payload16+ bytesEncrypted command structure
Command Code2 digitsOperation identifier
Primary ParameterVariableMain command data
Secondary ParameterVariableAdditional command data

1.2 Response Structure (Server → Client)

FieldSizeDescription
Response Payload16+ bytesEncrypted response structure
Response Code4 digitsStatus identifier
Primary DataVariableMain response data
Secondary DataVariableAdditional response data

2. Authentication and Key Derivation

Transit Password Derivation

When you enter your password, NesterShell creates a Transit Password by hashing it with SHA256 and taking the first 15 bytes. This Transit Password is then encrypted with the Shared Key (AES-256-CBC), adding padding to make it 16 bytes. The server verifies it using bcrypt before executing any commands.

Session Key Derivation

The Session Key is created by padding the 15-byte Transit Password with 17 null bytes to reach 32 bytes for AES-256 encryption.


3. Command and Response Codes

Request Command Codes

CodeDescriptionPrimary ParameterSecondary Parameter
00Execute shell commandCommand stringCurrent working directory
01Connection test
02Change working directoryTarget directory path

Response Status Codes

Success Codes

CodeDescriptionPrimary DataSecondary Data
0000Operation completed successfullyCommand stdoutCommand stderr
0100Ping test successful
0200Working directory changed successfullyNew working directory path

Error Codes

CodeDescription
0010Command string was empty
0011Path parameter was empty
0012Specified path was not reachable
0013Specified path was not executable
0014Process failed to start
0210Path was empty for cd command
0211Path was not reachable for cd command
0212Path was not executable for cd command