I think this is the best solution ... now i'm trying to create the script!
<form method="post" action="index.lp" name="authform" id="authform">
<input type="password" name="password" id="password" onkeypress="return enter_submit(event);" />
<input name="enter" class="btn btn-primary" type="button" value="log in" onclick='auth()' />
Now i'm testing it on computer and have some problem:
1) Perl need a c compiler...after i can install it on openwrt?
2) I can try 2 different ways,
The first and more rapid is to use WWW::Scripter::Plugin::JavaScript but i cannot install the module because i cannot install mingw (i did, in ppm-shell, install mingw and it return "ppm install failed: Can't find any package that provides mingw"). Furthermore i don't see WWW::Scipter in https://lede-project.org/packages/index … ges---perl
I wrote that script (can it work?):
use WWW::Scripter;
$w = new WWW::Scripter;
$w->use_plugin('JavaScript');
$w->get('http://url');
$w->get('javascript:document.getElementById("password").value = "password";auth();');
sleep (1);
$w->get('http://url');
$w->get('javascript: function();');
The second is to use WWW:Mechanize. How i can see output page? And how i can send command to the second page? Now with that script i get this error: "Missing base argument at D:/Program Files/Perl/lib/HTTP/Response.pm line 92."
(can it work?)
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->get( $url );
$mech->follow_link( url => 'http://url' );
$mech->submit_form(
form_name => 'authform',
fields => { password => 'password', },
button => 'log in'
);
eduperez wrote:In most cases, you do not need to execute any JS to emulate a login page. Do not focus on the JS, focus on the content that gets sent to the server. Most probably, all what that JS does is to prepare some variables and launch a POST against the server. Use the debugging capabilities of your browser, intercept what is sent to the server, and you will have most of the work done.
I've already read the http header but it use some md5 (i think) and i don't know how to solve! I think also that with script i can solve quickly...
(Last edited by Squalo on 3 Nov 2017, 12:47)