mirror of
https://github.com/tenox7/wrp.git
synced 2025-02-21 22:29:08 +00:00
Merge pull request #27 from girst/master
support https:// sites by stripping with sslstrip
This commit is contained in:
commit
64cf34fb85
@ -4,8 +4,7 @@ A HTTP proxy server that renders the web page in to a GIF/PNG/JPEG image associa
|
|||||||
Version 2.0 brings support for PythonMagick (ImageMagick Library) that allows to optimize and reduce image size or covert to greyscale or bitmap for these cool computers without color displays.
|
Version 2.0 brings support for PythonMagick (ImageMagick Library) that allows to optimize and reduce image size or covert to greyscale or bitmap for these cool computers without color displays.
|
||||||
|
|
||||||
# Current Status
|
# Current Status
|
||||||
* Due to a recent migration of the whole Internet to SSL/HTTPS, WRP is currently pretty much useless
|
* SSL/TLS stripping is delegated to `sslstrip`[1], which you need to install into your PATH first
|
||||||
* Support for a SSL/HTTPS is under way, however not in a proxy mode
|
|
||||||
* I'm also looking for moving away from WebKit, QT and Python
|
* I'm also looking for moving away from WebKit, QT and Python
|
||||||
* Stay tuned
|
* Stay tuned
|
||||||
|
|
||||||
@ -25,3 +24,5 @@ Configure your web browser to use HTTP proxy at IP address and port where WRP is
|
|||||||
## More info and screenshots
|
## More info and screenshots
|
||||||
* http://virtuallyfun.superglobalmegacorp.com/2014/03/11/web-rendering-proxy-update/
|
* http://virtuallyfun.superglobalmegacorp.com/2014/03/11/web-rendering-proxy-update/
|
||||||
* http://virtuallyfun.superglobalmegacorp.com/2014/03/03/surfing-modern-web-with-ancient-browsers/
|
* http://virtuallyfun.superglobalmegacorp.com/2014/03/03/surfing-modern-web-with-ancient-browsers/
|
||||||
|
|
||||||
|
[1]: https://moxie.org/software/sslstrip/
|
||||||
|
13
wrp.py
13
wrp.py
@ -18,6 +18,7 @@ __version__ = "2.0"
|
|||||||
# Copyright (c) 2012-2013 picidae.net
|
# Copyright (c) 2012-2013 picidae.net
|
||||||
# Copyright (c) 2004-2013 Paul Hammond
|
# Copyright (c) 2004-2013 Paul Hammond
|
||||||
# Copyright (c) 2017-2018 Natalia Portillo
|
# Copyright (c) 2017-2018 Natalia Portillo
|
||||||
|
# Copyright (c) 2018 //gir.st/
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -47,6 +48,7 @@ WAIT = 1 # sleep for 1 second to allow javascript renders
|
|||||||
QUALITY = 75 # For JPEG: image quality 0-100; For PNG: sets compression level (leftmost digit 0 fastest, 9 best)
|
QUALITY = 75 # For JPEG: image quality 0-100; For PNG: sets compression level (leftmost digit 0 fastest, 9 best)
|
||||||
AUTOWIDTH = True # Check for browser width using javascript
|
AUTOWIDTH = True # Check for browser width using javascript
|
||||||
FORMAT = "AUTO" # AUTO = GIF for mac OS, JPG for rest; PNG, GIF, JPG as supported values.
|
FORMAT = "AUTO" # AUTO = GIF for mac OS, JPG for rest; PNG, GIF, JPG as supported values.
|
||||||
|
SSLSTRIP = True # enable to automatically downgrade secure requests
|
||||||
|
|
||||||
# PythonMagick configuration options
|
# PythonMagick configuration options
|
||||||
MK_MONOCHROME = False # Convert the render to a black and white dithered image
|
MK_MONOCHROME = False # Convert the render to a black and white dithered image
|
||||||
@ -68,6 +70,7 @@ import Queue
|
|||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
import StringIO
|
import StringIO
|
||||||
|
import subprocess
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import PythonMagick
|
import PythonMagick
|
||||||
@ -894,6 +897,16 @@ def main():
|
|||||||
if (sys.platform.startswith('linux') or sys.platform.startswith('freebsd')) and FORMAT == "GIF" and not HasMagick:
|
if (sys.platform.startswith('linux') or sys.platform.startswith('freebsd')) and FORMAT == "GIF" and not HasMagick:
|
||||||
sys.exit("GIF format is not supported on this platform. Exiting.")
|
sys.exit("GIF format is not supported on this platform. Exiting.")
|
||||||
|
|
||||||
|
# run traffic through sslstrip as a quick workaround for getting SSL webpages to work
|
||||||
|
# NOTE: modern browsers are doing their best to stop this kind of 'attack'. Firefox
|
||||||
|
# supports an about:config flag test.currentTimeOffsetSeconds(int) = 12000000, which
|
||||||
|
# you can use to circumvent those checks.
|
||||||
|
if SSLSTRIP:
|
||||||
|
try:
|
||||||
|
subprocess.check_output(["pidof", "sslstrip"])
|
||||||
|
except:
|
||||||
|
subprocess.Popen(["sslstrip"], stdout=open(os.devnull,'w'), stderr=subprocess.STDOUT) # runs on port 10000 by default
|
||||||
|
QNetworkProxy.setApplicationProxy(QNetworkProxy(QNetworkProxy.HttpProxy, "localhost", 10000))
|
||||||
# Launch Proxy Thread
|
# Launch Proxy Thread
|
||||||
threading.Thread(target=run_proxy).start()
|
threading.Thread(target=run_proxy).start()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user