How Hackers Can Hide PowerShell in Environment Variables

  Рет қаралды 58,226

John Hammond

John Hammond

Ай бұрын

jh.live/snykctf101 || Learn cybersecurity with a FREE Capture the Flag 101 workshop from Snyk on April 18th! jh.live/snykctf101
🗨️ Mapping printable characters to positions within Windows environment variables... to slap together silly obfuscated PowerShell code! Masking the original command in a cutesy way that made help evade detection... (or at least be a fun scripting challenge) 💬
Learn Cybersecurity - Name Your Price Training with John Hammond: nameyourpricetraining.com
📧JOIN MY NEWSLETTER ➡ jh.live/email
🙏SUPPORT THE CHANNEL ➡ jh.live/patreon
🤝 SPONSOR THE CHANNEL ➡ jh.live/sponsor
🌎FOLLOW ME EVERYWHERE ➡ jh.live/twitter ↔ jh.live/linkedin ↔ jh.live/discord ↔ jh.live/instagram ↔ jh.live/tiktok
💥 SEND ME MALWARE ➡ jh.live/malware
🔥KZfaq ALGORITHM ➡ Like, Comment, & Subscribe!

Пікірлер: 69
@abdirahmann
@abdirahmann 28 күн бұрын
This is a very NEAT technique, did you stumble upon this technique in the wild being used by some bad actors?, how did you come up with it, Its really nice. I LOVED IT
@NB-ph6cv
@NB-ph6cv 27 күн бұрын
Im really happy to see you grow, I have recommended you to a "thousand" others and now I see u got 1.3 m subs which is AMAZING. Keep on what ur doing! Greetings!
@polycapmuniu8494
@polycapmuniu8494 29 күн бұрын
This video is eye-opening! It's crazy to see how hackers can use something as innocuous as environment variables to hide malicious PowerShell commands. The level of sophistication in cyber attacks is just mind-boggling. Understanding these tactics is crucial for staying safe online. Thanks for the insightful breakdown! Time to up my cybersecurity game.
@_JoeVer
@_JoeVer 29 күн бұрын
thanks, chatgpt, very cool!
@xenostim
@xenostim 27 күн бұрын
yeah, why have chatgpt write this comment?? lmao
@aadishm4793
@aadishm4793 29 күн бұрын
Great video, seems like a good way to obfuscate commands!
@nuthugs
@nuthugs 28 күн бұрын
love the content!! keep killing it! what keyboard are you using in the newish setup?
@YuKonSama
@YuKonSama 28 күн бұрын
If you have variables that only have the user name as a variable path, you could for example use string splitting on \ to get more options.
@petko9001
@petko9001 28 күн бұрын
Thanks for the great video John, I would like to see what kind of setup you are using (home lab, personal rig, laptop etc.). Can you do a home lab, everyday carry video? I think it will be very interesting and inspiring for the community
@houseofcards251
@houseofcards251 19 күн бұрын
Great stuff. I would like to know how this looks in the event logs. Does it just show the env variables or does it show the cmdlet being run?
@vlado8587
@vlado8587 29 күн бұрын
TNX bro
@dyerseve3001
@dyerseve3001 28 күн бұрын
As i understand reverse engineering, which is very little admitedly. This is how hackers optimize building ROP gadgets. If you get a fixed number of bytes to add to the execution stack, you make sure that what is added is entirely built from other sections of the static mapped memory, because specific strings of assembly will be in fixed locations to reference. So instead of creating code that takes several bytes you just point to a chunk of that already in memory, thereby keeping the exploit within that limited stack space required to maintain the overflow or use after free or whatever tactic the codespace was permitted to hit the stack without the kernel overflowing. Stringing multiple gadgets together creates a ROP chain which is the set of functions you need the exploit to do.
@xYarbx
@xYarbx 29 күн бұрын
Did this idea come from a sample or just random thought ? Also nice to have more of the red team POV stuff. I've been trying to improve on red side since I've been made part of purple team and stuff like this is helping me make the mental shift.
@stollenjack6699
@stollenjack6699 29 күн бұрын
THANKS YOU
@battlegroundschampionshipi3054
@battlegroundschampionshipi3054 29 күн бұрын
Please bring a video on the new xz malware discovered
@baeg1689
@baeg1689 28 күн бұрын
i agree
@jacobfreeman8904
@jacobfreeman8904 29 күн бұрын
Its Because PSModulePath include another Environment Variable (%ProgramFiles%)
@dyerseve3001
@dyerseve3001 28 күн бұрын
It's because for some reason his Python generated powershell in sublime PSModulePath starts with the fixed system paths, C:\Program Files\W (17). Later he starts running the code at a powershell terminal and the output includes his user profile path and things work now, but previously he generated code in sublime then copied to powershell and the indexed were different. Besides it should be excluded since it has a user profile path depending on the context it is executed in. In both user and admin terminal i got the user profile, only at system context i did not, so maybe sublime runs python in a funky psuedo-user context. For an exploit that might run as system or admin, best to strike PSModulePath as a candidate .
@jamesroycoronel4987
@jamesroycoronel4987 29 күн бұрын
Watching right now❤
@carsonjamesiv2512
@carsonjamesiv2512 29 күн бұрын
YES!😃
@whoami8234
@whoami8234 29 күн бұрын
So helpful
@ronin0x_
@ronin0x_ 27 күн бұрын
John please make a video on the xz utils vulnerability and on Jia Tan😭
@josecintron85
@josecintron85 28 күн бұрын
this is a great idea... now i just need to translate python to PS to make it work on any Windows environment. Usually I don't have python available on Windows systems during tests.
@liamcoates4890
@liamcoates4890 27 күн бұрын
You disappeared off my algorithm then I tried to remember ur name when I saw the xz hack and then I see u have 1.3 milli subs, you had 350k last time I watched a vid, killin it!!!
@women-mw1uh
@women-mw1uh 29 күн бұрын
Cool video keep it up
@exploittutorial8689
@exploittutorial8689 29 күн бұрын
where do you get windows iso to run in vmware or virtualbox, the official site offers 22GB zip which is unreasonable
@DS6Prophet
@DS6Prophet 29 күн бұрын
In case my previous comment got deleted for whatever reason, I'll say again: The default ISO from Microsoft's website is about 5-6 GBs. You just download that & install it on virtual box normally. Don't waste time with the "optimized for VM" ISOs.
@hrk4153
@hrk4153 29 күн бұрын
Media Creation Tools from Microsoft let's you make an iso of windows
@robotron1236
@robotron1236 28 күн бұрын
I’ve never once heard of any OS being that large; even something as bloated as windows.
@MikeyMacc
@MikeyMacc 28 күн бұрын
One form of obfuscation could even be caps, powershell should be case insensitive
@cyber_space09
@cyber_space09 27 күн бұрын
This video is interesting and enthusiastic 😁😂
@NotMolly-jf2rh
@NotMolly-jf2rh 29 күн бұрын
Love you, dude. I am continuously hacked. Dangerous stalker. I have managed to thwart him a few times thanks to vids like this, many are yours! 🌹
@Electro-tw9um
@Electro-tw9um 28 күн бұрын
what!?
@Hepad_
@Hepad_ 28 күн бұрын
You need medication
@wickedwidget3812
@wickedwidget3812 28 күн бұрын
I am new to coding so all of this has been informative but very confusing to me. I need to start from the beginning of your videos I guess lol
@boogieman97
@boogieman97 28 күн бұрын
You have built a nice very pythonic conditional christmas tree 😊😊
@rogerioabreu3081
@rogerioabreu3081 28 күн бұрын
is this really useful if my environment is hardened?
@dyerseve3001
@dyerseve3001 28 күн бұрын
Not to be harsh, but if you don't know, I wonder how hardened your stuff is. This was just an exercise in obfuscation, an attacker would already need a way to execute powershell code on your hardened system.
@rogerioabreu3081
@rogerioabreu3081 28 күн бұрын
@@dyerseve3001 haha yep! Thanks for your reply. That's why I asked. I don't have any environment. I am just studying. some measures: Allsigned in the execution policy, no downgrade, ConstrainedLanguage, JEA, no powershell removing,WDAC Policy. Moreover, I could enable the various types of powershell logging in order to catch the execution of this obfuscated command.
@Braint-lr6uf
@Braint-lr6uf 27 күн бұрын
It's worrying the lack of Jurassic Park references.
@brizzelsprout
@brizzelsprout 29 күн бұрын
fun!
@joe-skeen
@joe-skeen 28 күн бұрын
It would be fun to run this on PowerShell Core in Linux or Mac 😂
@warlordkeys
@warlordkeys 29 күн бұрын
leaking my sauce man :( - +10/10 video
@Dani-cr7cj
@Dani-cr7cj 28 күн бұрын
You are naughty boy John
@chiragartani
@chiragartani 29 күн бұрын
Going to watch the video. Will ask if I want to know something
@ElvisLamAsia
@ElvisLamAsia 29 күн бұрын
Use a debugger bro :D
@omaroumessaoud8268
@omaroumessaoud8268 29 күн бұрын
The icons are so big😅
@nionioniosmeg
@nionioniosmeg 28 күн бұрын
Activate Windows got me
@webdashnews1211
@webdashnews1211 29 күн бұрын
make a video on how to detect hacking script which is in encoded javascript , i saw a pastebin post which can hack peoples crypto from g2a account scamming people via encode js code malicious
@gavinmicks227
@gavinmicks227 27 күн бұрын
Why is there so many ai written comments on this….
@shakibbro2
@shakibbro2 14 күн бұрын
please 1 video how to hacked gmail password please please new video 🙏🙏🙏🙏🙏🙏
@user-rj6ff8wu6x
@user-rj6ff8wu6x 6 күн бұрын
LMFAO
@exploittutorial8689
@exploittutorial8689 29 күн бұрын
i tried brute-forcing dvwa with hydra but wont work. I had to build a custom script can someone send me the command
@exploittutorial8689
@exploittutorial8689 29 күн бұрын
420😄
@romansovetskikh7902
@romansovetskikh7902 29 күн бұрын
I'm not trust snyk.
@b1U3b0i
@b1U3b0i 29 күн бұрын
I guess first
@xyssxy
@xyssxy 28 күн бұрын
video content is good, but python code quality terrible
@aadishm4793
@aadishm4793 29 күн бұрын
I guess I am first😀
@setup.repair
@setup.repair 29 күн бұрын
Python... wtf
@Alfred-Neuman
@Alfred-Neuman 29 күн бұрын
He's using Python, the programming language... It's not a snake so don't worry it's not going to bite you!
@exploittutorial8689
@exploittutorial8689 29 күн бұрын
LOL where have you been
@Hepad_
@Hepad_ 29 күн бұрын
What's wrong with python ?
@Alfred-Neuman
@Alfred-Neuman 28 күн бұрын
@@Hepad_ He's probably thinking: "Why would you spend 30 minutes writing this python script when you can spend 2 days writing a C++ code that will do the same exact thing?" lol
@jimo8486
@jimo8486 29 күн бұрын
😂 powershell_command = 'Write-Output 420'
@howtodefeatgangstalking
@howtodefeatgangstalking 28 күн бұрын
On a mission to bypass windows defnder. I found myself taking a powershell script Editing it a bit and to mt luck. I was able to get a shell and bypass defender. But that was me havifn to copy paste the powershell code ibto powershell. I wanted a clickable or executable.. Ya. Good luck 😅 I had to then create another file to excute the ps1 powershell payload i created. You cant just double click on it and run it. So i created a .bat file and slapped aome code in it.. to execute the ps1 powershell payload from my ppwershell script. It worked. Bypassed defender as well. I then added more code to execute the ps1 payload first then add an esclusion to windows defender to a future .exe windows meterpreter file and location that doesnt even exist yet. Then i created the meterpreter payload and uploaded it and ran it from mt basic shell. Boom! Full shell! Thats the most gangster thing i ever done as a begginer hacker. I think thats pretty advanced. Im on a fully updated windows 10.
Free Coding Tool Distributes Malware
42:12
John Hammond
Рет қаралды 126 М.
Learn To Code Like a GENIUS and Not Waste Time
9:41
The Coding Sloth
Рет қаралды 981 М.
КИРПИЧ ОБ ГОЛОВУ #shorts
00:24
Паша Осадчий
Рет қаралды 5 МЛН
ISSEI funny story 😂😂😂Strange World 🌏 Green
00:27
ISSEI / いっせい
Рет қаралды 87 МЛН
MINHA IRMÃ MALVADA CONTRA O GADGET DE TREM DE DOMINÓ 😡 #ferramenta
00:40
Learn Reverse Engineering (for hacking games)
7:26
cazz
Рет қаралды 929 М.
I Made Malware In Under 20 Minutes
19:44
John Hammond
Рет қаралды 60 М.
60 Hacking Commands You NEED to Know
27:01
NetworkChuck
Рет қаралды 314 М.
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 177 М.
Why I Like Programming in C.
3:16
Francisco Jinto Fox
Рет қаралды 7 М.
Hackers Steal Passwords & Personal Information
10:41
John Hammond
Рет қаралды 77 М.
everything is open source if you can reverse engineer (try it RIGHT NOW!)
13:56
Low Level Learning
Рет қаралды 1,2 МЛН
Tracking Cybercrime on Telegram
23:26
John Hammond
Рет қаралды 209 М.
The ULTIMATE Browser Tier List (Based Tier to Spyware Tier)
39:19
Eric Murphy
Рет қаралды 1,9 МЛН
Notepad.exe Will Snitch On You (full coding project)
53:30
John Hammond
Рет қаралды 181 М.
КИРПИЧ ОБ ГОЛОВУ #shorts
00:24
Паша Осадчий
Рет қаралды 5 МЛН