Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Showing new domain's title and status code in discord webhook is good #586

Open
z7701858 opened this issue Feb 14, 2022 · 2 comments
Assignees

Comments

@z7701858
Copy link

z7701858 commented Feb 14, 2022

Is your feature request related to a problem? Please describe.
I get the message from the discord webhook that a new domain was found, but I don't know the title and status code of the new domain, I need to return to rengine to see the title and status code of the new domain

Describe the solution you'd like
Add the title and status code of the new domain to the information returned by rengine to discord webhhok

@github-actions
Copy link
Contributor

👋 Hi @z7701858,
Issues is only for reporting a bug/feature request. Please read documentation before raising an issue https://rengine.wiki
For very limited support, questions, and discussions, please join reNgine Discord channel: https://discord.gg/azv6fzhNCE
Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

@xnl-h4ck3r
Copy link

Hi @z7701858
If you want a work around to do this before the feature is added, you can edit the file ~/rengine/web/reNgine/tasks.py and change the code for new subdomain and interesting subdomains like below:

    # check for any subdomain changes and send notif if any
    if notification and notification[0].send_subdomain_changes_notif:
        newly_added_subdomain = get_new_added_subdomain(task.id, domain.id)
        if newly_added_subdomain:
            message = "**{} New Subdomains Discovered on domain {}**".format(newly_added_subdomain.count(), domain.name)
            for subdomain in newly_added_subdomain:
                httpx_cmd = "echo \"{}\" | httpx -silent -status-code -title -nc".format(subdomain.name) 
                domainStatusTitle = subprocess.getoutput(httpx_cmd) 
                if not domainStatusTitle:
                    domainStatusTitle =  "{} [No response] [No title]".format(subdomain.name)
                message += "\n• {}".format(domainStatusTitle) 
            send_notification(message)

        removed_subdomain = get_removed_subdomain(task.id, domain.id)
        if removed_subdomain:
            message = "**{} Subdomains are no longer available on domain {}**".format(removed_subdomain.count(), domain.name)
            for subdomain in removed_subdomain:
                message += "\n• {}".format(subdomain.name)
            send_notification(message)

    # check for interesting subdomains and send notif if any
    if notification and notification[0].send_interesting_notif:
        interesting_subdomain = get_interesting_subdomains(task.id, domain.id)
        print(interesting_subdomain)
        if interesting_subdomain:
            message = "**{} Interesting Subdomains Found on domain {}**".format(interesting_subdomain.count(), domain.name)
            for subdomain in interesting_subdomain:
                httpx_cmd = "echo \"{}\" | httpx -silent -status-code -title -nc".format(subdomain.name)
                domainStatusTitle = subprocess.getoutput(httpx_cmd)
                if not domainStatusTitle:
                    domainStatusTitle = "{} [No response] [No title]".format(subdomain.name)
                message += "\n• {}".format(domainStatusTitle)
            send_notification(message)

basically it's adding this code to each section before message += "\n• {}".format(subdomain.name)...

                httpx_cmd = "echo \"{}\" | httpx -silent -status-code -title -nc".format(subdomain.name) 
                domainStatusTitle = subprocess.getoutput(httpx_cmd) 
                if not domainStatusTitle:
                    domainStatusTitle =  "{} [No response] [No title]".format(subdomain.name)

and then changing the line message += "\n• {}".format(subdomain.name) to message += "\n• {}".format(domainStatusTitle)

The subs messages are sent before HTTPX is used to get the status amnd title shown in the portal, so you have to just do it on each sub at this point in the code. Hope this helps!

@psyray psyray added the 2.0.0 label Nov 17, 2023
@yogeshojha yogeshojha removed the 2.0.0 label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants