Directly an example description:
<% @ Page ContentType = "text / html; charset = big5" session = "false" import = "java.io. *"%>
title> head> <% runtime runtime = runtime.getime (); process process = null; string line = null; inputStream is = NULL; InputStreamReader ISR = NUFFEREDReader br = null; string ip = "Please hit the IP you want ping here"; // Please modify the above IP address Try {process = runtime.exec ("ping" ip); IS = process.getinputStream (); ISR = New InputStreamReader (IS); br = new bufferedreader (ISR); out.println ("
"); while ((line = br.readline ())! = null) {OUT.PRINTLN (LINE); out.flush ();} out.println (" pre>"); is.close (); isr.close (); br.close ();} catch (IOException E ) {OUT.Println (E); runtime.exit (1);}%> body> html>
Related resources: JSP-Webshells full set of summary