Board logo

标题: [网络工具] 批处理版WebShell管理器 [打印本页]

作者: novaa    时间: 2007-12-13 13:49     标题: 批处理版WebShell管理器

  1. ::code by Novaa bbs.bathome.net 2007/12/13
  2. @echo off&color 02&Title WebShell管理器&mode con cols=80 lines=25
  3. set "Table=echo\&echo\"
  4. set "Back=       返回主菜单请输入:B"
  5. set "Twice=       任意键以继续!&echo\"
  6. set "Menu=endlocal&set Again=&goto Menu"
  7. if not exist WebShell.ini cd.>WebShell.ini
  8. :Menu
  9. cls&setlocal enabledelayedexpansion
  10. set "Function=1.添加网站分类,2.添加网站(WebShell),3.打开/删除网站,4.删除网站分类,5.退出"
  11. for /f "delims=" %%i in (WebShell.ini) do (
  12. set Get=%%i&set /a Type_Num+=1
  13. if "!Get:~0,1!"=="/" (
  14. set /a Type_1+=1&set !Type_1!=!Get:~1!
  15. set Type=!Get:~1!&set !Type!=!Get:~1!
  16. set Type_Num=0
  17. ) else (set !Type!!Type_Num!=%%i)
  18. )
  19. cls&echo\
  20. if defined Again goto :!Again!
  21. %Table%
  22. for %%i in (!Function!) do set /p=              %%i<nul&echo\&echo\
  23. set /p Choice=请选择功能:
  24. echo\&echo\
  25. if "%Choice%"=="5" exit
  26. for %%i in (1,2,3,4) do if "%Choice%"=="%%i" set Go=1
  27. if defined Go (goto :Choice%Choice%) else echo    错误的输入!&ping /n 3 127.1>nul&goto :Menu
  28. )
  29. :Choice1
  30. cls&%Table%
  31. set /p=        请输入你想添加的网站类别:<nul
  32. set /p WebType=
  33. if defined %WebType% echo 此类名已经存在!&ping /n 3 127.1>nul&cls&%Table%&goto :Choice1
  34. echo /!WebType!>>WebShell.ini&cls&%Table%
  35. echo        类别已经成功添加!
  36. %Table%
  37. echo        %Twice%
  38. echo        %Back%
  39. set /p Choice_1=
  40. if /i "%Choice_1%"=="b" %Menu%
  41. endlocal&set Again=Choice1&goto Menu
  42. :Choice2
  43. cls&%Table%
  44. call :Echo
  45. set /p Choice_2=        请选择你想添加的网站所属分类:
  46. set "Type_1=/!%Choice_2%!"
  47. cls&%Table%
  48. set /p WebDesc=        请输入网站的描述:
  49. %Table%
  50. set /p WebName=        请输入你想添加的网站域名:
  51. %Table%
  52. set /p WebPassword=        请输入网站密码:
  53. ::网站添加时间
  54. set date=%date%&set time=%time%
  55. set date=%date:~0,-4%&set time=%time:~0,-3%
  56. set "AddTime=%date% %time%"
  57. set "WebOk=!WebDesc!+!WebName!+!WebPassword!+!AddTime!"
  58. for /f "delims=" %%i in (WebShell.ini) do (
  59. echo %%i>>WebShell.txt
  60. if /i "%%i"=="!Type_1!" echo !%Choice_2%!+!WebOk!>>WebShell.txt
  61. )
  62. del WebShell.ini &ren "WebShell.txt" "WebShell.ini"
  63. %Table%
  64. echo        网站添加成功!&%Table%&echo %Twice%&%Table%&echo %Back%
  65. set /p Choice_12=
  66. if /i "%Choice_12%"=="b" %Menu%
  67. endlocal&set Again=Choice2&goto Menu
  68. :Choice3
  69. cls&%Table%
  70. call :Echo
  71. %Table%
  72. echo  %Back%
  73. %Table%
  74. set /p Choice_3=        请选择你想打开/删除的网站所属分类:
  75. if /i "%Choice_3%"=="B" %Menu%
  76. set /a Choice_33=Choice_3+1
  77. if not defined !%Choice_33%! goto :Next_1
  78. :Next
  79. cls
  80. call set OpenType=/!%Choice_3%!
  81. call set OpenType_1=/!%Choice_33%!
  82. for /f "tokens=1* delims=:" %%i in ('findstr /n .* WebShell.ini') do (
  83. if "%%j"=="%OpenType%" set StartLine=%%i
  84. if "%%j"=="%OpenType_1%" set EndLineNum=%%i
  85. )
  86. set /a Choice_Num=%EndLineNum%-%StartLine%-1
  87. echo  ===网站描述------网站后台------网站密码------网站添加时间===
  88. for /l %%i in (1 1 %Choice_Num%) do (
  89. call set Type_Name=!%Choice_3%!%%i
  90. call set TypeName=%%!Type_name!%%
  91. call :EchoWeb
  92. )
  93. %Table%
  94. echo        打开网站输入字母O+网站编号(比如O1)
  95. echo        删除网站输入字母D+网站编号(比如D1)
  96. echo\&echo %Twice%
  97. echo %Back%
  98. set /p Choice_Next=
  99. set Choice_Next11=%Choice_Next:~0,1%
  100. set Choice_Next12=%Choice_Next:~1,1%
  101. if /i "!Choice_Next11!"=="D"  call :DelW
  102. if /i "!Choice_Next11!"=="o"  call :OpenWeb
  103. if /i "!Choice_Next11!"=="B"  %Menu%
  104. endlocal&set Again=Choice3&goto Menu
  105. :Next_1
  106. cls
  107. call set OpenType=/!%Choice_3%!
  108. set EndLineNum=0
  109. for /f "delims=" %%i in (WebShell.ini) do set /a EndLineNum+=1
  110. for /f "tokens=1* delims=:" %%i in ('findstr /n .* WebShell.ini') do if "%%j"=="%OpenType%" set StartLine=%%i
  111. set /a Choice_Num=%EndLineNum%-%StartLine%
  112. echo  ===网站描述------网站后台------网站密码------网站添加时间===
  113. for /l %%i in (1 1 %Choice_Num%) do (
  114. call set Type_Name=!%Choice_3%!%%i
  115. call set TypeName=%%!Type_name!%%
  116. call :EchoWeb
  117. )
  118. %Table%
  119. echo        打开网站输入O+网站编号(比如O1)
  120. echo        删除网站输入字母D+网站编号(比如D1)
  121. echo\&echo %Twice%
  122. echo %Back%
  123. set /p Choice_Next_1=
  124. set Choice_Next11=%Choice_Next_1:~0,1%
  125. set Choice_Next12=%Choice_Next_1:~1,1%
  126. if /i "!Choice_Next11!"=="d"  call :DelW
  127. if /i "!Choice_Next11!"=="o"  call :OpenWeb
  128. if /i "!Choice_Next11!"=="b"  %Menu%
  129. endlocal&set Again=Choice3&goto Menu
  130. :Choice4
  131. if exist WebShell.txt del WebShell.txt
  132. cls&%Table%
  133. call :Echo
  134. echo        请输入想删除的类别编号:
  135. %Table%
  136. echo %Back%
  137. set /p Choice4_DT=
  138. if "%Choice4_DT%"=="b" %Menu%
  139. findstr /v !%Choice4_DT%! WebShell.ini>>WebShell.txt
  140. del WebShell.ini &ren "WebShell.txt" "WebShell.ini"
  141. echo        软件删除成功!&ping /n 3 127.1>nul
  142. %Table%
  143. echo %Back%
  144. %Table%
  145. echo %Twice%
  146. set /p Choice_DelT=
  147. if /i "!Choice_DelT!"=="b"  %Menu%
  148. endlocal&set Again=Choice4&goto Menu
  149. :Echo
  150. %Table%
  151. for /l %%i in (1,1,%Type_1%) do set /p=      ^(%%i^) !%%i!<nul&%Table%
  152. goto :eof
  153. :EchoWeb
  154. for /f "tokens=1,2,3,4* delims=+" %%j in ("%TypeName%") do (
  155. set Web_Desc=%%k&set Web_Name=%%l&set Web_PassWord=%%m&set Web_AddTime=%%n
  156. set /p= ^(%%i^) !Web_Desc!       !Web_Name!      !Web_Password!      !Web_AddTime!<nul&echo\
  157. )
  158. goto :eof
  159. :OpenWeb
  160. for /l %%i in (1 1 %Choice_Num%) do (
  161. if "%%i"=="%Choice_Next12%" (
  162. call set Type_Name=!%Choice_3%!%%i
  163. call set TypeName=%%!Type_name!%%
  164. )
  165. )
  166. for /f "tokens=1,2,3* delims=+" %%i in ("%TypeName%") do start http://%%k
  167. goto :eof
  168. :DelW
  169. for /l %%i in (1 1 %Choice_Num%) do (
  170. if "%%i"=="%Choice_Next12%" (
  171. call set Type_Name=!%Choice_3%!%%i
  172. call set TypeName=%%!Type_name!%%
  173. )
  174. )
  175. findstr /v /c:"!TypeName!" WebShell.ini>>WebShell.txt
  176. del WebShell.ini&ren "WebShell.txt" "WebShell.ini"
  177. echo        网站删除成功!&ping /n 3 127.1>nul
  178. goto :eof
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2