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

Add check that provided username argument in kick is indeed a user #11

Closed
woodb opened this issue Aug 30, 2012 · 1 comment
Closed

Add check that provided username argument in kick is indeed a user #11

woodb opened this issue Aug 30, 2012 · 1 comment

Comments

@woodb
Copy link

woodb commented Aug 30, 2012

Major issue with lack of validation on kick

If the user enters a number to kick a user, the kill command might still catch sshd when the number is present in the ps and kill tons of ssh sessions unintentionally :(

Example

Note the first PID returned from the kick search string!

~# ps aux | grep "2.*sshd"
root     21922  0.0  0.2  41996  1276 ?        Ss   22:28   0:00 /usr/sbin/sshd
root     21926  0.0  0.7  65520  3548 ?        Ss   22:29   0:00 sshd: user1 [priv]
user1    21928  0.5  0.3  65648  1848 ?        S    22:29   0:01 sshd: user1@pts/0
root     21999  0.0  0.7  65520  3536 ?        Ss   22:29   0:00 sshd: user2 [priv]
user2    22001  0.5  0.6  67284  3376 ?        S    22:29   0:01 sshd: user2@pts/1
user2    22173  0.0  0.2   8680  1052 pts/2    S+   22:33   0:00 grep 2.*sshd
~# ps aux | grep "2.*sshd" | grep -v grep | tr -s ' ' | cut -d ' ' -f 2
21922
21926
21928
21999
@zolrath
Copy link
Owner

zolrath commented Jan 25, 2013

Fixed in #20, thanks for the report woodb and the fix DexterTheDragon!

@zolrath zolrath closed this as completed Jan 25, 2013
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

2 participants