8
u/ilova-bazis Aug 19 '24
I have recently deployed a nodejs app with expressjs into production, when i was checking logs I saw these random URI request attempts, should i be concerned?
20
u/hecktarzuli Aug 19 '24
I see all of those too, multiple times a day. Assuming your stuff is locked down, no biggy. We also put in some WAF rules to block any url that doesn’t match our known patterns so they won’t even hit the servers.
2
u/ilova-bazis Aug 20 '24
thanks, I will try putting WAF
7
u/arndissler Aug 20 '24
You should harden your app in the first place. Reject unexpected or malformed input, have proper authentication, set up CORS header, do not expose more information than needed (like the .gitignore and .vscode files), add proper rate limiting (when you're exposing an API), update the dependencies regularly, do not provide source maps in production, things like this.
The WAF will just stop script kiddies from being too invasive with their attempts. Depending on your application, a WAF can be close to useless, e.g. when your app use unsecured APIs or expose sensitive information, then a WAF will likely not cover you.
2
u/hecktarzuli Aug 20 '24
100%. Since our app is SSR, we just wanted to reduce the load on the servers with super-old urls being crawled by bots (>10 year old urls) as well as hacker garbage like above. WAF cannot be the only line of defense!
3
u/implAustin Aug 20 '24
Based on your screenshot, I wouldn't be worried. These kinds of scanners map applications and check for vulnerabilities and info leaks. Though a few things to watch out for:
Scanners are sometimes used to hide real attacks in a flood of noise. If some of the IPs that generate this scanner traffic start intelligently/systematically interacting with any of the APIs you developed, then it's time for a WAF and monitoring.
Watch your "login" endpoint for high volumes (10k-100m) of failed logins. Credential stuffing attacks are one of the most common "front door" attacks - where botnets send tons of login attempts from giant databases of stolen usernames/passwords. Depending on your industry, they can be high impact if successful.
1
u/ilova-bazis Aug 20 '24
thanks for the advice, yes I am researching WAF right now and how can I deploy it.
6
u/anti-state-pro-labor Aug 19 '24
You shouldn't be concerned that someone is targeting you specifically, no. These happen to any server connected to the internet as far as I can tell.
But you should make sure no random person can request sensitive data from your server.
3
u/Booty_Bumping Aug 19 '24
There's a good chance that none of the exploits you've received so far work on your node webserver. Stuff gets patched, and these scanners are looking for extremely old unpatched software.
1
u/astralradish Aug 19 '24
They're also checking to see if the developer exposed any server side config on public paths.
12
u/Dark_zarich Aug 20 '24 edited Aug 20 '24
I'm surprised no one shared what you can use to mitigate that
fail2ban - simple tool for logs scanning and automatic ban for many common patterns like useragent, behaviors etc
crowdsec - does the same basically but is crowdsourced, someone bans a bot and it will be banned for your server too if they hit you
Also do note that what you see on the picture is not the whole picture, be sure they also try to enter your server by ssh. Implement some basic security measures like: create a user and work under that, disable password ssh auth use certificate instead, change the default ssh port to something custom only you know, close with firewall (ufw or something else) ports you don't use.
Technically you can just google "how to secure my vps" and there is a lot of articles about that
3
u/ilova-bazis Aug 20 '24
thank you 🙏, I will look into those tools. My container is being the nginx and only the https port is exposed. But nevertheless I will double check all other ports as well.
3
u/Interesting-Frame190 Aug 19 '24
Yup, and looking at the logs, you responded 200 to ?rest_route=/wp/v2/users. If that's not you, they may have gotten some info and a better attack angle. Google gives a nice description, but I know nothing about WordPress, so I may be off, but better investigate and be safe.
2
u/ilova-bazis Aug 20 '24
that's just the root path, no query params are being parsed.
3
u/Interesting-Frame190 Aug 20 '24
You are correct. Maybe it's just me, but I'd slap a 400 response on anything that query params are passed, but not in use to keep things sorted. I may also be alone on this and my coworkers might hate my API design for being so rigid with expected functionality.
1
200
u/lord2800 Aug 19 '24
Welcome to being on the internet. You should expect to see a lot of junk requests like this all the time.
-9
u/kilobrew Aug 20 '24
I highly suggest you look into a web application firewall of some type. Or just IP ban Eastern Europe, China, and Africa….
5
u/computerbeam Aug 20 '24
Not sure why you guys got downvoted, if you aren’t running something that targets networks outside of your country, it’s pretty safe to block countries that are known to have the most bot nets and hackers. Unfortunately for them.
0
u/aamfk Aug 20 '24
I block Russia, China. Should I really block most of Eastern Europe? Can you provide more specific recommendations?
2
u/kilobrew Aug 20 '24
I was probably over generalizing. You hit the two big ones. But if your site isn’t meant for people outside of a specific country there’s no harm in blocking the other countries.
0
u/captain_obvious_here Aug 20 '24
Or just IP ban Eastern Europe, China, and Africa….
Ever heard of VPNs?
2
u/kilobrew Aug 20 '24
For the most part bot nets and other scanners like these don’t bother with vpns.
If you don’t believe me setup a server and give it a go. You’ll see scanning traffic like this drop like a rock.
1
u/captain_obvious_here Aug 20 '24
For the most part bot nets and other scanners like these don’t bother with vpns.
How exactly can you be sure of that?
2
u/kilobrew Aug 20 '24
Because I’ve been running servers and looking at logs for 20+ years and can tell you that traffic like what the OP sees above drops to basically nothing when you ban China and Russia by IP range.
10
Aug 20 '24
[removed] — view removed comment
7
u/kilobrew Aug 20 '24
I’m not saying that at all. I have no idea what type of service he is providing.
If you are providing an international service outside the US then by all means, use something more robust like AWS/CloudFlare WAF in addition to something like fail2ban.
If you are running a website for a local bar in Colorado you probably don’t need or want people from outside the US accessing it.
It just makes security sense. Don’t expose yourself unless you have a reason to.
2
u/nubbins4lyfe Aug 20 '24
Agreed. If you aren't doing business in a country, no need to allow traffic from that country. Pretty simple logic.
86
40
u/bossmonchan Aug 19 '24
This is super common, it's just bots doing scans for easy targets or known vulnerabilities. It's not a person specifically trying to hack your server in particular.
As another commenter said, if you're using AWS, you can enable WAF on your load balancer to block these kinds of requests before they ever reach your server.
If you're managing your own server then make sure everything is configured properly, you keep up to date with patches, ufw is enabled, etc, all the basic security procedures should prevent all of this from doing any damage.
20
u/Fusseldieb Aug 19 '24
Basically yes. They are automatic attempts at finding vulnerable software. They also happen on other ports, such as 22. Bots do scan the whole IPv4 range just to find exploitable things. That's why you should always run up-to-date software, and not use easy passwords.
Get used to this gargabe. It happens multiple times a day, every day. Welcome to the internet.
26
u/takitus Aug 19 '24
Yeah, they’re looking for know weaknesses. I generally track these kinds of things and IP ban whoever is sending them
15
u/Kept_ Aug 19 '24
For how long? Say IP tables rotate and you just banned an unfortunate person who has now inherited a banned IP
30
14
u/Misclee Aug 19 '24
Or a library, school or office building where hundreds of devices could be sharing the same public IP.
6
7
u/takitus Aug 19 '24
You don’t have to make it a permanent ban. If you’re concerned you can always limit the ban duration
4
u/aamfk Aug 20 '24
Yes, fail2ban does a lot of that automatically.
Then I use 'Limit Logins Renewed' or whatever it's called. Anyone using the default username 'admin' gets blocked indefinitely.
24
5
u/ChiefDetektor Aug 19 '24
Yes and no. Your url is being inspected for vulnerabilities and credentials. If nothing is found nothing happens.
1
u/Head-Antelope2059 Aug 20 '24
which library are u using for logging these attempts?
1
2
u/poope_lord Aug 19 '24
I too had the same issue a month back when I deployed my app on AWS. Then my manager explained to me that there are bots running which continuously check for newly registered domains on the DNS. Then they run their scripts and basically check if they're able to scavenge something out of your tech.
Basically checking for leaked creds, environment variables, api keys, farming crypto, etc. These requests will die down as your domain gets older.
2
u/anengineerandacat Aug 19 '24
Pen test for sure, we have an internal app called "WhiteHat" that does a similar function and it's just thousands of junk requests.
Whatever is hitting your site/service there is trying to figure out more about tech stack and identify capabilities it can use against it.
Just track IPs and URLs accessed and start blocking IPs that have high counts to totally junk URLs.
2
1
1
u/johannes1234 Aug 19 '24
This is the reality on the net - many people running tools to randomly connect to hosts and testing for vulnerable software. A minority of those with good intentions (warning host operators about running outdated software), vast majority are dumb script kiddies just running a script to find exploitable stuff, extremely few for targeted attacks.
1
u/baronas15 Aug 19 '24
This is the reason you keep your servers up to date. Various bots scan the internet all day, that's completely normal. They're mostly harmless, but if you have some critical vulnerabilities.... Well, good luck then
1
u/Such_Caregiver_8239 Aug 19 '24
I wouldn’t say « hacking » this is just bots, basically scanning things for vulns.
I wouldn’t worry too much about it, if you are though, simply use a WAF. It should filter 99% of them as well as more serious « hacking » attempts
3
u/Key_Direction7221 Aug 20 '24
Some newbies don’t know what a WAF is. So to make easier: Web Application Firewall - aka Firewall.
1
Aug 20 '24
It sure looks like reconnaissance… but like mentioned before they are very generic and are therefore probably from one of thousands of bots looking for vulnerabilities.
There are probably ways to block these so your server doesn’t waste resources on them. I hope…
1
u/SnowConePeople Aug 20 '24
I route every /admin or /wp-login with a redirect to a rick roll.
2
u/ohcibi Aug 20 '24
Ignoring the fact that you have been rickrolled to use Wordpress
3
u/SnowConePeople Aug 20 '24
Who said i use WP? I set those urls because i know they are the most targeted because of WP.
1
u/Majestic_Fan5360 Aug 20 '24
It’s a reconnaissance attack likely from a bot crawling the internet: https://www.esecurityplanet.com/threats/how-hackers-use-reconnaissance/
1
1
u/alexs_90 Aug 21 '24
It is "normal". It happens all the time. For any new public domain, setup server+logs and in "5-10 min" you will see a lot of this.
2
1
448
u/thusman Aug 19 '24 edited Aug 21 '24
Some bots basically scan the internet 24/7 for accidently exposed credentials or other helpful data. If they find something, the hacking may commence. I setup a fake
/wp-loginroute and capture their login attempts and passwords for fun and insights.(Edit: it's actually
/wp-login.phpand the redirect/wp-admin).