diff --git a/mikrotikapi-bf.py b/mikrotikapi-bf.py index 3483a0c..71be97e 100644 --- a/mikrotikapi-bf.py +++ b/mikrotikapi-bf.py @@ -449,7 +449,15 @@ def main(): # First of all, we'll try with RouterOS default credentials ("admin":"") while defcredcheck: s = None - apiros = ApiRos(s, target, "admin", "", port) + + # check connection + # mayby administrator is disabled api on router + try: + apiros = ApiRos(s, target, "admin", "", port) + except: + print("Connection Failed. Mayby Administrator Disabled The Api...") + sys.exit('Bye :D') + dictFile.close() defaultcreds = apiros.status login = ''.join(defaultcreds[0][0])