Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
175 views2 pages

Banner Grab

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

1.

netcat(Banner Grabbing)
1) Perform an experiment to grab a banner with telnet and perform the task using
Netcat

For instance, netcat can be used to;


 Ability to scan if a port is open on a remote system
 Pull the banner information from a remote system
 Connect to a network service manually with listening
 Remote administration for transferring of files
Like so many applications in the Linux world, netcat runs in a client and server mode. This means
that we must designate one side the server and one side the client, when using netcat.
Here in this case, we are using two machines, one is Kali Linux 2017.1 VM in which netcat is
preinstalled and other is Windows 10, which is our base machine where we installed netcat in C:\
directory with directory named “nc“ .
Netcat Basics
Let’s start off by looking at the help screen for netcat. When using netcat, the command is simply
“nc“ .
1. To get the help screen then, type;
Command: nc -h
Note a few key switches;

 -e program to execute after connect


 -l listen mode for inbound connects
 -p designates the locat port
 -u UDP mode
 -v verbose output

Create a Simple TCP Connection

Netcat be used to create simple TCP or UDP connection to system to see whether the port and
service available. So, for instance, if we wanted to connect to the SSH on remote system, we can
type;

Command: nc -vn 192.168.179.146 22

Banner Grabbing
We can also use netcat to “grab” the banner on web servers by connecting to port 80 and then
sendinga HEAD / HTTP/1.0 or HEAD / HTTP/1.1 request depending upon the protocol which
they’re using.
Command: nc 192.168.179.146 80

1
HEAD / HTTP/1.0
Make certain to hit “Enter” a couple times after typing the HEAD request to pull the banner . As
you can see, we grabbed the banner of Apache 2.4.25 web server running on Debian. Through this
method,you can even find the open HTTP methods against the target like CONNECT , DELETE,
DEBUG,OPTIONS, PUT etc.

To do a banner grab,

type nc 10.73.31.1 81. This opens Netcat, to our router’s IP address, on port 81. Then
type: HTTP/1.1 200 . Since our server is running Apache, it won’t respond to anything until we give
it a specific request.

I can also connect to our SSH server using:

 nc 10.73.31.1 222 (a different port, but same internal IP). Or Google! ncat google.com 80. GET /
HTTP/1.1.

Why would this be useful? What could I use this for as a systems admin? Here is a simple example:

We have several products running in our office using SSH, but I don’t know which ones have been
updated. I know we have an SSH server running on 10.73.31.1 222, and a WiFi Pineapple running
on port 22.

I can type nc 10.73.31.1 222, and the same for the Pineapple on port 22. If I look at these versions,
I need to update the first one. That’s one quick and easy way to do some homework.

Opening TCP connection between two machines for “chat”


Netcat is capable of creating a simple TCP or UDP connection between two computers and then
open a communication channel between them. Let’s open a listener on the remote system first i.e.
on
Windows 10 machine.
Command: nc -l -p1604
Then connect to that listener in Kali Linux from a remote machine by typing the below command.
Command: nc 192.168.1.3 1604
When it connects, we can then begin typing my message.

You might also like