2 Star 2 Fork 4

Tody_Guo/php_issue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ffki.php 2.99 KB
一键复制 编辑 原始数据 按行查看 历史
<?
extract($_POST);
extract($_GET);
unset($_POST,$_GET);
$MDOS_Srv_List= array( "10.100.160.238", "172.17.0.56",
"10.100.160.246", "172.17.0.63",
"10.100.160.242", "172.17.0.60",
"10.100.160.240", "172.17.0.58",
"10.100.160.239", "172.17.0.57"
);
if (isset($ip) && isset($kid)){
$ip=trim($ip);
$kid=trim($kid);
$isFound="Fail";
if(in_array($ip, $MDOS_Srv_List)){
$servername="DRIVER={SQL Server};SERVER=10.100.160.176;DATABASE=ReportServer";
$conn=odbc_connect($servername,'thtfmes',"Mes&thtf",SQL_CUR_USE_ODBC);
if ($conn){
$sql1="SELECT Name FROM Master..SysDatabases";
$exec1=odbc_exec($conn, $sql1);
while(odbc_fetch_row($exec1)){
$sql=" SELECT ProductKeyID, ProductKeyStateID, ProductKeyState, HardwareID
FROM ".odbc_result($exec1,"Name").".dbo.ProductKeyInfo
WHERE (ProductKeyID = '$kid')";
$exec=odbc_exec($conn, $sql);
while(odbc_fetch_row($exec))
{
echo ":Product Key State:".odbc_result($exec,"ProductKeyState")."\r\n";
echo "set KeyStateID=".odbc_result($exec,"ProductKeyStateID")."\r\n";
if(odbc_result($exec,"ProductKeyStateID")>=3){
echo "oa3tool.exe /DecodeHwHash=\"".odbc_result($exec, "HardwareID")."\">decode.log\r\n";
$isFound="Pass";
}
odbc_close($conn);
}
}
}
odbc_close($conn);
}else{
// finding in new server
$servername="DRIVER={SQL Server};SERVER=$ip;DATABASE=SmartClient";
$conn=odbc_connect($servername,'thtfmes',"Mes&thtf",SQL_CUR_USE_ODBC);
if ($conn){
$sql="SELECT dbo.ProductKey.ProductKeyStateID, dbo.ProductKey.ProductKeyState
FROM dbo.ProductKey WHERE dbo.ProductKey.MSFTProductKeyID = '$kid'";
$exec=odbc_exec($conn, $sql);
if(odbc_fetch_row($exec)){
echo ":Product Key State:".odbc_result($exec, "ProductKeyState")."\r\n";
echo "set KeyStateID=".odbc_result($exec, "ProductKeyStateID")."\r\n";
if(odbc_result($exec, "ProductKeyStateID")>=3){
$sql="SELECT dbo.ProductKeyInfo.ProductKeyID,dbo.ProductKeyInfo.HardwareID
FROM dbo.ProductKey INNER JOIN
dbo.ProductKeyInfo ON dbo.ProductKey.ProductKeyID = dbo.ProductKeyInfo.ProductKeyID
WHERE (dbo.ProductKey.MSFTProductKeyID = '$kid')";
$exec=odbc_exec($conn, $sql);
if(odbc_fetch_row($exec)){
echo ":Product Key ID:".odbc_result($exec, "ProductKeyID")."\r\n";
echo ":MS Product Key ID:${kid}\r\n";
echo "oa3tool.exe /DecodeHwHash=\"".odbc_result($exec, "HardwareID")."\">decode.log\r\n";
$isFound="Bound";
}else{
echo ":[ERROR]: No KeyID was found\r\n";
}
}else{
$isFound="Consumed";
}
}else{
echo ":[ERROR]: No KeyID was found\r\n";
}
}else{
echo ":[ERROR]: No KeyID was found";
}
}
odbc_close($conn);
}else{
echo ":[ERROR]: information issue";
echo ":ip=$ip";
echo ":kid=$kid";
}
$fp=fopen("ffkilog.txt","a+");
fputs($fp, "[".date("Y-m-d H:i:s")."]: $ip->$kid called and result is $isFound\r\n");
fclose($fp);
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/tody_guo/php_issue.git
git@gitee.com:tody_guo/php_issue.git
tody_guo
php_issue
php_issue
master

搜索帮助