Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. # NetCat & Firewall Stuff
  2.  
  3. `netcat` is a program that allows us to send packets one at a time over a network. To set up communication using `netcat`, first start a `netcat` server in a terminal window.
  4.  
  5. ```bash
  6. netcat -l -p 3000
  7. ```
  8.  
  9. I chose to start the server on port `3000`. You can choose any number greater than 1024.
  10.  
  11. Next, open a new terminal window and set up the **client**. The client requests messages from the server.
  12.  
  13. ```bash
  14. netcat 127.0.0.1 3000
  15. ```
  16.  
  17. I used the IP address `127.0.0.1` so that I can communicate with the server hosted on on my machine. If you want to communicate with a server on a different machine, you have to put its IP address instead. I also put the port that I want to connect to.
  18.  
  19. You can now type into either terminal window, and send the message across to the other window. This will also work to send messages from one computer to another.
  20.  
  21. Next, try to **block** the `netcat` client by writing a new firewall rule. Check out `iptables` and the resources posted on Classroom.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement