JSP探針-虛擬機器主機JSP環境偵查工具

來源:互聯網
上載者:User
<%@page contentType="text/html;charset=gb2312"%><%@page import="java.io.*,java.util.*,java.net.*" %><%!String tblWidth = "700";String tblAlign = "center";String strOS =System.getProperty("os.name");private String getIp(){   String strTmp="";   try   {   strTmp =InetAddress.getLocalHost().getHostAddress();   return strTmp;   }   catch(Exception e)   {   return strTmp;   }}private String getSystemEnv() throws Exception{String OS = System.getProperty("os.name").toLowerCase();StringBuffer sb=new StringBuffer("");Process p=null;if(OS.indexOf("windows")>-1){   p=Runtime.getRuntime().exec("cmd /c set"); }else{   p=Runtime.getRuntime().exec("/bin/sh -c set"); }BufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));String line;while((line=br.readLine())!=null){   sb.append(line+"<br>");  }return sb.toString();}private String getDrivers(){StringBuffer sb=new StringBuffer("");File roots[]=File.listRoots();for(int i=0;i<roots.length;i++){   sb.append(roots[i]+" ");}return sb.toString();}%><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>jsp探針</title><style type="text/css"><!--body,td,th {font-size: 9pt;}body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}a:link {text-decoration: none;}a:visited {text-decoration: none;}a:hover {text-decoration: none;}a:active {text-decoration: none;}.STYLE4 {color: #000000}.STYLE5 {font-weight: bold; font-size: 10pt;}.STYLE7 {font-size: 10}--></style></head><body><table align="center" width="277" border="0"><tr>    <td width="90" align="center">Jsp探針 ver1.0 </td>    <td width="85" align="center"><a href="http://www.51safe.net">無憂安全網</a></td></tr></table><div align="center"><br>  <table width="<%=tblWidth%>" align="<%=tblAlign%>"   border="0" cellspacing="0" cellpadding="1">     <tr>       <td colspan="2" height="22" bgcolor="#E0E0E0"><span class="STYLE5">&nbsp;伺服器基本資料   </span> </td>     </tr>      <tr>        <td height="23" width="20%" >&nbsp;伺服器名稱</td>  <td>&nbsp;<%= request.getServerName() %>  </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;網域名稱/IP </td>  <td>&nbsp;<%= request.getServerName() %>  <%=getIp()%>  </td>     </tr>     <tr>       <td height="23">&nbsp;伺服器連接埠 </td>  <td>&nbsp;<%= request.getServerPort() %> </td>     </tr>      <tr>        <td height="23">&nbsp;用戶端連接埠 </td>  <td>&nbsp;<%= request.getRemotePort() %> </td>     </tr>      <tr>        <td height="23">&nbsp;用戶端IP </td>  <td>&nbsp;<%= request.getRemoteAddr() %> </td>     </tr>     <tr>       <td height="23">&nbsp;Web 服務器 </td>  <td>&nbsp;<%= application.getServerInfo() %> </td>     </tr>           <tr>       <td height="23">&nbsp;作業系統 </td>  <td>&nbsp;<%= strOS+" "+System.getProperty("sun.os.patch.level")+" Ver:"+System.getProperty("os.version") %> </td>     </tr>     <tr>       <td height="23">&nbsp;伺服器時間 </td>  <td>&nbsp;<%=new Date().toLocaleString()%> </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;CPU 資訊 </td>  <td>&nbsp;<%= System.getProperty("os.arch")%>  </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;磁碟分割 </td>  <td>&nbsp;<%= getDrivers()%>  </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;使用者當前工作目錄 </td>  <td>&nbsp;<%= System.getProperty("user.dir")%>  </td>     </tr>     <tr>       <td height="23">&nbsp;本檔案路徑 </td>  <td>&nbsp;<%= application.getRealPath(request.getRequestURI()) %> </td>     </tr>    </table>  <br>  <table width="<%=tblWidth%>" align="<%=tblAlign%>"   border="0" cellspacing="0" cellpadding="1">     <tr>       <td colspan="2" height="22" bgcolor="#E0E0E0"><span class="STYLE4">&nbsp;<span class="STYLE5">Java 相關資訊</span></span> </td>     </tr>     <tr>       <td height="23" width="20%" ><span class="STYLE7">&nbsp;JDK 版本</span> </td>  <td>&nbsp;<%= System.getProperty("java.version") %>  </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;Servlet 版本 </td>  <td>&nbsp;<%= application.getMajorVersion()+"."+application.getMinorVersion() %>  </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;JDK 安裝路徑 </td>  <td>&nbsp;<%= System.getProperty("java.home")%>  </td>     </tr>     <tr>       <td height="23" width="20%" >&nbsp;編碼 </td>  <td>&nbsp;<%= System.getProperty("file.encoding")%>  </td>     </tr>      <tr>        <td height="23" width="20%" >&nbsp;JAVA類路徑 </td>  <td>&nbsp;<%= System.getProperty("java.class.path")%>  </td>     </tr>    </table>  <br>  <table width="<%=tblWidth%>" align="<%=tblAlign%>"   border="0" cellspacing="0" cellpadding="1">     <tr>       <td colspan="2" height="22" bgcolor="#E0E0E0">&nbsp;伺服器環境變數 &nbsp;</td>     </tr>     <tr>  <td colspan="2"><%= getSystemEnv() %>  </td>     </tr>    </table>  <br>  </div></body></html>
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.