SBN

Web server security: Command line-fu for web server protection

Introduction

Adequate web server security requires proper understanding, implementation and use of a variety of different tools. In this article, we will take a look at some command line tools that can be used to manage the security of web servers. The tools reviewed will demonstrate how to perform tasks such as hashing strings in the Base64 hashing algorithm, hexdump for file analysis, gzip for file compressions and decompression, tcpdump for traffic analysis and several others.

Overview

In order to securely manage web servers, you must be conversant with different command line tools. These tools also allow you to troubleshoot errors and perform file and traffic analysis. Let’s consider some tools and how we can use them to enhance the security of our web server.

Using curl for web server security

Curl is a tool that is used to transfer data with URLs and using various network protocols. Using curl, you are able to perform data transfer on many protocols. The data transfer is done without user interaction.

The following usage examples demonstrate how curl can be used on the terminal:

1. Downloading multiple files

You can be able to download multiple files using curl with the –O flag.

$ curl -O http://yoursite.com/info.html -O http://mysite.com/about.html

2. Resuming an interrupted download

Suppose in the process of downloading a file, your connection got interrupted. You can resume your download with the –C – -O flags.

$ curl -C - -O http://yourdomain.com/yourfile.tar.gz

3. Querying HTTP headers

The –I flag can be used to query the HTTP headers within a request

$ curl -I google.com

4. Downloading files without authentication

You can also download files without any authentication, using the command below.

$ curl -x proxy.yourdomain.com:8080 -U /

user:password –O http://yourdomain.com/yourfile.tar. (Read more...)

*** This is a Security Bloggers Network syndicated blog from Infosec Resources authored by Lester Obbayi. Read the original post at: http://feedproxy.google.com/~r/infosecResources/~3/H7oT1D075m4/