This pull request proposes a number of fixes to the proxy, and should solve issues #66, #70, #77, and #78:
66: Rather than storing files as <hash>.<ext> they are stored as <domain>/<hash>/<name>.<ext>. URL's without a filename, e.g. sra.samsung.com, will be stored as <domain>/<hash>/index.<ext>.
This makes it significantly easier to locate the instrumented source files. For example, the instrumented version of foo.bar/baz.js can be located simply by find . -name baz.js.
In addition, the environment variable JALANGI_URL is set to the source URL. This can be useful for NodeJS modules passed to Jalangi2 using the --astHandlerModule option, for example, in order to load a configuration file associated with the URL of the web page being analyzed.
70: The content type is now checked case insensitively.
77: The proxy now runs on the current release of mitmproxy, v. 0.15.
In addition, an option --no-cache is now handled by the proxy.py script for the purpose of development.
The pull request also:
Removes the need for running the proxy script from inside a tmp/ folder; it will automatically store the files in a folder named cache/.
Adds an option --auto-disable to the mitmproxywrapper.py script, which automatically disables the proxy when the script is interrupted (rather than having to rerun the script).
Removes content security policies since they may block jalangi from executing
This pull request proposes a number of fixes to the proxy, and should solve issues #66, #70, #77, and #78:
66: Rather than storing files as
<hash>.<ext>
they are stored as<domain>/<hash>/<name>.<ext>
. URL's without a filename, e.g.sra.samsung.com
, will be stored as<domain>/<hash>/index.<ext>
.This makes it significantly easier to locate the instrumented source files. For example, the instrumented version of
foo.bar/baz.js
can be located simply byfind . -name baz.js
.In addition, the environment variable
JALANGI_URL
is set to the source URL. This can be useful for NodeJS modules passed to Jalangi2 using the--astHandlerModule
option, for example, in order to load a configuration file associated with the URL of the web page being analyzed.70: The content type is now checked case insensitively.
77: The proxy now runs on the current release of mitmproxy, v. 0.15.
78: The problem is that the instrumented version of the file is believed to be in the cache if
<hash>.js
is a file on the disk, and not if<hash>_jalangi_.js
is a file on the disk (https://github.com/Samsung/jalangi2/blob/master/scripts/proxy.py#L23).In addition, an option
--no-cache
is now handled by theproxy.py
script for the purpose of development.The pull request also:
tmp/
folder; it will automatically store the files in a folder namedcache/
.--auto-disable
to themitmproxywrapper.py
script, which automatically disables the proxy when the script is interrupted (rather than having to rerun the script).