website/content/blog/bashtcpudp.md

20 lines
474 B
Markdown
Raw Normal View History

2020-05-26 03:17:46 +00:00
---
title: "TCP/UDP with Bash"
date: 2020-05-25T23:10:15-04:00
draft: false
2022-01-02 19:24:29 +00:00
tags: ["Bash", "Networking"]
2023-01-05 19:04:45 +00:00
medium_enabled: true
2020-05-26 03:17:46 +00:00
---
The bash shell contains pseudo-devices to send packets with TCP/UDP. The pseudo files are formatted like the following:
```
dev/tcp/HOST/PORT
/dev/udp/HOST/PORT
```
To send a UDP packet to `localhost:6300` containing the payload "Hello, World.", we would run the following command:
```bash
echo "Hello, World." > /dev/udp/127.0.0.1/6300
```