Ignore comment lines in user file
secureality opened this issue · 0 comments
I apologize in advance, I am not a git pro, I don't know how to pull/branch yet; I will learn, but I need to get back to my pentest first. Below I have a change suggestion to ignore lines in the userlist file that start with a comment (#). Use case: I start with a list, and as I find invalid usernames, etc, I like to keep them in the list, but comment them out with some reason why. I considered it for the password file as well, but a password starting with # is possible. I also considered using some form of line.partition("#")[0] to catch it anyplace in the line, but again it may be potentially valid for a password.
I modified modules/generate/helpers.py as follows (just add the if check):
def get_users(conf: Configuration) -> list[str]:
user_list: list[str] = []
for line in conf.user_file:
line = line.rstrip()
if line[0] == "#":
continue
user_list.append(line)
return user_list
Thanks for your work, I will attempt to contribute more effectively!