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 tmux and screen sessions. Resolves #50 #52

Merged
merged 4 commits into from
Sep 4, 2021

Conversation

rjsu26
Copy link
Contributor

@rjsu26 rjsu26 commented Aug 28, 2021

Added level 0 testing for tmux and screen

@rjsu26 rjsu26 changed the title Work in progress PR for issue #50 Work in progress PR to resolve #50 Aug 28, 2021
@rjsu26 rjsu26 changed the title Work in progress PR to resolve #50 Add tmux and screen sessions. Resolves #50 Aug 30, 2021
@diego-treitos
Copy link
Owner

Hello, thank you for your PR but I am afraid it is far from ready.

Let me go through some points.

  1. IDs over 500 are used for level 2 tests
  2. IDs are numbered in steps of 10 just in case we need to add some in the middle. That way we do not need to change the other ones.

I know this information should be written somewhere and that is something that I have to do.

Now, regarding the PR:

  1. TODOs do not belong in code. In my opinion it is a bad practice. We can use the issue tracker to add tasks.
  2. Regarding the tmux tests:
  • sof535 Should be sof040 and it should be level 2
  • sof540 Should be sof110
  • sof541 Should be sof120 and the test should be more consistent. I suggest find /tmp -type s -regex '/tmp/tmux-[0-9]+/.+' -exec ls -l {} +
  • sof542 Is redundant. The previous test already checks for other tmux sessions.
  • It would be good to add a level 0 test with ID sof130 that checks for writeable tmux sockets not belonging to current user: find /tmp -writable -type s -regex '/tmp/tmux-[0-9]+/.+' ! -user $lse_user -exec ls -l {} +
  1. Regarding the screen tests, something mostly similar:
  • sof550 should be level 2
  • sof555 should be sof140
  • sof560 should be sof150 but the test is actually wrong. It is testing for current user sessions. It should be womething like: find /run/screen -type s -regex '/run/screen/S-.+/.+' ! -user $lse_user -exec ls -l {} +
  • There should be a test that checks for writeable screen sockets, with level 0 and ID sof160: find /run/screen -writable -type s -regex '/run/screen/S-.+/.+' ! -user $lse_user -exec ls -l {} +

@rjsu26
Copy link
Contributor Author

rjsu26 commented Aug 31, 2021

Thanks for the comments @diego-treitos . I will make the changes and push them.

@rjsu26
Copy link
Contributor Author

rjsu26 commented Sep 2, 2021

One small confusion, as u are asking to make the sof535 as sof040 and level 2. Since all level 2 tests are above 500, it will be a contradiction now!?

@diego-treitos
Copy link
Owner

One small confusion, as u are asking to make the sof535 as sof040 and level 2. Since all level 2 tests are above 500, it will be a contradiction now!?

You are absolutely right. It shouldn't be sof040 but the sof540 (I think). In any case try to leave 10 numbers between the IDs and use 5xx for the level 2 tests.

@rjsu26
Copy link
Contributor Author

rjsu26 commented Sep 2, 2021

cool! Also, is there any rule for IDs of level 1 tests?

@rjsu26
Copy link
Contributor Author

rjsu26 commented Sep 2, 2021

  1. Regarding the tmux tests:
  • sof535 Should be sof040 and it should be level 2
  1. Regarding the screen tests, something mostly similar:
  • sof550 should be level 2

Both the suggested level 2 tests are only checking whether they are installed or not. Won't it be more reasonable to keep these 2 tests as level 0/1 and the socket tests as level 1/2 ?

@diego-treitos
Copy link
Owner

Level 0 shows very important results. Results that it is probable to lead to a privilege escalation. Showing the version of software is not a level 0.

Level 1 shows information that can be important or help to gather information for a privilege escalation. Just knowing the version of software is not that helpful.

Level 2 is meant to gather all information about the system that could be used for a privilege escalation or help you contextualize the system to know more about it and find a good approach for a privilege escalation. I think that knowing the version of software belongs here and actually all the tests that show software versions are level 2 if you check the code.

@rjsu26
Copy link
Contributor Author

rjsu26 commented Sep 2, 2021

I got ur point now. Making sense this way..

@diego-treitos diego-treitos merged commit e593e70 into diego-treitos:master Sep 4, 2021
@diego-treitos
Copy link
Owner

I am merging this but I will apply some changes later. The PR itself is quite inconsistent:

  • Some tests have comments some not
  • Some comments are not properly indented
  • Some tests use single quotes other double
  • Some tests description start with capital others don't
  • Some tests description are questions others not

@diego-treitos
Copy link
Owner

Also, next time please test the tests. There were several that were not working.

Thank you

@rjsu26
Copy link
Contributor Author

rjsu26 commented Sep 5, 2021

I am merging this but I will apply some changes later. The PR itself is quite inconsistent:

* Some tests have comments some not

* Some comments are not properly indented

* Some tests use single quotes other double

* Some tests description start with capital others don't

* Some tests description are questions others not

Thanks for telling the mistakes. I will make another commit+PR to correct them.

@rjsu26
Copy link
Contributor Author

rjsu26 commented Sep 5, 2021

Also, next time please test the tests. There were several that were not working.

Can you please tell me which ones? I actually ran then before pushing.

@diego-treitos
Copy link
Owner

sof120 and sof150. You can check the commits: https://github.com/diego-treitos/linux-smart-enumeration/commits/master

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

Successfully merging this pull request may close these issues.

2 participants