An open API service indexing awesome lists of open source software.

https://github.com/lifailon/netcat-api-endpoints

Netcat simple server that accepts and processes endpoint requests REST API to manage Linux-based services
https://github.com/lifailon/netcat-api-endpoints

api-endpoints bash endpoint endpoints linux ncat netcat powershell rest-api service-manager socket systemctl

Last synced: 6 months ago
JSON representation

Netcat simple server that accepts and processes endpoint requests REST API to manage Linux-based services

Awesome Lists containing this project

README

          

## Netcat API endpoints

This is a simple netcat server that accepts and processes endpoint requests REST API to manage Linux-based services via systemctl.

Supported only the GET method for **PowerShell 7 (Invoke-RestMethod or Invoke-WebRequest)**.

**Curl is not supported!** Curl does not wait for additional time from the server to get a complete response to the request (same with irm/iwr and POST method), **unlike Invoke-RestMethod and GET method in PowerShell 7**, it waits for a complete response from the server before returning the result of the request. In the case of netcat, the utility does not terminate the connection until the server sends a complete response. The result of the request is stored in a buffer/stream and gives back the response of the previous request when the client makes a subsequent request.

**Endpoints:**

- `/api/date`
- `/api/disk`
- `/api/service/service_name`

**Request syntax for send:**

`irm http://192.168.3.101:8081/api/service/cron -Method Get`

`irm http://192.168.3.101:8081/api/service/cron -Method Get -Headers @{"Status" = "restart"}`

`irm http://192.168.3.101:8081/api/service/cron -Method Get -Headers @{"Status" = "stop"}`

`irm http://192.168.3.101:8081/api/service/cron -Method Get -Headers @{"Status" = "start"}`

### Example:

![Image alt](https://github.com/Lifailon/netcat-api-endpoints/blob/rsa/screen/powershell-example.jpg)

### Disk endpoint:

![Image alt](https://github.com/Lifailon/netcat-api-endpoints/blob/rsa/screen/disk-endpoint.jpg)

### Bad Example:

![Image alt](https://github.com/Lifailon/netcat-api-endpoints/blob/rsa/screen/bad-example.jpg)

### Netcat jobs work example:

![Image alt](https://github.com/Lifailon/netcat-api-endpoints/blob/rsa/screen/jobs-example.jpg)