#! /usr/bin/env python
# -*- coding: utf-8 -*-

import urllib2 as http

# URL with GET to reboot router or status main page to tests
#url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1'
url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Fstatus.htm&rd2=%2Fuir%2Fwanst.htm&Nrd=1'
url_root = url_get_status

# Handling HTTP Cookie - Session Cookie Router
cookieprocessor = http.HTTPCookieProcessor()

# Customize it Opener with CookieProcessor
opener = http.build_opener(cookieprocessor)

# Using here Opener + CookieProcessor
http.install_opener(opener)

# Open URL with Opener above
payload_router = http.urlopen(url_root)

# Print payload Request URL
print "Payload %s" % payload_router.read()

@@ -65,17 +65,168 @@
 s http%0A%0A
+%0A
 #
+ Data Router%0Auser_router = %22user_here%22%0Apass_router = %22password_here%22%0Aip_router   = %22IP_here%22%0Aport_router = %2280%22%0A%0A%0A# URL with filling the fields above,
  URL wit
@@ -277,17 +277,16 @@
 o tests%0A
-#
 url_get_
@@ -298,55 +298,106 @@
 t = 
-'
+%22
 http://
-10.11.12.254/log/in?un=admin&pw=admin12
+%22 + ip_router + %22:%22 + port_router + %22/log/in?un=%22 + user_router + %22&pw=%22 + pass_router + %22
 &rd=
@@ -429,18 +429,19 @@
 =0&Nsm=1
-'%0A
+%22%0A#
 url_get_
@@ -453,134 +453,255 @@
 s = 
-'
+%22
 http://
-10.11.12.254/log/in?un=admin&pw=admin12&rd=%252Fuir%252Fstatus.htm&rd2=%252Fuir%252Fwanst.htm&Nrd=1'%0Aurl_root = url_get_status
+%22 + ip_router + %22:%22 + port_router + %22/log/in?un=%22 + user_router + %22&pw=%22 + pass_router + %22&rd=%252Fuir%252Fstatus.htm&rd2=%252Fuir%252Fwanst.htm&Nrd=1%22%0A%0A# Variable global to open URL%0Aurl_root = url_get_reboot%0A%0Aprint %22Processing URL: %25s%22 %25 url_root
 %0A%0A# 

Add variables with info access router