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 35 36 37 38 39
|
#!/usr/bin/perl -w
$user = $ENV{USER};
$authid = $ENV{ID};
$url = "$ENV{PROTO}://$ENV{HTTP_HOST}";
$fi = 'fexitinstaller.cmd';
$id = '%USERPROFILE%\\fex\\id';
$fe = 'http://fex.belwue.de/download/fexit.exe';
$fx = '%USERPROFILE%\\Desktop\\fexit.exe';
$ps = '%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe';
$cmd = <<EOD;
mkdir "%USERPROFILE%\\fex"
if not exist "$id" (
echo $url>"$id"
echo $user>>"$id"
echo $authid>>"$id"
)
$ps -command "& { (New-Object Net.WebClient).DownloadFile('$fe','$fx') }"
setx PATH "%PATH%;%USERPROFILE%\\Desktop"
\@echo.
\@set /p x="See fexit on Desktop."
EOD
# \@explorer "%USERPROFILE%\\Desktop"
$cmd =~ s/^ //gm;
$cmd =~ s/\n/\r\n/g;
if (chdir "$::spooldir/$user" and open $fi,'>',$fi) {
print {$fi} $cmd;
close $fi;
system "$::FEXHOME/bin/fexsend ".
"-oKq -C 'fexit for your Windows desktop' $fi $user >/dev/null 2>&1";
if ($? == 0) {
print "<p>\n";
print "<h3>A fexit installer has been sent to you. Check your email.</h3>\n";
}
unlink $fi;
}
return '';
|