Bewertung: 0 / 5

Stern inaktivStern inaktivStern inaktivStern inaktivStern inaktiv
 

1)

 

#!/usr/bin/perl

use strict;
use LWP 5.64;
use Digest::MD5 "md5_hex";
my $boxpasswort = "FRITZ!BOX_PASSWORT"; my $user_agent = LWP::UserAgent->new;
# challenge string holen my $http_response = $user_agent->get("http://fritz.box/login_sid.lua"); $http_response->content =~ /<Challenge>(\w+)/i and my $challengeStr = $1; # response zur challenge generieren my $ch_Pw = "$challengeStr-$boxpasswort"; $ch_Pw =~ s/(.)/$1 . chr(0)/eg; my $md5 = lc(md5_hex($ch_Pw)); my $challenge_response = "$challengeStr-$md5"; # Session ID erfragen $http_response = $user_agent->get( "http://fritz.box/login_sid.lua?user=&response=$challenge_response"); # Session ID aus XML Daten auslesen $http_response->content =~ /<SID>(\w+)/i and my $sid = $1; # by rgh # die reine Watt-Zahl # server $http_response = $user_agent->get("http://fritz.box/webservices/homeautoswitch.lua?ain=08761001xxxx&switchcmd=getswitchpower&sid=$sid"); # spuck es uns aus print $http_response->content; . .

 

 2)

 

#!/usr/bin/perl

use strict;
use LWP 5.64;
use Digest::MD5 "md5_hex";

my $boxpasswort = "FRITZ!BOX_PASSWORT";
my $user_agent = LWP::UserAgent->new;

# challenge string holen
my $http_response = $user_agent->get("http://fritz.box/login_sid.lua");

$http_response->content =~ /<Challenge>(\w+)/i and my $challengeStr = $1;

# response zur challenge generieren
my $ch_Pw = "$challengeStr-$boxpasswort";
$ch_Pw =~ s/(.)/$1 . chr(0)/eg;
my $md5 = lc(md5_hex($ch_Pw));
my $challenge_response = "$challengeStr-$md5";

# Session ID erfragen
$http_response = $user_agent->get( "http://fritz.box/login_sid.lua?user=&response=$challenge_response");

# Session ID aus XML Daten auslesen
$http_response->content =~ /<SID>(\w+)/i and my $sid = $1;

# by rgh
# Temperatur inside
$http_response = $user_agent->get("http://fritz.box/webservices/homeautoswitch.lua?switchcmd=getdevicelistinfos&sid=$sid");sid=$sid");

# spuck es uns aus
print $http_response->content;
.
.

 

 

 

 

SeitenURL :
Qr Code