Skip to content
Permalink
Browse files

Simplified cli

  • Loading branch information...
byt3bl33d3r committed Dec 21, 2018
1 parent ec5d138 commit b79fa1acc685290a17c945895561a7a709f7d234
Showing with 28 additions and 31 deletions.
  1. +6 −7 README.md
  2. +16 −16 atomizer.py
  3. +6 −8 spindrift.py
@@ -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]
@@ -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
@@ -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
@@ -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
@@ -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]
@@ -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
@@ -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(
@@ -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']:
@@ -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(
@@ -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))
@@ -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
@@ -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
@@ -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.
You can’t perform that action at this time.