Skip to content

Ignore comment lines in user file #28

@secureality

Description

@secureality

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions