Jump to content
Fi8sVrs

Quick tiny python web proxy

Recommended Posts

  • Active Members
Posted

the following code is all you need to have a proxy up and running in like 10 seconds

from flask import Flask

from flask import request

import requests

app = Flask(__name__)

hosttorequest = 'www.cnn.com'

@app.route('/')

def root():

r = requests.get('http://'+hosttorequest+'/')

return r.content

@app.route('/<path:other>')

def other(other):

r = requests.get('http://'+hosttorequest+'/'+other)

return r.content

if __name__ == '__main__':

app.run(host='0.0.0.0', port=80)

Now this sure makes it easy to start hiding some stuff in there. To get it up and running just do: sudo python filename.py

Quick tiny python web proxy | DiabloHorn

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...