Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Level of privileges

Level of privileges

Scheduled Pinned Locked Moved C#
csharplinqgraphicssecuritytutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Herboren
    wrote on last edited by
    #1

    How do I know which files on the system have different level of privileges. For example, if the 'at.exe' runs from the command prompt to open cmd.exe then the new cmd.exe has been given system privilages Is there any way to dump the level of privileges to a text file. I managed to get the application descriptions to a listview, now just trying to get their security levels.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.IO;

    namespace FileDescription
    {
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }
    
        private void button1\_Click(object sender, EventArgs e)
        {
            GetFileDescription();
        }
        private void GetFileDescription()
        {
            string\[\] fileInfo = Directory.GetFiles(Environment.SystemDirectory);            
    
            foreach (string str in fileInfo)
            {
                if (str.ToString().Contains(".exe"))
                {
                    ListViewItem lvi = new ListViewItem();
                    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(str);
                    
                    lvi = lv.Items.Add(str);
                    lvi.SubItems.Add(myFileVersionInfo.FileDescription);
                }
            }
        }
    
        private void Form1\_Load(object sender, EventArgs e)
        {
            lv.Columns.Add("File",200,HorizontalAlignment.Left);
            lv.Columns.Add("Description",400,HorizontalAlignment.Left);
        }
    
        private void openToolStripMenuItem\_Click(object sender, EventArgs e)
        {
            Process.Start(lv.SelectedItems\[0\].ToString());
        }
    
        
    }
    

    }

    Thats what I turned out with.

    Richard Andrew x64R 1 Reply Last reply
    0
    • H Herboren

      How do I know which files on the system have different level of privileges. For example, if the 'at.exe' runs from the command prompt to open cmd.exe then the new cmd.exe has been given system privilages Is there any way to dump the level of privileges to a text file. I managed to get the application descriptions to a listview, now just trying to get their security levels.

      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Windows.Forms;
      using System.Diagnostics;
      using System.IO;

      namespace FileDescription
      {
      public partial class Form1 : Form
      {

          public Form1()
          {
              InitializeComponent();
          }
      
          private void button1\_Click(object sender, EventArgs e)
          {
              GetFileDescription();
          }
          private void GetFileDescription()
          {
              string\[\] fileInfo = Directory.GetFiles(Environment.SystemDirectory);            
      
              foreach (string str in fileInfo)
              {
                  if (str.ToString().Contains(".exe"))
                  {
                      ListViewItem lvi = new ListViewItem();
                      FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(str);
                      
                      lvi = lv.Items.Add(str);
                      lvi.SubItems.Add(myFileVersionInfo.FileDescription);
                  }
              }
          }
      
          private void Form1\_Load(object sender, EventArgs e)
          {
              lv.Columns.Add("File",200,HorizontalAlignment.Left);
              lv.Columns.Add("Description",400,HorizontalAlignment.Left);
          }
      
          private void openToolStripMenuItem\_Click(object sender, EventArgs e)
          {
              Process.Start(lv.SelectedItems\[0\].ToString());
          }
      
          
      }
      

      }

      Thats what I turned out with.

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      Files don't have privileges, users have privileges. A standard user and an admin could both start instances of the same program file, but the admin instance will have all the admin privileges, and the other will have only standard user privileges.

      The difficult we do right away... ...the impossible takes slightly longer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups