Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self):
# sync top level domains with mozilla if the user is root
if os.geteuid() == 0:
update_tld_names()
else:
print "Not running as root, you are going to need those privs to nmap properly"
sys.exit(-1)
# try to resolve ip
if self._isHostname:
try:
self._ip = socket.gethostbyname(self._target)
except:
print "== Error on resolving IP check that hostname resolves: "
print sys.exc_info()
sys.exit(-1)
else:
self._ip = self._target
# Iterate through plugins which require a hostname to be passed
def main():
"""Updates TLD names.
:example:
python src/tld/commands/update_tld_names.py
"""
try:
print(do_update_tld_names())
except Exception as err:
print(err)