pro hacker teaches you how to bypass this!

Loi Liang Yang
5 May 202308:12

Summary

TLDRThe video explains how to bypass restrictions on school or work laptops that prevent access to Command Prompt or PowerShell. It guides users through a step-by-step process of using Notepad to create a .bat file, which allows executing restricted commands. The tutorial also discusses using FTP services and renaming PowerShell files as a workaround. The video highlights how to bypass local Group Policy restrictions and access administrative functions using coding tricks, but cautions viewers that hacking is illegal and advises against misuse.

Takeaways

  • đŸ’» CMD and PowerShell access is often restricted on work or school laptops.
  • 🔑 The video teaches a method to bypass these restrictions using Notepad to write a batch script.
  • 📂 The batch script includes commands like 'echo off' to hide execution output, followed by a looping structure that runs commands.
  • đŸ‘šâ€đŸ’» The script is saved with a '.bat' extension and allows execution of various commands like 'dir' and 'net user'.
  • đŸš« Restrictions can also be bypassed using services like FTP to run commands indirectly.
  • đŸ› ïž Restrictions are usually enforced through Local Group Policy Editor, which blocks CMD or PowerShell.
  • đŸ–„ïž To bypass blocked PowerShell, you can use PowerShell ISE (Integrated Scripting Environment).
  • 📄 A method involves renaming 'powershell.exe' to something else (e.g., 'powershell_hack.exe') to bypass restrictions.
  • 🔍 Windows security settings like software restriction policies can block executables based on file hashes, but this can be circumvented.
  • ⚠ The video emphasizes that hacking is illegal, and viewers should be aware of the consequences.

Q & A

  • What is the main problem addressed in the video?

    -The main problem addressed is the restriction on accessing the Command Prompt or PowerShell on school or work laptops, and the video teaches methods to bypass these restrictions.

  • Why does the speaker suggest using Notepad as a workaround?

    -Notepad is used as a workaround because it allows users to create and execute batch scripts (.bat files) that can bypass Command Prompt or PowerShell restrictions by coding commands directly.

  • What does the 'Echo off' command do in the script created in Notepad?

    -'Echo off' prevents the commands from being displayed on the screen when the script is executed, making the output cleaner.

  • What is the purpose of setting a variable in the script?

    -The variable is used to store whatever input is entered after the 'cmd' command, allowing the script to process user commands and execute them in a loop.

  • What is an infinite loop in programming, and how is it used in the script?

    -An infinite loop is a sequence of instructions that continuously repeats until it is terminated. In this script, the loop allows continuous execution of commands by jumping back to the start after each command.

  • What is the significance of renaming 'powershell.exe' to 'powershell_hackeralloy.exe'?

    -Renaming the executable helps bypass the restriction placed on 'powershell.exe' by tricking the system into running the file under a different name, thus allowing access to PowerShell.

  • How does the Local Group Policy Editor restrict access to Command Prompt and PowerShell?

    -The Local Group Policy Editor can prevent access by setting policies to block the execution of 'cmd.exe' and 'powershell.exe,' preventing users from running these programs.

  • What is the FTP service mentioned in the video, and how is it used as an alternative to execute commands?

    -The FTP service is used to run commands when direct access to Command Prompt is blocked. By leveraging FTP's capabilities, users can execute commands such as 'dir' or 'net user' indirectly.

  • What is the purpose of the hash rule in Windows security settings?

    -The hash rule prevents certain executables from running based on their hash values (unique identifiers for files). In this case, 'powershell.exe' is blocked, but modifying the executable bypasses the restriction.

  • What lesson does the speaker emphasize regarding hacking?

    -The speaker emphasizes that hacking is illegal, warning viewers to be cautious and understand the risks of being caught while performing unauthorized actions.

Outlines

00:00

đŸ’» Logging into Restricted Systems and Encountering CMD Restrictions

This paragraph introduces the issue of restricted access to command prompt (CMD) on certain computers like school or work laptops. The narrator explains how users are often blocked from executing commands through CMD or PowerShell due to system restrictions. The section hints at a tutorial for bypassing these restrictions, while also issuing a disclaimer that hacking is illegal. The narrator proceeds by demonstrating an initial unsuccessful attempt to access CMD.

05:01

📝 Using Notepad to Create a Command Execution Loop

Here, the narrator presents a method for bypassing CMD restrictions using Notepad. They demonstrate writing a batch file (.bat) with simple code that sets up an infinite loop to continuously execute commands in the background. The narrator explains using ‘Echo off’ to hide command output and setting variables to automate the process. They then show how to save and execute the batch file, successfully accessing the directory and listing user information on the restricted system.

🌐 Leveraging FTP to Execute Commands

This paragraph shifts to another method of executing commands by utilizing the FTP service. The narrator explains how users can bypass CMD restrictions by running commands through FTP, demonstrating the process step-by-step, including setting font size for easier visibility. They show how commands like ‘dir’ and ‘net user’ can be executed to gather system information, once again successfully bypassing system restrictions.

⚙ Group Policy Editor: Restricting CMD and PowerShell

The focus shifts to explaining how restrictions are enforced through the Local Group Policy Editor. The narrator walks through the process of preventing access to CMD and PowerShell by modifying user configurations and system settings. They demonstrate how specific applications, like PowerShell, can be restricted, and how the system prevents access when these policies are enabled.

🔑 Bypassing PowerShell Restrictions through Renaming

The narrator introduces a method to bypass PowerShell restrictions by renaming the executable file. They show how simply changing the name of 'powershell.exe' allows access despite the restrictions in place. This paragraph emphasizes the role of hash value rules in enforcing executable restrictions, explaining how to modify these settings in the security configuration to bypass them.

đŸ–„ïž Executing Renamed PowerShell and Overcoming Security Policies

This section continues with the process of bypassing PowerShell restrictions by modifying its executable file. The narrator explains how to copy and rename PowerShell to trick the system into allowing access. They successfully demonstrate the workaround, showing how changing the hash value or renaming the file lets them launch PowerShell despite restrictions. The paragraph concludes with a reminder about hacking, wrapping up the tutorial.

Mindmap

Keywords

💡Command Prompt (CMD)

The Command Prompt, often referred to as CMD, is a command-line interface in Windows that allows users to run commands to perform various system tasks. In the video, the speaker discusses how users are often restricted from accessing CMD on certain computers, such as school or work laptops, and how they can bypass these restrictions using alternative methods.

💡Notepad Hack

The Notepad hack involves using Notepad to create and execute a script when access to the Command Prompt or PowerShell is restricted. The speaker demonstrates how to write a simple batch file (a '.bat' script) in Notepad to bypass restrictions and perform command-line operations. This method tricks the computer into executing commands indirectly.

💡Batch File (.bat)

A batch file is a script file in DOS, OS/2, and Windows that consists of a series of commands to be executed by the command-line interpreter. The speaker creates a batch file named 'hackerlaw.bat' to run commands even when CMD access is blocked. Batch files allow automation of tasks and are commonly used for system administration purposes.

💡Local Group Policy Editor

The Local Group Policy Editor is a tool in Windows that allows administrators to configure system settings, including restrictions on certain applications. In the video, the speaker explains how to navigate the Group Policy Editor to find and modify settings that prevent users from accessing CMD or PowerShell, and shows ways to bypass these restrictions.

💡PowerShell

PowerShell is a task automation framework consisting of a command-line shell and scripting language. It is more powerful than CMD and is commonly used for system management. The video shows how PowerShell access can also be restricted by administrators, and the speaker demonstrates methods to bypass these restrictions using alternative file names or paths.

💡FTP (File Transfer Protocol)

FTP is a protocol used to transfer files between computers over a network. In the video, the speaker highlights the possibility of using the FTP service to run commands when CMD or PowerShell access is blocked. This is an unconventional method of executing commands by leveraging services available on the system.

💡Hash Value

A hash value is a unique, fixed-length value that represents a file's contents. In the context of the video, the speaker explains how Windows may block executables like PowerShell by identifying their hash value, which is used for security purposes. The speaker demonstrates how renaming the file or modifying the hash can potentially bypass these security measures.

💡Powershell_ise.exe

PowerShell Integrated Scripting Environment (ISE) is a graphical user interface for PowerShell that allows users to write and test scripts. In the video, the speaker discusses how even if PowerShell itself is blocked, the ISE version may still allow users to run PowerShell commands, providing another way to bypass system restrictions.

💡Script Kiddie

A Script Kiddie is a derogatory term used to describe a person who uses existing scripts or tools to hack into systems without fully understanding the underlying mechanisms. The speaker humorously references a user named 'Script Kitty Loy' in the video, suggesting that the tools and methods demonstrated can be used by people with limited technical knowledge.

💡Group Policy Restrictions

Group Policy restrictions are configurations applied by system administrators to limit user access to certain features or applications. In the video, the speaker explores how administrators can use these restrictions to block CMD and PowerShell, and the video demonstrates methods to bypass these security measures, such as renaming files or using alternative command-line tools.

Highlights

Access to command prompt is often restricted on school or work laptops, preventing the execution of certain commands.

An initial workaround is using Notepad to create a batch file that simulates a command prompt environment.

The script uses an 'Echo off' command to hide executed commands, providing a cleaner output.

A loop is created in the batch file using label and jump commands to execute commands continuously.

The batch file, when executed, allows users to input common commands like 'dir' and 'net user' as if in a regular command prompt.

It’s possible to bypass command prompt restrictions using FTP services, allowing command execution through the FTP interface.

The video demonstrates how to change font size within the FTP service for better visibility of executed commands.

Local Group Policy Editor is identified as the source of restrictions on cmd.exe and Powershell, with settings for preventing access.

Another method to bypass these restrictions involves using the integrated scripting environment 'Powershell ISE' as an alternative to the standard Powershell.

The video explains how to copy and rename the Powershell executable to circumvent restrictions based on the executable’s name.

The restrictions might also be based on hash values, which can be modified or worked around to gain access.

Demonstrating the use of the Software Restriction Policy, the video shows how modifying hash rules can alter the accessibility of certain applications.

Renaming the Powershell executable to a different name allows the user to bypass application restrictions.

The concept of modifying executable paths and values is highlighted as a way to circumvent administrator restrictions.

The video concludes with a reminder that these actions are considered hacking and may be illegal, emphasizing the need to use such knowledge responsibly.

Transcripts

play00:00

whenever you log into a computer the

play00:01

first thing you may do is to go ahead

play00:03

and enter into command prompt so you

play00:05

enter CMD you see command prompt app you

play00:07

hit enter on and boom that's a problem

play00:10

and just like me we are not a fan of

play00:12

this problem and we have to fix it

play00:16

[Music]

play00:22

and this generally happens when you are

play00:24

trying to log into a school laptop your

play00:26

work laptop and you're restricted from

play00:28

executing some super interesting stuff

play00:30

because they restrict you from going to

play00:32

command prom or Powershell I'm teaching

play00:34

you how to bypass that you definitely

play00:36

want to watch the end because I don't

play00:38

know if YouTube is going to take down

play00:40

this video and now before we get started

play00:41

kids remember hacking is illegal if you

play00:44

get caught hacking

play00:47

now what we can do here is go ahead and

play00:50

close off the command prompt that's not

play00:51

working and what we can do now is go

play00:53

ahead and enter into say notepad click

play00:55

OK on that so what happens now is we

play00:57

need to do a little bit of coding

play00:59

trick the computer into executing what

play01:02

we want them to run so the first thing I

play01:04

do is enter Echo off so that whatever we

play01:06

are executing do not get displayed so it

play01:09

gives us a cleaner output so this is a

play01:11

label that is the beginning of a loop

play01:13

next up we set the variable com for

play01:16

whatever is entered after CMD followed

play01:18

by that Curly thing and a super

play01:20

interesting part right here is where we

play01:22

execute comment variable and finally we

play01:26

jump back into the label and this allows

play01:29

us to create an infinite Loop and once

play01:31

you're ready go ahead and save this file

play01:33

to your favorite location in this case I

play01:35

will save it over to desktop and I'll

play01:37

call this

play01:39

hackerlaw.bat it's safe on that done so

play01:42

what I can do now again go ahead and

play01:43

execute on this so when I double click

play01:45

you can see right here there is a prompt

play01:47

so let me zoom in a little more so it's

play01:49

easier for you to see click on your

play01:51

phone click under say 28 click OK on

play01:53

that and let's see what we can do right

play01:55

here so what I'll do right now is to go

play01:57

ahead and enter something like print

play01:59

working directory all right so that does

play02:01

not work because we're on windows so I

play02:03

enter the IR

play02:04

and you can see right here we are

play02:05

directory of users

play02:08

and we can list all of this information

play02:10

in fact I can even enter say for example

play02:14

all right let's see whether this work

play02:16

who am I

play02:20

and what if I enter something like net

play02:23

user Loi Liang young what do we get

play02:25

right here all right this user is part

play02:28

of the administrator's group as you can

play02:29

see right here and I can enter net user

play02:32

and see the list of all of the users

play02:34

that are within the computer and of

play02:37

course we have one of our favorite

play02:38

person here a script Kitty Loy

play02:42

so when we try to do a direct access

play02:44

into command prom over here what happens

play02:47

is that we get a deny now the question

play02:50

is is there something else we can use

play02:52

that can help us call command and one of

play02:55

the really interesting option is to use

play02:57

the FTP Service to help us do the

play03:00

command wait a minute you don't believe

play03:02

Mr hack along

play03:04

I told your best friend forever so now

play03:06

when you go back to the Windows computer

play03:07

all you got to do right here is go to

play03:09

bottom left and through FTP hit run

play03:11

command over here so let me once again

play03:13

zoom in a little more so it's easier for

play03:15

you to see so what I can do now is click

play03:17

on properties and let's go ahead and

play03:19

give a 28 font and what I can do right

play03:21

here now is to enter some interesting

play03:23

stuff which is an exclamation mark

play03:25

followed by say dir alright so it shows

play03:29

us all of this information right here I

play03:31

can also go ahead and enter say net user

play03:33

see what we get right here we have

play03:35

loyally we have script kitty line

play03:37

default user zero and all of that so

play03:39

we're lavaging on a service which can

play03:42

help us run those commands that we

play03:45

wanted to execute on for us super cool

play03:48

so this happens because of the local

play03:50

Group Policy editor because the bottom

play03:52

left side go ahead and enter local Group

play03:55

Policy click enter edit group policy and

play03:57

this is the place where you can

play03:58

configure the Restriction of cmd.exe as

play04:01

well as a Powershell so you go under you

play04:04

user configuration amp Street templates

play04:06

and over here what you can do is go

play04:08

ahead and click on to click on the

play04:10

system and right here you can see the

play04:11

following prevent access to command

play04:13

prompt double clicked on this and you

play04:15

can easily enter enable alright so this

play04:17

will allow us to disable the Run of CMD

play04:21

and you can see right here too don't run

play04:23

specific Windows application and in this

play04:26

case it could also be a restriction of

play04:28

Powershell so once I click on the don't

play04:29

run specify Windows application you can

play04:31

see right here we have the list of this

play04:34

along application I click show and you

play04:36

can see the information over here which

play04:38

is

play04:38

powershell.exe so when you go to the

play04:41

bottom left side again I enter

play04:43

Powershell

play04:45

dot ex you hit OK on that and it stays

play04:47

the phone the operation has been

play04:49

canceled due to restrictions in effect

play04:51

on this computer please contact your

play04:53

system administrator so the question of

play04:55

course is how can we bypass that again

play04:58

one simple simple trick is to think

play05:00

about what else can call power shells

play05:02

and of course in this case Powershell

play05:03

underscore inc.exe

play05:05

allow us to do Powershell alright so in

play05:08

this case what is ISE well it is

play05:11

basically an integrated scripting

play05:13

environment so literally we can do

play05:14

whatever we want here by entering all

play05:17

those commands see for example I can

play05:18

enter the same command here by

play05:20

enumerating or listing down all the

play05:21

users between the local computer I can

play05:23

enter net user looking at all the lists

play05:25

of the users within the computer say for

play05:27

example your best friend script Katie

play05:28

Lloyd right here if I copy the same file

play05:31

somewhere else would that still work

play05:33

because it could be pointing to a path

play05:36

so that's the first option you want to

play05:37

try now the first option here is to go

play05:39

ahead and copy where Powershell is

play05:41

located and now we want to Target it

play05:43

into the desktop directory hit enter on

play05:46

that okay

play05:47

and now we've done the copy now the

play05:49

question is would this work so once I'm

play05:52

here I double clicked on it it says the

play05:54

following this operation has been

play05:55

canceled due to restrictions in fact in

play05:57

this computer please contact your system

play05:59

administrator no worries we just have to

play06:01

try harder and what I do now is I'm

play06:04

going to rename

play06:05

powershell.exe into say Powershell

play06:09

hackeralloy.exe is the same file it's

play06:11

just a rename of the file I double

play06:13

clicked on it

play06:14

boom we are in look at that this is

play06:17

crazy how can this even work

play06:20

are we naming the fall the other

play06:22

interesting part is they could be using

play06:24

the hash value of the file as you can

play06:26

see right here we on Windows settings

play06:28

and then followed by security settings

play06:30

and then under software restriction

play06:32

policy and additional rules and right

play06:34

here we have powershell.exe which takes

play06:36

in as a hash of value so when I double

play06:39

click onto here

play06:41

you can see the following which is Hash

play06:42

rule alright so when I go ahead and

play06:45

browse we can Target any form of

play06:46

executables and this allows the use and

play06:50

check of those hash value based on the

play06:52

executable and we can easily change this

play06:54

up a little which will then allow us to

play06:57

still execute on the file so what I'll

play07:00

do now is go ahead and disable don't run

play07:03

specified Windows application click

play07:04

apply on that click OK because we're

play07:06

testing out the hotter hash rule here so

play07:09

what I can do right now is go ahead and

play07:11

launch a good friend and what I can do

play07:13

here is to change up a little bit of the

play07:16

value in powershell.exe and see whether

play07:19

we're able to execute on it so what I've

play07:21

entered here is to copy from system2

play07:23

Windows Powershell version 1.0

play07:25

Powershell exe into user desktop I go

play07:29

ahead and hit enter and that done so we

play07:32

can see the file on the left so we have

play07:34

the powershell.exe right here so the

play07:37

proof and pass it out let's go ahead and

play07:39

move this over into the center a little

play07:41

and I double clicked on it and it says

play07:42

defaulting your system illustrator has

play07:45

blocked this program for more

play07:46

information contact consistent registry

play07:47

or whatever

play07:48

so what we want to do now is to change

play07:50

up the value of this a little and see if

play07:52

we're able to launch Powershell and what

play07:54

we'll do here is to append it to

play07:56

powershell.exe hit enter done double

play07:59

click on the powershell.exe boom we're

play08:02

in we managed to change up the value of

play08:05

the executable and this gives us access

play08:07

to Powershell and remember kids that's

play08:11

how you do hacking

Rate This
★
★
★
★
★

5.0 / 5 (0 votes)

Étiquettes Connexes
CMD BypassHacking TricksSchool RestrictionsWork LaptopsCoding HacksCommand PromptWindows HacksTech WorkaroundsPowershell AccessFTP Tricks
Besoin d'un résumé en anglais ?