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

Prebellico crashes while processing certain SNMP community strings. #2

Open
unixrox opened this issue Jun 5, 2018 · 4 comments
Open

Comments

@unixrox
Copy link
Owner

unixrox commented Jun 5, 2018

Prebellico from time to time will crash when processing specific SNMP community strings. The traceback produces an 'IndexError: list index out of range' on line 326 in 'udpdiscovery' on the following line:
communitystring = filter(lambda x: x in printtable, snmptempdata[0])

This occurs just after host identification via UDP and port 161. This issue was originally identified by @unixrox and then later reported by @n8tr0n .

A sample PCAP has been obtained which can reproduce this issue and is being worked on.

unixrox added a commit that referenced this issue Jun 6, 2018
Changed the way I process SNMP strings. I believe this resolves the issue for issue #2.
@unixrox
Copy link
Owner Author

unixrox commented Jun 6, 2018

This new code might potential resolve this issue. Will continue to monitor.

@unixrox
Copy link
Owner Author

unixrox commented Jun 7, 2018

Did some additional testing against some new code and it looks as if this issue is resolved. I do not have raw data to confirm this with the last reported crash by @n8tr0n so I am going to close this out for now.

@unixrox unixrox closed this as completed Jun 7, 2018
@unixrox
Copy link
Owner Author

unixrox commented Jun 19, 2018

This appeared to crash again, so I am reopening the issue:

Traceback (most recent call last):
File "prebellico.py", line 941, in
sniff.loop(0, inspectproto)
File "prebellico.py", line 203, in inspectproto
udpdiscovery(header,data)
File "prebellico.py", line 355, in udpdiscovery
potentialSnmpStrings = re.split('[\x00-\x1f,\x7f-\xff]',snmpTempData[0])
IndexError: list index out of range

@unixrox unixrox reopened this Jun 19, 2018
unixrox added a commit that referenced this issue Jun 19, 2018
After the user reported that the last fix still led to a crash, I worked to include a check to see if the list was empty, and if so, just return, otherwise, work to extract the string. This is more than likely some other version of SNMP or something else entirely that does not use a single ascii printable character within the data packet.
@unixrox
Copy link
Owner Author

unixrox commented Jun 19, 2018

@n8tr0n I believe that I have provided a decent solution in the last commit to the master branch: 92e771d

Please let me know if this resolves the issue for you.

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