Closed abuyusif01 closed 3 months ago
Hi @abuyusif01, sorry for the huge delay. I didn't have time to monitor PRs for a long time. I already pushed a similar fix for this issue some time ago. I'm gonna close this, but if you want to appear in the contributors as this was a valid issue reported early, you can make a new PR replacing lines 1150-1158 in villain_core.py
with this slightly improved version that informs the user of the undefined hostname and user. This concerns the dev
branch that is ahead of main:
try:
Sessions_Manager.active_sessions[session_id]['Computername'] = url_split[1]
Sessions_Manager.active_sessions[session_id]['Username'] = url_split[2]
print_to_prompt(f'\r[{GREEN}Shell{END}] Backdoor session established on {ORANGE}{self.client_address[0]}{END}')
except IndexError:
Sessions_Manager.active_sessions[session_id]['Computername'] = 'Undefined'
Sessions_Manager.active_sessions[session_id]['Username'] = 'Undefined'
print_to_prompt(f'\r[{GREEN}Shell{END}] Backdoor session established on {ORANGE}{self.client_address[0]}{END} (hostname and user undefined)')
Hi @t3l3machus
i've created a PR to the dev with the fix.
Thanks for reviewing the PR
Signed-off-by: abuyusif01 abubakaryusuf951@gmail.com
Sometimes the client wont give the username and hostname, especially if the terminal is not a tty. so villian will fail if it tries to get username from url_split. This commit solves that by having a try block. if we succeed in retrieving hostname and username. then fine, else we set the default value to host, user respectively