j3ssie / osmedeus

A Workflow Engine for Offensive Security
https://osmedeus.org/
MIT License
5.25k stars 873 forks source link

Has anyone been able to get Slack or Telegram notifications to work? #262

Open Sab0tag3d opened 11 months ago

Sab0tag3d commented 11 months ago

I did everything for telegram following instruction: https://docs.osmedeus.org/installation/notification/ I receive test notification from step 3, but cant receive them with Osmedius. The same problem for Slack webhooks.

How I run it:

# osmedeus scan -m ~/osmedeus-base/workflow/test/noti.yaml -t example.com --debug
[2023-09-14T10:24:31] DEBUG Append $PATH with: /root/osmedeus-base/binaries
[2023-09-14T10:24:31] DEBUG Loading all environment variables from: /root/osmedeus-base/token/osm-var.yaml
[2023-09-14T10:24:31] DEBUG Adding 4 tokens to the environment variables
[2023-09-14T10:24:31] DEBUG Setting environment variable: TELEGRAM_API_TOKEN -- 58***BE
[2023-09-14T10:24:31] DEBUG Getting all the config that need to be set manually
[+] Osmedeus v4.6.0 by @j3ssiejjj
[2023-09-14T10:24:31]  INFO Storing the log file to: /tmp/osm-log/osmedeus-1536123093.log
[2023-09-14T10:24:31] DEBUG Parsing module at: /root/osmedeus-base/workflow/test/noti.yaml
[2023-09-14T10:24:31]  INFO Running default tactic with baseline threads hold as 10
[2023-09-14T10:24:31]  INFO Running the routine /root/osmedeus-base/workflow/test/noti.yaml on example.com
[2023-09-14T10:24:31]  INFO Detailed runtime file can be found on /root/workspaces-osmedeus/example.com/runtime
[Module-Started] test-noti - test notification
[2023-09-14T10:24:32] DEBUG Updating 0 report records
[2023-09-14T10:24:32]  INFO Running prepare scripts for module test-noti
[2023-09-14T10:24:32] DEBUG Run-Scripts: CreateFolder("/tmp/test-osm-noti/")
[2023-09-14T10:24:32] DEBUG Run-Scripts: StartNoti()
[2023-09-14T10:24:32] DEBUG Run-Scripts: ExecCmd("echo 'sample text here' > /tmp/test-osm-noti/dirb.txt")
[2023-09-14T10:24:32] DEBUG Execute: echo 'sample text here' > /tmp/test-osm-noti/dirb.txt
[2023-09-14T10:24:32] DEBUG Run-Scripts: TeleMessByFile("#dirb", "/tmp/test-osm-noti/dirb.txt")
[2023-09-14T10:24:32] DEBUG Run-Scripts: TeleMess("#mics", "Sample message --> example.com")
[2023-09-14T10:24:32] DEBUG Run-Scripts: TeleMessByFile("#report", "/tmp/test-osm-noti/dirb.txt")
[2023-09-14T10:24:32] DEBUG Run-Scripts: TeleMessByFile("#sensitive", "/tmp/test-osm-noti/dirb.txt")
[2023-09-14T10:24:32] DEBUG Run-Scripts: WebHookNoti("test string")
[2023-09-14T10:24:32]  INFO Running conclude scripts for module test-noti
[2023-09-14T10:24:32] DEBUG Run-Scripts: DoneNoti()
----------------------------------------
[Report] List of reports generated by the test-noti module
[Module-Ended] Elapsed Time for the module test-noti in 0.00479161s
----------------------------------------
[2023-09-14T10:24:32] DEBUG DB: Finished 1/1 steps in the test-noti module
[2023-09-14T10:24:32] DEBUG DB: The scan has been completed: example.com -- noti.yaml
[Finished] The scan for example.com was completed within 0s

My notification config: image

noti.yaml also a standart one, I just add sting for Slack:

name: test-noti
desc: test notification

# osmedeus scan -m ~/osmedeus-base/workflow/tests/noti.yaml -t sample.com

pre_run:
  - CreateFolder("/tmp/test-osm-noti/")
  - StartNoti()

steps:
  - scripts:
      - ExecCmd("echo 'sample text here' > /tmp/test-osm-noti/dirb.txt")
      - TeleMessByFile("#dirb", "/tmp/test-osm-noti/dirb.txt")
      - TeleMess("#mics", "Sample message --> {{Target}}")
      # these channels usually use for vulnscan
      - TeleMessByFile("#report", "/tmp/test-osm-noti/dirb.txt")
      - TeleMessByFile("#sensitive", "/tmp/test-osm-noti/dirb.txt")
      - WebHookNoti("test string")

post_run:
  - DoneNoti()

I retest the same tokens and webhooks with Rengine(https://rengine.wiki/usage/notification/) and it works well.

Where could the problem be?

patrickhener commented 11 months ago

Yeah second that. I did create a bot which works with curl just fine. Entering channel id and api key to the config file otherwise will not send messages to that channel using the test run or productive runs.

atastycookie commented 5 months ago

+1

4riful commented 5 months ago

Not working