Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch Advice  (Read 5032 times)

0 Members and 1 Guest are viewing this topic.

Losthymns

    Topic Starter


    Greenhorn

    • Experience: Experienced
    • OS: Windows 10
    Batch Advice
    « on: September 30, 2019, 02:09:49 PM »
    I am a desktop administrator and I am using c$ all day in order to backdoor into devices on our domain. I am trying to create a batch file that will speed up this process and honestly would like to just learn a little bit more on this and what I have available to me. I want the script to prompt for the Host Name of the device that I am trying to backdoor into then ask for the administrator password. I am utterly failing at making this work, any help or advice would be greatly appreciated.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Batch Advice
    « Reply #1 on: September 30, 2019, 08:52:08 PM »
    How did you get this job ? ?
    " Anyone who goes to a psychiatrist should have his head examined. "

    Lisa_maree



      Mentor
    • My first real computer
    • Thanked: 161
      • Yes
    • Experience: Expert
    • OS: Windows 10
    Re: Batch Advice
    « Reply #2 on: September 30, 2019, 10:27:58 PM »
    Instead of looking to write a batch file to do what you are typing etc. Why not use a macro recorder and let it do the repetitive things you do each day.
    You have not lived today until you have done something for someone who can never repay you.”
    ― John Bunyan

    Losthymns

      Topic Starter


      Greenhorn

      • Experience: Experienced
      • OS: Windows 10
      Re: Batch Advice
      « Reply #3 on: October 01, 2019, 05:27:28 AM »
      How did you get this job ? ?

      You realize that I can be a desktop admin and not know coding right? I can also just go ahead and report you for being assinine. If you have no intelligent comment maybe just IDK stop typing?

      Losthymns

        Topic Starter


        Greenhorn

        • Experience: Experienced
        • OS: Windows 10
        Re: Batch Advice
        « Reply #4 on: October 01, 2019, 05:35:28 AM »
        I posted on this forum because after reading a couple posts it looked like a helpful and intelligent group of people looking to genuinely help people learn and write scripts/powershell and stuff like that. I honestly think people are just on here now to flame others. Thanks, but no thanks. Legit first post and a moderator comes in and tries to invalidate my work ethic and job. I went out wanting to learn more, that kind of behavior is childish as *censored*.

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: Batch Advice
        « Reply #5 on: October 01, 2019, 10:08:56 AM »
        Your use of the term backdoor was probably the trouble, as a backdoor is generally an *unauthorized* way of gaining access to a system- like a secret password left in by a developer so they can muck about if they get fired or whatever. The concern was, I think, that you were accessing remote systems without authorization. Presumably that is not what you mean.

        You should be fine to use the net use command \\Host\C$ /user:<username> <password> ...Not sure what you intend to automate. I suppose, you could have a script prompt for the username/pass/hostname first?

        Code: [Select]
        echo Enter Host Name to connect
        set /p useHost=
        echo Enter username
        set /p useUser=
        echo Enter password
        set /p usePassword=
        net use \\%useHost%\C$ /user:%useUser% %usePassword%
        explorer \\%useHost%\C$

        If the username is the same across them (Administrator for example) You could remove the prompt and have it only ask for the password. net use probably returns an errorlevel if it fails as well in which case it would be reasonable to not run explorer trying to load up the share folder too, but this is the basic idea.
        I was trying to dereference Null Pointers before it was cool.

        patio

        • Moderator


        • Genius
        • Maud' Dib
        • Thanked: 1769
          • Yes
        • Experience: Beginner
        • OS: Windows 7
        Re: Batch Advice
        « Reply #6 on: October 01, 2019, 07:10:40 PM »
        Given the stated task i asked my question because it would have been part of your job description...
        If i offended you i apologise but i think you are in over head...
        Best of luck.
        " Anyone who goes to a psychiatrist should have his head examined. "

        Losthymns

          Topic Starter


          Greenhorn

          • Experience: Experienced
          • OS: Windows 10
          Re: Batch Advice
          « Reply #7 on: October 03, 2019, 05:49:18 AM »
          Given the stated task i asked my question because it would have been part of your job description...
          If i offended you i apologise but i think you are in over head...
          Best of luck.

          I am a desktop administrator....I replace keyboards, troubleshoot systems...I am honestly just dabbling in programming and what not to try to learn. I'd just watch how you talk to people because it kinda sucks to be shut down when you are trying to learn something.

          Losthymns

            Topic Starter


            Greenhorn

            • Experience: Experienced
            • OS: Windows 10
            Re: Batch Advice
            « Reply #8 on: October 03, 2019, 05:54:20 AM »
            Your use of the term backdoor was probably the trouble, as a backdoor is generally an *unauthorized* way of gaining access to a system- like a secret password left in by a developer so they can muck about if they get fired or whatever. The concern was, I think, that you were accessing remote systems without authorization. Presumably that is not what you mean.

            You should be fine to use the net use command \\Host\C$ /user:<username> <password> ...Not sure what you intend to automate. I suppose, you could have a script prompt for the username/pass/hostname first?

            Code: [Select]
            echo Enter Host Name to connect
            set /p useHost=
            echo Enter username
            set /p useUser=
            echo Enter password
            set /p usePassword=
            net use \\%useHost%\C$ /user:%useUser% %usePassword%
            explorer \\%useHost%\C$

            If the username is the same across them (Administrator for example) You could remove the prompt and have it only ask for the password. net use probably returns an errorlevel if it fails as well in which case it would be reasonable to not run explorer trying to load up the share folder too, but this is the basic idea.

            I'll give this a shot. Yeah, I use backdoor freely. At work I am constantly sending files to and from devices. It's just easier to prompt for admin password and pc name and let me right into the c drive. Makes life easy. Time to study.

            Losthymns

              Topic Starter


              Greenhorn

              • Experience: Experienced
              • OS: Windows 10
              Re: Batch Advice
              « Reply #9 on: October 03, 2019, 06:00:36 AM »
              So I think I figured it out. It's running in a batch script and asks for just my password. Feels good. I really appreciate the help with this. Saves me a very small amount of time...but it was a lot of fun. Sorry for getting upset it's just that this was my first real attempt and it felt like I was just getting pointed at and laughed at lol. Either way, page bookmarked.