Urgent: Malicious Script Injection Only on HTTPS (Cloudflare Issue?)

Hey everyone, I'm facing a serious issue with my website, and I need help identifying the cause. - My website is https://americadelsurtours.com and it's behind Cloudflare. - When accessing the site over HTTPS, a malicious script is injected into the page. - The script attempts to fetch data from data-seed-prebsc-1-s1.bnbchain.org and runs obfuscated JavaScript. - However, when accessing http://americadelsurtours.com (without HTTPS), the script does not appear. - I have checked my Nginx configuration, SSL certificates, and server files (/var/www/html/index.html), and the script is not present on my server. - Running curl -s -k https://americadelsurtours.com | grep -i "data-seed-prebsc-1-s1.bnbchain.org" confirms that the script is being injected only when using Cloudflare HTTPS. This makes me suspect that either Cloudflare is compromised, or there is an unknown misconfiguration. Has anyone encountered this issue before? Any ideas on how to fully debug and fix this?
87 Replies
Idle
Idle•2d ago
blockchain 🤔 ah, that makes more sense
Laudian
Laudian•2d ago
Start by checking if the malicious code is also injected if you visit your site directly, without Cloudflare.
Idle
Idle•2d ago
have you tried using a different browser / disabling browser plugins? I've visited your site and couldn't find any script that made requests to the bnb chain
andrew_nyr
andrew_nyr•2d ago
yeah, I would check your website files and whatever its hosted on.
ian
ianOP•23h ago
UPDATE: I removed Cloudflare by setting my A and CNAME records to DNS Only and installing Certbot to continue using HTTPS. Once I did that, the malicious CAPTCHA disappeared, so the problem was Cloudflare. I don't know how the attacker did this. Check the update How do I check that? Sorry, I'm not a pro at using Cloudflare. I just use it because, at least for me, it's easier to set up HTTPS using their DNS. Because now my other webiste that also uses Cloudflare: https://incremental.store has the same malicious CAPTCHA.
Laudian
Laudian•23h ago
Run a trace and see if anything is active for a normal request to your domain: https://dash.cloudflare.com/?to=/:account/trace
ian
ianOP•23h ago
Which HTTP Method?
Laudian
Laudian•23h ago
both?
ian
ianOP•23h ago
No description
Laudian
Laudian•23h ago
oh, that. get
ian
ianOP•23h ago
Okay
ian
ianOP•23h ago
No description
Laudian
Laudian•23h ago
yup, a worker
ian
ianOP•23h ago
That's for the https://incremental.store webiste that has the captcha thing rn
Laudian
Laudian•23h ago
First, add 2FA, then change your password, then change your API key, then delete any API tokens
ian
ianOP•23h ago
No description
Laudian
Laudian•23h ago
and then delete the worker
ian
ianOP•23h ago
I already have 2FA thats weird Yesterday I had to change my password, but already have the 2FA enabled... I'll add a new 2FA then
Laudian
Laudian•23h ago
check your computer for malware Do you use Wordpress with the Cloudflare addon?
ian
ianOP•23h ago
No, I don't use Wordpress I've been checking my server logs, there are a bunch of bots trying to exploit Wordpress stuff
Laudian
Laudian•23h ago
Also, check that you don't have any members in your account
ian
ianOP•23h ago
162.158.38.54 - - [13/Mar/2025:05:41:16 +0000] "GET /wp-includes/pomo/autoload_classmap.php HTTP/1.1" 301 178 "-" "-"
162.158.38.54 - - [13/Mar/2025:05:41:16 +0000] "GET /wp-includes/pomo/autoload_classmap.php HTTP/1.1" 301 178 "-" "-"
Okay I will run also the Windows Security thing to check for malware.
Laudian
Laudian•23h ago
Did you maybe fall for the scam captcha that is now running on your website and paste the code into your cmd? That's how these things spread like 99% of the time
ian
ianOP•23h ago
I didnt touch the captcha I change the 2FA again, and the password I changed it yesterday
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
I also changed the API keys and deleted the API tokens
Laudian
Laudian•23h ago
Did you check for any Members in your account?
ian
ianOP•23h ago
How do I check that? Sorry I don't know that much about Cloudflare as I said...
Laudian
Laudian•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
Only me
Laudian
Laudian•23h ago
And below that, account api tokens?
ian
ianOP•23h ago
Thats the workers
No description
Laudian
Laudian•23h ago
below members look on my screenshot
ian
ianOP•23h ago
No description
Laudian
Laudian•23h ago
I'd also check your computer with malwarebytes
ian
ianOP•23h ago
I'm installing it rn Also how do I delete the worker?
Laudian
Laudian•23h ago
Click on the worker, go to settings and then at the bottom
ian
ianOP•23h ago
Should I first run the malwarebytes test and windows defender test or it doesnt matter?
ian
ianOP•23h ago
No description
Laudian
Laudian•23h ago
I don't think the order matters^^
ian
ianOP•23h ago
I deleted the worker and now the captcha is gone Thank you so much Laudian
Laudian
Laudian•23h ago
Can you check in the audit log when and how it was created? https://dash.cloudflare.com/?to=/:account/audit-log
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
That is so weird Ive been sick so I didnt even login to Cloudflare yesterday, not even this week The attacker did all that without even loggin into my account
ian
ianOP•23h ago
The only active sessions are mine
No description
Laudian
Laudian•23h ago
Can you check if any custom hostnames have been added to your account? Account home -> select domain -> ssl/tls -> custom hostnames
ian
ianOP•23h ago
I'm from Peru btw
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
I check all my domains, no custom hostnames
Laudian
Laudian•23h ago
I'm still looking through the logs btw. There's a lot about rulesets updates. Can you check in the Rules section if you see anything? Also Security --> WAF -> Custom Rules and Managed Rules
ian
ianOP•23h ago
No rules added
No description
ian
ianOP•23h ago
No custom rules added
No description
Laudian
Laudian•23h ago
And in the tools section of WAF?
ian
ianOP•23h ago
I have old IP bans from my old game back in 2019
No description
Laudian
Laudian•23h ago
anyone except you using the computer?
ian
ianOP•23h ago
Only me Thats why its so weird Because I was using 2FA with the Google Authenticator app
Laudian
Laudian•23h ago
phone is up to date?
ian
ianOP•23h ago
This guy did that
No description
ian
ianOP•23h ago
Yes I'm using the iPhone 15 with iOS 18.3.2 Also the app is up to date I'm not even sure how this guy did that
Laudian
Laudian•23h ago
I've seen quite a few sites with these fake captchas in the last few days. With 2FA enabled, I think the most likely cause is malware on your pc, however it may have gotten there.
ian
ianOP•23h ago
The scan finished No malware in my pc
ian
ianOP•23h ago
No description
ian
ianOP•23h ago
No description
ian
ianOP•22h ago
That is so weird... Theres probably a Cloudflare security breach they didn't notice yet
Laudian
Laudian•22h ago
Nothing found doesn't mean there is nothing 😉
ian
ianOP•22h ago
Should I run the Windows Defender Complete Scan then?
Laudian
Laudian•22h ago
That's very very unlikely. In that case, you'd have a lot more sites infected, and also very large sites.
ian
ianOP•22h ago
Well that's true But then how did he got access to my Cloudflare account, created the worker and do all that stuff
Laudian
Laudian•22h ago
They probably had access to your computer at one point.
ian
ianOP•22h ago
That's impossible
Laudian
Laudian•22h ago
Not physically, via malware.
ian
ianOP•22h ago
But I've been sick, I didn' use the computer for like 3 days they sent me this message yesterday i didnt get into any malicious link or smthing thats why i don't understand how they did this im still sick i have fever rn lol im using the pc now because i had to fix this issue
Laudian
Laudian•22h ago
The routes were created march 10th, so it started 3 days ago. Might have gotten the access sooner than that.
ian
ianOP•22h ago
My fever started sunday sunday was 9 so yeah 3-4 days without getting into the pc
Laudian
Laudian•22h ago
They could've gotten access weeks ago, copied the API key and only acted now.
ian
ianOP•22h ago
I have weekly windows defender scans i dont have malicius reports tho
Laudian
Laudian•22h ago
As @Leo said, it's quite common that the malware deletes itself after doing what it's supposed to do to avoid detection.
ian
ianOP•22h ago
Any ideas guys how can I prevent this in the future? I think I should start using a vm lol
database
database•5h ago
maybe it's physical access to your computer.. some random guy who knows your discord sending your a first message with that kind of info is something sketchy I noticed: 1 server in common in your screenshot.. it's possible you shared a screenshot of your api token or something to that server that might've been misused... you need to censor the sensitive info when sharing a screenshot and manually destroy those tokens as an extra security act just go complete paranoid when it comes to this

Did you find this page helpful?