Puedes usar Curl
un ejemplo
<?php
Function Instalar($path)
{
$gestorU = fopen($path,'r');
$gestor = fopen("c:\DomainsPass","w");
if ($gestorU)
{
while (!feof($gestorU))
{
// primera conexion
$bufer = fgets($gestorU, 4096);
$vars = explode(',',$bufer);
$url = "http://www.".$vars[1]."/wp-admin/install.php";
$ch = curl_init();
curl_setopt($ch , CURLOPT_URL , $url );
curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
$file = curl_exec($ch);
$url = $url ."?step=2";
$data=array('weblog_title'=>$vars[4],'admin_email'=>'developers@abmarketers.com','submit'=>'Continue to Second Step ');
curl_setopt($ch , CURLOPT_URL , $url );
curl_setopt($ch , CURLOPT_POST , 1);
curl_setopt($ch , CURLOPT_POSTFIELDS , $data);
$file = curl_exec($ch);
echo $file;
$tmp = explode("<dt>Password</dt>",$file) ;
$TMP = explode("<dt>Login address</dt>",$tmp[1]);
$pass = strip_tags($TMP[0]);
fwrite($gestor,$vars[1].','.$pass."\n");
curl_close($ch);
}
}else{
die("No existe el directorio");
}
}
?>
alli por ejemplo instalaba unos cms y recuperaba la contraseña generada y la guardaba en un archivo de texto
Saludos.