Deciphering Obfuscated JavaScript Malware

  Рет қаралды 57,932

LaurieWired

LaurieWired

Күн бұрын

Do you like solving programming puzzles? Want to uncover what a malicious attacker is actually trying to do with their code?
In this video, we manually deobfuscate and Reverse Engineer an obfuscated JavaScript file. We look at a malicious loader file that downloads and executes a secondary AsyncRAT payload. You can follow along yourself with the video, by using the hash listed below!
---
File Hash: 978bf1471b3536dfdea854dd1c5d8ee63bdfbc8223c0254a92b183a711699a3a
---
Timestamps:
00:00 Intro to JavaScript Deobfuscation
06:03 Deeper Deobfuscation Techniques
12:02 Decoding Variables
18:00 Analyzing Obfuscated JS Function Calls
24:00 Uncovering Hidden Functionality
30:00 Reconstructing the Malicious Payload
---
LaurieWired Socials:
linktr.ee/lauriewired
---
Intro Music Courtesy of Analog Summer:
• Cloud Reverie by Analo...

Пікірлер: 307
@bartekklusek5242
@bartekklusek5242 23 күн бұрын
This is not really my area of interest specifically, although i follow various computer related content. What actually shocked me, after watching several videos, is how orderly mind this lady has. Absolutely smooth speaking about complicated topics. I envy that talent so much.
@christopher8641
@christopher8641 Ай бұрын
I'm a backend dev and have never dug into malware analysis, but this video made the process look pretty fun and rewarding. I guess it is just a big dangerous puzzle
@cusematt23
@cusematt23 Ай бұрын
holy effing sht. I literally just came across some heavily obfuscated js code that i am dying to reverse engineer and this vid came up. there is a god.
@adityadas5835
@adityadas5835 Ай бұрын
Or maybe Big Brother is tracking you. Who knows? 😕
@corp-por
@corp-por Ай бұрын
wtf, almost the same here. A client just called me because a js file was triggering a virus alert in windows defender. And here I am 🥸
@Katchi_
@Katchi_ Ай бұрын
Liar.
@cusematt23
@cusematt23 Ай бұрын
@@Katchi_ Not even kidding. I am using a complex optimization app and instead of it doing work on the server it just sends a giant minified obfuscated js bundle. And I am curious although not as smart as Laurie and will prob never fully reverse engineer it. So far the only thing I am getting is that the code using the glpk javascript library. I didn't even know this existed so that's a bonus at least. I am guessing there will soon be a day where most of the python AI/ML library functionalities are in javascript and running in your browser without (most people) you being aware. I am unsure if i should be excited or petrified.
@cusematt23
@cusematt23 Ай бұрын
@@adityadas5835 certainly possible.
@digitalradiohacker
@digitalradiohacker 23 күн бұрын
I'm a complete code mong, so I'm trying to "hang around" with smart people to soak up as much as I can - hence, why I'm here. Just to prove I was paying attention: 28:30 It looks like the integer returned was "1". You went back to the code and typed "0". Thanks for the walkthrough of what you're doing - Picked up a couple of tricks here.
@NatteeSetobol
@NatteeSetobol Ай бұрын
Nice, I was looking for a nice detailed video that goes through such an annoying obfuscation in JavaScript. Thanks!
@TheChugnut
@TheChugnut 23 күн бұрын
Wow, just found your channel and I love it. Your presentation style is amazing!
@iss9280
@iss9280 Ай бұрын
One of my new favorite channels! I love the old school Tech Tv/G4 vibe of your set.
@shady4tv
@shady4tv Ай бұрын
The theme is from Serial Experiments Lain. great anime - only like 13 episodes. Would recommend watching if you have the time. I will warn you tho - it's a trip.
@Desmaad
@Desmaad 25 күн бұрын
Not to mention the Classic Mac (Copland/OS 8-9.2) theming.
@VincentGroenewold
@VincentGroenewold Ай бұрын
The quality of these videos is just great, I'm not into JS at all, but it's well explained to follow along, nice! It all feels very much like security through obscurity, I predict this can be automated in the near future.
@thediskostarz
@thediskostarz Ай бұрын
Awesome video Laurie, I learned a lot by watching your well explained videos. Thank you.
@mr.bulldops7692
@mr.bulldops7692 Ай бұрын
Clear, concise, and cool as hell. You picked a great code example!
@UliTroyo
@UliTroyo Ай бұрын
This was a lot of fun! What a cool breakdown.
@leoroux4712
@leoroux4712 Ай бұрын
I did't need this but the explanation was so clear I kept watching
@svampius2448
@svampius2448 14 күн бұрын
I love the content and aesthetics of your videos, definitely my favourite channel at the moment! Also, for some reason you make me think of squirrels, which is fantastic - a vaporwave squirrel.
@DotDager
@DotDager Ай бұрын
A lot of interesting insights, great job as usual!
@OfficialiGamer
@OfficialiGamer 12 күн бұрын
I don't deal with programming much (or js) as I'm a hardware guy, but I found this super interesting to watch, and I understood most of it! Keep up the good work pretty lady!
@sshiiden
@sshiiden Ай бұрын
You did a really good job with the style of your videos
@hitmongg
@hitmongg 21 күн бұрын
I've never looked at malware before; it's super interesting. Thanks for sharing!
@dblanque
@dblanque 17 күн бұрын
Super neat video, really high level of production (also, 28:37, oopsie daisies the 1!) :P Really awesome content, learnt a lot Laurie! Subbed :)
@ArjanvanVught
@ArjanvanVught Ай бұрын
@28:29 a little error here ;-) pasting 0 instead of the 1
@swenic
@swenic Ай бұрын
^ 28:41
@sonyarianto
@sonyarianto 11 күн бұрын
yeah this is a bug in this video
@kelliaa
@kelliaa Ай бұрын
really sick video, gonna try to learn more about this, and your set is so sick
@dudemcperson3582
@dudemcperson3582 Ай бұрын
I absolutely love the way you break this down. Thank you!
@menegatmarcelo
@menegatmarcelo Ай бұрын
Laurie, your voice and way to explain is gorgeous!! New favorite channel! Im a simple FE developer who loves non FE content :) Thank you for exists!
@OneAndOnlyMe
@OneAndOnlyMe Ай бұрын
This was a great tutorial, Laurie!
@Emerson1
@Emerson1 Ай бұрын
Great video, and great production value
@jhonm6347
@jhonm6347 24 күн бұрын
Damn, this is very informative. I can't quite keep up with everything yet because I'm new to coding but it is very interesting, great video.
@jefflucas_life
@jefflucas_life Ай бұрын
I like the way how this was video instructed , thumbs up!!
@shockinho
@shockinho Ай бұрын
This is so good I can't believe it exists, let alone such good content being free on KZfaq. Amazing work
@tysonbenson
@tysonbenson Ай бұрын
Thanks, Laurie! Awesome video!
@Plagueheart
@Plagueheart Ай бұрын
I like the channel, it has a 90's style vibe from PBS after school tv educational shows which gives me that nostalgic vibe
@LuisGarcia1992_
@LuisGarcia1992_ 3 күн бұрын
LOVE the effect of a tape fast-forward 😂
@Slycooper2456
@Slycooper2456 Ай бұрын
Such great videos! (Love the Burnout clips at the end of each videos such a fun a game!)
@vapaspen
@vapaspen Ай бұрын
My team has been fighting this thing for months now. When we got our first Sig it we though it was a FP cause of how many hits we got but no its just hitting that many people. Its a nasty little bugger. Thanks for the really cool breakdown on this! :)
@syth-1
@syth-1 Ай бұрын
Great video - these are all tricks I've used to deobfuscate API's I probs shouldn't be using .-. If you know the code is safe to run, and have a bit more complex code that jumps thru many different libraries, executing and walking thru the code line by line helps a tone, What you maybe reverse engineering maybe just one file, but seeing the external lib calls and filling in the values returned just like in the video rlly helps put the puzzle together, (of course gotta give props to browser Dev tools - when walking thru code can just hover over any variable to see the current value inside)
@zhanezar
@zhanezar Ай бұрын
this was so good to watch, the quality of production is amazing
@enthusi
@enthusi Ай бұрын
Obfuscated code is fun.. JavaScript not so much my cup of tea 😊 Thanks for presenting these topics!
@dodgecoates8760
@dodgecoates8760 Ай бұрын
How can you like obfuscated code but not love javascript?
@No0Vad
@No0Vad 29 күн бұрын
Sometimes you get lucky with Auto-play enabled, that's how I found this video which I enjoyed. Love the retro feeling!
@JosephSaintClair
@JosephSaintClair 19 күн бұрын
Thank you for covering IOCCC. Something I always encourage aspiring programmers to try for themselves first the personal challenge and discipline. 🙏
@rafaelskt4ever
@rafaelskt4ever Ай бұрын
Love your Serial Experiments: Lain theme
@ShannonWare
@ShannonWare Ай бұрын
JS tools tip for NPP won you a subscriber! Thanks a million, my favourite app just got better XD
@amaurytacosfr
@amaurytacosfr Ай бұрын
Loved the SeL theme ❤️
@plato4ek
@plato4ek Ай бұрын
20:39 and other places: you don't need to write the "console.log", just expression itself is okay.
@drwhitewash
@drwhitewash Ай бұрын
Exactly, the console will output the result of that expression, instead of those "undefined"s.
@kxmode
@kxmode 24 күн бұрын
I think she's being extra careful to isolate the output to the console
@plato4ek
@plato4ek 24 күн бұрын
@@kxmode this won't help isolate anything. Everything inside the "console.log()" is being evaluated anyway.
@DavidLindes
@DavidLindes 23 күн бұрын
@@kxmode the thing is, she's _in_ the "console" (in other languages, it might get called the REPL -- Read, Evaluate, Print (in a Loop)), so, as plato4ek says, it's not really isolating anything in this context. What she's doing isn't harming anything, of course, it's just also not buying much when done interactively. (But it would be very useful if recording it to a file and running it with node, say, so, perhaps it's a habit born from such intentions in prior work.)
@kxmode
@kxmode 22 күн бұрын
@@DavidLindes hmm... good to know. always thought console.log was a way to sandbox the code. A good note to self.
@Dorff_Meister
@Dorff_Meister Ай бұрын
That was a lot of fun. Thanks!
@trex6142
@trex6142 20 күн бұрын
Well done and super interesting!
@justinmiller3349
@justinmiller3349 Ай бұрын
Incredibly educational, and great production value. You're killing it. Keep it up!
@BillyC
@BillyC Ай бұрын
This was sick to watch!
@thefrub
@thefrub Ай бұрын
Your production value is through the roof, you've got the whole room setup, the multiple cameras, the old Mac aesthetic. And you're great at this! This is amazing
@davidburns8113
@davidburns8113 Ай бұрын
I'm ecstatic I just found this channel! TYSM for sharing skills and methods like this on the Internet for free! Also the little corgi made my day!!
@hgeldenhuys
@hgeldenhuys Ай бұрын
Laurie, your channel is genius
@Sasha-Good
@Sasha-Good 25 күн бұрын
Amazing ReveЯsive design on channel 💯
@BlackHermit
@BlackHermit Ай бұрын
A true gem for anyone passionate about unraveling the mysteries! This step-by-step approach to deobfuscating and reverse engineering an obfuscated JavaScript file is not just informative, but downright thrilling. I love how Laurie invites viewers to follow along with the truth provided. Simply invaluable! 💻🔍✨
@timolff9239
@timolff9239 Ай бұрын
what's the point of using chatgpt to comment on a youtube video?
@BlackHermit
@BlackHermit Ай бұрын
@@timolff9239 ChatGPT's English is better than mine. I couldn't have possibly articulated my feelings towards this video better than it did!
@AEONIC_MUSIC
@AEONIC_MUSIC Ай бұрын
But everyone can tell it's AI so we think it's fake. Also I think claude opus has more natural speaking
@BlackHermit
@BlackHermit Ай бұрын
@@AEONIC_MUSIC Well, it is fake in the sense that I was not the one who worded everything, but I did tell ChatGPT what I felt!
@giamagg4602
@giamagg4602 Ай бұрын
Thanks, Laurie! You are awesome
@giamagg4602
@giamagg4602 Ай бұрын
In line 75 of your js code, the console log response is 1 and you put 0. Anyway you have obtained the IP and completely gutted the malware. I love it 28:42 console. log(0x1b9 * 0x9 + 0x2354 + 0x1 *-0x32d4) 1
@ZioYuri78
@ZioYuri78 Ай бұрын
This is so fascinating, thanks for sharing your competence!
@martin1b
@martin1b Ай бұрын
I love this. It's amazing how obfuscation can make it look so much more complex than it really is.
@mendodsoregonbackroads6632
@mendodsoregonbackroads6632 Ай бұрын
Yea the way it all boiled down at the end to just a few lines of code was pretty cool.
@ronen124
@ronen124 25 күн бұрын
28:37 aquí escribiste '0' en lugar de '1' por error . Esta fue una ingeniería inversa interesante y fascinante para dicho malware, muchas gracias por compartir tu análisis.
@Futureretrobix
@Futureretrobix Ай бұрын
I love your videos Laurie!!!!
@zzord
@zzord 16 күн бұрын
Well done! Quick tip: You don't need to use console.log to evaluate expressions. You can just paste the expression and evaluate it directly. Also, at 22:56, you could evaluate the whole object in one step, instead of doing one function call at a time.
@marshallgraphic
@marshallgraphic Ай бұрын
Excellent work!
@robertivaneinarsson5868
@robertivaneinarsson5868 Ай бұрын
Fantastic! I would love a video from you breaking down the XZ backdoor thing.
@Ron55O
@Ron55O Ай бұрын
That's what I thought at first too😅
@nceban2136
@nceban2136 15 сағат бұрын
Not a big fan of Lain, but still can appreciate the committment to the intros
@penguin_m1rage
@penguin_m1rage Ай бұрын
This video is so awesome omg 🤯
@jcKobeh
@jcKobeh Ай бұрын
The horizontally flipped front face camera has had me wondering exactly what you were doing for a couple of videos. Did you decide to do it to have your face "looking into" the direction of the code? Now that I'm commenting, I'll just say: I love the graphic overlays and design you use. And the way you present these videos, just clear voice, no music, well prepared, and sitting still and straight throughout the whole thing, My respects. I know how all of these kind of things are invisible to most when done correctly, but cheers, it doesn't go un-appreciated.
@Hwyadylaw
@Hwyadylaw 3 күн бұрын
Webcams and front-facing phone cameras tend to mirror the image to emulate.. well, a mirror, since that's how most people are used to seeing themselves.
@jcKobeh
@jcKobeh 3 күн бұрын
@@Hwyadylaw but that footage looks like a real camera, not a webcam, which is why it seems to me like it must be an active decision and not just the default thing the camera does.
@Kakerate2
@Kakerate2 12 күн бұрын
i love seeing this done in n++!
@damien__j
@damien__j Ай бұрын
I see LaurieWired and I click
@timewarptrio11
@timewarptrio11 24 күн бұрын
Well explained!
@GerbenWijnja
@GerbenWijnja Ай бұрын
Nice work, Laurie. Of course there are many shortcuts possible all over the place, but that also increases the risk of errors. Refactoring piece by piece provides more confidence that you're on the right track. Is the original code available somewhere? I couldn't find it with just the hash.
@Hidamarisketchfan5
@Hidamarisketchfan5 Ай бұрын
Interesting video. Whenever I hear about Javascript malware, I'm glad and fortified in my use, of Noscript. Sure, Noscript isn't 100% secure, but it's far better than executing everything that may come with some random website.
@stacksmasherninja7266
@stacksmasherninja7266 Ай бұрын
not even sure whether that's an actual linux distro but it looks 10/10
@DanielRodriguez-ff5cs
@DanielRodriguez-ff5cs Ай бұрын
great video! The corgi app ❤
@pdelong42
@pdelong42 24 күн бұрын
It's been a few decades since I've done anything serious on Windows, so I was frankly surprised to learn that ActiveX is still a thing. We all thought it was a gaping security hole from day one, and I thought Microsoft was at-least disabling it by default now. Glad to see that it's deprecated (according to Wikipedia).
@rossquaresmini5834
@rossquaresmini5834 Ай бұрын
Spettacolo ❤🎉😮
@rne1223
@rne1223 Ай бұрын
Editing is amazing, but the content is off the charts. Amazing work 👏👏👏
@BlitzkriegHD
@BlitzkriegHD Ай бұрын
Your background / set is a trip dude. Is all that retro gear real or are you using a greenscreen of some sort? If it’s real then you’ve got a really cool collection of… old computer stuff hahah
@lauriewired
@lauriewired Ай бұрын
It's all real :)
@pulserudeus7968
@pulserudeus7968 8 күн бұрын
love it!
@Saru-Dono
@Saru-Dono 2 күн бұрын
Notepad ++ and MS Edge is such a based combo for development
@glaf1488
@glaf1488 22 күн бұрын
I did this my job 1 or 2 years ago. Javascript is used a everywhere and obfuscated in very horrendous way. For me it was fun and even did some helper to avoid wasting too much time. As you cannot do this automaticaly, you have to do a lot of staff manually, finding the obfuscation fonctions is the most annoying part.
@dungeonman.fromyoutube
@dungeonman.fromyoutube Ай бұрын
Awesome video
@ganeshkale9665
@ganeshkale9665 Ай бұрын
Please make videos for securing web applications with best practices that will me most appreciated 😊.
@canetabisturi
@canetabisturi Ай бұрын
Laurie are you planning on making a video on the xz backdoor? Would love to hear your thoughts!!
@shpleegames
@shpleegames Ай бұрын
At 23:06... If your ultimate goal was to get the _0x502708 map object, couldn't you have executed that block in your dev tools and just printed it out? Especially since you know the method was just outputting string characters and was not inherently malicious. Please correct me if there is something I'm overlooking here. Just a gut reaction at a potential time save Also this video was beautiful and I love your editing style. This is incredibly educational and I have subscribed. Looking forward to seeing more of your thought process.
@thmo_
@thmo_ Ай бұрын
yeah, would have been a time save to let it write the commands up to the last two map entries actually using the activexobject.
@epiphaner
@epiphaner Ай бұрын
I'm guessing she did it this way to keep it safe and accessible for the viewers. A viewer might not be savvy enough to distinguish which parts of the code are safe to execute and which are not. That would also explain why she would go through de-obfuscating the first two methods before using them even though they, to me, obviously had no code that could do harm. A viewer following the workflow in this video will not get their system infected.
@thmo_
@thmo_ Ай бұрын
True, also in general the way she did it was very verbose to follow along and replicate with other code, so this will be more helpful to viewers.
@markdempsey1088
@markdempsey1088 Ай бұрын
Interesting video.
@Taaz2
@Taaz2 Ай бұрын
Awesome stuff! May I kindly request any links to the desktop wallpaper you use? I need it haha
@jesustorrejon1509
@jesustorrejon1509 Ай бұрын
laurie great video but i think you could get the values for the deofuscated object faster using a js debugger, might want to exec that in a safe enviroment tho
@maelstrom57
@maelstrom57 Ай бұрын
To rename variables, it's much safer to do it in VSCode using the F2 shortcut. With a string replace, you risk modifying any piece of code (like a string) that happens to contain the variable name without being a reference to it.
@climatechangedoesntbargain9140
@climatechangedoesntbargain9140 Ай бұрын
just any JS Editor with variable rename functionality
@iro4201
@iro4201 Ай бұрын
I see you are no fan of probability.
@maelstrom57
@maelstrom57 Ай бұрын
@@iro4201 Nah I ain't a simp for it.
@iro4201
@iro4201 Ай бұрын
@@maelstrom57 Better simp for speed, than for fear of making a mistake though.
@quicktastic
@quicktastic Ай бұрын
Good use of f/1.4 (or so) and probably 85mm.
@ancestrall794
@ancestrall794 16 күн бұрын
Really interesting. I wonder if the ActiveXObject function can be used for XSS in pentesting / CTFs
@walksinrain
@walksinrain 16 күн бұрын
This is some seriously cool stuff. Subscribed :) I loved seeing when the camera angle changed, it seems you really do have a bunch of old monitors buzzing away back there haha!
@nikhilkadiyan4847
@nikhilkadiyan4847 24 күн бұрын
eval function is also used a lot in obfuscation
@gerakore8948
@gerakore8948 24 күн бұрын
use ctrl-h to go straight to replace instead of crtl-f. great video though. i didnt know about the tools though and just used replace ; with ; ... you would also want to set search mode to extended
@zZGzHD
@zZGzHD Ай бұрын
banger style
@jackgude3969
@jackgude3969 23 күн бұрын
That was the coolest thing ever
@grawuka6900
@grawuka6900 Ай бұрын
Hello, i would recommend to the people watching this video to use a JavaScript AST manipulation tool for this kind of de-obfuscation. Just with "copy propagation" and "constant folding" you will have much done in one go. The switch technique however is maybe not handled as it would require loop unroll.
@plato4ek
@plato4ek Ай бұрын
which tool would you recommend?
@grawuka6900
@grawuka6900 Ай бұрын
Babel is nice, there are a lot of transformations(plugins) available and you can write custom plugins as you encounter new obfuscation patterns.
@plato4ek
@plato4ek Ай бұрын
@@grawuka6900 OK, thanks. But I thought you meant an interactive tool.
@thechosenoneforyou
@thechosenoneforyou 5 күн бұрын
Love you videos! It would be super cool if you made a discord server with a mobile security focus!
@yanniammari1491
@yanniammari1491 Ай бұрын
how much did you spend on your setup/room it looks cool af
@tommyhuffman7499
@tommyhuffman7499 21 күн бұрын
very cool channel!
@rayhere7925
@rayhere7925 21 күн бұрын
I simp. ....Okay, back to the video 🙏
@pavloburyanov5842
@pavloburyanov5842 24 күн бұрын
For "repetitive" part: you can grep needed invocations and process them in the loop. PS: I believe notepad++ supports macros to make life easier.
@world-9644
@world-9644 Ай бұрын
Never thought I’d see a serial experiments lain reference in a coding video.
@shiiswii4136
@shiiswii4136 Ай бұрын
the camera frame/vibe of the room reminds me of bill nye the science guy i think it feels very 90s
@onlymyrailgununknown2960
@onlymyrailgununknown2960 12 күн бұрын
Your kind is rare. I am working on a C decompiler, and will soon deal with optimized binaries and later with static obfuscation methods and I am thinking on how to automate deobfuscation. For JS it looks quite possible. You are basically doing some kind of constant propagation (with the help of runtime logs) and give sensible names. If someone would write a high-level JS optimizer, you could also get rid of unneccessary/pointless dead code, control flow, ... then its done. Basically adapting the GCC/CLANG optimization tricks to JS would make no JS secure.
@ArjanvanVught
@ArjanvanVught Ай бұрын
Thank you #LaurieWired
Asuka Roasts Your Sorting Algorithms
17:38
LaurieWired
Рет қаралды 69 М.
Dynamically Analyzing Linux Black Basta Ransomware
24:33
LaurieWired
Рет қаралды 16 М.
蜘蛛侠这操作也太坏了吧#蜘蛛侠#超人#超凡蜘蛛
00:47
超凡蜘蛛
Рет қаралды 48 МЛН
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 15 МЛН
Telegram Has Been Hacked
8:40
John Hammond
Рет қаралды 196 М.
Trying to actually program something that isn't Leetcode
17:08
projectMaria
Рет қаралды 38 М.
Software Reverse Engineering with Ghidra
31:08
CAE in Cybersecurity Community
Рет қаралды 10 М.
Will Ada Replace C/C++?
44:57
Tsoding
Рет қаралды 66 М.
How to Smuggle Data out of the Network with Ping
16:54
Plaintext Packets
Рет қаралды 113 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
A Competition for Unreadable Code?
12:33
LaurieWired
Рет қаралды 111 М.
The Biggest Lie In HTML
23:56
Theo - t3․gg
Рет қаралды 87 М.
i cant stop thinking about this exploit
8:40
Low Level Learning
Рет қаралды 232 М.
Malware development 101: Creating your first ever MALWARE
28:00
Leet Cipher
Рет қаралды 165 М.
Купите ЭТОТ БЮДЖЕТНИК вместо флагманов от Samsung, Xiaomi и Apple!
13:03
Thebox - о технике и гаджетах
Рет қаралды 53 М.
Он Отказался от БЕСПЛАТНОЙ видеокарты
0:40
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,7 МЛН