Leser: 1
6 Einträge, 1 Seite |
1
2
3
4
5
6
<form action="/admin/index.php?action=login" method="post" name="action">
<input type="hidden" name="ADMIN" value="f23af307ea00b284fb9e74c4cbabfbdf" />
<input type="text" name="username" size="12" value="">
<input type="password" name="password" size="12">
<input type="submit" name="login" value="Login">
</form>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
use WWW::Mechanize; use LWP::Debug qw(+); $username = "xxx"; $password = "xxx"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get( "https://meineSeite.de/admin" ); #Get ADMIN-ID $mech->content() =~ /name=\"ADMIN\" value=\"([^\"]+)/g; $hiddenField = $1; #Fill form $mech->submit_form( form_name => "action", fields => { ADMIN => $hiddenField, username => $username, password => $password}, button => 'login'); #Print site print $mech->content();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking <<URL>> for cookies
LWP::UserAgent::send_request: GET https://meineSeite/admin
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 242 bytes
LWP::UserAgent::request: Simple response: Moved Permanently
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking <<URL>> for cookies
LWP::UserAgent::send_request: GET https://meineSeite/admin
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 965 bytes
HTTP::Cookies::extract_cookies: Set cookie ADMIN => 829052f0173388362a649d8fe980081b
LWP::UserAgent::request: Simple response: OK
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking <<URL>> for cookies
HTTP::Cookies::add_cookie_header: - checking cookie path=/
HTTP::Cookies::add_cookie_header: - checking cookie ADMIN=829052f0173388362a649d8fe980081b
HTTP::Cookies::add_cookie_header: it's a match
HTTP::Cookies::add_cookie_header: Checking <<URL>> for cookies
LWP::UserAgent::send_request: POST https://meineSeite/admin/index.php?action=login
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 238 bytes
LWP::Protocol::collect: read 540 bytes
LWP::Protocol::collect: read 2348 bytes
LWP::Protocol::collect: read 219 bytes
LWP::Protocol::collect: read 419 bytes
LWP::Protocol::collect: read 160 bytes
LWP::Protocol::collect: read 1122 bytes
LWP::UserAgent::request: Simple response: OK
moritz+2007-10-14 11:22:23--Das ist übrigens ein Doppelposting: http://www.perlmonks.org/?node_id=644637
(Ich finde, man könnte zumindest darauf hinweisen...)
6 Einträge, 1 Seite |