// 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 You are not allowed to view links.
Register or
Login servidor
; public static int puerto;
public static You are not allowed to view links.
Register or
Login nick
; public static You are not allowed to view links.
Register or
Login admin
;
public static You are not allowed to view links.
Register or
Login canal
; public static int tiempo;
public static You are not allowed to view links.
Register or
Login conexion
; public static You are not allowed to view links.
Register or
Login escribir
; public static You are not allowed to view links.
Register or
Login leer
;
public static void responder
(You are not allowed to view links.
Register or
Login contenido
) { try {
You are not allowed to view links.
Register or
Login[] textos
= contenido.
split("\n"); for (You are not allowed to view links.
Register or
Login texto
: textos
) { if (!"".equals(texto)) {
escribir.write("PRIVMSG " + admin + " : " + texto + "\r\n");
escribir.flush();
try {
You are not allowed to view links.
Register or
Login.
sleep(tiempo
* 1000); } catch (You are not allowed to view links.
Register or
Login ex
) { Logger.getLogger(ClapTrapIRCBot.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
} catch (You are not allowed to view links.
Register or
Login e
) { //
}
}
public static void main
(You are not allowed to view links.
Register or
Login[] args
) {
Scanner input
= new Scanner
(You are not allowed to view links.
Register or
Login.
in);
You are not allowed to view links.
Register or
Login.
out.
println("\n-- == ClapTrap IRC Bot 0.5 == --\n\n"); You are not allowed to view links.
Register or
Login.
out.
println("[+] Hostname : "); You are not allowed to view links.
Register or
Login hostname_value
= input.
nextLine(); You are not allowed to view links.
Register or
Login.
out.
println("\n[+] Port : "); You are not allowed to view links.
Register or
Login port_value
= You are not allowed to view links.
Register or
Login.
parseInt(input.
nextLine()); You are not allowed to view links.
Register or
Login.
out.
println("\n[+] Channel : "); You are not allowed to view links.
Register or
Login channel_value
= input.
nextLine(); You are not allowed to view links.
Register or
Login.
out.
println("\n[+] Nickname Admin : "); You are not allowed to view links.
Register or
Login admin_value
= input.
nextLine();
servidor = hostname_value;
puerto = port_value;
nick = "ClapTrap";
admin = admin_value;
canal = channel_value;
tiempo = 3;
try {
conexion
= new You are not allowed to view links.
Register or
Login(servidor, puerto
); escribir
= new You are not allowed to view links.
Register or
Login( new You are not allowed to view links.
Register or
Login(conexion.
getOutputStream())); new You are not allowed to view links.
Register or
Login(conexion.
getInputStream()));
escribir.write("NICK " + nick + "\r\n");
escribir.write("USER " + nick + " 1 1 1 1\r\n");
escribir.flush();
You are not allowed to view links.
Register or
Login contenido
= null;
escribir.write("JOIN " + canal + "\r\n");
escribir.flush();
You are not allowed to view links.
Register or
Login.
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()) {
You are not allowed to view links.
Register or
Login control_admin
= regex.
group(1); You are not allowed to view links.
Register or
Login text
= regex.
group(4); if (control_admin.equals(admin)) {
//
search = Pattern.compile("!sqli (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login target
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
SQLI_Scanner(target
); responder(code);
}
search = Pattern.compile("!lfi (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login target
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
scan_lfi(target
); responder(code);
}
search = Pattern.compile("!panel (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login target
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
panel_finder(target
); responder(code);
}
search = Pattern.compile("!fuzzdns (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login target
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
fuzz_dns(target
); responder(code);
}
search = Pattern.compile("!locateip (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login target
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
locate_ip(target
); responder(code);
}
search = Pattern.compile("!sqlifinder (.*) (.*) (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login dork
= regex.
group(1); int cantidad
= You are not allowed to view links.
Register or
Login.
parseInt(regex.
group(2)); You are not allowed to view links.
Register or
Login buscador
= regex.
group(3); You are not allowed to view links.
Register or
Login code
= funcion.
find_sqli(dork, cantidad, buscador
); responder(code);
}
search = Pattern.compile("!rfifinder (.*) (.*) (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login dork
= regex.
group(1); int cantidad
= You are not allowed to view links.
Register or
Login.
parseInt(regex.
group(2)); You are not allowed to view links.
Register or
Login buscador
= regex.
group(3); You are not allowed to view links.
Register or
Login code
= funcion.
find_rfi(dork, cantidad, buscador
); responder(code);
}
search = Pattern.compile("!crackit (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login md5
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
crack_md5(md5
); responder(code);
}
search = Pattern.compile("!tinyurl (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login url
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
tiny_url(url
); responder(code);
}
search = Pattern.compile("!httpfinger (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login page
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= funcion.
http_finger(page
); responder(code);
}
search = Pattern.compile("!md5 (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login texto
= regex.
group(1); You are not allowed to view links.
Register or
Login code
= "[+] MD5 : " + funcion.
md5_encode(texto
); responder(code);
}
search = Pattern.compile("!base64 (.*) (.*)$");
regex = search.matcher(text);
if (regex.find()) {
You are not allowed to view links.
Register or
Login option
= regex.
group(1); You are not allowed to view links.
Register or
Login texto
= regex.
group(2); 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()) {
You are not allowed to view links.
Register or
Login option
= regex.
group(1); You are not allowed to view links.
Register or
Login texto
= regex.
group(2); 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()) {
You are not allowed to view links.
Register or
Login option
= regex.
group(1); You are not allowed to view links.
Register or
Login texto
= regex.
group(2); 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()) {
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 (You are not allowed to view links.
Register or
Login e
) { You are not allowed to view links.
Register or
Login.
out.
println("\n[-] Error connecting"); }
}
}
// The End ?