Skip to content

Commit

Permalink
v1.7 (correct issue #1 & #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien committed Aug 20, 2022
1 parent ae3e0b7 commit dfa9979
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TITB is a fork from [Threat Intelligence Discord Bot from vx-underground](https:

> The vx-underground Threat Intelligence Discord Bot gets updates from various clearnet domains, ransomware threat actor domains This bot will check for updates in intervals of 1800 seconds.
[![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) ![Version](https://img.shields.io/badge/version-1.6.1-blue.svg) [![Twitter: JMousqueton](https://img.shields.io/twitter/follow/JMousqueton.svg?style=social)](https://twitter.com/JMousqueton) [![Last Run](https://github.com/JMousqueton/CTI-MSTeams-Bot/actions/workflows/fetchCTI.yml/badge.svg)](.github/workflows/fetchCTI.yml) [![CodeQL](https://github.com/JMousqueton/CTI-MSTeams-Bot/actions/workflows/codeql-analysis.yml/badge.svg)](.github/workflows/codeql-analysis.yml)
[![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) ![Version](https://img.shields.io/badge/version-1.7.0-blue.svg) [![Twitter: JMousqueton](https://img.shields.io/twitter/follow/JMousqueton.svg?style=social)](https://twitter.com/JMousqueton) [![Last Run](https://github.com/JMousqueton/CTI-MSTeams-Bot/actions/workflows/fetchCTI.yml/badge.svg)](.github/workflows/fetchCTI.yml) [![CodeQL](https://github.com/JMousqueton/CTI-MSTeams-Bot/actions/workflows/codeql-analysis.yml/badge.svg)](.github/workflows/codeql-analysis.yml)

## Description

Expand Down Expand Up @@ -78,20 +78,14 @@ python3 checkFeed.py
```

## Adding or removing RSS Feeds to monitor
All monitored RSS feeds are in [Feed.csv](Feed.csv) file. To add a new RSS feed simply append a new entry and assign it a [Config.txt](Config.txt) file entry name. e.g.
All monitored RSS feeds are in [Feed.csv](Feed.csv) file. To add a new RSS feed simply append a new entry. e.g.

In the ```Feed.csv``` file :
```
https://grahamcluley.com/feed/,Graham Cluley
https://1337WebsiteIWannaFollow.com/feed/,1337Website
```

In the ```Config.txt``` file:
```
1337Website = ?
```
The "?" indicates it has never received an update.

## Sources

I've added the following sources :
Expand All @@ -113,6 +107,7 @@ I've added the following sources :
* ~~Add more sources~~
* ~~Add support of Python 3.10 for support of match functions~~
* ~~Change emoji depending on source~~ (version 1.6)
* ~~No need to make an entry in Config.txt~~ (version 1.7)

## Credit

Expand Down
28 changes: 22 additions & 6 deletions TeamsIntelBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Created By : Julien Mousqueton @JMousqueton
# Original By : VX-Underground
# Created Date: 18/08/2022
# version : 1.6.1
# version : 1.7.0
# ---------------------------------------------------------------------------


Expand Down Expand Up @@ -70,7 +70,13 @@ def FnGetRansomwareUpdates():
for Entries in Data:

DateActivity = Entries["discovered"]
TmpObject = FileConfig.get('main', Entries["group_name"])

# Correction for issue #1 : https://github.com/JMousqueton/CTI-MSTeams-Bot/issues/1
try:
TmpObject = FileConfig.get('main', Entries["group_name"])
except:
FileConfig.set('main', Entries["group_name"], " = ?")
TmpObject = FileConfig.get('main', Entries["group_name"])

if "?" in TmpObject:
FileConfig.set('main', Entries["group_name"], DateActivity)
Expand All @@ -79,18 +85,20 @@ def FnGetRansomwareUpdates():
continue
else:
FileConfig.set('main', Entries["group_name"], Entries["discovered"])

OutputMessage = "Group : <b>"
OutputMessage += Entries["group_name"]
OutputMessage += "</b><br>πŸ—“ "
OutputMessage += Entries["discovered"]
OutputMessage += "</b><br>🌍 <a href=\"https://www.google.com/search?q="
OutputMessage += Entries["post_title"]
# Correction for issue #2 : https://github.com/JMousqueton/CTI-MSTeams-Bot/issues/2
OutputMessage += Entries["post_title"].replace("*.", "")
OutputMessage += "\">"
OutputMessage += Entries["post_title"]
OutputMessage += "</a>"
Title = "πŸ΄β€β˜ οΈ πŸ”’ "
Title += Entries["post_title"]
Title = "πŸ΄β€β˜ οΈ πŸ”’ "
# Correction for issue #2 : https://github.com/JMousqueton/CTI-MSTeams-Bot/issues/2
Title += Entries["post_title"].replace("*.", "")
send_teams(Url,OutputMessage,Title)
time.sleep(3)

Expand All @@ -117,6 +125,14 @@ def FnGetRssFromUrl(RssItem):
except:
DateActivity = time.strftime('%Y-%m-%dT%H:%M:%S', RssObject.updated_parsed)

# Correction for issue #1 : https://github.com/JMousqueton/CTI-MSTeams-Bot/issues/1
try:
TmpObject = FileConfig.get('main', RssItem[1])
except:
FileConfig.set('main', RssItem[1], " = ?")
TmpObject = FileConfig.get('main', RssItem[1])


TmpObject = FileConfig.get('main', RssItem[1])
if "?" in TmpObject:
IsInitialRun = True
Expand Down

0 comments on commit dfa9979

Please sign in to comment.