Vistas

TOOLBOX

LANGUAGES

Installation of advanced EzWeb Cross-Site Scripting proxy

De MorfeoWiki

Back

EzWeb embedded python proxy is not suitable for certains scenarios. For example, it does not support acceses to HTTPS resources through a network proxy with authentication. To solve these scenarios, you can install this advanced proxy.

The advanced EzWeb Cross-Site Scripting proxy is a HTTP proxy implemented in java, with support for HTTP/HTTPS invocations and optional network proxy with or without authentication.

Contenido

Installation and testing

To install the proxy, download the war file from here: https://svn.forge.morfeo-project.org/svn/ezwebplatform/ezweb_javaproxy/Instalacion/EzWebJavaProxy.war and deploy it in your preferred Web Container. For configuration purposes, we'll asume that you have a Web Container running in localhost, on port 8080. So, the URL for the proxy will be:

http://127.0.0.1:8080/EzWebJavaProxy/proxy/

You can test the proxy accesing that URL. It will return a HTML form with the proxy request parameters, you can enter URL = http://www.google.com, and method = get and make the request. It shoud return and show Google home page

Configuration

For using a network proxy, you must edit the configuration file located inside the .war file (WEB-INF/classes/proxy.properties) and repack the war file. The proxy.properties file contains the following properties:

# --------------------------------------
# Set the proxy server here if needed
# Default proxy.port = 8080
# --------------------------------------
#proxy.host = nube.hi.inet
#proxy.port = 8080
#proxy.user = foo
#proxy.pass = foo_pass

Another option, if you don't want to pack/repack the .war manually, is to download full project from SNV (https://svn.forge.morfeo-project.org/svn/ezwebplatform/ezweb_javaproxy/), modify the properties file, and run the default ant task to regenerate the war.

Connecting the proxy and EzWeb

To override EzWeb default proxy and use the advanced one, you must set an inverse proxy on your web server EzWeb instalation. Doing this, all request to http://[ezweb_host]/proxy will be redirected by your web server to the new proxy location. This process is diferent, depending on your web server installation

Apache

  • Install mod_proxy apache module:
apt-get install libapache2-mod-proxy-html
  • Enable mod_proxy apache module:
cd /etc/apache2/mods-enabled
ln -s ../mods-available/proxy.conf proxy.conf
ln -s ../mods-available/proxy.load proxy.load
ln -s ../mods-available/proxy_http.load proxy_http.load
ln -s ../mods-available/proxy_html.load proxy_html.load
  • Modify EzWeb Apache configuration file /etc/apache2/sites-available/ezweb-platform, adding the bolded lines:
ServerName...

ProxyRequests Off
<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

# Inverse Proxy for EzWeb Cross-Site Scripting java proxy
ProxyPass /proxy/ http://127.0.0.1:8080/EzWebJavaProxy/proxy/
ProxyPassReverse /proxy/ http://127.0.0.1:8080/EzWebJavaProxy/proxy/

DocumentRoot...
  • Restart apache:
sudo /etc/init.d/apache2 restart

Lighttpd

  • Modify Lighttpd configuration file /etc/lighttpd/lighttpd.conf, adding the bolded lines:
...
server.modules              = (
...
                              "mod_proxy",
...

url.rewrite-once = (
  "^/proxy(.*)$" => "/EzWebJavaProxy/proxy$1",
  "^(/media.*)$" => "$1",
  "^(/ezweb.*)$" => "$1",
  "^(/repository.*)$" => "$1",
  "^(/.*)$" => "/django$1",
)

proxy.server = ( "/EzWebJavaProxy/proxy" => ( ( "host" => "127.0.0.1" , "port" => 8080 ) ) )
  • Restart lighttpd:
sudo /etc/init.d/lighttpd restart