Skip to content

Commit 05eef3c

Browse files
committed
fixes issue #224 and issue #221, deperecates some code that has to do with macOS which is no longer needed, removes the error_file after it has been used (if it has been used)
1 parent 41017bb commit 05eef3c

5 files changed

Lines changed: 17 additions & 16 deletions

File tree

autosploit/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ def main():
6969
)
7070
if choice.lower().startswith("y"):
7171
try:
72-
if "darwin" in platform_running.lower():
73-
cmdline("{} darwin".format(START_SERVICES_PATH))
74-
elif "linux" in platform_running.lower():
72+
if "linux" in platform_running.lower():
7573
cmdline("{} linux".format(START_SERVICES_PATH))
7674
else:
7775
close("your platform is not supported by AutoSploit at this time", status=2)

etc/scripts/start_services.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,10 @@ function startPostgreSQLLinux () {
1111
sudo systemctl start postgresql > /dev/null 2>&1
1212
}
1313

14-
function startApacheOSX () {
15-
sudo apachectl start > /dev/null 2>&1
16-
}
17-
18-
function startPostgreSQLOSX () {
19-
brew services restart postgresql > /dev/null 2>&1
20-
}
21-
2214
function main () {
2315
if [ $1 == "linux" ]; then
2416
startApacheLinux;
2517
startPostgreSQLLinux;
26-
elif [ $1 == "darwin" ]; then
27-
startApacheOSX;
28-
startPostgreSQLOSX;
2918
else
3019
echo "[*] invalid operating system";
3120
fi

lib/creation/issue_creator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import os
23
import sys
34
import json
45
import platform
@@ -165,5 +166,9 @@ def request_issue_creation(path, arguments, error_message):
165166
lib.output.error(
166167
"someone has already created this issue here: {}".format(find_url(identifier))
167168
)
169+
try:
170+
os.remove(path)
171+
except:
172+
pass
168173
else:
169174
lib.output.info("the issue has been logged to a file in path: '{}'".format(path))

lib/exploitation/exploiter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ def start_exploit(self, sep="*" * 10):
7878

7979
today_printable = datetime.datetime.today().strftime("%Y-%m-%d_%Hh%Mm%Ss")
8080
current_run_path = path.join(lib.settings.RC_SCRIPTS_PATH, today_printable)
81-
makedirs(current_run_path)
81+
try:
82+
makedirs(current_run_path)
83+
except OSError:
84+
current_run_path = path.join(lib.settings.RC_SCRIPTS_PATH, today_printable + "(1)")
85+
makedirs(current_run_path)
8286

8387
report_path = path.join(current_run_path, "report.csv")
8488
with open(report_path, 'w') as f:

lib/term/terminal.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,12 @@ def custom_host_list(self, mods):
274274
option 3 must be provided
275275
"""
276276
provided_host_file = lib.output.prompt("enter the full path to your host file", lowercase=False)
277-
self.exploit_gathered_hosts(mods, hosts=provided_host_file)
277+
if provided_host_file == "":
278+
lib.output.error("you provided a blank hosts file, did you mean to?")
279+
lib.output.info("defaulting to default hosts file (press CNTRL-C to go back and try again)")
280+
self.exploit_gathered_hosts(mods, hosts=self.host_path)
281+
else:
282+
self.exploit_gathered_hosts(mods, hosts=provided_host_file)
278283

279284
def terminal_main_display(self, loaded_mods):
280285
"""

0 commit comments

Comments
 (0)