GhostManager / Shepherd

A Django application to help red team operators manage a library of domain names
https://medium.com/@cmaddy/being-a-good-domain-shepherd-part-2-5e8597c3fe63
161 stars 37 forks source link

DoesNotExist at /catalog/domain/1 #1

Closed sil3ntcor3 closed 5 years ago

sil3ntcor3 commented 5 years ago

When clicking on a domain from the 'All Registered Domains' page, I receive the following error:

DoesNotExist at /catalog/domain/2

Group matching query does not exist.

Request Method:     GET
Request URL:    http://127.0.0.1:8000/catalog/domain/2
Django Version:     2.1.5
Exception Type:     DoesNotExist
Exception Value:    

Group matching query does not exist.

Exception Location:     /usr/local/lib/python3.6/dist-packages/django/db/models/query.py in get, line 399
Python Executable:  /usr/bin/python3
Python Version:     3.6.7
Python Path:    

['/opt/Shepherd',
 '/usr/lib/python36.zip',
 '/usr/lib/python3.6',
 '/usr/lib/python3.6/lib-dynload',
 '/root/.local/lib/python3.6/site-packages',
 '/usr/local/lib/python3.6/dist-packages',
 '/usr/lib/python3/dist-packages']

I'm running Ubuntu 18.10.

RCStep commented 5 years ago

This error is likely related to not having the groups created or assigned for the logged in user:

"Shepherd will make a couple of functions available to a "Senior Operators" group, including editing a domain's information. To use this functionality create two groups named "Operators" and "Senior Operators" in the admin panel."

sil3ntcor3 commented 5 years ago

Thanks. That resolved the issue.

chrismaddalena commented 5 years ago

Thanks for mentioning this @sil3ntcor3, and thanks @RCStep for pointing out the groups. I'm looking into a better way to handle this particular function. From what I have read, there's no good way to make groups ahead of time during setup with Django. The proper way to handle this probably specifying a new permission for the model and then admins just need to assign that permission to users or whatever group(s) they make in their own instance of Shepherd.