{"id":17267273,"url":"https://github.com/abe-101/ip-bot","last_synced_at":"2025-04-14T08:03:36.593Z","repository":{"id":58549878,"uuid":"530457005","full_name":"abe-101/IP-Bot","owner":"abe-101","description":"a Slack bot that listens for messages containing IP addresses and responds with security info about them. ","archived":false,"fork":false,"pushed_at":"2023-06-26T13:03:57.000Z","size":177,"stargazers_count":10,"open_issues_count":10,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T10:22:40.897Z","etag":null,"topics":["python","slack","slack-bot","virustotal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abe-101.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-30T01:40:11.000Z","updated_at":"2025-01-16T13:56:28.000Z","dependencies_parsed_at":"2023-02-17T05:16:09.704Z","dependency_job_id":null,"html_url":"https://github.com/abe-101/IP-Bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"allenai/python-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abe-101%2FIP-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abe-101%2FIP-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abe-101%2FIP-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abe-101%2FIP-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abe-101","download_url":"https://codeload.github.com/abe-101/IP-Bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240177055,"owners_count":19760308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","slack","slack-bot","virustotal"],"created_at":"2024-10-15T08:10:14.438Z","updated_at":"2025-02-24T23:31:00.503Z","avatar_url":"https://github.com/abe-101.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IP-Bot\n\n\nhttps://user-images.githubusercontent.com/82916197/187593974-ca406ab0-8813-4396-bb16-5d06fbee0bf8.mp4\n\n\n## Description\n\na Slack bot that listens for messages containing IP addresses and responds with security info about them.\n\nFull demo video at https://youtu.be/1LehrI46O-c\n\n# Getting Started\n\n## Creating a Slack app\nFirst you'll need to [create a Slack app](https://api.slack.com/apps?new_app=1\u0026ref=bolt_start_hub)\n\n## Requesting Scopes\nNavigate over to the **OAuth \u0026 Permissions** sidebar, Scroll down to the **Bot Token Scopes** section and click **Add an OAuth Scope**\n\nSearch for:\n1. channels:history\n2. chat:write\n\nScroll down to the **User Token Scopes** section and click **Add an OAuth Scope**:\nSearch for:\n1. channels:history\n\n## Fork and Clone this repo\n```\ngit clone git@github.com:\u003cUSERNAME\u003e/ip-bot.git\n```\n\n## Install Dependencies:\n```\npip install -r requirements.txt\n```\n## Installing Your App\n\nInstall your own app by selecting the **Install App** button at the top of the **OAuth \u0026 Permissions** page\n5.\n\n\n## Environment Variables\n\nCreate a file `ip_bot/.env` Containing you API tokens.\nfor this project we need:\n1. The Bot User OAuth Access Token under the **OAuth \u0026 Permissions** sidebar\n2. The Slack signing secret. Navigate to the **Basic Information** page from your app management page. Under **App Credentials**, copy the value for Signing Secret.\n3. [Virus Total's](https://www.virustotal.com/gui/home/upload) public API. Create an account to get your Token at https://developers.virustotal.com/reference/overview\n\n```\nSLACK_BOT_TOKEN=\u003cYour Slack bot Token\u003e\nSLACK_SIGNING_SECRET=\u003cSlack signing key\u003e\nVIRUS_TOTAL_API_KEY=\u003cYour Virus Total api token\u003e\n```\n\n## Using ngrok as a local proxy \n\nTo tr out locally we'll be using ngrok, which allows you to expose a public endpoint that Slack can use to send your app events. If you haven't already, [install ngrok from their website](https://ngrok.com/download).  \nTell ngrok to use port 3000 which Bolt for python uses by default:\n```\nngrok http 3000\n```\n\n## Subscribing to events\n\nFirst get the Bolt app running:\n```\npython ip_bot/app.py\n```\n\nOn your app configuration page, select the **Event Subscriptions** sidebar. You'll be presented with an input box to enter a Request URL, which is where Slack sends the events your app is subscribed to. For local development, we'll use your ngrok URL from above.\n\n    For example: https://1234abcde.ngrok.io\n\nBy default Bolt for Python listens for all incoming requests at the /slack/events route, so for the Request URL you can enter your ngrok URL appended with `/slack/events`.\n\n    For example: https://1234abcde.ngrok.io/slack/events\n\nAfter you've saved your Request URL, click on **Subscribe to events on behalf of users**, then **Add Workspace Event** and search for `message.channels`. Then **Save Changes** using the button on the bottom right.\n\n## Try It Out\n\nYou bot is now ready in action\nOpen slack messenger and add your bot to any channel and mention an ip address in a message and see what happens\n\n## Deployment\n\nYou can deploy this project for free on [Railway.app](https://railway.app?referralCode=abe-101)  \n\n1. Create a new project and select `deploy from GitHub repo`  \n    give railway.app access to your newly created GitHub repo.\n2. Go to the variables tab and add the [above mentioned](#Environment-Variables) variables.\n3. In the setting tab under the Domains section click `generate domain` and add it to your slack app as mentioned above in [Subscribing to events](#Subscribing-to-events)\n4. Set the `start command` to be `python ip_bot/app.py`.\n\nYour bot is now running all the time.  \n\n## Credits\n* [Abe](https:github.com/abe-101)\n\u003c!-- * [b-fullam](https://github.com/b-fullam/Automating-VirusTotal-APIv3-for-IPs-and-URLs)--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabe-101%2Fip-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabe-101%2Fip-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabe-101%2Fip-bot/lists"}