wooooooowwwwwwww actually though head to jh.live/training and subscribe to jh.live/newsletter for more stuff like this
@jb_lofi2 жыл бұрын
John, you're an inspiration and got me into the cybersec industry. Don't be ashamed about your code quality; what matters is it works to the required standard. If you wanted or needed to write top-notch code all the time even for a quick solution out in the field, you'd be a programmer.
@jimmyc30302 жыл бұрын
im right with you on loving obfuscation. It may seem silly, but its so cool to see the weird and wacky ways people disguise what theyre doing. Thanks for the awesome video :D
@DarkFaken2 жыл бұрын
Hey John, you don't need to apologise or feel embarrassed about your script. It's definitely not perfect and I'm sure given the time you could come up with something better. However you did an amazing job to put this video together and showcase your handy tool, you're giving so much back to the community, don't be so hard on yourself.
@jb_lofi2 жыл бұрын
This.
@beni91292 жыл бұрын
This looks really cool. Im a CS major interested in Cybersecurity and after seeing this, I totally want to give that coding problem a try. I can't say how efficient i'd make it, but it looks like something ive never done before and that's how I like it. To be honest it would be a really good project to add to my resume too haha.
@pedallknife2 жыл бұрын
This is awesome, and never hesitate to show code, because (most of us) aren't even near you level! Thanks for this John!
@gnulnx71332 жыл бұрын
John: I'm embarrassed about my code. *The code is actually better than 99% of my codes*
@NKCSS2 жыл бұрын
One way to make it faster and more plesant, is to treat each folder separately; no need to do the whole loop again when one part of the path changes; then you can offer choices for each section.
@kicks28972 жыл бұрын
This is fun... I can completely understand as a researcher why this is exciting despite those "interesting" conversations. Defensive sec people love to downplay the capability of a simple trick until it works everywhere where it supposedly shouldnt. I share the same level of enthusiasm as you for neat tricks like this... 👍👍
@LxciferXIII2 жыл бұрын
Honestly its a lot easier to just make your commands look like typical network traffic. Admin can be gained without touching disk a lot of the time, once you have an admin account a good portion of commands blend into the background. Its more data exfil that requires an advance level of obfuscation.
@schlaus_kwab2 жыл бұрын
don't scold yourself, Ricky, this was fun and educational to watch. Thanks for sharing cool stuff
@nimoo19292 жыл бұрын
I learnt this technique from you. Thank you sir for this video. ❤
@iblackfeathers2 жыл бұрын
you can use your program that enumerates through all the different wildcard possibilities and instead make them as directories on your system after replacing the question marks with a different character. find which pathways are targeted the most and create these empty directories to the point where explicit pathways are necessary. using wildcards will produce numerous outputs and becomes less practical that calling out specific and explicit pathways.
@patrickshepherd13412 жыл бұрын
Couple things: a) I'm so sorry, but I can't help but see you as the child of Seth Rogen and Ed Sheeran. Lol please forgive me. b) I LOVE this channel. I finished a phd in cs a year ago, but my work is all social simulation stuff, nothing to do with security. I did have to do buffer overflows and reverse engineering assembly just a little bit, but that was only one class. I always wondered about the details of a lot of things we heard about, but there were never any examples. This channel is every worked example I could ever ask for! I know just enough to follow along with what you're doing most times, and watching you work through everything is SO INSTRUCTIVE. I've learned a ton already, and I've been binging your videos for a couple weeks. No plans to stop any time soon; I'm gonna start some CTF challenges myself because of all this. Thanks dude! Keep up the awesome work!
@QuickFixHicks9142 жыл бұрын
I don't think its a bad idea, because the question is "How many people actually look at the logs like they're suppose to?" I want to start getting into making more projects like you made. The code wasn't perfect but you saw your vision out.
@jb_lofi2 жыл бұрын
That's the thing, if I see any form of obfuscation (or even use of rare aliases in PowerShell) my suspicion is increased 100 fold. This might help you avoid certain forms of static analysis or string filtering, etc, but if you _do_ see this in the logs, you've probably found something interesting...
@JorgetePanete2 жыл бұрын
supposed*
@JorgetePanete2 жыл бұрын
it's*
@leandrolej10 ай бұрын
How Reloaded, Razor1911, Fitgirl etc etc can "hide" for so long time ?
@grayshell89282 жыл бұрын
this is quite neat, thanks for the update John
@nicholasdacri2 жыл бұрын
Whenever I hear John’s voice I get really relaxed! So I will keep advocating for his asmr :D
@everything-om3zx2 жыл бұрын
dont listen to people ur the best my brother we love u. :)
@rustywolf-tcg2 жыл бұрын
The wildcard syntax looks a lot like what was happening in the powershell reverse engineering video you encountered previous
@atsekbatman2 жыл бұрын
Very interesting! Thank you!
@bakedmuffinman872 жыл бұрын
wow that is pretty awesome. thanks for everything your doing!
@skysurfer_kon16412 жыл бұрын
Thanks for the tutorial, I'll try it out
@scottspa742 жыл бұрын
John, ] you're awesome, Mark. Inspiring. Keep up the great work
@SeveredSanctum2 жыл бұрын
Well looking at the output of your shortest code: $env:?????????T\ Is always the shortest path that populates: To optimize it you would just have to tell your loops to only check the end parts of the script, as when you performed the full look up, It was also cycling: $env:???????OO?\ which does not need to be checked.
@MrNolimitech2 жыл бұрын
Great subject and great video, as always. Python can be slow ONLY, and ONLY when you have tested with Asyncio / Multiprocessing / CPython. But I think in this case, it can do the trick, because we don't need to wait for a result to create another one.
@numero7mojeangering2 жыл бұрын
I was wondering if applications uses this to find paths or is it just a tool in the command line for users? Also if apps uses this. What happens if I create a new folder?
@armoghan2 жыл бұрын
Love your videos 🖤
@ancestrall7942 жыл бұрын
Awesome vid John
@torsec60482 жыл бұрын
love your code john !
@arcowo2 жыл бұрын
This script would be a good opportunity to implement some "dynamic programming" tricks such as memoization. Might help speed it up.
@fram11112 жыл бұрын
Thanks, more videos on how to find the hack or attack... and destroy them!
@Lampe20202 жыл бұрын
14:58 This reminds me of Matt Parker's code to find five five-letter words that have no letters in common...
@kaare1992 Жыл бұрын
"It takes a long time, it's not ideal..." So it takes like hours? Yeah I can see that's a long time. "It takes like 30 seconds to a minute" Oh... That's way faster than I expected.
@cyphodias16402 жыл бұрын
@John your code is beautiful on the inside ❤
@riordan3812 жыл бұрын
If you are from a developing country, 99% of ISP will be dynamic, so you ips are always changing everytime you connect back. Unlike USA, where you are given a static IP by your ISP. Dynamic IP equal safety Pair with a proxy randomizer and proxy shell on your network. You will be untraceable
@PassionataDance2 жыл бұрын
Is there a powershell command to detect when someone is using these?
@PewPewPew_viper2 жыл бұрын
This is what I’ve been what for. Yaaaaassssss im so happy 😁
@amirniko80142 жыл бұрын
what is the final benefit for all of that ?
@doge19312 жыл бұрын
this would be awesome if you could use some of that * wildcard action on my Junk Mail Block list. Been trying to get wildcards working for junk mail filtering forever.
@liamwhalen2 жыл бұрын
Would it be quicker to set each directory as its own variable, find all the glob permutations for each variable, then combine them together to get all the total permutations?
@luketurner3142 жыл бұрын
If that is the case, would multithreading speed it up any further? Example: target = "C:\dir_1\dir_2\dir_3\file.ext" splitting gives us a list: "C:\dir_1" "C:\dir_1\dir_2" "C:\dir_1\dir_2\dir_3" "C:\dir_1\dir_2\dir_3\file.ext" assign each entry in the list to a thread or core each thread/core runs the permutation finding code only on the last part (output to a file perhaps) then when you want to get a result, it could pick one randomly from each set/group
@liamwhalen2 жыл бұрын
@@luketurner314 I was thinking something like target = "C:\dir_1\dir_2\dir_3\file.ext" splitting gives us a list: var1 = "C:\dir_1" var2 = "\dir_2" var3 = "\dir_3" var4 = "\file.ext" I'm not up on threaded programming, but it seems like those four variables could be sent to different threads to create all the possible glob patterns. When those threads return, then recombine the four variables to get all possible combinations. Depending on the threads available, that could also be threaded. Set thread 1 at var1 mutable, var2, var3, var4 static. Thread 2 at var2 mutable, var1, var3, var4 static, ... thread n at var1, var2, var3, var4 mutable. However the final string is chosen, it would need to be checked to make sure it doesn't pickup more than one file.
@luketurner3142 жыл бұрын
@@liamwhalen If each thread checks for a single match on each iteration of the glob pattern permutation, then you won't need to at the end when combining the partial results. These single match checks shouldn't be computationally expensive since the subdirectories are cached beforehand. That's why I had the list contain full paths that could be checked during the permutation iteration.
@liamwhalen2 жыл бұрын
@@luketurner314 I defined the problem in another way. If the user is looking for a single string to use, it is probably quicker (in a problem space of say >= 3 directories) to generate all the possible combinations first. Once that is done choosing one from them can be done and checked. A directory search is going to be a system call of some sort even if the information is cached (and the user may not be able to guarantee that a target system has anything cached). As well, once all the combinations are present, then advanced options could be added to qualify how the string is chosen e.g. User wants > 10 single character substitutions and < 5 wildcards, and the filename can have at most 2 characters.
@luketurner3142 жыл бұрын
@@liamwhalen Maybe it would be quicker to only check at the end, but IIRC in the video the caching and permutation finding is done on the attacker's machine before the attack even begins
@Boolap13372 жыл бұрын
Video suggestion! Do the Hacktheboo ctf's - would love to see em
@InfernalOd1n2 жыл бұрын
I love Snyk. We use it at my work.
@Kitejrpaladin2 жыл бұрын
This seems like the sort of problem computer scientists and leet coders salivate about. If I had to take a guess, it’s something like figure out the minimum amount of changes required to autocomplete your chosen path (Yes I know it’s a super obvious definition) So if you had a trie filled with the characters with all the paths from having a all ? glob. The only location that must have a character is where there are branches that lead away from the result. Something like that, I’m not a leet coder lol I could be wrong, this is more of an answer coming from intuition. This generates one answer but the nice thing is because we know the minimum character locations required to get the chosen result then it becomes very easy to generate all the other potential matches. Just replace the ? that aren’t part of the minimum with characters from the path.
@dclxviclan2 жыл бұрын
Wow, dude, great job 👍💬🔥
@peculiarfamiliar6 ай бұрын
I need help tremendously with all of my tech! I haven't had access to my wifi security in four years, ive called everywhere & get nowhere. I have multiple administrators & groups on both of me laptops & limited $$$ due to trying to buy new devices. There's sooooo much more at hand here, that's just me naming a few. I have basically no control over my own tech within my whole life & it's sad & limiting in my life.
@bhagyalakshmi1053 Жыл бұрын
What can I do for generating in the Calcutta
@Annette-k7q3 ай бұрын
Where is your link? I really cannot find it i seriously need your snyk program being 73yrs im not real up on all this development and hackers which by tge wat it is happening to me from August and still!
@ITSSIRWAN862 жыл бұрын
awesome jhon
@CA-FE-C0-FF-EE-002 жыл бұрын
Why not getting a few short version from every step/directory for the specified path, save them and join them together for a variety of version to chose from. So first check, what's the best way for env, then system32,... And at the end join some versions together for printing a variety to choose from :) Sorry for my bad explanation but I'm not English and can't code :D but thought this make it alot easier to process. Thanks for the video tho, very inspiring :)
@coolbreeze0092 жыл бұрын
I would be interested to see how fast the script ran on the version of PY used here and the new 3.11 you posted a video about.
@amerispunk2 жыл бұрын
Exactly. Python 3.11 is supposed to be about 20% faster in most tasks generally. It's worth checking...
@uskrzydlacz2 жыл бұрын
wow, news from a few decades ago. really impressive, clap, clap, clap ...
@chrisfahie27672 жыл бұрын
It can't get anymore simple than this. Thank you soo much howtobasic!
@aymaneelhadi29542 жыл бұрын
Hey man, It works great and without any problems.
@MajidLearner Жыл бұрын
@Johnhammond please do part 2
@jackalexander88422 жыл бұрын
I'm wondering if you know any free, online beginner resources to teach people how to code? I watched a video on PyCharm/Python and followed the baby steps, understanding most of the concepts, but the series ended abruptly after simply teaching you how to code a thermometer (maybe there was more somewhere else behind a pay wall, idk..). I really want to try to learn some technical skill and ability with computers to hopefully effect a career change but I can't afford courses etc as too many mouths to feed! And I can't really attend a classroom setting due to having to work ~72hrs a week. At the bottom end of the ladder the salaries in IT fields for unskilled folk is literally half my current salary and I cant take that pay cut. Is there anything you know of that I can do remotely to get the knowledge, even if that comes without accreditation? Sorry for long message..
@whtiequillBj2 жыл бұрын
I recently watched: JavaScript Is Weird (EXTREME EDITION) by, Low Byte Productions. Do you ever find anything like this when breaking down some malicious code?
@logiciananimal2 жыл бұрын
I've done secure code reviews where the developers have inadvertently done "weird things" which meant doing the review is harder.
@Jacob-ABCXYZ2 жыл бұрын
I remember you talking a out IEX alternatives in a past video. I wonder if there's a good way to further obfuscate this (or get this to function in an environment that is less friendly toward IEX)
@Thjon262 жыл бұрын
"Ferb i know what are we gonna do today!"
@djcb41902 жыл бұрын
I knew these hackers. There are musical effects.
@ishanpatel5972 жыл бұрын
Defender wants to know your location 😂
@kylewalker60492 жыл бұрын
How is malware signed with a ceritficate? How do they bypass Windows Defender Smartscreen?
@thedosiusdreamtwister15462 жыл бұрын
Certificates get stolen all the time. Nvidia had a couple stolen earlier this year.
@logiciananimal2 жыл бұрын
Neat idea. Is the source code in github or the like?
@derrickochieng95552 жыл бұрын
i love u so much bro, thanks very much
@charliebaby70652 жыл бұрын
I got tossed an obfuscated url once without any fancy clones characters.. Not sure exactly how it was done. I recall there's some kind of... Targeting syntax used first. Like some underlying url code that may trigger say Google maps to load the URL right away. But tweaked It said dub dub dub Google cm like it should but definitely took me far from it
@danielbloom24702 жыл бұрын
Obfuscation is a deprecated practice. If you still use this method, you deserve the part van.
@dandk_2 жыл бұрын
It's like cybersecurity wordle
@SNO22072 жыл бұрын
you should rewrite it in c++! its so fast 👍
@scizophreniac2 жыл бұрын
i assume a hacky way of protecting against this would be to create decoy dirs that satisfy the wildcards, like C:\Windows\System31...
@lancemarchetti86732 жыл бұрын
This is so cool!
@0ADVISOR02 жыл бұрын
Wtf, stop apologizing for your code! Trust me, mine is worse...
@Paul-kr8dq2 жыл бұрын
Well, it leads us to even more funny idea. What about writing a tool, which will analyze the content of a filesystem and derive the minimal set of fake folder names, that should be created to let all such globes fail? It should be the simplest but effective protection against this kind of obfuscation 🤣
@ddeboy0022 жыл бұрын
10 go to DOS 20 go to 10 end (endless dos screens open up. If you really want to piss off the scammer just put this into startup. Every time to try to reboot dos continues.)
@ian562ADF52E2 жыл бұрын
You have the "if main==name" thing, so your python code is already better than most of mine.
@jtoddcyber2 жыл бұрын
Your worst Python is better than my best.
@lkentwell2495 ай бұрын
Whats the idea of having a file extension .pdf.lnk rather than just a pdf?
@area07502 жыл бұрын
Basically, this is just another way to obfuscate a string constant? Or well, to obfuscate certain file paths. Does it have any advantage over, for example, storing the encrypted/encoded file path with the key and then decrypting/decoding it?
@qsxmirage72742 жыл бұрын
Yeah lots of antimalware will catch it on decryption this is kinda more hiding in plain sight
@rushikeshpatil60172 жыл бұрын
can we obsfucate "-ep bypass" ??
@rushikeshpatil60172 жыл бұрын
@@thedosiusdreamtwister1546 so it should bypass and run the "powershell -ep bypass" command right ?
@jurajchobot2 жыл бұрын
09:52 Why would such option even exist? As far as I understood it the "?" wild card character does nothing good to anyone trying to work with the system but makes the life of threat defenders a nightmare as antimalware software might get in trouble finding a malicious code, that is basically just question marks that Windows is going to evaluate to the closest command. Isn't it stupid? Or maybe even downright dangerous practice?
@HawksAndSwords2 жыл бұрын
$env:whatever is just a string. You can find the path to calc however you like. e.g. Get-Childitem also allows glob matching, or Join-Path 'C:' 'W*s' 's*m3?' '*lc.*e' -resolve That's not even counting .net and regex. If you want to stop somebody running calc you'll have to deny their permissions on calc. Searching for files is a perfectly legitimate and useful feature of powershell.
@GustavoPinho892 жыл бұрын
Lookin' slim.
@DefaultYoutubeHandle2 жыл бұрын
an actual way they hide is putting null byte character im beginning of key names of registry causing an item not to show in the gui. a badass would use dinvoke
@scarlettwhyte41702 жыл бұрын
17:25 play with it in C? :D
@brunolopes73112 жыл бұрын
can you tell what is the best CTF for people that are complete ignorant about hacking like me? lol
@Jaktechnologies2 жыл бұрын
"AT" for the WIN, not listed still there.
@jayjoneslive2 жыл бұрын
Did you just pronounce meme, me-me? It's pronounced MEEM. Don't act like someone wasn't going to notice that. Also, soft G on GIF like give or going. I do love that you keep the mistakes you make up. Helps to know that no one is perfect and I know you could edit that out, but it's fun to see what common typing errors people have in their head.
@davidjthorne1733 Жыл бұрын
It's creator says it should be pronounced as Jiff...😄 But everyone says Giff !! Apparently it really bugs him. 😆
@0Rhiino02 жыл бұрын
Good afternoon When I type htop I see PID# and USER- rtkit What does this mean???
@nasonmamu Жыл бұрын
Hey John, I need your help please, I have qualified to do software engineering in the next two weeks time but my biggest problem I don't know how to do coding.kindly help
@lostsecArmy2 жыл бұрын
Sir plz made a video in bug bounty 🥺
@DefaultYoutubeHandle2 жыл бұрын
i think this is a waste tbh because you would have to know a lot of specific info about a system. random things might accidentally be run instead or it might not working depending on which version or framework they have installed. dinvoke and c# would be better to bypass antivirus. they wouldnt flag the keys or env vars anyway. unless it relates to like a super common bypass or wtv like the windir key in environment of hkcu
@bhagyalakshmi1053 Жыл бұрын
Full file explain How to time.
@withrejkapermana60872 жыл бұрын
lemme be your stundent sensei!
@useruseruseruser-i6s11 ай бұрын
someone knows if theres a script for linux escape?
@MajikCatSecurity2 жыл бұрын
Real hackers won't use Microcrap Winblows
@VECTORY_2 жыл бұрын
i need help, short said: i have a virus, he gets activated every 3 months. its annoying, i still have the virus on an usb stick to share. if you could look into it, would be nice, thx
@VECTORY_2 жыл бұрын
why has this guy such a problem with bots?
@vancejensen38442 жыл бұрын
Did you just say “me me”?!?!
@WaveFlightSimulations2 жыл бұрын
Can u talk about the 10 hacks happening in Australia this month to phone, banks and healthcare
@gregg7182 жыл бұрын
Interesting
@liveunderflow55112 жыл бұрын
Give me source code of envy John!
@ഹർഷിത്2 жыл бұрын
Why don't you try rewrite it in rust..
@luisrosado70502 жыл бұрын
interesting.. now i know how they do it, i can theoretically counter this by looking at there own directories and forcing them to run there own virus on there machine : P