首页 > 其他分享 >在不需要WiFi密码的情况下进行断网攻击

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

时间:2024-10-09 19:35:17浏览次数:1  
标签:__ python WiFi 密码 断网 print ___ check

准备
* kali linux 系统  这里使用的是虚拟机 

2021-09-11 12-21-29 的屏幕截图.png
* 一张可以开启监听模式的网卡
* 两张网卡使用那一张都可以
IMG_20210911_120640.jpg
* 本教程使用的是 python编写的脚本代码 以下是部分代码
* 在代码中作者写了大量的注释 以供使用者参考

active_wireless_networks = []
# We use this function to test if the ESSID is already in the list file. 
# If so we return False so we don't add it again.
# If it is not in the lst we return True which will instruct the elif 
# statement to add it to the lst.
def check_for_essid(essid, lst):
    check_status = True

    # If no ESSIDs in list add the row
    if len(lst) == 0:
        return check_status
    # This will only run if there are wireless access points in the list.
    for item in lst:
        # If True don't add to list. False will add it to list
        if essid in item["ESSID"]:
            check_status = False

    return check_status
# Basic user interface header
# This is a period of output, don't want you to do it.
print(r"""______            _     _  ______                 _           _ 
|  _  \          (_)   | | | ___ \               | |         | |
| | | |__ ___   ___  __| | | |_/ / ___  _ __ ___ | |__   __ _| |
| | | / _` \ \ / / |/ _` | | ___ \/ _ \| '_ ` _ \| '_ \ / _` | |
| |/ / (_| |\ V /| | (_| | | |_/ / (_) | | | | | | |_) | (_| | |
|___/ \__,_| \_/ |_|\__,_| \____/ \___/|_| |_| |_|_.__/ \__,_|_|""")
print("\n****************************************************************")
print("\n* Copyright of David Bombal, 2021                              *")
print("\n* https://www.davidbombal.com                                  *")
print("\n* https://www.youtube.com/davidbombal                          *")
print("\n****************************************************************")
# If the user doesn't run the program with super user privileges, don't allow them to continue.
if not 'SUDO_UID' in os.environ.keys():
    print("Try running this program with sudo.")
    exit()
# Remove .csv files before running the script.

for file_name in os.listdir():
    # We should only have one csv file as we delete them from the folder 
    #  every time we run the program.
    if ".csv" in file_name:
        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.")
        # We get the current working directory.
        directory = os.getcwd()
        try:
            # We make a new directory called /backup
            os.mkdir(directory + "/backup/")
        except:
            print("Backup folder exists.")
        # Create a timestamp
        timestamp = datetime.now()
        # We move any .csv files in the folder to the backup folder.
        shutil.move(file_name, directory + "/backup/" + str(timestamp) + "-" + file_name)
# Regex to find wireless interfaces. We're making the assumption they will all be wlan0 or higher.

wlan_pattern = re.compile("^wlan[0-9]+")

# Python allows is to run system commands by using a function provided by the subprocess module. 
# subprocess.run(<list of command line arguments goes here>)
# The script is the parent process and creates a child process which runs the system command, 
# and will only continue once the child process has completed.
# We run the iwconfig command to look for wireless interfaces.
check_wifi_result = wlan_pattern.findall(subprocess.run(["iwconfig"], capture_output=True).stdout.decode())
# No WiFi Adapter connected.
if len(check_wifi_result) == 0:
    print("Please connect a WiFi adapter and try again.")
    exit()
    
# Menu to select WiFi interface from
print("The following WiFi interfaces are available:")
for index, item in enumerate(check_wifi_result):
    print(f"{index} - {item}")
    
# Ensure the WiFi interface selected is valid. Simple menu with interfaces to select from.
while True:
    wifi_interface_choice = input("Please select the interface you want to use for the attack: ")
    try:
        if check_wifi_result[int(wifi_interface_choice)]:
            break
    except:
        print("Please enter a number that corresponds with the choices available.")
具体步骤
  • 将提前准备好的 网卡插入 电脑并切换到虚拟机
  • 由于kali linux 自带的python 不是3.7而是3.6 所以要重新下载 python
  • 打开终端 输入一下命令 下载
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
  • 解压压缩包
tar -zxvf Python-3.7.0.tgz
# 将解压出来的文件夹复制到 /usr/local/  目录下
cp -r python-3.7.0 /usr/local/
  • 然后进行编译安装
./configure --enable-optimizations --prefix=/usr/local/Python-3.7/ && make && make install

  • 在进入到解压出来的文件的位置后输入
./python --version

查看版本信息
2021-09-10 18-47-22 ����Ļ��ͼ.png

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

2021-09-10 19-08-14 ����Ļ��ͼ.png

标签:__,python,WiFi,密码,断网,print,___,check
From: https://www.cnblogs.com/ZapcoMan/p/18454984

相关文章

  • Windows 11 WIFI/无线网络因为升级驱动失败而消失的解决办法 - 升级你的Windows系统
    上周六Intel的驱动管理软件提醒有驱动更新,于是升级,其余的驱动都升级正常,不料升级WIFI无线网络导致WIFI功能凭空消失,在控制面板里面对应的适配器也不见了,不是禁用,而是不存在了.打开设备管理器,对应的网络适配器也显示黄色惊叹号.于是先是尝试重新安装驱动,无果,虽......
  • 请问宝塔面板忘了账号密码怎么办
    忘记宝塔面板的账号密码可以通过以下几种方法尝试解决:邮箱找回:如果你在设置宝塔面板时绑定了邮箱,并开启了邮箱找回功能,可以直接通过绑定的邮箱找回密码。数据库修改:可以通过SSH登录到服务器,然后通过命令行进入宝塔面板的数据库,找到用户表,修改对应的密码字段。具体命令如下:......
  • 忘记宝塔面板登陆密码怎么办?附解决方法!
    如果你忘记了宝塔面板的登录密码,可以通过以下几种方式来重置或找回密码:通过数据库重置登录到服务器。使用命令行进入到宝塔面板的MySQL管理界面。找到保存用户信息的表,通常为bt_users。更新该表中你的账户对应的密码字段。可以设置一个临时密码,之后再通过面板修改。使......
  • 密码需包含数字、字母或符号至少两种以上字符组成且长度在6-20位的正则
    可以使用以下正则表达式来匹配密码需包含数字、字母或符号至少两种以上字符组成且6-20位的条件:varpattern=/^(?![0-9]+$)(?![a-zA-Z]+$)(?![^0-9a-zA-Z]+$).{6,20}$/;这个正则表达式使用了正向否定预查来确保密码包含至少两种字符类型(数字、字母或符号),并且长度在6到20......
  • 网站密码忘记了怎么找回?网站的密码忘记了怎么办
    当您忘记网站密码时,可以按照以下步骤尝试找回:访问登录页面:打开网站的登录页面。寻找“忘记密码”链接:通常在登录表单附近会有一个“忘记密码”或“找回密码”的链接。输入注册邮箱或手机号:点击链接后,系统会要求您输入注册时使用的邮箱地址或手机号码。查收邮件或短信:提交信息......
  • 网站密码忘记了怎么办?网站密码忘记了无法找回
    当遇到网站密码忘记且无法通过常规方式找回的情况时,可以尝试以下几个步骤来解决问题:联系客服支持:大多数正规网站都有客服支持,可以通过邮件或电话联系他们说明情况。通常客服会要求用户提供注册时的一些个人信息进行验证,验证通过后可以帮助重置密码。检查垃圾邮件箱:有时候密......
  • php网站登录密码忘记了的三种解决办法
    如果你忘记了PHP网站的登录密码,可以通过以下三种方法来解决这个问题:1.通过数据库直接修改密码步骤如下:登录数据库:使用命令行工具(如 mysql 或 phpMyAdmin)登录到数据库。例如,通过命令行登录MySQL数据库:mysql-uroot-p选择对应的数据库:选择包含用户表......
  • 如何找回宝塔管理面板密码
    找回宝塔面板的密码可以通过以下几种方法实现:通过官方客户端找回:登录宝塔面板的官方网站或使用其官方客户端。在登录页面点击“忘记密码”链接。按照提示输入你的注册邮箱或手机号,并完成身份验证。重置密码并重新登录。通过数据库直接修改:如果你有服务器的SSH访问权......
  • 请问想登录宝塔面板但是忘记密码_宝塔密码忘记了怎么办
    通过邮箱找回:如果你在设置宝塔面板时绑定了邮箱,可以通过绑定的邮箱来找回密码。访问宝塔面板登录页面,找到“忘记密码”选项并点击,按照提示输入已绑定的邮箱地址。登录邮箱查看收到的重置链接或验证码,按照邮件中的指引完成密码重置。通过SSH命令行重置:首先通过SSH客户......
  • 网站密码忘记了?网站忘了密码怎么办
    如果你忘记了网站的密码,可以按照以下步骤尝试找回或重置密码:访问登录页面:打开网站的登录页面。查找密码找回选项:通常在登录表单附近会有“忘记密码”、“找回密码”或类似的链接。输入注册邮箱或手机号:点击相关链接后,系统会要求你输入注册时使用的邮箱地址或手机号码。查收邮......