#StackBounty: #c# #installation #permissions #windows-services #user-accounts How to programatically grant a virtual user permission to…

Bounty: 50

I have a service that I wrote that I need to deploy to a number (about 1100) devices. All of these devices are logged in as a regular user, not an administrator.

I can push out the service with our deployment software, which does run as an admin. Our security team does not want this service to run on the Local System account (for obvious reasons). What I’ve come up with is that the service will install as the Local System, but will then change it’s log in account to a virtual user, which then needs access to a folder in Program Files (x86).

What I’ve found is that if I install the service (using remote admin access) via the command line, I can install the service, but it won’t start.

When I look in the event logs, I get an UnauthorizedAccessException error.

This I suspect is because the service is already running under the virtual user which doesn’t have access to start the service. So how can I get around this?

In the main class for the service, I have this method, which is supposed to give the user access to the necessary folder:

    private void GiveDirectoryAccess(string dir, string user)
    {
        try
        {
            DirectoryInfo directoryInfo = new DirectoryInfo(dir);
            DirectorySecurity ds = directoryInfo.GetAccessControl();
            ds.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.FullControl,
                InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.NoPropagateInherit, AccessControlType.Allow));
            directoryInfo.SetAccessControl(ds);
        }
        catch (Exception e)
        {
            SimpleLog.Log(e);
            throw;
        }

    }

This is called right after the service is initialized:

    public CheckRALVersionService()
    {
        InitializeComponent();
        // Give directory access
        string alhadminPath = System.IO.Path.Combine(pathToFolder, alhadmin);
        GiveDirectoryAccess(alhadminPath, serviceUser);
        string exeName = System.IO.Path.GetFileName(fullExeNameAndPath);
        string tmppath = System.IO.Path.Combine(localdir, tmp);
        SimpleLog.SetLogFile(logDir: tmppath, prefix: "debout." + exeName + "_", extension: "log");
        watcher = new DirectoryWatcher(pathToFolder, alhadmin);
    }

Then, in the ProjectInstaller class, I am changing the user to the virtual user in the serviceInstaller1_Committed method:

    void serviceInstaller1_Committed(object sender, InstallEventArgs e)
    {
        using (ManagementObject service = new ManagementObject(new ManagementPath("Win32_Service.Name='RalConfigUpdate'")))
        {
            object[] wmiParams = new object[11];
            wmiParams[6] = @"NT ServiceRalConfigUpdate";
            service.InvokeMethod("Change", wmiParams);
        }
    }

Do I need a helper service to give the access? Can what I want to do be done all within this service?

Thanks in advance.


Get this bounty!!!

#StackBounty: #sql-server #installation #sql-server-2019 How can Cumulative Updates to SQL Server 2019 be Slipstreamed into a Single In…

Bounty: 50

I’d like to take the latest version of SQL Server (SQL Standard, 15.0.2000.5), and apply the latest CU to it so that I have a single installer, thus reducing the size of the resulting package. The custom installer that I’m developing packages the SQL Server installer, and thus reducing the size by several hundred MB is important.

In previous versions of SQL Server, it was possible to create a single merged media output folder using the /PCUSOURCE and /CUSOURCE parameters, however this seems to have been removed in SQL Server 2014 (See “Slipstream Functionality” here). The alternative provided is to use the /UpdateSource flag, however this approach only allows for the simultaneous application of patches at the time of installation (by bundling the CU media with the original installation media). Further, the /ACTION=PrepareImage facilitates a SysPrep installation, not a slipstreamed update to the install media.

So, is there a way to update the installation media of SQL Server Standard 2019 with CU patches such that there’s a single (reduced-size) installation media bundle?


Get this bounty!!!

#StackBounty: #magento2 #product-attribute #installation #patch-data Create attribute option using Data patch in Magento2

Bounty: 50

I am creating a product attribute with option using Magento 2.3 Data patch.

Used below code.

<?php
declare(strict_types=1);

namespace VendorModuleSetupPatchData;

use MagentoEavModelEntityAttributeScopedAttributeInterface;
use MagentoEavSetupEavSetup;
use MagentoEavSetupEavSetupFactory;
use MagentoFrameworkSetupModuleDataSetupInterface;
use MagentoFrameworkSetupPatchDataPatchInterface;

class AddFeatureAttribute implements DataPatchInterface
{

private $moduleDataSetup;
private $eavSetupFactory;
public $_storeManager;
private $logger;
protected $_dir;
public function __construct(
    ModuleDataSetupInterface $moduleDataSetup,
    EavSetupFactory $eavSetupFactory,
    PsrLogLoggerInterface $logger,
    MagentoStoreModelStoreManagerInterface $storeManager,
    MagentoFrameworkFilesystemDirectoryList $dir
) {
    $this->moduleDataSetup = $moduleDataSetup;
    $this->eavSetupFactory = $eavSetupFactory;
    $this->_storeManager = $storeManager;
    $this->logger = $logger;  
    $this->_dir = $dir;
}

/**
 * {@inheritdoc}
 */
public function apply()
{
    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);

    $fileName = 'attributes.csv';
    $pubPath = $this->_dir->getPath('pub');
    $attributeFile = $pubPath.'/'.$fileName;
    $arrResult = array();
    if(($handle = fopen($attributeFile, 'r')) !== FALSE) {
        $row = 1;
        while(($data = fgetcsv($handle, 1000000, ',')) !== FALSE) {
            $col_count = count($data);
            $arrResult[] = $data;               
            $row++;
        }
        fclose($handle);
    } 
    $i = 0;
    foreach ($arrResult as $line) {
        if($i > 0){
            $attributeCode = $line[0];                    
            $attributeName = $line[1];
            $inputType = strtolower($line[2]);
            $options = $line[3];
          $type = 'int';
      $eavSetup->addAttribute(
        MagentoCatalogModelProduct::ENTITY,
           $attributeCode,
           [
             'type' => $type,
             'group' => 'General',
             'backend' => '',
             'frontend' => '',
             'label' => $attributeName,
             'input' => $inputType,
             'class' => '',
             'source' => '',
             'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
             'visible' => true,
             'required' => false,
             'user_defined' => true,
             'searchable' => false,
             'filterable' => true,
             "filterable_in_search" => '1',
             'comparable' => false,
             'visible_on_front' => true,
             'used_in_product_listing' => true,
             'unique' => false,                 
             'option' => [
                'values' => $options,
               ],
             'system' => 1                    
             ]
           );
       }
     $i++;
   }

  }

public static function getDependencies()
 {
    return [];
 }

 /**
 * {@inheritdoc}
 */
 public function getAliases()
  {
     return [];
  }
}

The sample csv file is like below

enter image description here

The above code not creating the options, please someone help me on that how can we create a attribute with options. Thanks!!


Get this bounty!!!

#StackBounty: #installation #magento2.3.3 #nginx #php-7.2 #centos Magento 2.3.3 on Centos 7 with Nginx using composer – Website not wor…

Bounty: 100

Following tutorial : https://devdocs.magento.com/guides/v2.3/install-gde/composer.html

After download magento by using,

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.3.3 magento

Folder path : var/ww/html/magento

I am using centos 7 – Nginx how to run following last 2 commands,

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data . # Ubuntu
chmod u+x bin/magento

Finally my installation command,

bin/magento setup:install –base-url=http://127.0.0.1/magento –db-host=localhost –db-name=magento –db-user=root –db-password=P@ssword123 –admin-firstname=mage –admin-lastname=mage --admin-email=mage@gmail.com –admin-user=mage –admin-password=mage@123 –language=en_US –currency=INR –timezone=Asia/Kolkata –use-rewrites=1

How to setup magento.conf in etc/nginx/config.d/ magento.conf?

my magento.conf :

upstream fastcgi_backend {
     server  127.0.0.1:9000;
 }

 server {

     listen 8085;
     server_name 192.168.1.65:8085;
     set $MAGE_ROOT /var/www/html/magento;
     include /var/www/html/magento/nginx.conf.sample;
 }

In url section if i type 192.168.1.65:8085 getting blank page.

FYI – After install magento 2.3.3 not created env.php file under appetc.


Get this bounty!!!

#StackBounty: #installation #magento2.3.3 #nginx #php-7.2 #centos Anyone install Magento 2.3.3 on Centos 7 with Nginx using composer?

Bounty: 100

Following tutorial : https://devdocs.magento.com/guides/v2.3/install-gde/composer.html

After download magento by using,

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.3.3 magento

Folder path : var/ww/html/magento

I am using centos 7 – Nginx how to run following last 2 commands,

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data . # Ubuntu
chmod u+x bin/magento

Finally my installation command,

bin/magento setup:install –base-url=http://127.0.0.1/magento –db-host=localhost –db-name=magento –db-user=root –db-password=P@ssword123 –admin-firstname=mage –admin-lastname=mage --admin-email=mage@gmail.com –admin-user=mage –admin-password=mage@123 –language=en_US –currency=INR –timezone=Asia/Kolkata –use-rewrites=1

How to setup magento.conf in etc/nginx/config.d/ magento.conf?

my magento.conf :

upstream fastcgi_backend {
     server  127.0.0.1:9000;
 }

 server {

     listen 8085;
     server_name 192.168.1.65:8085;
     set $MAGE_ROOT /var/www/html/magento;
     include /var/www/html/magento/nginx.conf.sample;
 }

In url section if i type 192.168.1.65:8085 getting blank page.

FYI – After install magento 2.3.3 not created env.php file under appetc.


Get this bounty!!!

#StackBounty: #google-play-store #adb #security #installation #apk How to block app silent installation

Bounty: 100

Recently I noticed I have opera browser installed. I definitely did not install it because I was sleeping at that time. I checked installation time and revealed it was the day before yesterday

enter image description here

Checking installation source like this outputs android:

adb shell dumpsys package com.opera.browser | grep -e "installerPackageName"

so I don’t know whether it was through Play Store or through APK.

Can I found out who have done this and how can I prevent future intrusions?

P.S. I have MIUI 11.0.3 Global device

UPDATE:

INSTALL_PACKAGES permission

apps

  • com.miui.msa.global
  • com.android.vending
  • com.miui.cloudbackup
  • com.google.android.packageinstaller
  • com.xiaomi.mipicks
  • com.android.managedprovisioning
  • com.facebook.system
  • com.miui.analytics
  • com.xiaomi.discover

users

  • android.uid.backup
  • android.uid.shell

services

  • com.lbe.security.miui/com.lbe.security.service.SecurityService

REQUEST_INSTALL_PACKAGES permission

  • android
  • com.miui.msa.global
  • com.android.browser
  • com.miui.player
  • com.google.android.gm
  • com.google.android.apps.docs
  • com.android.chrome
  • com.xiaomi.midrop
  • com.miui.hybrid
  • com.miui.securityadd

users

  • android.uid.bluetooth


Get this bounty!!!

#StackBounty: #linux #windows-10 #installation #uefi #manjaro I can't install Linux (+ Brick, HELP!)

Bounty: 50

I’m trying to install Linux in this computer:

  • MB: ASRock Z75 Pro3
  • CPU: I3-3220
  • GPU: AMD Radeon HD 6800
  • RAM: 8GB
  • BIOS: UEFI American Megatrends ICN 2.00, 2013/10/9
  • SMBIOS version: 2.7.
  • SSD with two HDD in RAID as a slave
  • Windows 10

I’ve done the next actions:

  • I disabled SecureBoot
  • I disabled Fastboot
  • I have checked the ISO of Manjaro
  • I made the bootable USB again (Rufus and Etcher) with 3 different USB sticks.
  • I started with restart+shift (win) and selecting the UEFI USB Manjaro installation (and also the Legacy before)
  • I tried with Puppy Linux also and get similar results (when it is loading kernels in the installation process I get a black screen)
  • I tried with Puppy in DD mode (Rufus)
  • I checked that the disk is in a GPT mode
  • I tried with Arcolinux broking the PC (more info below)

All that I get is the Manjaro installation menu, I select languages and Time Zone and then select the Manjaro installation option I get a black screen. In the best results, I could see an Asrock logo for milliseconds on the screen (I think it is after a fast reboot).

Now, after trying to install Arcolinux as @vxp suggested, I have broken my computer. I get a black screen since the very beginning, I can’t see even the BIOS messages.

Any idea?


Get this bounty!!!

#StackBounty: #linux #windows-10 #installation #uefi #manjaro I can't install Linux (UEFI, SecureBoot disabled)

Bounty: 50

I’m trying to install Linux in a computer with Windows 10 and UEFI system (Asrock). Nowadays I have Win10 in an SSD with two HDD in RAID as a slave.

  • I disabled SecureBoot
  • I disabled Fastboot
  • I have checked the ISO of Manjaro
  • I made the bootable USB again (Rufus and Etcher) with 3 different USB sticks.
  • I started with restart+shift (win) and selecting the UEFI USB Manjaro installation (and also the Legacy before)
  • I tried with Puppy Linux also and get similar results (when it is loading kernels in the installation process I get a black screen)
  • I tried with Puppy in DD mode (Rufus)
  • I checked that the disk is in a GPT mode

All that I get is the Manjaro installation menu, I select languages and Time Zone and then select the Manjaro installation option I get a black screen. In the best results, I could see an Asrock logo for milliseconds in the screen.

Any idea?


Get this bounty!!!

#StackBounty: #linux #windows-10 #installation #uefi #manjaro I can't install Linux (UEFI, SecureBoot disabled)

Bounty: 50

I’m trying to install Linux in a computer with Windows 10 and UEFI system (Asrock). Nowadays I have Win10 in an SSD with two HDD in RAID as a slave.

  • I disabled SecureBoot
  • I disabled Fastboot
  • I have checked the ISO of Manjaro
  • I made the bootable USB again (Rufus and Etcher) with 3 different USB sticks.
  • I started with restart+shift (win) and selecting the UEFI USB Manjaro installation (and also the Legacy before)
  • I tried with Puppy Linux also and get similar results (when it is loading kernels in the installation process I get a black screen)
  • I tried with Puppy in DD mode (Rufus)
  • I checked that the disk is in a GPT mode

All that I get is the Manjaro installation menu, I select languages and Time Zone and then select the Manjaro installation option I get a black screen. In the best results, I could see an Asrock logo for milliseconds in the screen.

Any idea?


Get this bounty!!!

#StackBounty: #linux #windows-10 #installation #uefi #manjaro I can't install Linux (UEFI, SecureBoot disabled)

Bounty: 50

I’m trying to install Linux in a computer with Windows 10 and UEFI system (Asrock). Nowadays I have Win10 in an SSD with two HDD in RAID as a slave.

  • I disabled SecureBoot
  • I disabled Fastboot
  • I have checked the ISO of Manjaro
  • I made the bootable USB again (Rufus and Etcher) with 3 different USB sticks.
  • I started with restart+shift (win) and selecting the UEFI USB Manjaro installation (and also the Legacy before)
  • I tried with Puppy Linux also and get similar results (when it is loading kernels in the installation process I get a black screen)
  • I tried with Puppy in DD mode (Rufus)
  • I checked that the disk is in a GPT mode

All that I get is the Manjaro installation menu, I select languages and Time Zone and then select the Manjaro installation option I get a black screen. In the best results, I could see an Asrock logo for milliseconds in the screen.

Any idea?


Get this bounty!!!