←back to thread

1369 points universesquid | 7 comments | | HN request time: 0.001s | source | bottom
Show context
joaomoreno ◴[] No.45170585[source]
From sindresorhus:

You can run the following to check if you have the malware in your dependency tree:

`rg -u --max-columns=80 _0x112fa8`

Requires ripgrep:

`brew install rg`

https://github.com/chalk/chalk/issues/656#issuecomment-32668...

replies(8): >>45171142 #>>45171275 #>>45171304 #>>45171841 #>>45172110 #>>45172189 #>>45174730 #>>45175821 #
cgijoe ◴[] No.45171275[source]
Sorry, I am unfamiliar with ripgrep. Is this simply scanning for the string `_0x112fa8`? Could we do the same thing with normal grep -r?
replies(2): >>45171316 #>>45171334 #
1. skrebbel ◴[] No.45171316[source]
yes. ripgrep just does it faster, is all.
replies(2): >>45173163 #>>45173857 #
2. hinkley ◴[] No.45173163[source]
Make it work, make it right, make it fast.

For security checks, the first 2 out of 3 is just fine.

replies(1): >>45174327 #
3. nothrabannosir ◴[] No.45173857[source]
But also respects .gitignore by default so I’m not sure you want to use ripgrep to scan your node_modules
replies(2): >>45174032 #>>45174067 #
4. Fishkins ◴[] No.45174032[source]
For others who didn't know, the -u flag in the OP's command makes it so ripgrep _will_ search files even if they're gitignored
replies(1): >>45177926 #
5. AkshatJ27 ◴[] No.45174067[source]
Isn't the intended behaviour of original comment checking the node_modules folder for the "infected" string.
6. Aeolun ◴[] No.45174327[source]
Sure, but if you can get the last for free, why not?
7. postalcoder ◴[] No.45177926{3}[source]
-u searches through ignored files

-uu searches through ignored and hidden files (eg dotfiles)

-uuu searches through ignored, hidden, and binary files (ie everything)