#!/bin/sh

# Proxy port number
port=8080

# Using netcat or socket?
tcpserver="nc -l -p $port"
#tcpserver="socket -s $port"

# Show how to configure netscape
echo "Test running."
echo "Configure Netscape to use proxy-server `uname -n` port $port"
echo

# Here is the test page/server
while $tcpserver <<%EOF%; do cat <<%EOM%
HTTP/1.0 200 OK
Proxy-Connection: Keep-Alive
Content-Type: text/html
Content-Length: 202

<TITLE>Netscape Bug test page</TITLE>
<FORM ACTION="https://testserver.nowhere/" METHOD=POST>
<INPUT TYPE=HIDDEN VALUE="Your browser is VULNERABLE" NAME="DATA">
<INPUT TYPE=SUBMIT VALUE="TEST">
</FORM>
%EOF%

* If you see "Your+browser+is+VULNERABLE" above, then it is.

* If you see a lot of garbage above, then it isn't.

* If you don't see anything when pressing the TEST button (and
  Netscape gave you a error dialog), then you have not configured
  your proxy settings correctly.

Press reload to retry the test.
%EOM%
done


