Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Windows support #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions aiodnsbrute/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import asyncio
import functools
import os
import uvloop
import aiodns
import click
import socket
import sys
from tqdm import tqdm
from aiodnsbrute.logger import ConsoleLogger

import platform
if platform.system() == "Windows":
import winloop
else:
import uvloop


class aioDNSBrute(object):
"""aiodnsbrute implements fast domain name brute forcing using Python's asyncio module."""
Expand All @@ -26,7 +30,7 @@ def __init__(self, verbosity=0, max_tasks=512):
self.errors = []
self.fqdn = []
self.ignore_hosts = []
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
asyncio.set_event_loop_policy(winloop.WinLoopPolicy() if platform.system() == "Windows" else uvloop.EventLoopPolicy())
self.loop = asyncio.get_event_loop()
self.resolver = aiodns.DNSResolver(loop=self.loop, rotate=True)
self.sem = asyncio.BoundedSemaphore(max_tasks)
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from aiodnsbrute.cli import main; main()
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
Brute force DNS domain names asynchronously
"""
from setuptools import find_packages, setup
import platform

dependencies = ['click', 'asyncio', 'uvloop', 'tqdm', 'aiodns']
dependencies = ['click', 'asyncio', 'tqdm', 'aiodns']

if platform.system() == "Windows":
dependencies.append('winloop')
else:
dependencies.append('uvloop')

setup(
name='aiodnsbrute',
Expand Down