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

Improve detection of white/black lies #27

Open
nmalcolm opened this issue Oct 1, 2024 · 1 comment
Open

Improve detection of white/black lies #27

nmalcolm opened this issue Oct 1, 2024 · 1 comment

Comments

@nmalcolm
Copy link

nmalcolm commented Oct 1, 2024

Another similar project has detection for white/black lies which nsec3map doesn't seem to have

https://github.com/Harrison-Mitchell/NSEC-3-Walker/blob/main/nsec-walker.py#L113

With nsec3map we get "hit an existing owner name" over and over and nothing happens, while with NSEC-3-Walker the script exits immediately after detecting walking isn't possible.

You can use cloudflare.com as an example (or any domain that uses Cloudflare)

@nmalcolm
Copy link
Author

nmalcolm commented Oct 1, 2024

This seems to work.

diff --git a/n3map/nsec3walker.py b/n3map/nsec3walker.py
index 53686bb..1ac3ba1 100644
--- a/n3map/nsec3walker.py
+++ b/n3map/nsec3walker.py
@@ -58,8 +58,16 @@ class NSEC3Walker(walker.Walker):

     def _process_query_result(self, query_dn, res, ns):
         recv_nsec3 = res.find_NSEC3()
+
         if len(recv_nsec3) == 0:
             if res.status() == "NOERROR":
+                # Tarpit detection
+                for record in res._result.sections[2]:
+                    if 'IN NSEC \\000' in record.to_text():
+                        log.error("Tarpit detected by Cloudflare: https://blog.cloudflare.com/black-lies/")
+                        exit()
+
+
                 log.info("hit an existing owner name: ", str(query_dn))
                 ns.reset_errors()
                 return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant