Решил выложить некоторые из своих библиотек, может быть кому нибудь пригодятся: Библиотека содержащая некоторые методы, по работе с протоколом FTP: Code: /* * Description: Library for work with ftp the report * Author: procedure (**** ****) * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Net.Sockets; using System.Net; namespace FTP { public class Work { public string server; public string user; public string password; /// <summary> /// Constructor for object Work /// </summary> /// <param name="s">server</param> /// <param name="l">login</param> /// <param name="p">password</param> public Work(string s, string u, string p) { server = s; user = u; password = p; } /// <summary> /// Check ftp for valid /// </summary> /// <returns>bool</returns> public bool CheckFtp() { TcpClient tcp = new TcpClient(); tcp.Connect(this.server, 21); NetworkStream netStream = tcp.GetStream(); StreamReader sr = new StreamReader(netStream); byte[] WriteBuffer = new byte[1024]; //ATTENTION: ASCII transfering mode //passing ASCII characters ASCIIEncoding enc = new System.Text.ASCIIEncoding(); // Pass the username to the server WriteBuffer = enc.GetBytes("USER " + user + "\r\n"); netStream.Write(WriteBuffer, 0, WriteBuffer.Length); // Read the server response line from the stream reader string status = sr.ReadLine(); // here will be any operations with status string // Pass the password to the server WriteBuffer = enc.GetBytes("PASS " + password + "\r\n"); netStream.Write(WriteBuffer, 0, WriteBuffer.Length); // Read the server response line from the stream reader status = sr.ReadLine(); sr.Close(); tcp.Close(); if (status.IndexOf("OK") != -1) return true; return false; } /// <summary> /// Set permission to file /// </summary> /// <param name="file">file name</param> /// <param name="permission">permission (example: 755)</param> public bool Permission(string file, string permission) { TcpClient tcp = new TcpClient(); tcp.Connect(this.server, 21); NetworkStream netStream = tcp.GetStream(); StreamReader sr = new StreamReader(netStream); byte[] WriteBuffer = new byte[1024]; //ATTENTION: ASCII transfering mode //passing ASCII characters ASCIIEncoding enc = new System.Text.ASCIIEncoding(); // Pass the username to the server WriteBuffer = enc.GetBytes("USER " + user + "\r\n"); netStream.Write(WriteBuffer, 0, WriteBuffer.Length); // Read the server response line from the stream reader Console.WriteLine(sr.ReadLine()); // Pass the password to the server WriteBuffer = enc.GetBytes("PASS " + password + "\r\n"); netStream.Write(WriteBuffer, 0, WriteBuffer.Length); // Read the server response line from the stream reader Console.WriteLine(sr.ReadLine()); try { //Change permission of file name WriteBuffer = enc.GetBytes("CHMOD " + permission + " " + file + "\r\n"); netStream.Write(WriteBuffer, 0, WriteBuffer.Length); // Read the server response line from the stream reader Console.WriteLine(sr.ReadLine()); } catch { return false; } finally { sr.Close(); tcp.Close(); } return true; } public bool Upload(string filename) { FileInfo fInfo = new FileInfo(filename); //path string uri = "ftp://" + server + "/" + fInfo.Name; FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); // Provide the WebPermission Credintials reqFTP.Credentials = new NetworkCredential(user, password); // By default KeepAlive is true, where the control connection is not closed // after a command is executed. reqFTP.KeepAlive = false; // Upload file mthod active reqFTP.Method = WebRequestMethods.Ftp.UploadFile; // Specify the data transfer type. reqFTP.UseBinary = true; // Notify the server about the size of the uploaded file reqFTP.ContentLength = fInfo.Length; // The buffer size is set to 2kb int buffLength = 2048; byte[] buff = new byte[buffLength]; int contentLen; // Opens a file stream (System.IO.FileStream) to read the file to be uploaded FileStream fs = fInfo.OpenRead(); Stream s = null; try { // Stream to which the file to be upload is written s = reqFTP.GetRequestStream(); // Read from the file stream 2kb at a time contentLen = fs.Read(buff, 0, buffLength); // Till Stream content ends while (contentLen != 0) { // Write Content from the file stream to the FTP Upload Stream s.Write(buff, 0, contentLen); contentLen = fs.Read(buff, 0, buffLength); } } catch { return false; } finally { s.Close(); // Close all streams fs.Close(); } return true; } public bool Upload(string filename, string dir) { FileInfo fInfo = new FileInfo(filename); //path string uri = "ftp://" + server + "/" + dir + "/" + fInfo.Name; FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); // Provide the WebPermission Credintials reqFTP.Credentials = new NetworkCredential(user, password); // By default KeepAlive is true, where the control connection is not closed // after a command is executed. reqFTP.KeepAlive = false; // Upload file mthod active reqFTP.Method = WebRequestMethods.Ftp.UploadFile; // Specify the data transfer type. reqFTP.UseBinary = true; // Notify the server about the size of the uploaded file reqFTP.ContentLength = fInfo.Length; // The buffer size is set to 2kb int buffLength = 2048; byte[] buff = new byte[buffLength]; int contentLen; // Opens a file stream (System.IO.FileStream) to read the file to be uploaded FileStream fs = fInfo.OpenRead(); Stream s = null; try { // Stream to which the file to be upload is written s = reqFTP.GetRequestStream(); // Read from the file stream 2kb at a time contentLen = fs.Read(buff, 0, buffLength); // Till Stream content ends while (contentLen != 0) { // Write Content from the file stream to the FTP Upload Stream s.Write(buff, 0, contentLen); contentLen = fs.Read(buff, 0, buffLength); } } catch { return false; } finally { s.Close(); // Close all streams fs.Close(); } return true; } public string[] ListFiles() { string[] downloadFiles; StringBuilder result = new StringBuilder(); FtpWebRequest reqFTP; WebResponse response = null; StreamReader reader = null; try { reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + server + "/")); reqFTP.UseBinary = true; reqFTP.Credentials = new NetworkCredential(user, password); reqFTP.Method = WebRequestMethods.Ftp.ListDirectory; response = reqFTP.GetResponse(); reader = new StreamReader(response.GetResponseStream()); string line = reader.ReadLine(); while (line != null) { result.Append(line); result.Append("\n"); line = reader.ReadLine(); } result.Remove(result.ToString().LastIndexOf('\n'), 1); reader.Close(); response.Close(); return result.ToString().Split('\n'); } catch { downloadFiles = null; return downloadFiles; } } } } Здесь немного изменненный код MSDN, который получает список *всех* внешних IP в системе и помещает его в коллекцию Queue. Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net.Sockets; using System.Net; namespace HTTPWorker { static class GetExternalIP { public static Queue<IPAddress> GetList() { IPHostEntry IPHost = Dns.GetHostByName(Dns.GetHostName()); IPAddress[] ipList = IPHost.AddressList; Queue<IPAddress> result = new Queue<IPAddress>(); string host = "ya.ru"; int port = 80; foreach (IPAddress item in ipList) { if (SocketSendReceive(host, port, item)) result.Enqueue(item); } return result; } private static Socket ConnectSocket(string server, int port, IPAddress ip) { Socket s = null; IPHostEntry hostEntry = null; hostEntry = Dns.GetHostEntry(server); foreach (IPAddress address in hostEntry.AddressList) { IPEndPoint ipe = new IPEndPoint(address, port); Socket tempSocket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp); IPEndPoint end = new IPEndPoint(ip, 80); tempSocket.Bind(end); tempSocket.Connect(ipe); if (tempSocket.Connected) { s = tempSocket; break; } else { continue; } } return s; } private static bool SocketSendReceive(string server, int port, IPAddress ip) { string request = "GET / HTTP/1.1\r\nHost: " + server + "\r\nConnection: Close\r\n\r\n"; Byte[] bytesSent = Encoding.ASCII.GetBytes(request); Socket s = null; try { s = ConnectSocket(server, port, ip); s.Send(bytesSent, bytesSent.Length, 0); s.Close(); } catch { return false; } return true; } } } Эта библиотека, получает список всех внешних ip в системе, с помощью прошлой библиотеки. И при создании экземпляра класса HTTP, отправляет пакеты на заданный адресс, каждый раз со следущего IP в очереди Queue. В чем прикол? Описано ниже.... Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; namespace Connect { public class HTTP { /// <summary> /// Work with http through sockets /// </summary> //Cookies ( key - value ) public Dictionary<string, string> cookies = new Dictionary<string, string>(); //IP Collection private Queue<IPAddress> ipCollection; //User Agents Collection private Queue<string> uaCollection = new Queue<string>(); /// <summary> /// Class Designer /// </summary> public HTTP() { //IP collection initialize ipCollection = GetExternalIP.GetList(); //User Agents Initialize uaCollection.Enqueue("Opera/9.60 (Windows NT 5.1; U; ru) Presto/2.1.1"); uaCollection.Enqueue("Mozilla/5.0 (Windows; U; Windows NT 6.0; ru) AppleWebKit/522.15.5 (KHTML, like Gecko) Version/3.03 Safari/522.15.5"); uaCollection.Enqueue("Opera/9.23 (Windows NT 6.0; U; ru)"); uaCollection.Enqueue("Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.9.0.2) Gecko/2008092702 Gentoo Firefox/3.0.2"); uaCollection.Enqueue("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3"); uaCollection.Enqueue("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618)"); uaCollection.Enqueue("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.25 Safari/525.19"); uaCollection.Enqueue("Opera/9.62 (Windows NT 6.0; U; ru) Presto/2.1.1"); } public string HTTPSend(string uri, string method, string Referer) { //Get external ip IPAddress ip = GetIP(); //for get host Uri url= new Uri(uri); //need referer? if (!String.IsNullOrEmpty(Referer)) Referer = "Referer: " + Referer.Trim(); else Referer = String.Empty; //cookie string cookie = String.Empty; foreach (KeyValuePair<string, string> item in cookies) cookie += item.Key + "=" + item.Value + "; "; string request = method.ToUpper().Trim() + " " + uri.Trim() + " HTTP/1.0\r\n" + "User-Agent: " + GetUA() +"\r\n" + "Host: " + url.Host + "\r\n" + "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\n" + "Accept-Language: ru-RU,ru;q=0.9,en;q=0.8\r\n" + "Accept-Charset: utf-8, *;q=0.1\r\n" + "Accept-Encoding: identity;q=0\r\n" + Referer + "\r\n" + "Cookie: " + cookie + "\r\n" + "Cookie2: $Version=1\r\n" + "Connection: Keep-Alive\r\n\r\n"; Byte[] bytesSent = Encoding.Unicode.GetBytes(request); Byte[] bytesReceived = new Byte[256]; int bytes = 0; string page = String.Empty; try { Socket s = Connect(url.Host, 80); s.Send(bytesSent, bytesSent.Length, 0); // The following will block until te page is transmitted. do { bytes = s.Receive(bytesReceived, bytesReceived.Length, 0); page = page + Encoding.ASCII.GetString(bytesReceived, 0, bytes); } while (bytes > 0); /*TEST*/ /*TEST*/ return page; } catch { return "connection failed"; } } /// <summary> /// Connect to server /// </summary> /// <param name="server">host name (Uri.Host)</param> /// <param name="port">port (int)</param> /// <returns>Socket</returns> private Socket Connect(string server, int port) { Socket s = null; IPHostEntry hostEntry = Dns.GetHostEntry(server); foreach (IPAddress address in hostEntry.AddressList) { IPEndPoint ipe = new IPEndPoint(address, port); Socket tempSocket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp); //Bind IPEndPoint end = new IPEndPoint(GetIP(), 80); tempSocket.Bind(end); tempSocket.Connect(ipe); if (tempSocket.Connected) { s = tempSocket; break; } else { continue; } } return s; } /// <summary> /// Get IP Address /// </summary> /// <returns>IP Address</returns> private IPAddress GetIP() { IPAddress ip = ipCollection.Dequeue(); ipCollection.Enqueue(ip); return ip; } /// <summary> /// Get user random agent /// </summary> /// <returns>user agent</returns> private string GetUA() { string ua = uaCollection.Dequeue(); uaCollection.Enqueue(ua); return ua; } } } Для чего же я реализовал именно так? Почему я сделал класс GetExternalIP? Это для того друзья, чтобы ваши спамеры работали немного поэффективней. Сейчас объясню. Многие для спама набирают кучу дедиков. Зачем они все нужны? Для того чтобы были разные ip адреса. А почему же прокси не юзают. Потому что прокси нужно чекать, они живут не долго, прокси сервер может вас забанить. В общем, о проксях нужно заботится как детях. Намного легче, не брать кучу дедиков, а взять один, с большим кол-вом ip на компе и спамить с него. Эту идею придумал, я. may be кто то придумал ее раньше меня. Но я не видел ни в одном спамере подобный метод реализации сего.) Поэтому предлагаю вам заюзать эту библиотеку. Итак, покажу примерно как это выглядит: 1. создаем экземпляр класса HTTP. Конструктор объекта запрашивает список всех внешних ip в системе и передает их объекту в виде коллекции. 2. Отправляем пакет №1. Он подставляет рэндомный браузер и привязывает к высшему в коллекции Queue ip адресу. И отправляет пакет. Факт спама, различить сложнее. При этом куки остаются теже. 3. Отправляем пакет №2. Он опять же отправляется с другого ip и браузер в заголовке стоит другой. Таким образом, работа вашего спамера будет намного эффективней. Клиенту же остается после покупки вашего спамера, купить дедик (15-25$) и некоторое число ip (класс С (255 ip) стоит в Германии 20 евро) не так уж и дорого. Зато 255 постоянно живых ip адресов. С которых можно спамить со скоростью света))) Далее идею вы можете развить, и заставить работать этот спамер в процессе. Чтоб клиент не тратил деньги на абузоустойчивый дед. А при этом написать клиентское приложение которое будет показывать ложную информацию, работы какой нибудь вполне законной программы. В итоге, когда админ видет высокую сетевую активность деда, заходит на него, 90% что он не замечает спамер работающий в процессе, а видит ваше фейковое клиентское приложение. Кто не понял, спрашивайте, - объясню. Я где то потерял еще одну библиотеку, (если кому сильно нужна, - пишите). Эта библиотека создает на фри хосте фейк одноклассников или контакта. (2 метода там). Понимаете идею? Программа создает фейк сама и спамит на него к примеру 80% акков которые вначале вы дали программе. Остальные 20% спамит сообщением которое установил пользователь. На фейке акки появляются, каждый час программа чекает новые акки и спамит какой либо % опять на фейк, а остальные на сообщения юзера. Тем самым, узеру все что нужно будет сделать, кинуть в программу 1000 акков, запустить ее на дедике и программа будет спамить полностью сама) Весь процесс автоматизирован. А если еще заюзать технологию Windows Communication Foundation (почитайте статейки есть.) То юзер может даже и на дедик не заходить. Управляя этой программы с домашнего компа. Да и почему я завел речь про спамеры? Ведь можно не только спамеры писать, если у нас ip много. По этой технологии можно писать и флудеры, авторегеры. Хотя для авторегеров, более подойдут прокси. (выгодней). На данный момент это лучший метод спама по социальным сетям, который придумал я. Удачного вам спама и с уважением - procedure. Добавил: Замечу, работа с HTTP тут ведется через сокеты. Если кому нибудь нужна будет помощь пишите, - помогу.