
Let’s assume we have remote command execution on the target host and we want to transfer a file from the attack box to the host. In this example we will be using a Netcat connection to transfer a text file. To retrieve the top level page on the webserver we can issue the following command: The webserver responds with the server banner: Apache/2.2.8 (Ubuntu) DAV/2 and the PHP version. With the following command we can grab the banner of the web service running on Metasploitable 2: Netcat can also be used to interact with webservers by issuing HTTP requests. In this example we’ve used an FTP service but this also works on other services such as SMTP and HTTP services.
OSCP NETCAT WINDOWS LAB MACHINE INSTALL HOW TO
This example demonstrates how to grab a banner and how to setup and use a raw data connection. Interaction with the FTP service over a raw connection.

Let’s see if anonymous access is allowed on this FTP server by issuing the USER and PASS command followed by anonymous. To demonstrate how a raw connection works we will issue some FTP commands after we’re connected to the target host on the FTP service. Have a look at the service enumeration tutorial if you want to learn more about this subject. Nc is used to make a raw connection to the port which will return a service banner when it’s available.As we can see there is a vsFTPD service running on port 21. Let’s try this on the FTP service on Metasploitable 2 which is running on port 21: The following command is used the grab a service banner (make a raw connection to a service): When a banner is available, it is printed to the console. When using Netcat for banner grabbing you actually make a raw connection to the specified host on the specified port. Banner grabbing is a technique to retrieve this information about a particular service on an open port and can be used during a penetration test for performing a vulnerability assessment. The service banners identify the running service and often the version number too. Service banners are often used by system administrators for inventory taking of systems and services on the network. Banner Grabbing, raw connections and webserver interaction Let’s start with the very basics and have a look at how we can make raw data connections to grab service banners.
