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

bug: ERROR - get() returned more than one IpAddress -- it returned 2 #1471

Open
1 task done
zerodaykb opened this issue Dec 23, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@zerodaykb
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello, I am starting a scan of one ip address.

I have such error:
port_scan | INFO | naabu -json -exclude-cdn -list /usr/src/scan_results/[XXX.XXX.XXX.XXX]_313/input_subdomains_port_scan.txt -p 0-65535 -c 30 -rate 1000 -timeout 5000 -silent port_scan | ERROR | get() returned more than one IpAddress -- it returned 2! Traceback (most recent call last): File "/usr/src/app/reNgine/celery_custom_task.py", line 130, in __call__ self.result = self.run(*args, **kwargs) File "/usr/src/app/reNgine/tasks.py", line 1392, in port_scan ip, _ = save_ip_address(ip_address, subdomain, subscan=self.subscan) File "/usr/src/app/reNgine/tasks.py", line 4579, in save_ip_address ip, created = IpAddress.objects.get_or_create(address=ip_address) File "/usr/local/lib/python3.10/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 581, in get_or_create return self.get(**kwargs), False File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 439, in get raise self.model.MultipleObjectsReturned( startScan.models.IpAddress.MultipleObjectsReturned: get() returned more than one IpAddress -- it returned 2! send_scan_notif | WARNING | Sending notification "Scan #313 summary" [error]

please note that I have hid my IP address [XXX.XXX.XXX.XXX] because of sensitivity.

The file /usr/src/scan_results/[XXX.XXX.XXX.XXX]_313/input_subdomains_port_scan.txt has only one IP address in it:

XXX.XXX.XXX.XXX

The address doesn't have new line added at the end.

When I run same naabu command from the container it works fine.

Expected Behavior

The scan is successful

Steps To Reproduce

My scan engine is custom and looks like this:

http_crawl: {}
port_scan: {
  'enable_http_crawl': true,
  'timeout': 5,
  # 'exclude_ports': [],
  # 'exclude_subdomains': [],
  'ports': ['0-65535'],
  'rate_limit': 1000,
  'threads': 30,
  'passive': false,
  # 'use_naabu_config': false,
  # 'enable_nmap': true,
  # 'nmap_cmd': '',
  # 'nmap_script': '',
  # 'nmap_script_args': ''
}

My target is not subdomain, it is IP address.
I initiate new scan, it errors:

image

Environment

- reNgine: newest version
- OS: Debian 6.1.119-1
- Python: 3.10.12
- Docker Engine: Docker version 27.4.0
- Docker Compose: Docker Compose version v2.5.0

Anything else?

No response

@zerodaykb zerodaykb added the bug Something isn't working label Dec 23, 2024
Copy link
Contributor

Hey @zerodaykb! 👋 Thanks for flagging this bug! 🐛🔍

You're our superhero bug hunter! 🦸‍♂️🦸‍♀️ Before we suit up to squash this bug, could you please:

📚 Double-check our documentation: https://rengine.wiki
🕵️ Make sure it's not a known issue
📝 Provide all the juicy details about this sneaky bug

Once again - thanks for your vigilance! 🛠️🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant