DEDECMS织梦忘记管理帐号和密码的解决方法 – DeD


avatar
pcwnas 2023-04-21 231

原文来自:https://www.zixuephp.com

DEDECMS织梦忘记管理帐号和密码的解决方法

我们在使用DEDECMS织梦管理系统时,有时也会忘记管理帐号名,有时会忘记管理密码,这时我们就得想办法找回管理帐号名或密码,织梦管理员密码重设工具有UTF-8/GBK两个版本,适用于 DedeCMS V5.3-5.6 版本,5.7也可以没测试,应该也是可以的.

这样可以方便新手操作,也可以进数据库对加密后的密码进行破解,这样也能找回忘记了的帐号或密码.

DEDECMS织梦GBK版本,复制一下代码:

  1. <?php
  2. //error_reporting(E_ALL||~E_NOTICE);
  3. require_once(dirname(__FILE__)."/include/common.inc.php");
  4. if(emptyempty($step))
  5. {
  6. $step=1;
  7. }
  8. ?>
  9. <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <htmlxmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
  13. <title>密码重设工具_GBK</title>
  14. <styletype="text/css">
  15. <!–
  16. body{
  17. font-family:"MSSerif","NewYork",serif;
  18. font-size:12px;
  19. color:#000;
  20. }
  21. table{
  22. border-top-width:1px;
  23. border-right-width:1px;
  24. border-left-width:1px;
  25. border-top-style:dotted;
  26. border-right-style:dotted;
  27. border-left-style:dotted;
  28. border-top-color:#CCC;
  29. border-right-color:#CCC;
  30. border-left-color:#CCC;
  31. }
  32. td{
  33. border-bottom-width:1px;
  34. border-bottom-style:dotted;
  35. border-bottom-color:#CCC;
  36. }
  37. –>
  38. </style>
  39. </head>
  40. <body>
  41. <?php
  42. if($step==1)
  43. {
  44. $dsql->SetQuery("Select*From`detest_admin`whereusertype='10'");
  45. $dsql->Execute("ut");
  46. ?>
  47. <tablewidth="98%"border="0"align="center"cellpadding="3"cellspacing="1">
  48. <tr>
  49. <tdheight="19"bgcolor="#E7E7E7"><tablewidth="96%"border="0"cellspacing="1"cellpadding="1">
  50. <tr>
  51. <tdwidth="24%"><b><strong>第一步:选择管理员账号</strong></b></td>
  52. <tdwidth="76%"align="right">&nbsp;</td>
  53. </tr>
  54. </table></td>
  55. </tr>
  56. <tr>
  57. <tdheight="215"align="center"valign="top"bgcolor="#FFFFFF"><formaction="radminpass.php"method="post"name="form1"id="form1">
  58. <inputtype="hidden"name="step"value="2"/>
  59. <tablewidth="98%"border="0"cellspacing="1"cellpadding="1">
  60. <tr>
  61. <tdheight="60"colspan="2"align="left">本工具是用于新人忘记管理员密码重设所制作,只需要将radminpass.php文件拷贝到根目录,运行&ldquo;http://phpfensi.com/radminpass.php(phpfensi.com为网站域名)&rdquo;,按照操作执行就可以。<fontcolor="#FF0000">恢复完成后请及时删除这个文件!</font></td>
  62. </tr>
  63. <tr>
  64. <tdwidth="16%"height="30"align="left">选择超级管理员ID:</td>
  65. <tdwidth="84%"align="left">
  66. <selectname='id'style='width:150px'>
  67. <?php
  68. while($myrow=$dsql->GetObject("ut"))
  69. {
  70. echo"<optionvalue='".$myrow->id."'>".$myrow->userid."</option>\r\n";
  71. }
  72. ?>
  73. </select>
  74. </td>
  75. </tr>
  76. <tr>
  77. <tdheight="60"align="left">&nbsp;</td>
  78. <tdalign="left"><inputtype="submit"name="Submit"value="下一步&gt;"class="coolbgnp"/></td>
  79. </tr>
  80. </table>
  81. </form></td>
  82. </tr>
  83. </table>
  84. <?php
  85. }elseif($step==2){
  86. $row=$dsql->GetOne("Select*From`detest_admin`whereid='$id'");
  87. ?>
  88. <tablewidth="98%"border="0"align="center"cellpadding="3"cellspacing="1">
  89. <tr>
  90. <tdheight="19"bgcolor="#E7E7E7"><tablewidth="96%"border="0"cellspacing="1"cellpadding="1">
  91. <tr>
  92. <tdwidth="24%"><b><strong>第二步:修改管理员密码</strong></b></td>
  93. <tdwidth="76%"align="right">&nbsp;</td>
  94. </tr>
  95. </table></td>
  96. </tr>
  97. <tr>
  98. <tdheight="215"align="center"valign="top"bgcolor="#FFFFFF"><formaction="radminpass.php"method="post"name="form1"id="form1">
  99. <inputname="step"type="hidden"id="step"value="3"/>
  100. <inputtype="hidden"name="id"value="<?phpecho$row['id']?>"/>
  101. <tablewidth="98%"border="0"cellspacing="1"cellpadding="1">
  102. <tr>
  103. <tdwidth="16%"height="30"align="left">用户登录ID:</td>
  104. <tdwidth="84%"align="left"><?phpecho$row['userid']?></td>
  105. </tr>
  106. <tr>
  107. <tdheight="30"align="left">用户笔名:</td>
  108. <tdalign="left"><inputname="uname"type="text"id="uname"size="16"value="<?phpecho$row['uname']?>"style="width:200px"/>
  109. &nbsp;(发布文章后显示责任编辑的名字)</td>
  110. </tr>
  111. <tr>
  112. <tdheight="30"align="left">用户密码:</td>
  113. <tdalign="left"><inputname="pwd"type="text"id="pwd"size="16"style="width:200px"/>
  114. &nbsp;(留空则不修改,只能用'0-9a-zA-Z.@_-!'以内范围的字符)</td>
  115. </tr>
  116. <tr>
  117. <tdheight="60"align="left">&nbsp;</td>
  118. <tdalign="left"><inputtype="submit"name="Submit"value="确定修改"class="coolbgnp"/></td>
  119. </tr>
  120. </table>
  121. </form></td>
  122. </tr>
  123. </table>
  124. <?php
  125. }elseif($step==3){
  126. $pwdm='';
  127. if($pwd!=''){
  128. $pwdm=",pwd='".md5($pwd)."'";
  129. $pwd=",pwd='".substr(md5($pwd),5,20)."'";
  130. }
  131. $query="Update`detest_admin`setuname='$uname'$pwdwhereid='$id'";
  132. $dsql->ExecuteNoneQuery($query);
  133. $query="Update`detest_member`setuname='$uname'$pwdmwheremid='$id'";
  134. $dsql->ExecuteNoneQuery($query);
  135. ShowMsg("成功更改一个帐户!","radminpass.php");
  136. }
  137. ?>
  138. </body>
  139. </html>

DEDECMS织梦UTF8版本复制以下代码:

  1. <?php
  2. //error_reporting(E_ALL||~E_NOTICE);
  3. require_once(dirname(__FILE__)."/include/common.inc.php");
  4. if(emptyempty($step))
  5. {
  6. $step=1;
  7. }
  8. ?>
  9. <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <htmlxmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
  13. <title>密码重设工具_UTF-8</title>
  14. <styletype="text/css">
  15. <!–
  16. body{
  17. font-family:"MSSerif","NewYork",serif;
  18. font-size:12px;
  19. color:#000;
  20. }
  21. table{
  22. border-top-width:1px;
  23. border-right-width:1px;
  24. border-left-width:1px;
  25. border-top-style:dotted;
  26. border-right-style:dotted;
  27. border-left-style:dotted;
  28. border-top-color:#CCC;
  29. border-right-color:#CCC;
  30. border-left-color:#CCC;
  31. }
  32. td{
  33. border-bottom-width:1px;
  34. border-bottom-style:dotted;
  35. border-bottom-color:#CCC;
  36. }
  37. –>
  38. </style>
  39. </head>
  40. <body>
  41. <?php
  42. if($step==1)
  43. {
  44. $dsql->SetQuery("Select*From`detest_admin`whereusertype='10'");
  45. $dsql->Execute("ut");
  46. ?>
  47. <tablewidth="98%"border="0"align="center"cellpadding="3"cellspacing="1">
  48. <tr>
  49. <tdheight="19"bgcolor="#E7E7E7"><tablewidth="96%"border="0"cellspacing="1"cellpadding="1">
  50. <tr>
  51. <tdwidth="24%"><b><strong>第一步:选择管理员账号</strong></b></td>
  52. <tdwidth="76%"align="right">&nbsp;</td>
  53. </tr>
  54. </table></td>
  55. </tr>
  56. <tr>
  57. <tdheight="215"align="center"valign="top"bgcolor="#FFFFFF"><formaction="radminpass.php"method="post"name="form1"id="form1">
  58. <inputtype="hidden"name="step"value="2"/>
  59. <tablewidth="98%"border="0"cellspacing="1"cellpadding="1">
  60. <tr>
  61. <tdheight="60"colspan="2"align="left">本工具是用于新人忘记管理员密码重设所制作,只需要将radminpass.php文件拷贝到根目录,运行“http://phpfensi.com/radminpass.php(phpfensi.com为网站域名)”,按照操作执行就可以。<fontcolor="#FF0000">恢复完成后请及时删除这个文件!</font></td>
  62. </tr>
  63. <tr>
  64. <tdwidth="16%"height="30"align="left">选择超级管理员ID:</td>
  65. <tdwidth="84%"align="left">
  66. <selectname='id'style='width:150px'>
  67. <?php
  68. while($myrow=$dsql->GetObject("ut"))
  69. {
  70. echo"<optionvalue='".$myrow->id."'>".$myrow->userid."</option>\r\n";
  71. }
  72. ?>
  73. </select>
  74. </td>
  75. </tr>
  76. <tr>
  77. <tdheight="60"align="left">&nbsp;</td>
  78. <tdalign="left"><inputtype="submit"name="Submit"value="下一步&gt;"class="coolbgnp"/></td>
  79. </tr>
  80. </table>
  81. </form></td>
  82. </tr>
  83. </table>
  84. <?php
  85. }elseif($step==2){
  86. $row=$dsql->GetOne("Select*From`detest_admin`whereid='$id'");
  87. ?>
  88. <tablewidth="98%"border="0"align="center"cellpadding="3"cellspacing="1">
  89. <tr>
  90. <tdheight="19"bgcolor="#E7E7E7"><tablewidth="96%"border="0"cellspacing="1"cellpadding="1">
  91. <tr>
  92. <tdwidth="24%"><b><strong>第二步:修改管理员密码</strong></b></td>
  93. <tdwidth="76%"align="right">&nbsp;</td>
  94. </tr>
  95. </table></td>
  96. </tr>
  97. <tr>
  98. <tdheight="215"align="center"valign="top"bgcolor="#FFFFFF"><formaction="radminpass.php"method="post"name="form1"id="form1">
  99. <inputname="step"type="hidden"id="step"value="3"/>
  100. <inputtype="hidden"name="id"value="<?phpecho$row['id']?>"/>
  101. <tablewidth="98%"border="0"cellspacing="1"cellpadding="1">
  102. <tr>
  103. <tdwidth="16%"height="30"align="left">用户登录ID:</td>
  104. <tdwidth="84%"align="left"><?phpecho$row['userid']?></td>
  105. </tr>
  106. <tr>
  107. <tdheight="30"align="left">用户笔名:</td>
  108. <tdalign="left"><inputname="uname"type="text"id="uname"size="16"value="<?phpecho$row['uname']?>"style="width:200px"/>
  109. &nbsp;(发布文章后显示责任编辑的名字)</td>
  110. </tr>
  111. <tr>
  112. <tdheight="30"align="left">用户密码:</td>
  113. <tdalign="left"><inputname="pwd"type="text"id="pwd"size="16"style="width:200px"/>
  114. &nbsp;(留空则不修改,只能用'0-9a-zA-Z.@_-!'以内范围的字符)</td>
  115. </tr>
  116. <tr>
  117. <tdheight="60"align="left">&nbsp;</td>
  118. <tdalign="left"><inputtype="submit"name="Submit"value="确定修改"class="coolbgnp"/></td>
  119. </tr>
  120. </table>
  121. </form></td>
  122. </tr>
  123. </table>
  124. <?php
  125. }elseif($step==3){
  126. $pwdm='';
  127. if($pwd!=''){
  128. $pwdm=",pwd='".md5($pwd)."'";
  129. $pwd=",pwd='".substr(md5($pwd),5,20)."'";
  130. }
  131. $query="Update`detest_admin`setuname='$uname'$pwdwhereid='$id'";
  132. $dsql->ExecuteNoneQuery($query);
  133. $query="Update`detest_member`setuname='$uname'$pwdmwheremid='$id'";
  134. $dsql->ExecuteNoneQuery($query);
  135. ShowMsg("成功更改一个帐户!","radminpass.php");
  136. }
  137. ?>
  138. </body>
  139. </html>

将以上代码保存为radminpass.php,上传到网站根目录运行“http://phpfensi.com/radminpass.php(phpfensi.com为网站域名)”,按照操作执行就可以,恢复完成后请及时删除这个文件!