Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
61a788d
update
NullArray Feb 7, 2018
d927ebb
Update autosploit.py
NullArray Feb 7, 2018
4a149dd
created some updates and moved the modules and usage into etc/ folder…
Feb 7, 2018
cb3bece
Merge branch 'dev-beta' into dev-beta
Ekultek Feb 7, 2018
e7ad52f
Merge pull request #32 from Ekultek/dev-beta
NullArray Feb 7, 2018
82756f2
Merge branch 'master' of git://github.com/nullarray/autosploit into d…
Feb 8, 2018
ef06d32
fixed all errors (most anyways) so that it will run successfully. cre…
Feb 8, 2018
0799c07
fixed the numbers
Feb 8, 2018
86d4f68
Update autosploit.py
NullArray Feb 8, 2018
0458fc7
Update autosploit.py
NullArray Feb 8, 2018
dcad3fd
Merge branch 'dev-beta' into dev-updates
Ekultek Feb 8, 2018
00e313d
Merge remote-tracking branch 'NullArray/master'
ehlewis Feb 8, 2018
a8bf69b
Added ability to limit number of hosts
ehlewis Feb 8, 2018
c467672
Merge pull request #34 from Ekultek/dev-updates
NullArray Feb 14, 2018
79ea890
Merge branch 'dev-beta' into dev-beta
ehlewis Feb 14, 2018
5e23e7f
Merge branch 'master' of git://github.com/NullArray/AutoSploit into d…
Feb 15, 2018
8f9874e
created an animation that will run while the program sorts, or writes…
Feb 15, 2018
1676499
Update autosploit.py
Ekultek Feb 15, 2018
be124aa
Merge pull request #46 from Ekultek/animation
NullArray Feb 16, 2018
c31373e
Stylized .yml, .py, .md, and .txt
thehappydinoa Feb 16, 2018
6a8fb98
Merge pull request #48 from thehappydinoa/dev-beta
NullArray Feb 16, 2018
ceb6851
Create modules.json
NullArray Feb 19, 2018
dde825b
Update autosploit.py
NullArray Feb 19, 2018
2ea9170
created a function that will take a text file and turn it into a JSON…
Feb 19, 2018
bbb9bc2
Merge pull request #52 from NullArray/jsonize
Ekultek Feb 20, 2018
8a9f4ad
Merge branch 'dev-beta' into dev-beta
ehlewis Feb 20, 2018
7a7e587
Merge pull request #37 from ehlewis/dev-beta
NullArray Feb 20, 2018
a9f00db
Implemented Censys Functionality (#60) (#56 dome)
ehlewis Feb 21, 2018
c2c260e
Fixed targets() input infinite loop (#61)
ehlewis Feb 22, 2018
042c864
started creating the arguments for issue #57
Feb 22, 2018
cd0483d
Merge pull request #62 from NullArray/cmdline
NullArray Feb 22, 2018
2217366
voided blessings in favor of ANSI codes
Feb 22, 2018
aadc942
changed all the output to new favorable output
Feb 22, 2018
91ae0cf
changed all the output to new favorable output
Feb 22, 2018
8e50ad6
finished the '-e' argument, will now convert a text file containing e…
Feb 22, 2018
ba39cb9
changed all the output to new favorable output
Feb 22, 2018
9a7b0aa
created a way to validate IP addresses pythonically, also created pro…
Feb 22, 2018
6f93e79
voided blessings
Feb 22, 2018
f792e27
Merge pull request #63 from NullArray/updates
NullArray Feb 22, 2018
3d777f2
refractor to the way that the processes are started, will now run thr…
Feb 22, 2018
52f95c7
Merge pull request #65 from NullArray/more-updates
NullArray Feb 22, 2018
e309f3e
pushing the API packages to Github, will implement them later on (iss…
Feb 23, 2018
4201d9e
Merge pull request #66 from NullArray/api
Ekultek Feb 23, 2018
e889bea
nuclear option
NullArray Feb 23, 2018
f9c1578
nuclear option
NullArray Feb 23, 2018
fb53eaa
created a new banner, made it so that banner always displays, fixed t…
Feb 23, 2018
4c1783c
Merge pull request #67 from NullArray/banner_fix
Ekultek Feb 23, 2018
28a5c86
created a method to load the API keys since we now use multiple of th…
Feb 23, 2018
778bcce
fixed the ID call for censys, will now also prompt for an ID instead …
Feb 24, 2018
da27f08
Merge pull request #69 from NullArray/updates
NullArray Feb 26, 2018
81e3028
fixed shebang line
NullArray Feb 26, 2018
861959a
fixed shebang line
NullArray Feb 26, 2018
38e7329
created a terminal output for the program that implements #64 and #49
Feb 27, 2018
afc6567
moved some stuff to settings, created a class for the exploitation so…
Feb 27, 2018
a6ba889
Merge pull request #70 from NullArray/terminal
NullArray Feb 27, 2018
5099df6
fixes the issue
Feb 27, 2018
bc1994b
Merge pull request #71 from NullArray/animation
Ekultek Feb 27, 2018
ef52595
created an issue template for furture issues
Feb 27, 2018
38122d2
fixed the docker file to download the correct requirements
Feb 27, 2018
2a90d89
fixed the README to have the correct requirements
Feb 27, 2018
c7f05ca
fixed the req file to have the correct requirements
Feb 27, 2018
a4c13bd
Merge pull request #72 from NullArray/trivial
NullArray Feb 28, 2018
9adb6eb
implemented the switches, search engines, and everything else, issue …
Feb 28, 2018
eb3d938
ready for deployment
Mar 1, 2018
a88d06c
Merge pull request #73 from NullArray/trivial
NullArray Mar 1, 2018
ae80ecb
Update CONTRIBUTING.md
NullArray Mar 1, 2018
7d3af30
Update general
NullArray Mar 1, 2018
c85ebc1
Update README.md
NullArray Mar 1, 2018
72ad39c
Update README.md
NullArray Mar 1, 2018
03e73e9
minor edits to fix minor banner issues
Mar 1, 2018
11d2888
Merge branch 'master' into dev-beta
NullArray Mar 1, 2018
13260b5
Merge pull request #75 from NullArray/trivial
Ekultek Mar 1, 2018
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
Prev Previous commit
Next Next commit
created an animation that will run while the program sorts, or writes…
… the data
  • Loading branch information
ekultek
ekultek committed Feb 15, 2018
commit 8f9874e100fe0af3712ad5af343b8b31cea6dea6
97 changes: 52 additions & 45 deletions autosploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
import os
import sys
import time
import shlex
import pickle
import threading
import subprocess

import shodan

# idk if you're going to need this since retrying is a decorator (see line 410)
# from retrying import retry
from blessings import Terminal
from subprocess import PIPE, Popen

t = Terminal()

Expand All @@ -39,11 +42,10 @@
version = "1.4.0"
usage_and_legal_path = "{}/etc/general".format(os.getcwd())
modules_path = "{}/etc/modules.txt".format(os.getcwd())
stop_animation = False
autosploit_opts = {
1: "usage and legal", 2: "gather hosts", 3: "custom hosts",
4: "add single host", 5: "view gathered hosts", 6: "exploit gathered hosts",
# changing quit to 99 so that we can keep adding without having to change
# the numbers
99: "quit"
}

Expand All @@ -60,6 +62,22 @@ def logo(line_sep="#--", space=" " * 30):
""".format(sep1=line_sep, v_num=version, space_sep=space)))


def animation(text):
global stop_animation
i = 0
while not stop_animation:
temp_text = list(text)
if i >= len(temp_text):
i = 0
temp_text[i] = temp_text[i].upper()
temp_text = ''.join(temp_text)
sys.stdout.write("\033[96m\033[1m{}...\r\033[0m".format(temp_text))
sys.stdout.flush()
i += 1
time.sleep(0.1)
else: pass


def usage():
"""Usage & Legal."""
global usage_and_legal_path
Expand All @@ -78,13 +96,11 @@ def cmdline(command):
I intend to have the issue resolved by Version 1.5.0.
"""

# TODO:/
# split the command by shlex, this will help with
# most command injection sequences.
command = shlex.split(command)

process = Popen(
process = subprocess.Popen(
args=command,
stdout=PIPE,
stdout=subprocess.PIPE,
shell=True
)
return process.communicate()[0]
Expand All @@ -97,6 +113,7 @@ def exploit(query=None, single=None):
global local_port
global local_host
global modules_path
global stop_animation
print("\033[H\033[J") # Clear terminal

logo()
Expand All @@ -112,18 +129,18 @@ def exploit(query=None, single=None):
proceed = raw_input("[" + t.magenta("?") + "]Continue? [Y]es/[N]o: ").lower()

if proceed == 'y':
print("\n\n\n[{}]Loading modules...".format(t.green("+")))
# Progress bar
sys.stdout.write("[%s]" % (" " * toolbar_width))
sys.stdout.flush()
sys.stdout.write("\b" * (toolbar_width + 1))
thread = threading.Thread(target=animation, args=("loading modules", ))
thread.daemon = True
thread.start()

with open(modules_path, "rb") as infile:
for i in xrange(toolbar_width):
time.sleep(0.1)
for lines in infile:
all_modules.append(lines)

stop_animation = True

print("\n\n\n[{}]Done. Launching exploits.".format(t.green("+")))
# TODO:/
# exploit is not referenced anywhere around here
Expand All @@ -138,25 +155,21 @@ def exploit(query=None, single=None):
print("[{}]Unhandled Option. Defaulting to Main Menu".format(t.red("!")))

else:
print("[{}]Sorting modules relevant to the specified platform.".format(t.green("+")))
print("[{}]This may take a while...\n\n\n".format(t.green("+")))

# Progress bar
sys.stdout.write("[%s]" % (" " * toolbar_width))
sys.stdout.flush()
sys.stdout.write("\b" * (toolbar_width + 1))

with open(modules_path, "rb") as infile:
for i in xrange(toolbar_width):
time.sleep(0.1)
for lines in infile:
all_modules.append(lines)
if query in lines:
sorted_modules.append(lines)

# update the bar
sys.stdout.write('\033[94m' + "|" + '\033[0m')
sys.stdout.flush()

thread = threading.Thread(target=animation, args=(
"sorting modules by relevance, this may take awhile",
))
thread.daemon = True
thread.start()

with open(modules_path, "rb") as infile:
for i in xrange(toolbar_width):
time.sleep(0.1)
for lines in infile:
all_modules.append(lines)
if query in lines:
sorted_modules.append(lines)
stop_animation = True

print("\n\n\n[{}]AutoSploit sorted the following MSF modules based search query relevance.\n".format(t.green("+")))
# Print out the sorted modules
Expand Down Expand Up @@ -256,6 +269,7 @@ def settings(single=None):
def targets(clobber=True):
"""Function to gather target host(s) from Shodan."""
global query
global stop_animation

print("\033[H\033[J") # Clear terminal
logo()
Expand All @@ -280,10 +294,9 @@ def targets(clobber=True):
print("\n[{}]Critical. An error was raised with the following error message.\n".format(t.red("!")))
sys.exit() # must use an integer with sys.exit()

# Setup progress bar
sys.stdout.write("[%s]" % (" " * toolbar_width))
sys.stdout.flush()
sys.stdout.write("\b" * (toolbar_width + 1))
thread = threading.Thread(target=animation, args=("collecting results", ))
thread.daemon = True
thread.start()

# TODO:/
# edit the clobber function to work properly
Expand All @@ -294,11 +307,8 @@ def targets(clobber=True):
for service in result['matches']:
log.write("{}{}".format(service['ip_str'], os.linesep))

# update the bar
sys.stdout.write('\033[94m' + "|" + '\033[0m')
sys.stdout.flush()

hostpath = os.path.abspath("hosts.txt")
hostpath = os.path.abspath("hosts.txt")
stop_animation = True

print("\n\n\n[{}]Done.".format(t.green("+")))
print("[{}]Host list saved to {}".format(t.green("+"), hostpath))
Expand All @@ -311,11 +321,8 @@ def targets(clobber=True):
log.write(service['ip_str'])
log.write("\n")

# update the bar
sys.stdout.write('\033[94m' + "|" + '\033[0m')
sys.stdout.flush()

hostpath = os.path.abspath("hosts.txt")
stop_animation = True

print("\n\n\n[{}]Done.".format(t.green("+")))
print("[{}]Hosts appended to list at ".format(t.green("+"), hostpath))
Expand Down