• Privacy Policy
  • Terms of Use
  • DMCA
Friday, July 1, 2022
Wollito.com Blog
Buy Advantage Token on Wollito.com
  • Home
  • Trending News
    • Crypto News
    • Product News
    • Company News
  • New Coin Listings
    • ERC20
    • BEP20
    • TRON20
    • ICO Events
  • Blockchain
  • Learn
  • MarketCap
No Result
View All Result
  • Home
  • Trending News
    • Crypto News
    • Product News
    • Company News
  • New Coin Listings
    • ERC20
    • BEP20
    • TRON20
    • ICO Events
  • Blockchain
  • Learn
  • MarketCap
No Result
View All Result
Wollito.com Blog
No Result
View All Result

Analyzing a WooCommerce Credit Card Skimmer

May 19, 2022
in ICO Events
Reading Time: 8 mins read
A A
0
Analyzing a WooCommerce Credit Card Skimmer
0
SHARES
5
VIEWS
ShareShareShareShareShare

The number of credit card skimmers targeting WooCommerce websites has skyrocketed over the past year, and threat actors have become increasingly creative in the different ways they obfuscate their payloads to avoid traditional detection.

During a recent investigation for an infected WordPress website, we discovered an obfuscated credit card stealer hiding amongst the website’s theme files which was exfiltrating stolen credit card details from the WooCommerce plugin.

Let’s dive into how we identified the skimmer and analyze its malicious behavior.

Identification

During our remediation efforts, we often receive hints that point towards the issue before we actually begin our investigation. These clues range from a new client receiving reports of suspicious credit card activity after customers made a purchase on their website to remote monitoring detecting suspicious or malicious code on the website.

When we launched this specific investigation, the site’s customers were complaining about warnings from their antivirus software whenever attempting to place a checkout — which was more than enough information to give a good starting place for our search.

Injection Loads Malicious Code in html5.js File

Through monitoring our browser’s network traffic while simulating a checkout on the compromised website, we were able to determine that a malicious file had been placed in their Porto theme at ./wp-content/themes/porto/js/html5.js.

This html5.js file isn’t loaded by the Porto theme by default, and upon further inspection we found that the initiating code was injected into another originally legitimate file which the site was using — custom.js.

By combining the concatenated variables, we determined that the injection was loading the malicious skimming code stored in the html5.js file. The skimmer code was present here in a minified and obfuscated form to prevent detection.

Analysis of Malicious Skimmer Code

Perhaps the most common first step when approaching any sample is to “beautify” it by running the code through a formatter to help break up large chunks of text into more palatable, traditionally formatted code. After reformatting the infection, it’s much easier to see each individual function and how they interact.

For example, here is part of the malicious sample prettified in our text editor:

Prettified malicious JavaScript code
Prettified malicious JavaScript code

This formatted sample contains 165 lines, and now that it’s readable we’re able to begin ascertaining the exact functionality of the malware.

Deobfuscating the Malicious Code

The majority of this sample consists of functions, meaning the first deobfuscation step is to find the first function call. At the end of the file, we can see that the malware both adds an event listener and calls the PictureSetImagesResult() function.

Malware adds an event listener and calls the PictureSetImagesResult() function

This addEventListener() method is native JavaScript; the first argument being the event it’s listening for and the second argument being the action that is executed.

Both the addEventListener() and PictureSetImagesResult() functions are using the webkitAllselectElement array, which is defined a little over halfway into the sample:

We can create a simple loop in your preferred scripting language of choice to replace all array calls with their proper values. For example:

PHP script to replace webkitAllselectElement items in the original file
PHP script to replace webkitAllselectElement items in the original file

With the array values defined, we can get a better understanding of what the setOnCollectionChar() function may do. Nearly every obfuscated string is passed to it, indicating that the purpose is to translate it to executable code — one of several such functions in this sample.

Translating strings to executable code

Looking at the function code, we can confirm this is the case: it will build and return a new string that is generated based on the input.

Building a new string generated from input

We just need to run this function against each input and save that result back into their respective place to continue decoding the sample. To accomplish this, I replicated the decoding function and used preg_replace_callback() to find and replace each value:

Decode function replication

With the values replaced, we’re starting to be able to get a clearer picture of how the malware is functioning. The addEventListener() method is binding the queryDefaultNameOptions() function to the click event — meaning it will execute any time the page is clicked by the website visitor.

click event executed on page

Fetching & Encoding User Input Values

The malware also makes use of two functions, PictureOneImagesResult() and PictureSetImagesResult(), which executes localStorage.getItem() and localStorage.setItem() respectively. To further simplify our code, we can replace these functions with the localStorage statements.

localStorage statements

The function queryDefaultNameOptions() checks if the clicked element is a button, span, or div, and if so calls the queryDefaultNameSelect() function, passing along arguments consisting of any input field’s value or select input’s text.

validating user payment information

When queryDefaultNameOptions() calls the queryDefaultNameSelect() function, it will validate the given data and convert it to a readable format of “elementName->elementValue|”. It then uses queryDefaultNameInput() to set the pictureInSelectElement variable, which will contain — along with every other field on the page — our sensitive billing details and credit card information, as seen below.

Credit card details set in pictureInSelectElement variable

With the pictureInSelectElement variable set, queryDefaultNameOptions() will then encode it via the use of the setStartCollectionInt() and setAllCollectionChar() functions and then pass it to the PictureGetImagesResult() function.

Exfiltrating Stolen Credit Card Information

While the malware thus far has focused on fetching and encoding the credit card data, the PictureGetImagesResult() function is where the exfiltration actually occurs.

PictureGetImagesResult() function responsible for exfiltrating stolen credit card information
PictureGetImagesResult() function responsible for exfiltrating stolen credit card information

This PictureGetImagesResult() function sets the j variable to point to a remote file “hxxps://fagun[.]com.bd/js/flash/ico.png”, which is hosted on what looks to be a compromised Magento installation. The e variable is appended to the request, which is where our credit card details and other skimmed information are provided.

The malware then creates a new image object and sets the source to ico.png, which initiates an HTTP request to the remote website.

At this point, the attacker has successfully skimmed and exfiltrated our data. We can confirm this by viewing the network log while simulating a purchase from the website’s checkout page.

simulating a purchase

Conclusion & Prevention Steps

WooCommerce is steadily overtaking Magento in terms of eCommerce market share, and we can reliably expect continued increases in the prevalence of skimming attacks on these WordPress websites.

As such, it’s of critical importance that steps are taken to secure your environment and establish website monitoring so that the moment any issues occur, they can be tracked and remediated as soon as possible. To mitigate risk, site owners should ensure that their plugins are routinely updated and that two-factor authentication is enabled on their WordPress website.

If you’re looking for an simple automated solution, the Sucuri website firewall can help detect and block attacks just like this one before it even has a chance to reach your website — and, when paired with our website monitoring, notifies you immediately of any potential security issues or indicators of compromise.

Credit: Source link

ShareTweetSendPinShare
Previous Post

Successes and Failures of Brand Marketing in the Metaverse

Next Post

Crypto exchange FTX expands into US stock trading

Related Posts

Rochdale News | Sport News | Dylan launches £1k appeal to fight at world kickboxing championships
ICO Events

Rochdale News | Sport News | Dylan launches £1k appeal to fight at world kickboxing championships

July 1, 2022
Jervois Commits Further US$3.6 Million to ICO Drilling
ICO Events

Jervois participates in U.S. Department of Commerce SelectUSA panel

June 30, 2022
Lloyd v Google – Supreme Court Judgment – report and impacts on data protection and mass claims in the UK
ICO Events

FinTech Global FS Regulatory Round-up – w/e 24 June 2022

June 30, 2022
Best games on PS Plus, Extra, and Premium
ICO Events

Best games on PS Plus, Extra, and Premium

June 29, 2022
Next Post
Crypto exchange FTX expands into US stock trading

Crypto exchange FTX expands into US stock trading

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Weekly Updates

How Forex and Crypto is taking off post-Covid-19: What the future holds

How Forex and Crypto is taking off post-Covid-19: What the future holds

June 25, 2022
YouTube investigator suggests Justin Sun’s USDD could be a Ponzi scheme

YouTube investigator suggests Justin Sun’s USDD could be a Ponzi scheme

June 25, 2022
Analyst says crypto winter has changed crypto companies

Analyst says crypto winter has changed crypto companies

June 27, 2022
How Clash of Coins is Moving Forward, Changing Trends and Market Issues Aside 

How Clash of Coins is Moving Forward, Changing Trends and Market Issues Aside 

June 25, 2022
The Allegation That Alex Mashinsky Tried To Flee The US Is False, Says Celsius

The Allegation That Alex Mashinsky Tried To Flee The US Is False, Says Celsius

June 28, 2022
Paxos Standard, Stasis Euros Token And Mehracki Tokens Compete To Be The Best Cryptocurrency

Paxos Standard, Stasis Euros Token And Mehracki Tokens Compete To Be The Best Cryptocurrency

June 25, 2022

Resources

  • Live Chat
  • Contact Us
  • API Documentation
  • Developers
  • Coin Listing

Wollito Cyprus

Yiannis Court, Neophytos Nikolaides Street 61, Paphos, Cyprus. 8011

Company

  • Our Terms
  • Privacy Policy
  • Our Fees
  • Coin Information
  • Cookies

Wollito Seychelles

House of Francis, Office 303, Ile Du Port, Mahe, Seychelles.

Socials

  • Facebook
  • Twitter
  • Instagram
  • Reddit
  • LinkedIn
© 2021 Wollito.com All Rights Reserved - All Rights Reserved.
No Result
View All Result
  • Home
  • Trending News
    • Crypto News
    • Product News
    • Company News
  • New Coin Listings
    • ERC20
    • BEP20
    • TRON20
    • ICO Events
  • Blockchain
  • Learn
  • MarketCap

© 2021 - blog.wollito.com - All rights reserved!

  • bitcoinBitcoin (BTC) $ 19,334.85 0.53%
  • ethereumEthereum (ETH) $ 1,051.80 1.7%
  • tetherTether (USDT) $ 1.00 0.04%
  • usd-coinUSD Coin (USDC) $ 1.00 0.19%
  • bnbBNB (BNB) $ 217.26 2.9%
  • binance-usdBinance USD (BUSD) $ 1.00 0.26%
  • xrpXRP (XRP) $ 0.314626 0.48%
  • cardanoCardano (ADA) $ 0.447393 0.16%
  • solanaSolana (SOL) $ 32.29 0.47%
  • dogecoinDogecoin (DOGE) $ 0.065196 0.86%
  • polkadotPolkadot (DOT) $ 6.68 2.68%
  • daiDai (DAI) $ 1.00 0.1%
  • tronTRON (TRX) $ 0.065019 2.85%
  • shiba-inuShiba Inu (SHIB) $ 0.000010 0.08%
  • leo-tokenLEO Token (LEO) $ 5.99 0.14%
  • wrapped-bitcoinWrapped Bitcoin (WBTC) $ 19,301.12 0.27%
  • avalanche-2Avalanche (AVAX) $ 16.01 2.66%
  • staked-etherLido Staked Ether (STETH) $ 1,011.33 1.45%
  • matic-networkPolygon (MATIC) $ 0.461860 3.63%
  • litecoinLitecoin (LTC) $ 50.89 1.16%
  • ftx-tokenFTX (FTT) $ 24.48 3.25%
  • okbOKB (OKB) $ 11.98 0.72%
  • crypto-com-chainCronos (CRO) $ 0.113090 1.15%
  • chainlinkChainlink (LINK) $ 6.02 1.57%
  • stellarStellar (XLM) $ 0.109334 2.37%
  • nearNEAR Protocol (NEAR) $ 3.27 1.53%
  • uniswapUniswap (UNI) $ 4.80 0.55%
  • cosmosCosmos Hub (ATOM) $ 7.35 3.15%
  • algorandAlgorand (ALGO) $ 0.304915 4.12%
  • moneroMonero (XMR) $ 112.90 1.15%
  • ethereum-classicEthereum Classic (ETC) $ 14.48 0.46%
  • bitcoin-cashBitcoin Cash (BCH) $ 100.18 0.63%
  • theta-fuelTheta Fuel (TFUEL) $ 0.047430 3.16%
  • chain-2Chain (XCN) $ 0.084310 2.73%
  • vechainVeChain (VET) $ 0.022145 1.3%
  • flowFlow (FLOW) $ 1.47 1.19%
  • the-sandboxThe Sandbox (SAND) $ 1.09 8.41%
  • fraxFrax (FRAX) $ 0.999598 0.14%
  • apecoinApeCoin (APE) $ 4.41 0.94%
  • hedera-hashgraphHedera (HBAR) $ 0.061836 0.01%
  • decentralandDecentraland (MANA) $ 0.847356 2.6%
  • internet-computerInternet Computer (ICP) $ 5.20 0.66%
  • true-usdTrueUSD (TUSD) $ 1.00 0.02%
  • filecoinFilecoin (FIL) $ 5.31 1.46%
  • tezosTezos (XTZ) $ 1.35 3.1%
  • theta-tokenTheta Network (THETA) $ 1.15 0.14%
  • axie-infinityAxie Infinity (AXS) $ 13.90 0.91%
  • elrond-erd-2Elrond (EGLD) $ 50.38 5.03%
  • bitcoin-svBitcoin SV (BSV) $ 51.78 3.48%
  • heliumHelium (HNT) $ 9.08 0.8%
  • kucoin-sharesKuCoin (KCS) $ 9.63 0.91%
  • eosEOS (EOS) $ 0.904694 0.82%
  • paxos-standardPax Dollar (USDP) $ 1.00 0.09%
  • compound-usd-coincUSDC (CUSDC) $ 0.022637 0.16%
  • makerMaker (MKR) $ 895.30 4.83%
  • aaveAave (AAVE) $ 56.09 1.77%
  • neutrinoNeutrino USD (USDN) $ 0.983036 0.75%
  • huobi-btcHuobi BTC (HBTC) $ 19,320.44 0.36%
  • bittorrentBitTorrent (BTT) $ 0.00000080 0.26%
  • huobi-tokenHuobi (HT) $ 4.80 0.65%
  • tensetTenset (10SET) $ 3.81 5.39%
  • iotaIOTA (MIOTA) $ 0.261517 1.3%
  • usddUSDD (USDD) $ 0.995380 0.27%
  • ecasheCash (XEC) $ 0.000038 0.26%
  • quant-networkQuant (QNT) $ 52.45 2.3%
  • compound-ethercETH (CETH) $ 21.10 1.58%
  • the-graphThe Graph (GRT) $ 0.091536 0.24%
  • klay-tokenKlaytn (KLAY) $ 0.231275 2.11%
  • zcashZcash (ZEC) $ 52.82 0.78%
  • radixRadix (XRD) $ 0.063698 3.02%
  • fantomFantom (FTM) $ 0.247009 1.15%
  • gatechain-tokenGate (GT) $ 4.08 2.41%
  • pax-goldPAX Gold (PAXG) $ 1,796.40 1.82%
  • basic-attention-tokenBasic Attention (BAT) $ 0.399450 9.51%
  • neoNEO (NEO) $ 8.17 0.11%
  • cdaicDAI (CDAI) $ 0.022071 0.14%
  • zilliqaZilliqa (ZIL) $ 0.038549 4.18%
  • thorchainTHORChain (RUNE) $ 1.79 0.53%
  • blockstackStacks (STX) $ 0.392816 2.52%
  • wavesWaves (WAVES) $ 5.15 3.5%
  • chilizChiliz (CHZ) $ 0.095047 0.36%
  • havvenSynthetix Network (SNX) $ 2.19 0.26%
  • arweaveArweave (AR) $ 9.79 12.18%
  • stepnSTEPN (GMT) $ 0.814023 2.19%
  • defichainDeFiChain (DFI) $ 0.890026 2.42%
  • bitdaoBitDAO (BIT) $ 0.426141 1.48%
  • amp-tokenAmp (AMP) $ 0.009872 15.94%
  • loopringLoopring (LRC) $ 0.375480 1.12%
  • enjincoinEnjin Coin (ENJ) $ 0.486907 1.16%
  • tether-goldTether Gold (XAUT) $ 1,840.53 0.85%
  • dashDash (DASH) $ 41.38 0.68%
  • terrausdTerraClassicUSD (USTC) $ 0.043183 18.02%
  • pancakeswap-tokenPancakeSwap (CAKE) $ 3.02 2.97%
  • kusamaKusama (KSM) $ 47.65 2.61%
  • evmosEvmos (EVMOS) $ 2.00 3.3%
  • galaGala (GALA) $ 0.052138 0.76%
  • kavaKava (KAVA) $ 1.76 1.66%
  • ecomiECOMI (OMI) $ 0.001402 6.26%
  • celoCelo (CELO) $ 0.837185 0.14%
  • 1inch1inch (1INCH) $ 0.660258 7.07%