projectdiscovery / notify

Notify is a Go-based assistance package that enables you to stream the output of several tools (or read from a file) and publish it to a variety of supported platforms.

Home Page:https://projectdiscovery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notify doesn't post to discord with webhook.

0xTides opened this issue · comments

commented

`

Slack

slack: false
slack_webhook_url: https://a.b.c
slack_username: test
slack_channel: test

Discord

discord: true
discord_webhook_url: https://discordapp.com/api/webhooks/774399247235022920/QiMD_xhcM5YPDvk2ZI0pien8GpZy8tPnTXAZWwxl8BnAv1GBP2yYc-3SMIZM6FYSKm6C
discord_username: tides
discord_avatar: https://a.b.c/avatar

General Settings

interval: 2 # seconds

http_message: |
The collaborator server received an {{protocol}} request from {{from}} at {{time}}:
```http
{{request}}

{{response}}
```

dns_message: |
The collaborator server received a DNS lookup of type {{type}} for the domain name {{domain}} from {{from}} at {{time}}:
{{request}}
`

Located in ~/.config/notify/notify.conf not too sure what im doing wrong!

Hi @0xTides,

Can you do echo test | notify -v and share the info?

@0xTides try this, If the below command works (make sure to replace the webhook URL with yours), it's something has to do with the config file, if this doesn't work, the webhook URL is invalid or not working.

echo test | notify -discord -discord-webhook-url https://discordapp.com/api/webhooks/XXXX
commented

Just tried with new webhook url.
https://gyazo.com/ab52f9eedda12653095e8d258e47e0e4
Dunno if I'm doing something wrong on Discord. https://gyazo.com/1062063713f6d53a24c5a8d568131e55 url copied from here.

commented

I have installed notify on 2 systems with " | notify " not working.
Config file is not created in ~/.config/notify/notify.conf" on either system.

it works with | Notify -discord -discord-webhook-url.

When creating the config file and adding the one pasted on the info page, it does not work either.

@d0xo not sure if i am supposed to speak here but have to tried commenting out the discord webhook lines
by default all the lines are commented using the #

# discord_webhook_url: https://discord.com/api/webhooks/814010970925301790/bHr-bPgUGoWhGH5Bf9d4bqZJ9IZAiboLeXcRbQhbmUy9qbQ8K-Jhs8pWBAD1tSL16eke
# discord_username: recon notifier
# discord_avatar: https://cdn.discordapp.com/attachments/726783626074914820/814015868810952714/unknown.png
# discord: true

remove the # and try again
example picture
image

@ehsandeep maybe you should do put a disclamer in the readme to remove the # , might solve the common issue

commented

I commented out the discord webhook lines in the config file, tried this and it works perfectly fine

curl -X POST -H "Content-Type: application/json" -d '{"username": "Friday", "content": "hello"}' https://discordapp.com/api/webhooks/831523787626381342/DdMs39sulVIFd-gxdMDLJq36A_430_c_BW4XF5xMsHHSAcrJtzwDvDpkSmiWYZckQGYe

image

However, it doesn't work when I tried this

echo test | notify

It doesn't work with this too

echo test | notify -discord -discord-webhook-url https://discordapp.com/api/webhooks/831523787626381342/DdMs39sulVIFd-gxdMDLJq36A_430_c_BW4XF5xMsHHSAcrJtzwDvDpkSmiWYZckQGYe

Is there any solutions?

I have the same issue. I can curl the discord webhook and it works fine but notify does not work with the same webhook.

Anyone with a idea on how we can test this further?

I went through the same issue in this thread and was able to fix this by deleting the "discord_avatar:" content. The script is probably getting stuck there. Without the avatar, it works just fine with simple echo test | notify.

script changes

Which returns:

notification

Just remove line "discord_avatar: " it works fine then

Tested this multiple times and unable to reproduce this, and looks like mostly related to config entry.

These 2 line in the config file should be fine to get the discord webhook working.

discord_webhook_url: https://discord.com/api/webhooks/TOKEN
discord: true

Additionally, you can debug the HTTP call of notify to see in the discord or any other webhook request in the burp.

echo test | HTTPS_PROXY=http://127.0.0.1:8080 notify