Does anyone know of a way to alter the Host header used in a HTTP request without breaking it? Zap appears to use the host header to work out which IP to send the request to, so altering it triggers an error:
For example, sending the following request to
192.168.1.73 via org.parosproxy.paros.network.HttpMessage paros.network.HttpRequestHeader
GET /joomla/?foo=bar&cachebust=1405888831.78 HTTP/1.1
Host: ndz27s.192.168.1.73
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0)
Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Cookie: tz_offset=3600; acopendivids=swingset,jotto,phpbb2,redmine;
acgroupswithpersist=nada;
d5a4bd280a324d2ac98eb2c0fe58b9e0=ahufhedqrq6atgh9lp81ogg3p6
Referer:
http://192.168.1.73/
DNT: 1
Connection: keep-alive
Cache-Control: no-cache
triggers the following error:
javax.script.ScriptException: java.net.UnknownHostException:
java.net.UnknownHostException: ndz27s.192.168.1.73 in <script> at line number 58
The relevant code looks roughly like:
headers = org.parosproxy.paros.network.HttpRequestHeader(headers_shown_above)
attack = org.parosproxy.paros.network.HttpMessage(headers, body)
as_helper.sendAndReceive(attack, True, True)
Any suggestions?
(The background is that I'm currently porting
ActiveScan++)
Cheers,
James