Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I want to test our DOS prevention system against http requests that are not have header and agent information. Is there any tool I can do that. I tried siege with this command

siege -c 3 -b -H "Host: " -A ""  http://10.0.1.2/

This command sends requests with empty host and agent values. What I want is to send requests without defining host and agent values.

Thanks for any advice...

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Worst case, you could use netcat.

nc example.com 80 << http_message_file

where example.com is the host to which you want to connect, 80 is the port to which you want to connect (I chose 80 since that's typical HTTP server port) and http_message_file contains the exact HTTP request you want to send, such as

GET /path/to/resource HTTP/1.1
Host: example.com
share|improve this answer
    
Nice answer. Don't forget to put "\r\n\r\n" at the end of header ;) –  ibrahim Jan 8 at 7:47

I don't know if this will work for you, but why not. You can easely use python to send requests as you whish like so:

import urllib
import urllib2

url = 'http://www.someserver.com/cgi-bin/register.cgi'
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
values = {'name' : 'Michael Foord',
          'location' : 'Northampton',
          'language' : 'Python' }
headers = { 'User-Agent' : user_agent }

data = urllib.urlencode(values)
req = urllib2.Request(url, data, headers)
response = urllib2.urlopen(req)
the_page = response.read()

From python doc : http://docs.python.org/2/howto/urllib2.html#headers

Try doing the same thing but with empty user_agent and Headers, it worked in my smal test.

Here is the snippet I tested:

import urllib
import urllib2

url = 'http://www.someserver.com/cgi-bin/register.cgi'
user_agent = ''
values = ''
headers = { '' : '' }

data = urllib.urlencode(values)
req = urllib2.Request(url, data, headers)
response = urllib2.urlopen(req)
the_page = response.read()
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.