MIpython.com Tutorial 1 Command Line Anonimizer Browsing Script

Hey everybody,

lets start out with something simple. Today we are using Selenium with the Chrome webdriver. This nice little piece of kit is going to be the foundation of many of our future projects. So, let’s get this thing up and running.
INSTALL NOTEPAD++
INSTALL PYTHON:
INSTALL SELENIUM:
INSTALL WEBDRIVER:
INSTALL CHROME:

We are making an Anonymizer redirect script today. The script will take the user inputed url from command line and concatenate the variable with the cgi script from www.anonymouse.org. The program then opens a new instance of a Google Chrome browser. Obviously this is very low level( as in low security). Don’t use this to login to any secure or important sites( I don’t think you can anyway with free version of anonymouse.org anyway) with your “money” passwords.

This is a useful Tool for web scrapping, web application testing and all other kinds of tasks that require variable IP addresses.

Once we have everything installed through PIP and our system PATH variable configured properly.
Open up your IDE of choice. I just use Notepad++.

Make a new file “anon_browsing.py”.

Here’s the code.

I always like to put a cool banner lol. Lets you know when the script executes in the Terminal.
Print command in Python 3:
print(” your text goes here “)
print(“”” multi line 1
multi line 2
“””)
[code]
print(“*” * 30)
print(“”” ####### MIpython.com Anon Browser Script ################################
## Script Concatenate’s the User inputed url
## with the anonymizer url from http://anonymouse.org
## then opens up a browser window in Chrome.
“””)
[/code]

We only need to import the Selenium library for this one.
[code]
###### IMPORT SELENIUM
from selenium import webdriver
[/code]

More Terminal print bling to give us an idea what stage the script is in.
User defines url in Terminal.
In Python 3 input is raw_input method.
[code]
print(“*” * 30)
print(“INITIALIZE ANON_REQUEST”)
print(“*” * 30)
### URL TO INPUT TO ANONYMIZER
print(“DEFINE URL”)
url = input(“Type in the Url of the Site you wish to login to Anon. ” + “http://” )
[/code]

We are using Chrome Webdriver.
Define driver as the webdriver.Chrome() method
[code]
### CHROME DRIVER FOR SELENIUM
print(“DRIVER = CHROME WEB DRIVER”)
driver = webdriver.Chrome()
[/code]

Here we pass to the anon_page variable the chrome driver .get method with the anonymouse.org site cgi script location as argument.
[code]
### ANON_PAGE VAR FOR URL PLUS ANON SERVICE
print(“FETCHING ” + url + ” THROUGH http://anonymouse.org”)
anon_page = driver.get(“http://anonymouse.org/cgi-bin/anon-www.cgi/http://” + url)
[/code]

Here’s the code in it’s entirety. Use responsibly.

[code]

print(“*” * 30)
print(“”” ####### MIpython.com Anon Browser Script ################################
## Script Concatenate’s the User inputed url
## with the anonymizer url from http://anonymouse.org
## then opens up a browser window in Chrome.
“””)
###### IMPORT SELENIUM
from selenium import webdriver

print(“*” * 30)
print(“INITIALIZE ANON_REQUEST”)
print(“*” * 30)
### URL TO INPUT TO ANONYMIZER
print(“DEFINE URL”)
url = input(“Type in the Url of the Site you wish to login to Anon. ” + “http://” )
### CHROME DRIVER FOR SELENIUM
print(“DRIVER = CHROME WEB DRIVER”)
driver = webdriver.Chrome()
### ANON_PAGE VAR FOR URL PLUS ANON SERVICE
print(“FETCHING ” + url + ” THROUGH http://anonymouse.org”)
anon_page = driver.get(“http://anonymouse.org/cgi-bin/anon-www.cgi/http://” + url)
[/code]

Save your file “anon_browsing.py”

Open up your Terminal or Powershell. Navigate to the source directory of you’re file and type “python” + the name of your script. In this case anon_browsing.py

You should be greeted with instructions to enter an URL.
Enter URL of choice in Terminal.
Google Chrome should open a new browser instance.
[strike]Surf anon through anonymouse.org [/strike] or another webservice ### EDIT Apparantly from my limited testing anonymouse.org free service changes your IP to a static one that remains the same?

Related posts