Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Slack Cleaner2 is an improved slack cleaner version using a python first approach
Bulk delete messages and files on Slack.
Install from PyPi:
pip install slack-cleaner2
latest version
pip install -e git+https://github.com/sgratzl/slack_cleaner2.git#egg=slack_cleaner2
In contrast to the original version (https://github.com/kfei/slack-cleaner) this version is a focusing on pure python package that allows for easy scripting instead of a vast amount of different command line arguments.
basic usage
from slack_cleaner2 import *
s = SlackCleaner('SECRET TOKEN')
# list of users
s.users
# list of all kind of channels
s.conversations
# delete all messages in -bots channels
for msg in s.msgs(filter(match('.*-bots'), s.conversations)):
# delete messages, its files, and all its replies (thread)
msg.delete(replies=True, files=True)
# delete all general messages and also iterate over all replies
for msg in s.c.general.msgs(with_replies=True):
msg.delete()
Migration Guides form slack-cleaner contains a series of common pattern in slack cleaner and their counterpart in Slack Cleaner2
The slack cleaner needs you to give Slack's API permission to let it run the operations it needs. You grant these by registering it as an app in the workspace you want to use it in.
You can grant these permissions to the app by:
SlackCleaner
The token should start with xoxp and not like bot tokens with xoxb.
Beyond granting permissions, if you wish to use this library to delete messages or files posted by others, you will need to be an Owner or Admin of the workspace.
users:read
channels:read
groups:read
im:read
mpim:read
users:read
channels:read
channels:history
chat:write
users:read
groups:read
groups:history
chat:write
Note: You can only delete your own messages, not the ones of others. This is due to a restriction in the Slack API and there is nothing one can do about it.
im:read
im:history
users:read
chat:write
mpim:read
mpim:history
users:read
chat:write
files:read
users:read
files:write
There is no direct docker file available, however since it is a python module one can easily create one:
FROM python:3.9-alpine
LABEL maintainer="Samuel Gratzl <sam@sgratzl.com>"
VOLUME "/backup"
WORKDIR /backup
RUN pip --no-cache-dir install slack-cleaner2
CMD ["python", "-"]
An Docker image named slack_cleaner2
with this Dockerfile would be used like
cat myscript.py | docker run -i slack_cleaner2
The myscript.py
file is a python script using the slack_cleaner2 module.
To all the people who can only afford a free plan. :cry:
bumpversion patch
git commit -am 'release vX.X.X'
git tag vX.X.X
invoke release
git push
git push --tags
change version in slack_cleaner2/_info.py
FAQs
Slack Cleaner2 is an improved slack cleaner version using a python first approach
We found that slack-cleaner2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.