[Java] ClapTrap IRC Bot 0.5

Iniciado por BigBear, Abril 15, 2016, 04:26:35 PM

Tema anterior - Siguiente tema

0 Miembros y 2 Visitantes están viendo este tema.

Traduccion a Java de mi IRC Bot , tiene las siguientes opciones :

  • Scanner SQLI
  • Scanner LFI
  • Buscador de panel de administracion
  • Localizador de IP
  • Buscador de DNS
  • Buscador de SQLI y RFI en google
  • Crack para hashes MD5
  • Cortador de URL usando tinyurl
  • HTTP FingerPrinting
  • Codificador base64,hex y ASCII 

    Unas imagenes :





    El codigo :

    Código: java

    // ClapTrap IRC Bot 0.5
    // (C) Doddy Hackman 2015
    package claptrap.irc.bot;

    import java.io.IOException;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.io.*;
    import java.net.*;
    import java.util.Scanner;
    import java.util.logging.Level;
    import java.util.logging.Logger;

    /**
    *
    * @author Doddy
    */
    public class ClapTrapIRCBot {

        /**
         * @param args the command line arguments
         */
        public static String servidor;
        public static int puerto;
        public static String nick;
        public static String admin;

        public static String canal;
        public static int tiempo;

        public static Socket conexion;
        public static BufferedWriter escribir;
        public static BufferedReader leer;

        public static void responder(String contenido) {
            try {
                String[] textos = contenido.split("\n");
                for (String texto : textos) {
                    if (!"".equals(texto)) {
                        escribir.write("PRIVMSG " + admin + " : " + texto + "\r\n");
                        escribir.flush();
                        try {
                            Thread.sleep(tiempo * 1000);
                        } catch (InterruptedException ex) {
                            Logger.getLogger(ClapTrapIRCBot.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                }
            } catch (IOException e) {
                //
            }
        }

        public static void main(String[] args) {

            Scanner input = new Scanner(System.in);

            System.out.println("\n-- == ClapTrap IRC Bot 0.5 == --\n\n");
            System.out.println("[+] Hostname : ");
            String hostname_value = input.nextLine();
            System.out.println("\n[+] Port : ");
            Integer port_value = Integer.parseInt(input.nextLine());
            System.out.println("\n[+] Channel : ");
            String channel_value = input.nextLine();
            System.out.println("\n[+] Nickname Admin : ");
            String admin_value = input.nextLine();

            servidor = hostname_value;
            puerto = port_value;
            nick = "ClapTrap";
            admin = admin_value;
            canal = channel_value;
            tiempo = 3;

            try {

                conexion = new Socket(servidor, puerto);
                escribir = new BufferedWriter(
                        new OutputStreamWriter(conexion.getOutputStream()));
                leer = new BufferedReader(
                        new InputStreamReader(conexion.getInputStream()));

                escribir.write("NICK " + nick + "\r\n");
                escribir.write("USER " + nick + " 1 1 1 1\r\n");
                escribir.flush();

                String contenido = null;

                escribir.write("JOIN " + canal + "\r\n");
                escribir.flush();

                System.out.println("\n[+] Online");

                funciones funcion = new funciones();

                while ((contenido = leer.readLine()) != null) {

                    Pattern search = null;
                    Matcher regex = null;

                    search = Pattern.compile("^PING(.*)$");
                    regex = search.matcher(contenido);
                    if (regex.find()) {
                        escribir.write("PONG " + regex.group(1) + "\r\n");
                        escribir.flush();
                    }

                    search = Pattern.compile(":(.*)!(.*) PRIVMSG (.*) :(.*)");
                    regex = search.matcher(contenido);
                    if (regex.find()) {
                        String control_admin = regex.group(1);
                        String text = regex.group(4);
                        if (control_admin.equals(admin)) {

                            //
                            search = Pattern.compile("!sqli (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String target = regex.group(1);
                                String code = funcion.SQLI_Scanner(target);
                                responder(code);
                            }

                            search = Pattern.compile("!lfi (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String target = regex.group(1);
                                String code = funcion.scan_lfi(target);
                                responder(code);
                            }

                            search = Pattern.compile("!panel (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String target = regex.group(1);
                                String code = funcion.panel_finder(target);
                                responder(code);
                            }

                            search = Pattern.compile("!fuzzdns (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String target = regex.group(1);
                                String code = funcion.fuzz_dns(target);
                                responder(code);
                            }

                            search = Pattern.compile("!locateip (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String target = regex.group(1);
                                String code = funcion.locate_ip(target);
                                responder(code);
                            }

                            search = Pattern.compile("!sqlifinder (.*) (.*) (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String dork = regex.group(1);
                                int cantidad = Integer.parseInt(regex.group(2));
                                String buscador = regex.group(3);
                                String code = funcion.find_sqli(dork, cantidad, buscador);
                                responder(code);
                            }

                            search = Pattern.compile("!rfifinder (.*) (.*) (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String dork = regex.group(1);
                                int cantidad = Integer.parseInt(regex.group(2));
                                String buscador = regex.group(3);
                                String code = funcion.find_rfi(dork, cantidad, buscador);
                                responder(code);
                            }

                            search = Pattern.compile("!crackit (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String md5 = regex.group(1);
                                String code = funcion.crack_md5(md5);
                                responder(code);
                            }

                            search = Pattern.compile("!tinyurl (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String url = regex.group(1);
                                String code = funcion.tiny_url(url);
                                responder(code);
                            }

                            search = Pattern.compile("!httpfinger (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String page = regex.group(1);
                                String code = funcion.http_finger(page);
                                responder(code);
                            }

                            search = Pattern.compile("!md5 (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String texto = regex.group(1);
                                String code = "[+] MD5 : " + funcion.md5_encode(texto);
                                responder(code);
                            }

                            search = Pattern.compile("!base64 (.*) (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String option = regex.group(1);
                                String texto = regex.group(2);
                                String code = "";
                                if ("encode".equals(option)) {
                                    code = "[+] Base64 : " + funcion.encode_base64(texto);
                                }
                                if ("decode".equals(option)) {
                                    code = "[+] Text : " + funcion.decode_base64(texto);
                                }
                                responder(code);
                            }

                            search = Pattern.compile("!ascii (.*) (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String option = regex.group(1);
                                String texto = regex.group(2);
                                String code = "";
                                if ("encode".equals(option)) {
                                    code = "[+] ASCII : " + funcion.encode_ascii(texto);
                                }
                                if ("decode".equals(option)) {
                                    code = "[+] Text : " + funcion.decode_ascii(texto);
                                }
                                responder(code);
                            }

                            search = Pattern.compile("!hex (.*) (.*)$");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String option = regex.group(1);
                                String texto = regex.group(2);
                                String code = "";
                                if ("encode".equals(option)) {
                                    code = "[+] Hex : " + funcion.encode_hex(texto);
                                }
                                if ("decode".equals(option)) {
                                    code = "[+] Text : " + funcion.decode_hex(texto);
                                }
                                responder(code);
                            }

                            search = Pattern.compile("!help");
                            regex = search.matcher(text);
                            if (regex.find()) {
                                String code = "";
                                code = code + "Hi , I am ClapTrap an assistant robot programmed by Doddy Hackman in the year 2015" + "\n";
                                code = code + "[++] Commands" + "\n";
                                code = code + "[+] !help" + "\n";
                                code = code + "[+] !locateip <web>" + "\n";
                                code = code + "[+] !sqlifinder <dork> <count pages> <google/bing>" + "\n";
                                code = code + "[+] !rfifinder <dork> <count pages> <google/bing>" + "\n";
                                code = code + "[+] !panel <page>" + "\n";
                                code = code + "[+] !fuzzdns <domain>" + "\n";
                                code = code + "[+] !sqli <page>" + "\n";
                                code = code + "[+] !lfi <page>" + "\n";
                                code = code + "[+] !crackit <hash>" + "\n";
                                code = code + "[+] !tinyurl <page>" + "\n";
                                code = code + "[+] !httpfinger <page>" + "\n";
                                code = code + "[+] !md5 <text>" + "\n";
                                code = code + "[+] !base64 <encode/decode> <text>" + "\n";
                                code = code + "[+] !ascii <encode/decode> <text>" + "\n";
                                code = code + "[+] !hex <encode/decode> <text>" + "\n";
                                code = code + "[++] Enjoy this IRC Bot" + "\n";
                                responder(code);
                            }

                            //
                        }
                    }
                }
            } catch (IOException e) {
                System.out.println("\n[-] Error connecting");
            }

        }

    }

    // The End ?


    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

    Eso seria todo.