You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why are we using ["state"] and adding usernames for get_config_variables?
The returnedoptions are used to check for the validity of argument variable
Like set lhost 10.10.10.1 or set backdoor_user pwncat
Here, lhost and backdoor_user being the argument variable
The issue here is that after getting a session, get_config_variables returns a list containing "state" and usernames
This list can be checked by running set INVALID_ARG
Now, if we use one of the usernames or "state" as an argument variable like set root something, we get KeyError
Following is the reponsible code, in the same file - pwncat/commands/set.py
Calling sessions.current_user() would fetch /etc/passwd and the whole command can fail if the session is not responding
For example, closing a network interface may cause this like closing TryHackMeopenvpn while using pwncat
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In
pwncat/commands/set.py
Why are we using
["state"]
and adding usernames forget_config_variables
?The returned
options
are used to check for the validity of argument variableLike
set lhost 10.10.10.1
orset backdoor_user pwncat
Here,
lhost
andbackdoor_user
being the argument variableThe issue here is that after getting a session,
get_config_variables
returns a list containing"state"
and usernamesThis list can be checked by running
set INVALID_ARG
Now, if we use one of the usernames or
"state"
as an argument variable likeset root something
, we getKeyError
Following is the reponsible code, in the same file -
pwncat/commands/set.py
Some minor checks can be added but why are we using
"state"
and usernames here?["state"]
was added back in 82ea579 hereThere is one minor issue with
sessions
tooIn
pwncat/commands/sessions.py
Calling
sessions.current_user()
would fetch/etc/passwd
and the whole command can fail if the session is not respondingFor example, closing a network interface may cause this like closing TryHackMe openvpn while using
pwncat
Beta Was this translation helpful? Give feedback.
All reactions