Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Phishbert for Rocket.Chat (set this up as an Outgoing Webhook script)
class Script {
prepare_outgoing_request({ request }) {
// Detect phishing attempts and alert channel
let pattern = new RegExp('(0x)?[0-9a-f]{40}|(etherscan.io)', 'gi');
if (pattern.test(request.data.text)) {
return {
message: {
text: [
'⚠️ *ALERT* ⚠️',
'The previous message from @' + request.data.user_name + ' may be a phishing attempt. Do not send funds to addresses posted in this channel or follow suspicious links.'
].join('\n')
}
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.