Scanning For Default Credentials With Python

This Python project will use the Nmap Python library to scan the local network, enumerate select systems and devices, try to login with default or known credentials, and send a Slack message if it finds anything.

Summary

This technical segment discusses creating a Python script to scan a network for default credentials and send notifications through a Slack bot. The initial release is here: https://github.com/SecurityWeekly/netslackbot

Highlights

  • A Python script was created to scan a network for default credentials and send notifications through a Slack bot.
  • The Slack bot required an app-level token with specific permissions to send messages to private channels.
  • The first function created was called “post message to Slack” and sent a post request to the Slack API endpoint chat.post message.
  • The code should be extended and modified to fit individual needs, but care should be taken to store Slack tokens securely.
  • The original code was found on GitHub, but the account has been archived. The code is MIT licensed and can be extended by others.