Wednesday, June 9, 2010

Switching Procedure In Money Plus Lic Policy

[Tutorial] Router Reconnect mit cURL

Thank you for this guide. My old one is, unfortunately, have been victims of a new installation and conversion in my forum.

There is a need
Mozilla Firefox Live HTTP Headers

cURL

Introduction

First I want to briefly explain what we are doing here. To disconnect from the Internet, usually have to click a button in the web interface of the router. It is the client (browser) a http request sent to the router that this would have an incentive sever the connection to the WWW. Making the connection is just as from. To find out what exactly is sent when you reconnect to the router, we draw the entire process with live http headers and create a batch from the result for cURL.

IP router

First you should know the local IP address of the router. For you got under Start => Programs => Accessories => Command Prompt and type ipconfig in the open and press Enter. Then should be the default gateway be the IP address of your router.











Login
There are basically two ways that you can you logon to the router. If it the local IP of your router in the browser requests and it appears at the beginning such a window as the screenshot, it is called an htaccess login.


This is by far the better case. In such a login you need your access data in the following way to write to the batch.



http://username:password @ IP of the router
is much more difficult when the login is via an HTML form. This could look like this:

To recreate such a login with cURL, you need the login process to record live http headers. Click this, click Tools => live http headers and changes in the register generator. The hook for images and CSS can take out their purpose of clarity. Log into now and look at the result. It might look something like this:



POST / login.php username = username & password = password


This would be of the following cURL call:



curl "http://192.168.1.1/login.php"-d "username = username & password = password"-c "Cookies"


The parameter c cURL stores all cookies in the specified file . In order to use them later, you must use the-b "cookies.txt".

Reconnect record

If you're logged in, go to the page "disconnect" in which a button labeled or something like that is.





Now open on the Tools previously installed addon livehttpheaders and then click on the button to disconnect and turn to the connection again. Livehttpheaders has now recorded the entire process. So changes in the window of livehttpheaders and goes into the register generator. The whole thing should look something like this: create


Bat file


Now here are all POST and GET requests sent to the router listed. You have to figure out now what lines you need it. This is basically very simple. In my case a couple of Javascript files (. Js) and an image (. Gif) was requested. These lines are designed to reconnect completely unimportant. Only the first and the fifth line are required. When you know which lines you need, you copied this out and opens a text editor. (Eg Windows Notepad) adds the line there once a stable. In my case, two POST requests sent to the router, the first to separate the compound and the second to restore it. That this is POST, POST can be recognized by keyword at the beginning of the line. Basically just get POST and GET in question.


Now you have to rebuild the whole thing so that curl the two requests may be sent to the router. Let us take the first line before:

POST /? Ce = 1 & be = 0 & l0 =- 1 & l1 =- 1 0 = 13 & 1 & 5 = 2 = Shared_Internet
The first part before the space (red) shows where the request was sent. In the second part after the space (blue) is the post data. The whole thing looks as curl-call as follows:

curl "? Http://Benutzer:Passwort @ 10.0.0.138 / ce = 1 & be = 0 & l0 =- 1 & l1 =- 1"-d "0 = 13 & 1 = Shared_Internet & 5 = 2 "
The parameter d is the blue part will be sent as POST. If you log in you do not need the router, then user: password @ of course be omitted. Exactly the same must be done now with the second row and one is as good as the goal.

For these two lines

POST /? Ce = 1 & be = 0 & l0 =- 1 & l1 =- 1 0 = 13 & 1 & 5 = 2 = Shared_Internet
POST /? Ce = 1 & be = 0 & l0 =- 1 & l1 =- 1 0 = 12 & 1 & 5 = 2 = Shared_Internet
then, is the grown here:

curl "http://Benutzer:Passwort @ 10.0.0.138 / ce = 1 &? ; & be = 0 & l0 =- 1 & l1 =- 1-d 0 = 13 & 1 = 5 = 2 Shared_Internet "
curl" http://Benutzer:Passwort @ 10.0.0.138 / ce = 1 &? be = 0 & l0 =- 1 & l1 =- 1 " -D "0 = 12 & 1 = Shared_Internet & 5 = 2"
This looks very complicated, but basically very simple.

The text file you have just now asked to save with the extension and already you can try if it works.


special characters special characters from the cmd.exe command line interpreter (the black screen with gray text ;-)), but interpreted differently. This can be unhardened by the individual parts (URL, post data ...) is in double quotes. Not so with the percent sign, this will not be interpreted as a mere string. To solve this problem, all you have to double percent sign, behind each percent sign another insert.

example

curl-d "MODEM_LOG = dial & message = & Session = Connect + is + being terminated +% 0D% 0A" "http://192.168.0.1/st_poe.cgi"

.. . is "message & = & MODEM_LOG dial = Connect = session + is + being terminated% +% 0D% 0A%" to
curl-d "http://192.168.0.1/st_poe.cgi"

test result




can to test it for example on the page go http://whatismyip.org and remember you the current IP. Then performs the reconnect.bat by double and see if the IP changed.

The
curl.exe must (obviously) in the same folder as the reconnect.bat!
Good luck!


http://www.paehl.de/php/contact/
If it all works send me the result so that I can take on the whole in my database: see http://www.paehl.de/reconnect Incorporated

it will be in this program

0 comments:

Post a Comment