View Single Post
Old 01-14-2013, 04:30 AM  
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,383

Quote:
Originally Posted by $5 submissions View Post
Man, that's rough. Thanks for this: This is a simple JAR which parses the ICQ db for image files: http://rghost.net/42926385
I didn't get it. What exactly is "rough" there? Java is not an .exe and it's easy to reverse (de-compile). If you think there is a virus in some Java app, why don't you just check it here: http://www.showmycode.com/? That's so fuckin' simple and can be done even by a kid

Here is the REVERSED contents of that jar:

IFS.class
Code:
import java.io.PrintStream;
import java.util.Random;

public class IFS
{
    /* member class not found */
    class MyRunnable {}


    public IFS()
    {
    }

    public static void main(String args[])
    {
        System.out.println("ICQ Files Scanner 0.3");
        for(int i = 0; i < 50; i++)
            (new Thread(new MyRunnable(i))).start();

    }

    public static String generateString(Random random, String s, int i)
    {
        char ac[] = new char[i];
        for(int j = 0; j < i; j++)
            ac[j] = s.charAt(random.nextInt(s.length()));

        return new String(ac);
    }

    private static final int THREADS = 50;
}
IFS$MyRunnable.class
Code:
import java.io.*;
import java.net.*;
import java.util.Random;

private static class mThreadId
    implements Runnable
{

    public void run()
    {
        File file = new File("out");
        file.mkdirs();
        String s = String.format("ifs%d.txt", new Object[] {
            Integer.valueOf(mThreadId)
        });
        do
        {
            mTotal++;
            String s1 = IFS.generateString(random, "1234567890QWERTYUIOPASDFGHJKLZXCVBNM", 6);
            String s2 = String.format("http://files.mail.ru/%s", new Object[] {
                s1
            });
            try
            {
                URL url = new URL(s2);
                URLConnection urlconnection = url.openConnection();
                urlconnection.connect();
                urlconnection.getContent();
                String s3 = urlconnection.getContentType();
                int i = urlconnection.getContentLength();
                String s4 = "done    ";
                if(i != 4189)
                {
                    if("image/jpeg".equals(s3))
                    {
                        File file1 = new File("out", (new StringBuilder()).append(s1).append(".jpg").toString());
                        saveBinaryFile(urlconnection, i, url, file1);
                    } else
                    if("image/tiff".equals(s3))
                    {
                        File file2 = new File("out", (new StringBuilder()).append(s1).append(".tiff").toString());
                        saveBinaryFile(urlconnection, i, url, file2);
                    } else
                    if("image/x-ms-bmp".equals(s3))
                    {
                        File file3 = new File("out", (new StringBuilder()).append(s1).append(".bmp").toString());
                        saveBinaryFile(urlconnection, i, url, file3);
                    } else
                    if("image/png".equals(s3))
                    {
                        File file4 = new File("out", (new StringBuilder()).append(s1).append(".png").toString());
                        saveBinaryFile(urlconnection, i, url, file4);
                    } else
                    if("image/gif".equals(s3))
                    {
                        File file5 = new File("out", (new StringBuilder()).append(s1).append(".gif").toString());
                        saveBinaryFile(urlconnection, i, url, file5);
                    } else
                    {
                        File file6 = new File("out", (new StringBuilder()).append(s1).append(".mpg").toString());
                        saveBinaryFile(urlconnection, i, url, file6);
                    }
                } else
                {
                    s4 = "not found";
                }
                mSuccess++;
                double d = mSuccess / mTotal;
                String s5 = String.format("(%d) %s %d/%d=%f %s %d %s", new Object[] {
                    Integer.valueOf(mThreadId), s4, Integer.valueOf(mSuccess), Integer.valueOf(mTotal), Double.valueOf(d), s3, Integer.valueOf(i), s2
                });
                System.out.println(s5);
                writeToFile(s, s5);
            }
            catch(MalformedURLException malformedurlexception)
            {
                System.out.println(String.format("(%d) %s", new Object[] {
                    Integer.valueOf(mThreadId), malformedurlexception.getMessage()
                }));
            }
            catch(FileNotFoundException filenotfoundexception) { }
            catch(IOException ioexception)
            {
                System.out.println(String.format("(%d) %s", new Object[] {
                    Integer.valueOf(mThreadId), ioexception.getMessage()
                }));
            }
        } while(true);
    }

    private void saveBinaryFile(URLConnection urlconnection, int i, URL url, File file)
        throws IOException
    {
        InputStream inputstream = urlconnection.getInputStream();
        BufferedInputStream bufferedinputstream = new BufferedInputStream(inputstream);
        byte abyte0[] = new byte[i];
        boolean flag = false;
        int k = 0;
        do
        {
            if(k >= i)
                break;
            int j = bufferedinputstream.read(abyte0, k, abyte0.length - k);
            if(j == -1)
                break;
            k += j;
        } while(true);
        bufferedinputstream.close();
        if(k != i)
        {
            throw new IOException((new StringBuilder()).append("Only read ").append(k).append(" bytes; Expected ").append(i).append(" bytes").toString());
        } else
        {
            FileOutputStream fileoutputstream = new FileOutputStream(file);
            fileoutputstream.write(abyte0);
            fileoutputstream.flush();
            fileoutputstream.close();
            return;
        }
    }

    private void writeToFile(String s, String s1)
    {
        BufferedWriter bufferedwriter;
        Object obj = null;
        bufferedwriter = null;
        FileWriter filewriter = new FileWriter(s, true);
        bufferedwriter = new BufferedWriter(filewriter);
        bufferedwriter.append(s1);
        bufferedwriter.newLine();
        try
        {
            if(bufferedwriter != null)
                bufferedwriter.close();
        }
        catch(IOException ioexception) { }
        break MISSING_BLOCK_LABEL_128;
        IOException ioexception1;
        ioexception1;
        System.out.println(String.format("(%d) %s", new Object[] {
            Integer.valueOf(mThreadId), ioexception1.getMessage()
        }));
        try
        {
            if(bufferedwriter != null)
                bufferedwriter.close();
        }
        catch(IOException ioexception2) { }
        break MISSING_BLOCK_LABEL_128;
        Exception exception;
        exception;
        try
        {
            if(bufferedwriter != null)
                bufferedwriter.close();
        }
        catch(IOException ioexception3) { }
        throw exception;
    }

    private static final String CHARS = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM";
    private static final int ID_LENGTH = 6;
    private static final String STR_MESSAGE = "(%d) %s";
    private static final String STR_SUCCESS = "(%d) %s %d/%d=%f %s %d %s";
    private static final String FILE_NAME = "ifs%d.txt";
    private static final String URL = "http://files.mail.ru/%s";
    private static final int MAX_SIZE = 0x6400000;
    private final Random random = new Random();
    private final int mThreadId;
    private int mSuccess;
    private int mTotal;

    public tion(int i)
    {
        mSuccess = 0;
        mTotal = 0;
        mThreadId = i;
    }
}
Some people afraid of even their own shadow

P.S. You are too late because it doesn't work anymore
__________________
Obey the Cowgod

Last edited by just a punk; 01-14-2013 at 04:44 AM..
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote