DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • How to Build Scalable Mobile Apps With React Native: A Step-by-Step Guide
  • Scaling Mobile App Performance: How We Cut Screen Load Time From 8s to 2s
  • Interrupt Testing: Bulletproof Your App for the Real World
  • In-App Browsers in Mobile Apps: Benefits, Challenges, Solutions

Trending

  • A Complete Guide to Modern AI Developer Tools
  • Automating Data Pipelines: Generating PySpark and SQL Jobs With LLMs in Cloudera
  • Customer 360: Fraud Detection in Fintech With PySpark and ML
  • Understanding IEEE 802.11(Wi-Fi) Encryption and Authentication: Write Your Own Custom Packet Sniffer
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. Thinking Like a Hacker: Commanding a Bot Army of Compromised Twitter Accounts

Thinking Like a Hacker: Commanding a Bot Army of Compromised Twitter Accounts

How can an attacker exploit leaked credentials? In this new series, we try to answer this question by imagining plausible attack scenarios. Third case: Twitter API keys are used to pump an altcoin.

By 
C.J. May user avatar
C.J. May
·
Nov. 05, 22 · Analysis
Likes (1)
Comment
Save
Tweet
Share
6.6K Views

Join the DZone community and get the full member experience.

Join For Free

About This Series

Last time, a malicious hacker got access to Poor Corp’s internal git repositories and used an open-source secret scanner to find and steal AWS keys. Using the stolen keys, the hacker gained deep access to Poor Corp’s major SaaS services and stole all their customer data.

In this series, we will dissect not just what an attacker can do to get access to credentials, but also what they would do after getting that initial access. We will walk through a different threat scenario in each part of the series and tell stories of malicious hackers that are either true, based on a true incident, or reasonably theoretical.

Crypto Scammers

In today’s scenario, we have a threat actor that isn’t your run-of-the-mill, business-hacking, ransomware operation. This threat actor is after a large amount of money being dumped into the cryptocurrency market. Although most people wouldn’t recognize it, we are living in the peak age of stolen money. Ransomware aside, cybercriminals in the crypto space have made off with more money than the largest bank heists in history — all without the personal risk that comes with robbing a bank.

The crypto hacker in this scenario doesn’t make their money by exploiting crypto exchanges though… They have strong programming skills and an understanding of how the cryptocurrency market reacts to various events. Rather than go after the big fish, this criminal makes their money by scamming cryptocurrency investors.

To dupe people on a large scale, our crypto hacker finds random alternative crypto coins (altcoins) and uses the classic pump-and-dump methodology to steal money from investors. How do they find and trick these people? With disinformation operations.

Social media has been a big tool in the tool belt for our criminal, and for years they have been creating automated accounts to pump up engagement on videos and messages promoting their targeted altcoins. This has worked okay for them, but people are starting to get better at recognizing when there are no serious backers of these cryptocurrencies. To give their altcoin promotions more credibility, the crypto hacker decides to work on finding ways to hijack legitimate accounts.

Leaky Mobile Apps

To find account credentials, the crypto hacker decides to search for new credentials rather than purchase leaked databases on the dark web. They know that lots of software developers hard-code secrets like API keys and private keys in their code, so there’s lots of opportunity to find new accounts. Unfortunately for the hacker, though, many of the obvious places to find these secrets are already scrutinized. Instead of looking at common places like open-source code repositories, the hacker decides to go searching for API keys embedded in mobile apps.

First, the hacker writes a script to crawl the Internet Archive’s Android APKs, and then the script will extract all the files from each APK. From there, the hacker writes a script to scan each app with an open-source tool called TruffleHog. After days of scanning, organizing, and validating the results, the crypto hacker has found over 3,000 apps leaking Twitter secrets. How did those get there?

When a developer of an app is testing the Twitter API, they end up saving strings related to their account’s authentication to certain files that the app uses. Sometimes, the developer forgets to clean up these files before deploying the app!

Hijacked Accounts Love Crypto!

Now the hacker has a bunch of legitimate accounts that they can use to promote their chosen altcoin. The scammer identifies their next target, an altcoin called BrrCoin, and they purchase a few thousand dollars worth of BrrCoin. Then, the crypto hacker begins to spread information about it on a bunch of platforms. On Twitter, the hacker uses the hijacked accounts to periodically like tweets about BrrCoin, leading followers of the hijacked accounts to be exposed to it.

Over time, the crypto hacker gets a lot of people to hear about and invest in BrrCoin. Eventually, the price of BrrCoin has gone up so much that the hacker’s initial investment has grown 100 times over what they put in. At that point, the crypto hacker pulls out of BrrCoin by transferring it with a more stable cryptocurrency, and they get ready for their next pump and dump operation.

Lessons Learned

Social media is a powerful tool for spreading information, and, like any tool, it can be used for good or for bad. If you write software that interacts with social media in any way, it’s important to protect yourself and your users from potential leakage of secrets. Scammers and nation states are always looking for ways to be more effective at disinformation operations on social media, and getting access to a bunch of real accounts would be a gold mine for these kinds of threat groups.

Analyzing the technical side of the story, our crypto hacker could find Twitter OAuth secrets by scanning tens of thousands of archived Android apps. Because the developers of the app forgot to clean up the secrets they generated when they were testing the Twitter API, the hacker was able to find their authentication strings and access the accounts that were used for testing.

Most developers know to use things like .gitignore to ensure sensitive files don’t end up in the git history. However, they might forget that those files still exist when testing happens, and they may even get caught in the build and shipped with the app! If you automate testing and then build your app and the environment is the same for both steps, you should consider if there are any artifacts from your tests that could end up in your build. This doesn’t just apply to Android apps. Docker container builds are another potential avenue where this could happen on. If your Dockerfile contains the line COPY . . to copy application files to the container, you should make sure that the directories you are copying only contain the files you expect them to. The moral of the story is this: always be conscious of where your secrets are stored and how they are used.

Hacker mobile app

Published at DZone with permission of C.J. May. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Build Scalable Mobile Apps With React Native: A Step-by-Step Guide
  • Scaling Mobile App Performance: How We Cut Screen Load Time From 8s to 2s
  • Interrupt Testing: Bulletproof Your App for the Real World
  • In-App Browsers in Mobile Apps: Benefits, Challenges, Solutions

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!