POWERSHELL - Automating RANDOM Local Admins (Active Directory #07)

  Рет қаралды 32,007

John Hammond

John Hammond

Күн бұрын

Help the channel grow with a Like, Comment, & Subscribe!
❤️ Support ➡ j-h.io/patreon ↔ j-h.io/paypal ↔ j-h.io/buymeac...
Check out the affiliates below for more free or discounted learning!
🖥️ Zero-Point Security ➡ Certified Red Team Operator j-h.io/crto
💻Zero-Point Security ➡ C2 Development with C# j-h.io/c2dev
🐜Zero2Automated ➡ Ultimate Malware Reverse Engineering j-h.io/zero2auto
🐜Zero2Automated ➡ MISP & Malware Sandbox j-h.io/zero2au...
⛳Point3 ESCALATE ➡ Top-Notch Capture the Flag Training j-h.io/escalate
👨🏻‍💻7aSecurity ➡ Hacking Courses & Pentesting j-h.io/7asecurity
📗Humble Bundle ➡ j-h.io/humbleb...
🐶Snyk ➡ j-h.io/snyk
🤹‍♀️SkillShare ➡ j-h.io/skillshare
🌎Follow me! ➡ j-h.io/discord ↔ j-h.io/twitter ↔ j-h.io/linkedin ↔ j-h.io/instagram ↔ j-h.io/tiktok
📧Contact me! (I may be very slow to respond or completely unable to)
🤝Sponsorship Inquiries ➡ j-h.io/sponsor...
🚩 CTF Hosting Requests ➡ j-h.io/ctf
🎤 Speaking Requests ➡ j-h.io/speaking
💥 Malware Submission ➡ j-h.io/malware
❓ Everything Else ➡ j-h.io/etc

Пікірлер: 54
@laurenlewis4189
@laurenlewis4189 2 жыл бұрын
"Skip to 43:50 to fix issues" made me laugh. I'm not skipping informative troubleshooting, I'm "fixing the issues" in fast-forward. If only real life was this easy. Also, John's troubleshooting is really helpful to watch. Not only does it help me understand the workings of the code better, it shows me how I might go about fixing similar issues when I face them. I wouldn't recommend skipping for anyone who doesn't already know the answers
@_JohnHammond
@_JohnHammond 2 жыл бұрын
This comment made me smile like crazy, thank you so much for writing this. I have a really big internal battle on leaving out all the mistakes and rabbit holes, because then it's more of a "pretty, packaged, giftwrapped education" -- but it is not always like that. I hear a lot of the time that people like to see the struggle and the debugging and the troubleshooting because it makes it more "real" and they learn from the process... but obviously that can make for a crazy long video not everyone has time for. I hope it is enough of a balance where I include all the "fixing the issues" segments, but just add the note so if folks want to skip on ahead, they can. Fingers crossed, anyway 😅 I super appreciate it, thank you again and again. ♥️
@karunareddy4714
@karunareddy4714 2 жыл бұрын
@@_JohnHammond Hi John, I'm looking for powershell automation training.. Please share details
@Vaenivo
@Vaenivo 2 жыл бұрын
Don't worry about the length or the mishaps that you stumble into, because watching you work yourself out of it is equally, if not more, valuable as the intended content. Thanks for being awesome.
@MsRayband
@MsRayband 2 жыл бұрын
Hey John, great content! For default param value just specify a value in the declaration param ($variable = 'default value') As for "is in" problem: PS > $array = (1..10) PS > $array -contains 1 True PS > $array -contains 11 False
@cjoman100
@cjoman100 2 жыл бұрын
Great video. Side note The local administrators group on the domain controller is the administrators group for the whole domain
@aaronjones2429
@aaronjones2429 2 жыл бұрын
Hey John! I'm a network admin but want to move towards the security side of things. Your videos have helped me understand the world of security. Will be going after more certifications soon!
@brianturney2124
@brianturney2124 2 жыл бұрын
John you remind me of a friend I once knew but lost touch with. Found you on YT a few months back as I was getting back to IT work after a sabbatical and you helped me realize how much I like IT security vs IT engineer roles I've previously had. Thanks my friend!
@MrDullBull
@MrDullBull Жыл бұрын
Thanks, John! As always fun to watch! I believe Add-ADGroupMember -Identity Administrators -Members [$USER] is what should have been used instead of Add-LocalGroupMember. I was too lazy to follow all the stuff, so I just added N randomly selected users from the existing pool to admin group with: Add-ADGroupMember -Identity Administrators -Members (get-random -InputObject (Get-ADUser -Filter *).SamAccountName -count 1) # where count is the number of admin account
@Darius1013
@Darius1013 2 жыл бұрын
Great videos, love to see struggle and Stack overflow - it's too real :D Issue at 23:30: You tested "poor man contains" like this: > if ((1..9) | where { $_ -eq 1}) { echo "found" } > found but PS works like JS: > if (0) {echo "found"} > will not return anything, but > if ("wow") { echo "found" } > found so if we will run > if ((0..9) | where { $_ -eq 0}) { echo "found" } > no output on 0 too.. You can user default function for that: > (0..9) -contains 0 > True Hope it will help other struggling on similar issues and explain why it was happening :) However looking at another issue at 29:30 what was resolved at 43:50 - i'm lost.. > if($userObject['local_admin']) { echo "found" } > found You set value as true, you treat json as map - it should work.. Yeah, accessing property by name maybe better solution, but i still don't get why accessing it from map was not working.. If someone can explain it to me - i would appreciate that.
@abhimanyusinghshekhawat6871
@abhimanyusinghshekhawat6871 Жыл бұрын
Really Really nice content! Because of the security reasons, there is no local Administrators on Domain Controllers, the users been added to "Builtin\Administrators" in the Domain, and that was the reason you were getting an error for Add-LocalGroupMember while adding the users to local Administrators Group of Domain Controller which doesn't exist.
@kostyatitovsky9983
@kostyatitovsky9983 2 жыл бұрын
Why u not use just Get-Random -Minimum 0 - Maximum $userscount -Count $localadmincount? RTFM!)
@kostyatitovsky9983
@kostyatitovsky9983 2 жыл бұрын
Or better in your case: (0..($userscount-1)) | Get-Random -Count $localadmincount this one will return list with unique ids from 0 to $userscount-1 also at 26:11 on line 55 you wrote if ($local_admin_indexes | Where { $_ -eq $i }) { which will turn to if (0) { when $i is 0, which equals to if ($false)
@manfredcomplex366
@manfredcomplex366 Жыл бұрын
You could simply set the first n users in the loop as admin. The order is not important as it is not sorted within the AD. In the video, you're basically just turning random users into more random admin users. But anyway, I watched the whole video. It's a good practice to learn Powershell :)
@PoringPoring951
@PoringPoring951 2 жыл бұрын
Curious to know what’s the use case for this automaton.
@Pavankumar0732
@Pavankumar0732 2 жыл бұрын
Hey, I'm new to these kinds of technical things, but I really like the way u create your contents and I'm also interested in learing kali, so will it be possible to make a video on how to install VMware and kali in it, in detail, it would be a great help for beginners like me....... And it would be great if u can cover some basic command used in terminal..... I want to learn it from u.....
@joseph_de_kvng
@joseph_de_kvng 2 жыл бұрын
Mr Hammond, Am 15 and l want to be a cyber security analyst so l want to learn the basic where should l start. l saw alot of playlist which or where should l start from.
@teachmeen9lish
@teachmeen9lish 2 жыл бұрын
hey mr.john can you make a video about hacking "login.aspx" page
@sysprank1267
@sysprank1267 2 жыл бұрын
Hey your videos are always extremely well constructed - keep it up!!! In both large and small environments, the passwords of local administrators of clients and servers should be set automatically. For this, it is worth taking a look at LAPS (free, fully integrated with GPO).
@shadaxgaming
@shadaxgaming 2 жыл бұрын
Dont need echo. The PS interpetor will simply output the variable contents if it's called. Great vid by the way!
@karunareddy4714
@karunareddy4714 2 жыл бұрын
Hi , i am looking for powershell automation training Please share details
@jackjoshlin8030
@jackjoshlin8030 2 жыл бұрын
Thank you for showing the issues as they unfold. so often I hit them and when i watch videos that just work its frustrating.
@snakebite1538
@snakebite1538 2 жыл бұрын
That's why I was trying to take down hackers to alow you open up the files and documents and spreadsheets that are encrypted end to easyer
@TheGlobalOffensive
@TheGlobalOffensive 2 жыл бұрын
Could you do a video about wacatac Trojan analysis? Love your videos!
@Tameyourcloud
@Tameyourcloud 2 жыл бұрын
I would love to be able to code on the fly and troubleshoot like that! Great content as always, thanks.
@blackcraft.
@blackcraft. 2 жыл бұрын
hey john i really learn a lot from your videos thank you keep up the good work
@gazzamildog6732
@gazzamildog6732 2 жыл бұрын
The way you do code comments is so useless 😂, this function is doing what it says it’s doing
@snakebite1538
@snakebite1538 2 жыл бұрын
By them doing so they made it in possible for me to get them back on my own
@snakebite1538
@snakebite1538 2 жыл бұрын
You need to go back as far as 2018 or 2019
@gazzamildog6732
@gazzamildog6732 2 жыл бұрын
If you do code comments, tell people why not what
@ChristopheKumsta
@ChristopheKumsta 2 жыл бұрын
Hi John, thank you for your very insightful videos!! Watching the Admin creation, I think you missed the fact that "Get-Random" can grab N values from a vector (inherently non duplicated). assuming $UserCount and $AdminCount variables, you could write: ``` $AdminUserIndexes = (0..($UserCount-1)) | Get-Random -Count $AdminCount ``` That would give you an array with $AdminCount users' index directly. Thank you and continue to share your passion with us!! Christophe.
@kraemrz
@kraemrz 2 жыл бұрын
Hakc KZbin 4 j0hn
@justbackbenchers5673
@justbackbenchers5673 2 жыл бұрын
I am from India Big fan sir 😍😍😍😍
@snakebite1538
@snakebite1538 2 жыл бұрын
About six or seven years old
@snakebite1538
@snakebite1538 2 жыл бұрын
I don't trust anyone anymore
@snakebite1538
@snakebite1538 2 жыл бұрын
Keep trying John I pray that you get it
@parthparmar2337
@parthparmar2337 2 жыл бұрын
Hey John. How do you make windows VM setup even 90 days after they expire ? I tried taking a snapshot but it didn't work. Even if we get the snapshot running with another 90 days, how do you setup accounts/installing normal applications like chrome and sysinternals, visual studio code etc.
@thespirit1446
@thespirit1446 2 жыл бұрын
Hey John, adding a = '5' after you param will make 5 as default value for that param: [int]$UserCount = '5'
@valk9789
@valk9789 2 жыл бұрын
Love your coded- 'what's happening' t-shirt - someone knows you well! Sweet!
@melonscratcher
@melonscratcher 2 жыл бұрын
John I absolutely love your videos, even when you go off script a bit, but these are the best bits! It teaches troubleshooting mentality and how to be a smart googler ;-) Keep doing what doing man. I've started a role where I'm responsible for On Prem AD, Azure AD, Intune etc. And wanted to get to a level where I can script an entire AD with Powershell so keep up the great work
@snakebite1538
@snakebite1538 2 жыл бұрын
They are old
@dariusjurma4253
@dariusjurma4253 2 жыл бұрын
Hey John, loved the powershell work you are doing with these videos and your overall great content. However as i remember Domain Controllers can not have local administrators or local accounts at all for that matter.
@Method5440
@Method5440 2 жыл бұрын
Once you generate your users you can just call get-random on that to choose a random number of them as admins.
@HopliteSecurity
@HopliteSecurity 2 жыл бұрын
This was awesome! Where would I be without you JH ❤
@strato5135
@strato5135 2 жыл бұрын
Hello John - I do not believe there is a local admin group on Domain controllers! I may be wrong. Thanks
@cjoman100
@cjoman100 2 жыл бұрын
I believe that is correct. The local administrators group on the domain controller is the administrators group for the whole domain
@guilherme5094
@guilherme5094 2 жыл бұрын
👍
@sireynolds7334
@sireynolds7334 2 жыл бұрын
Sweet.
@Sabyas_Hub
@Sabyas_Hub 2 жыл бұрын
John Hammond = Cybersecurity
@srikeshmaharaj
@srikeshmaharaj 2 жыл бұрын
Here's Johnny,,,,
@jabesmx
@jabesmx 2 жыл бұрын
Loving this new paymoneywubby yt series. . Srsly though great content. Thanks m8
@xxxDEV1xxx
@xxxDEV1xxx 2 жыл бұрын
automation...where have i heard that before....great minds think alike?
POWERSHELL: Random Users & Weak Passwords (Active Directory #03)
1:02:10
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 11 МЛН
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2 МЛН
Bruteforcing MFA & Fail2ban Manipulation - TryHackMe! (Biteme)
44:38
BLOODHOUND Domain Enumeration (Active Directory #06)
39:41
John Hammond
Рет қаралды 77 М.
Automating DOMAIN USERS (Active Directory #02)
53:42
John Hammond
Рет қаралды 37 М.
Swift Programming Tutorial for Beginners (Full Tutorial)
3:22:45
CodeWithChris
Рет қаралды 7 МЛН
Joining a HOME LAB Domain (Active Directory #01)
51:39
John Hammond
Рет қаралды 67 М.
PASSWORDS LEFT OUT IN THE OPEN (Active Directory #10)
17:33
John Hammond
Рет қаралды 40 М.
You Should Learn C++ (for hacking games)
6:11
cazz
Рет қаралды 461 М.
Homelab Setup Guide - Proxmox / TrueNAS / Docker Services
2:44:39
Matthias Benaets
Рет қаралды 184 М.