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

CVE-2014-7186 #22

Merged
merged 4 commits into from
Nov 26, 2024
Merged

CVE-2014-7186 #22

merged 4 commits into from
Nov 26, 2024

Conversation

mczimmermann
Copy link

pull request for bash redir_stack issue exploit

debug:
msg: "{{ bash_version_output.stdout }}"

- name: Execute CVE-2014-7186 test case
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the execution of the exploit to the "command" parameter of cvex.yml. Also, I'm not sure that the exploit is working properly:

2024-11-19 09:40:02,973 - INFO - [ubuntu] TASK [Execute CVE-2014-7186 test case] *****************************************
2024-11-19 09:40:04,012 - INFO - [ubuntu] changed: [ubuntu]
2024-11-19 09:40:04,012 - INFO - [ubuntu]
2024-11-19 09:40:04,012 - INFO - [ubuntu] TASK [Display exploit result] **************************************************
2024-11-19 09:40:04,108 - INFO - [ubuntu] ok: [ubuntu] => {
2024-11-19 09:40:04,109 - INFO - [ubuntu] "msg": ""
2024-11-19 09:40:04,109 - INFO - [ubuntu] }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it based on https://access.redhat.com/articles/1200223 & included the desired breaking output information as a comment in exploit.yml, hopefully this is more clear!

@@ -0,0 +1,4 @@
blueprint: ubuntu2204
ubuntu:
trace: docker
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why to trace docker? It's not even installed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was leftover from a previous iteration

done | bash || echo "CVE-2014-7186 triggered"
EOF
chmod +x /tmp/cve-2014-7186-test.sh
/tmp/cve-2014-7186-test.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is cve-2014-7186-test.sh?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this creates cve-2014-7186-test.sh as the ansible script executes. I've updated it to be separate now for readability

dest: /tmp/x.sh
mode: '0755'

- name: Execute the script
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move execution of the exploit to the "command" parameter of cvex.yml

executable: /bin/bash
register: exploit_output

- name: Display exploit result # if it worked, the time and date information will be output on the screen and a file called /tmp/echo will be created
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shows me this:

2024-11-20 13:46:58,503 - INFO - [ubuntu] TASK [Display exploit result] **************************************************
2024-11-20 13:46:58,581 - INFO - [ubuntu] ok: [ubuntu] => {
2024-11-20 13:46:58,582 - INFO - [ubuntu] "msg": "Wed Nov 20 12:46:58 UTC 2024"
2024-11-20 13:46:58,582 - INFO - [ubuntu] }

How exactly this is a proof that the exploit is working? It'd be great if you put a comment to x.sh, explaining it.

@olegbck
Copy link
Collaborator

olegbck commented Nov 21, 2024

Doesn't work :(

2024-11-21 12:28:38,751 - INFO - [ubuntu] Executing '/tmp/x.sh'...
2024-11-21 12:28:38,934 - INFO - [ubuntu] Thu Nov 21 11:28:28 AM UTC 2024

2024-11-21 12:28:38,934 - INFO - [ubuntu] bash: x: line 1: syntax error near unexpected token =' bash: x: line 1: '
bash: error importing function definition for `x'

@mczimmermann
Copy link
Author

I don't know why, but when I move the bash command into cvex.yml it always throws that error... I think it's because it executes with a slightly different configuration? I can't seem to fix it

@mczimmermann
Copy link
Author

I don't know why, but when I move the bash command into cvex.yml it always throws that error... I think it's because it executes with a slightly different configuration? I can't seem to fix it

@olegbck can you please advise on this? Is it ok to just have it in the exploit.yaml instead

@olegbck olegbck merged commit 1d657bb into ucsb-seclab:main Nov 26, 2024
@olegbck olegbck mentioned this pull request Nov 26, 2024
@olegbck
Copy link
Collaborator

olegbck commented Nov 26, 2024

Sorry I merged your PR by mistake. Could you please create another one? It seems that there is a bug in CVEX, working on it.

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