JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 20.01.2013, 18:14
FireVortex
Guest
 
Posts: n/a
Arrow Script de reconexión para firmware Gargoyle (basado en OpenWRT)

Buenas buenas, estuve buscando por Internet y en los foros mismos de JDownloader y no encontré un script para reiniciar la conexión de un router ejecutando el firmware Gargoyle (el cual es una interfaz del firmware OpenWRT) por lo que decidí realizar uno.

Lo hice "a las apuradas" (quick & dirty) y solamente lo probé con mi router TP-LINK TL-WR1043ND.

El código del script es el siguiente:

Code:
[[[HSRC]]]
    [[[STEP]]]
        [[[REQUEST]]]
            POST /utility/get_password_cookie.sh HTTP/1.1
            Connection: keep-alive
            Content-type: application/x-www-form-urlencoded
            Accept: */*
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
            password=%%%pass%%%
        [[[/REQUEST]]]
 
        [[[RESPONSE keys="hash"]]]
           hash=(.*?);
        [[[/RESPONSE]]]
        [[[RESPONSE keys="exp"]]]
           exp=(.*?);
        [[[/RESPONSE]]]
        [[[RESPONSE keys="browser_time"]]]
           browser_time=(.*?);
        [[[/RESPONSE]]]
    [[[/STEP]]]
 
    [[[STEP]]]
        [[[REQUEST]]]
            GET /login.sh HTTP/1.1
            Cookie: hash=%%%hash%%%; exp=%%%exp%%%; browser_time=%%%browser_time%%%;
            Connection: keep-alive
            Content-type: application/x-www-form-urlencoded
            Accept: */*
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
        [[[/REQUEST]]]
    [[[/STEP]]]
 
    [[[STEP]]]
        [[[REQUEST]]]
            GET /overview.sh HTTP/1.1
            Cookie: hash=%%%hash%%%; exp=%%%exp%%%; browser_time=%%%browser_time%%%;
            Connection: keep-alive
            Content-type: application/x-www-form-urlencoded
            Accept: */*
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
        [[[/REQUEST]]]
    [[[/STEP]]]
 
    [[[STEP]]]
        [[[REQUEST]]]
            GET /basic.sh HTTP/1.1
            Cookie: hash=%%%hash%%%; exp=%%%exp%%%; browser_time=%%%browser_time%%%;
            Connection: keep-alive
            Content-type: application/x-www-form-urlencoded
            Accept: */*
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
        [[[/REQUEST]]]
    [[[/STEP]]]
 
    [[[STEP]]]
        [[[REQUEST]]]
            POST /utility/run_commands.sh HTTP/1.1
            Connection: keep-alive
            Content-type: application/x-www-form-urlencoded
            Accept: */*
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
            commands=ifup wan&hash=%%%hash%%%
        [[[/REQUEST]]]
    [[[/STEP]]]
[[[/HSRC]]]

Código disponible en GitHub: **External links are only visible to Support Staff****External links are only visible to Support Staff**

Debería funcionar en cualquier dispositivo que se encuentre corriendo Gargoyle.

Sería bueno que los desarrolladores lo incluyeran en futuras revisiones de JDownloader.

Last edited by FireVortex; 20.01.2013 at 18:28.
Reply With Quote
  #2  
Old 21.01.2013, 17:31
FireVortex
Guest
 
Posts: n/a
Arrow Script de reconexión para firmware Gargoyle (basado en OpenWRT) [Revisión Nº 2]

Aparentemente la versión anterior del script fallaba a veces en renovar la conexión.
La cuestión principal está en el manejo de las cookies debido a que Gargoyle utiliza un hash al momento de enviar comandos a ejecutar con el fin de prevenir Replay Attacks (seguiré investigando ésto).

Mi "laboratorio" de pruebas consta de:
  • Router TP-LINK TL-WR1043ND v1.8 (Firmware: Gargoyle 1.5.9)
  • Sistema Operativo: Windows 7 Professional x32
  • JDownloader 0.9.581
  • Wireshark 1.8.4

Revisión Nº 2:
Code:
[[[HSRC]]]
    [[[STEP]]]
        [[[REQUEST]]]
            POST /utility/get_password_cookie.sh HTTP/1.1
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
            password=%%%pass%%%
        [[[/REQUEST]]]
        [[[RESPONSE keys="hash"]]]
           hash=(.*?);
        [[[/RESPONSE]]]
        [[[RESPONSE keys="exp"]]]
           exp=(.*?);
        [[[/RESPONSE]]]
        [[[RESPONSE keys="browser_time"]]]
           browser_time=(.*?);
        [[[/RESPONSE]]]
    [[[/STEP]]]
 
    [[[STEP]]]
        [[[REQUEST]]]
            GET /login.sh HTTP/1.1
            Cookie: hash=%%%hash%%%; exp=%%%exp%%%; browser_time=%%%browser_time%%%;
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
        [[[/REQUEST]]]
        [[[RESPONSE keys="hash"]]]
           hash=(.*?);
        [[[/RESPONSE]]]
        [[[RESPONSE keys="exp"]]]
           exp=(.*?);
        [[[/RESPONSE]]]
        [[[RESPONSE keys="browser_time"]]]
           browser_time=(.*?);
        [[[/RESPONSE]]]
    [[[/STEP]]]
 
    [[[STEP]]]
        [[[REQUEST]]]
            POST /utility/run_commands.sh HTTP/1.1
            Cookie: hash=%%%hash%%%; exp=%%%exp%%%; browser_time=%%%browser_time%%%;
            Accept-Charset: UTF-8
            Host: %%%routerip%%%
            commands=ifup wan&hash=%%%hash%%%
        [[[/REQUEST]]]
    [[[/STEP]]]
[[[/HSRC]]]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 04:15.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.