Skip to content

Commit df1811f

Browse files
committed
V1.0
1 parent 1422de3 commit df1811f

File tree

5 files changed

+137
-32
lines changed

5 files changed

+137
-32
lines changed

Webhook Spammer/Form1.Designer.cs

Lines changed: 53 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Webhook Spammer/Form1.cs

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Collections.Specialized;
4-
using System.ComponentModel;
5-
using System.Data;
62
using System.Drawing;
7-
using System.Linq;
8-
using System.Net;
9-
using System.Text;
3+
using System.Net.Http;
104
using System.Threading;
115
using System.Threading.Tasks;
126
using System.Windows.Forms;
7+
using Newtonsoft.Json;
138

149
namespace Webhook_Spammer
1510
{
1611
public partial class Form1 : Form
1712
{
18-
bool Spamming = true;
13+
public HttpClient httpClient = new HttpClient();
14+
bool Spamming = false;
1915
int Requests;
16+
int TotalRequests;
17+
2018
public Form1()
2119
{
2220
InitializeComponent();
@@ -63,31 +61,44 @@ private void button1_Click(object sender, EventArgs e)
6361
SpamWebhook();
6462
}
6563

66-
private static byte[] Post(string Url, NameValueCollection Pairs)
64+
private void RateLimited(bool Value)
6765
{
68-
using (WebClient webClient = new WebClient())
66+
if (Value == true)
67+
{
68+
this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate () { label8.Text = "You are being rate limited!"; });
69+
}
70+
else if (Value == false)
6971
{
70-
return webClient.UploadValues(Url, Pairs);
72+
this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate () { label8.Text = ""; });
7173
}
7274
}
7375

74-
private static void PostWebhook(string Url, string Message, string Username, string AvatarURL)
76+
private void Post(string Url, HttpContent Pairs)
7577
{
76-
Post(Url, new System.Collections.Specialized.NameValueCollection()
78+
Thread WebhookSendThread = new Thread(async () =>
7779
{
80+
try
7881
{
79-
"username",
80-
Username
81-
},
82-
{
83-
"avatar_url",
84-
AvatarURL
85-
},
82+
await httpClient.PostAsync(Url, Pairs);
83+
RateLimited(false);
84+
}
85+
catch
8686
{
87-
"content",
88-
Message
87+
RateLimited(true);
88+
await httpClient.PostAsync(Url, Pairs);
8989
}
9090
});
91+
92+
WebhookSendThread.Start();
93+
}
94+
95+
96+
private void PostWebhook(string Url, string Message, string Username, string AvatarURL)
97+
{
98+
99+
string data = JsonConvert.SerializeObject(new { content = Message, username = Username, avatar_url = AvatarURL });
100+
101+
Post(Url, new StringContent(data, System.Text.Encoding.UTF8, "application/json"));
91102
}
92103

93104
private async void SpamWebhook()
@@ -100,6 +111,8 @@ private async void SpamWebhook()
100111
{
101112
PostWebhook(textBox1.Text, textBox5.Text, textBox4.Text, textBox6.Text);
102113
Requests = Requests + 1;
114+
TotalRequests = TotalRequests + 1;
115+
label9.Text = Convert.ToString(TotalRequests);
103116
label5.Text = Convert.ToString(Requests);
104117
}
105118
}
@@ -111,7 +124,7 @@ private async void SpamWebhook()
111124
}
112125

113126
await Task.Delay((int)Convert.ToDouble(textBox3.Text));
114-
}
127+
}
115128
}
116129

117130
private void button2_Click(object sender, EventArgs e)
@@ -131,3 +144,5 @@ private void button2_Click(object sender, EventArgs e)
131144
}
132145
}
133146
}
147+
148+
// Exunys (Aleksandar)

Webhook Spammer/Program.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ static void Main()
1616
{
1717
Application.EnableVisualStyles();
1818
Application.SetCompatibleTextRenderingDefault(false);
19-
Application.Run(new Form1());
19+
20+
try
21+
{
22+
Application.Run(new Form1());
23+
}
24+
catch
25+
{
26+
MessageBox.Show("Too much trolling, the program crashed...", "Webhook Troller", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
27+
Application.Run(new Form1());
28+
}
2029
}
2130
}
2231
}

Webhook Spammer/Webhook Spammer.csproj

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<Deterministic>true</Deterministic>
15+
<IsWebBootstrapper>false</IsWebBootstrapper>
16+
<PublishUrl>C:\Users\Aleksandar\Desktop\Webhook Spammer\</PublishUrl>
17+
<Install>true</Install>
18+
<InstallFrom>Disk</InstallFrom>
19+
<UpdateEnabled>false</UpdateEnabled>
20+
<UpdateMode>Foreground</UpdateMode>
21+
<UpdateInterval>7</UpdateInterval>
22+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
23+
<UpdatePeriodically>false</UpdatePeriodically>
24+
<UpdateRequired>false</UpdateRequired>
25+
<MapFileExtensions>true</MapFileExtensions>
26+
<AutorunEnabled>true</AutorunEnabled>
27+
<ApplicationRevision>0</ApplicationRevision>
28+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
29+
<UseApplicationTrust>false</UseApplicationTrust>
30+
<BootstrapperEnabled>true</BootstrapperEnabled>
1531
</PropertyGroup>
1632
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1733
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,6 +49,9 @@
3349
<WarningLevel>4</WarningLevel>
3450
</PropertyGroup>
3551
<ItemGroup>
52+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
53+
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
54+
</Reference>
3655
<Reference Include="System" />
3756
<Reference Include="System.Core" />
3857
<Reference Include="System.Xml.Linq" />
@@ -66,6 +85,7 @@
6685
<AutoGen>True</AutoGen>
6786
<DependentUpon>Resources.resx</DependentUpon>
6887
</Compile>
88+
<None Include="packages.config" />
6989
<None Include="Properties\Settings.settings">
7090
<Generator>SettingsSingleFileGenerator</Generator>
7191
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -79,5 +99,17 @@
7999
<ItemGroup>
80100
<None Include="App.config" />
81101
</ItemGroup>
102+
<ItemGroup>
103+
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
104+
<Visible>False</Visible>
105+
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
106+
<Install>true</Install>
107+
</BootstrapperPackage>
108+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
109+
<Visible>False</Visible>
110+
<ProductName>.NET Framework 3.5 SP1</ProductName>
111+
<Install>false</Install>
112+
</BootstrapperPackage>
113+
</ItemGroup>
82114
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
83115
</Project>

Webhook Spammer/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
4+
</packages>

0 commit comments

Comments
 (0)