Skip to content

Commit cd0483d

Browse files
authored
Merge pull request #62 from NullArray/cmdline
Arguments
2 parents c2c260e + 042c864 commit cd0483d

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

autosploit.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@
2323
import pickle
2424
import threading
2525
import subprocess
26-
import json
27-
import requests
2826
import censysSearch
2927
import shodan
3028
# idk if you're going to need this since retrying is a decorator (see line 410)
3129
# from retrying import retry
3230
from blessings import Terminal
3331

3432
from lib.jsonize import load_exploits
33+
from lib.cmdline.cmd import AutoSploitParser
3534

3635

3736
t = Terminal()
@@ -598,6 +597,12 @@ def try_shodan():
598597

599598

600599
if __name__ == "__main__":
600+
601+
if len(sys.argv) > 1:
602+
opts = AutoSploitParser().optparser()
603+
AutoSploitParser().single_run_args(opts)
604+
605+
601606
logo()
602607

603608
print("[{}]Initializing AutoSploit...".format(t.green("+")))

etc/text_files/ethics.lst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"Consider if playing Xbox would be a wiser choice before proceeding..."
2+
"Think of it this way, is it worth the jail time?"
3+
"In the end, I can't figure out how to use Autosploit in a way that isn't merely a random act of vandalism.."
4+
"Threat or menace? 'Autosploit' tool sparks fears of empowered 'script kiddies'"
5+
"So far the response to AutoSploit has been a mix of outrage, fear, some applause, and more than a few shrugs."
6+
"Releasing AutoSploit, making mass exploitation even easier, was irresponsible. My friends at the FBI remind us all that while exploitation is easier, it is not any less illegal. #scriptkiddiesbeware"
7+
"New tool makes hacking even easier. Many people are critical of the release."
8+
"The kids are not more dangerous. They already were dangerous. We’ve simply given them a newer, simpler, shinier way to exploit everything that’s broken. Maybe we should fix the ROOT problem"
9+
"This provides an unending opportunity for cybercriminals and script kiddies to hijack vulnerable devices and subsequently launch attacks against online organizations with ease"
10+
"Both Metasploit and Shodan have been available for years, as integral to the pen testers toolkit as Nessus and Burpsuite. But with Autosploit pulling them together, the concern should be focused on curious kids thinking it would be fun to see what they can find"
11+
"My fear is that this has magnified the attack surface, and made it so that every exposed service on the internet will be scanned and probed on a near-constant basis by an entirely new set of attackers."
12+
"The release of tools like these exponentially expands the threat landscape by allowing a wider group of hackers to launch global attacks at will"

lib/cmdline/__init__.py

Whitespace-only changes.

lib/cmdline/cmd.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import sys
3+
import random
4+
import argparse
5+
6+
7+
class AutoSploitParser(argparse.ArgumentParser):
8+
9+
def __init__(self):
10+
super(AutoSploitParser, self).__init__()
11+
12+
@staticmethod
13+
def optparser():
14+
parser = argparse.ArgumentParser()
15+
parser.add_argument("-c", "--censys", action="store_true", dest="searchCensys",
16+
help="use censys.io as the search engine instead of shodan.io to gather hosts")
17+
parser.add_argument("-b", "--both", action="store_true", dest="searchBoth",
18+
help="search both shodan.io and censys.io for hosts")
19+
parser.add_argument("--proxy", metavar="PROTO://IP:PORT", dest="proxyConfig",
20+
help="run behind a proxy while performing the searches")
21+
parser.add_argument("-e", "--exploit-file", metavar="PATH", dest="exploitList",
22+
help="provide a text file to convert into JSON and save for later use")
23+
parser.add_argument("-E", "--exploit", metavar="EXPLOIT", dest="singleExploit",
24+
help="pass a single exploit in the same format as the JSON file(s)")
25+
parser.add_argument("--ethics", action="store_true", dest="displayEthics",
26+
help=argparse.SUPPRESS) # easter egg!
27+
opts = parser.parse_args()
28+
return opts
29+
30+
@staticmethod
31+
def single_run_args(opt):
32+
if opt.displayEthics:
33+
ethics_file = "{}/etc/text_files/ethics.lst".format(os.getcwd())
34+
with open(ethics_file) as ethics:
35+
ethic = random.choice(ethics.readlines()).strip()
36+
print("Your ethic for the day:\n\n{}".format(ethic))
37+
sys.exit(0)

0 commit comments

Comments
 (0)