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
- Host: GitHub
- URL: https://github.com/lifailon/netcat-api-endpoints
- Owner: Lifailon
- Created: 2023-09-29T11:18:34.000Z (about 2 years ago)
- Default Branch: rsa
- Last Pushed: 2024-02-29T12:58:02.000Z (over 1 year ago)
- Last Synced: 2025-02-19T08:36:24.468Z (8 months ago)
- Topics: api-endpoints, bash, endpoint, endpoints, linux, ncat, netcat, powershell, rest-api, service-manager, socket, systemctl
- Language: Shell
- Homepage:
- Size: 1.52 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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:

### Disk endpoint:

### Bad Example:

### Netcat jobs work example:
