Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // Phishbert for Rocket.Chat (set this up as an Outgoing Webhook script)
  2. class Script {
  3. prepare_outgoing_request({ request }) {
  4.  
  5. // Detect phishing attempts and alert channel
  6. let pattern = new RegExp('(0x)?[0-9a-f]{40}|(etherscan.io)', 'gi');
  7. if (pattern.test(request.data.text)) {
  8. return {
  9. message: {
  10. text: [
  11. '⚠️ *ALERT* ⚠️',
  12. '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.'
  13. ].join('\n')
  14. }
  15. };
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement