Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
Simplified cli
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3bl33d3r committed Dec 21, 2018
1 parent ec5d138 commit b79fa1a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
13 changes: 6 additions & 7 deletions README.md
Expand Up @@ -26,7 +26,7 @@ A blazing fast password sprayer for Lync/Skype For Business and OWA, built on As
#### Usage
```
Usage:
atomizer (lync|owa) <target> <password> --userfile USERFILE [--threads THREADS] [--debug]
atomizer (lync|owa) <target> <password> <userfile> [--threads THREADS] [--debug]
atomizer (lync|owa) <target> --csvfile CSVFILE [--user-row-name NAME] [--pass-row-name NAME] [--threads THREADS] [--debug]
atomizer (lync|owa) <target> --user-as-pass USERFILE [--threads THREADS] [--debug]
atomizer (lync|owa) <target> --recon [--debug]
Expand All @@ -36,28 +36,28 @@ Usage:
Arguments:
target target domain or url
password password to spray
userfile file containing usernames (one per line)
Options:
-h, --help show this screen
-v, --version show version
-u, --userfile USERFILE file containing usernames (one per line)
-c, --csvfile CSVFILE csv file containing usernames and passwords
-t, --threads THREADS number of concurrent threads to use [default: 3]
-d, --debug enable debug output
--recon only collect info, don't password spray
--user-row-name NAME username row title in CSV file [default: Email Address]
--pass-row-name NAME password row title in CSV file [default: Password]
--user-as-pass USERFILE use the usernames in the specified file as the password
--user-as-pass USERFILE use the usernames in the specified file as the password (one per line)
```

#### Examples

```bash
python atomizer.py owa contoso.com 'Fall2018' --userfile emails.txt
python atomizer.py owa contoso.com 'Fall2018' emails.txt
```

```bash
python atomizer.py lync contoso.com 'Fall2018' --userfile emails.txt
python atomizer.py lync contoso.com 'Fall2018' emails.txt
```

```bash
Expand Down Expand Up @@ -117,7 +117,7 @@ Converts names to active directory usernames (e.g `Alice Eve` => `CONTOSO\aeve`)

```
Usage:
spindrift [<file>] (--target TARGET | --domain DOMAIN | --no-domain) [--format FORMAT]
spindrift [<file>] [--target TARGET | --domain DOMAIN] [--format FORMAT]
Arguments:
file file containing names, can also read from stdin
Expand All @@ -126,7 +126,6 @@ Options:
--target TARGET optional domain or url to retrieve the internal domain name from OWA
--domain DOMAIN manually specify the domain to append to each username
--format FORMAT username format [default: {f}{last}]
--no-domain do not append a domain name
```

#### Examples
Expand Down
32 changes: 16 additions & 16 deletions atomizer.py
Expand Up @@ -2,7 +2,7 @@

"""
Usage:
atomizer (lync|owa) <target> <password> --userfile USERFILE [--threads THREADS] [--debug]
atomizer (lync|owa) <target> <password> <userfile> [--threads THREADS] [--debug]
atomizer (lync|owa) <target> --csvfile CSVFILE [--user-row-name NAME] [--pass-row-name NAME] [--threads THREADS] [--debug]
atomizer (lync|owa) <target> --user-as-pass USERFILE [--threads THREADS] [--debug]
atomizer (lync|owa) <target> --recon [--debug]
Expand All @@ -12,18 +12,18 @@
Arguments:
target target domain or url
password password to spray
userfile file containing usernames (one per line)
Options:
-h, --help show this screen
-v, --version show version
-u, --userfile USERFILE file containing usernames (one per line)
-c, --csvfile CSVFILE csv file containing usernames and passwords
-t, --threads THREADS number of concurrent threads to use [default: 3]
-d, --debug enable debug output
--recon only collect info, don't password spray
--user-row-name NAME username row title in CSV file [default: Email Address]
--pass-row-name NAME password row title in CSV file [default: Password]
--user-as-pass USERFILE use the usernames in the specified file as the password
--user-as-pass USERFILE use the usernames in the specified file as the password (one per line)
"""

import logging
Expand Down Expand Up @@ -122,7 +122,7 @@ def shutdown(self):


if __name__ == "__main__":
args = docopt(__doc__, version="0.0.1dev")
args = docopt(__doc__, version="1.0.0dev")
loop = asyncio.get_event_loop()

atomizer = Atomizer(
Expand All @@ -134,11 +134,11 @@ def shutdown(self):

logging.debug(args)

for input_file in [args['--userfile'], args['--csvfile'], args['--user-as-pass']]:
for input_file in [args['<userfile>'], args['--csvfile'], args['--user-as-pass']]:
if input_file:
file_path = Path(input_file)
if not file_path.exists() or not file_path.is_file():
logging.error(print_bad("Path to --userfile/--csvfile/--user-as-pass invalid!"))
logging.error(print_bad("Path to <userfile>/--csvfile/--user-as-pass invalid!"))
sys.exit(1)

if args['lync']:
Expand All @@ -150,7 +150,16 @@ def shutdown(self):
for sig in (signal.SIGINT, signal.SIGTERM):
loop.add_signal_handler(sig, atomizer.shutdown)

if args['--csvfile']:
if args['<userfile>']:
with open(args['<userfile>']) as userfile:
loop.run_until_complete(
atomizer.atomize(
userfile=userfile,
password=args['<password>']
)
)

elif args['--csvfile']:
with open(args['--csvfile']) as csvfile:
reader = csv.DictReader(csvfile)
loop.run_until_complete(
Expand All @@ -161,15 +170,6 @@ def shutdown(self):
)
)

elif args['--userfile']:
with open(args['--userfile']) as userfile:
loop.run_until_complete(
atomizer.atomize(
userfile=userfile,
password=args['<password>']
)
)

elif args['--user-as-pass']:
with open(args['--user-as-pass']) as userfile:
loop.run_until_complete(atomizer.atomize_user_as_pass(userfile))
Expand Down
14 changes: 6 additions & 8 deletions spindrift.py
Expand Up @@ -2,7 +2,7 @@

"""
Usage:
spindrift [<file>] (--target TARGET | --domain DOMAIN | --no-domain) [--format FORMAT]
spindrift [<file>] [--target TARGET | --domain DOMAIN] [--format FORMAT]
Arguments:
file file containing names, can also read from stdin
Expand All @@ -11,7 +11,6 @@
--target TARGET optional domain or url to retrieve the internal domain name from OWA
--domain DOMAIN manually specify the domain to append to each username
--format FORMAT username format [default: {f}{last}]
--no-domain do not append a domain name
"""

import sys
Expand All @@ -32,13 +31,12 @@ def convert_to_ad_username(name, username_format, domain):

domain = None

if not args['--no-domain']:
if args['--target']:
owa = OWA(args['--target'])
domain = owa.netbios_domain
if args['--target']:
owa = OWA(args['--target'])
domain = owa.netbios_domain

elif args['--domain']:
domain = args['--domain']
elif args['--domain']:
domain = args['--domain']

for line in contents:
convert_to_ad_username(line, args['--format'], domain)

0 comments on commit b79fa1a

Please sign in to comment.