Monsta FTP license cracker (open source)

I wanted to set up a monsta FTP server on my dashboard and have it automatically log me in to the server, but I learned that you needed a Buisness license, which costs MONEY. I couldnt let this stand. Luckily they ppl at this company had written their entire codebase in uncompiled, unobfuscated PHP and were trying to claim it as “not open source”. I wanted some practice cracking software for future piracy stuff so, two days and 34 php.net tabs later and I made this script.

Also as an extra slap in the face, I wrote it in the monsta FTP editor.

<pre style="background-color:#ffffff;">
<span style="color:#323232;"><?php
</span><span style="font-style:italic;color:#969896;">//Set mftp path and website url here because idk how to read CLI args in PHP
</span><span style="color:#323232;">$mftp_path </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">"/srv/mftp/"</span><span style="color:#323232;">;
</span><span style="color:#323232;">$website_url </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">""</span><span style="color:#323232;">;
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">//New license data
</span><span style="color:#323232;">$license_data </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">'{"email":"[email protected]","purchaseDate":1688671221,"expiryDate":4844344881,"version":"2.10.4","isTrial":false,"licenseVersion":3,"productEdition":1}'</span><span style="color:#323232;">;
</span><span style="color:#323232;">$encrypted_license_data </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">''</span><span style="color:#323232;">;
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">//Keypair
</span><span style="color:#323232;">$private_key </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">openssl_pkey_new</span><span style="color:#323232;">();
</span><span style="color:#323232;">$public_key_pem </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">openssl_pkey_get_details</span><span style="color:#323232;">($private_key)[</span><span style="color:#183691;">'key'</span><span style="color:#323232;">];
</span><span style="color:#323232;">$public_key_path </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$mftp_path </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"application/api/resources/monsta_public.pem"</span><span style="color:#323232;">;
</span><span style="color:#62a35c;">file_put_contents</span><span style="color:#323232;">($public_key_path, $public_key_pem);
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">//Encrypt license data
</span><span style="color:#62a35c;">openssl_private_encrypt</span><span style="color:#323232;">($license_data, $encrypted_license_data, $private_key);
</span><span style="color:#323232;">$output </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">base64_encode</span><span style="color:#323232;">($encrypted_license_data);
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">//Disarm license checker
</span><span style="color:#323232;">$affiliate_checker_path </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$mftp_path </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"application/api/licensing/AffiliateChecker.php"</span><span style="color:#323232;">;
</span><span style="color:#323232;">$affiliate_replacement_url </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$website_url </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"/application/api/licensing/true.php"</span><span style="color:#323232;">;
</span><span style="color:#323232;">$affiliate_replacement_path </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$mftp_path </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"application/api/licensing/true.php"</span><span style="color:#323232;">;
</span><span style="color:#323232;">$affiliate_contents </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">file_get_contents</span><span style="color:#323232;">($affiliate_checker_path);
</span><span style="color:#323232;">$affiliate_contents_new </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">str_replace</span><span style="color:#323232;">(</span><span style="color:#183691;">"https://www.monstaftp.com/_callbacks/affiliate-tracker.php"</span><span style="color:#323232;">, $affiliate_replacement_url, $affiliate_contents);
</span><span style="color:#62a35c;">file_put_contents</span><span style="color:#323232;">($affiliate_checker_path, $affiliate_contents_new);
</span><span style="color:#62a35c;">file_put_contents</span><span style="color:#323232;">($affiliate_replacement_path, </span><span style="color:#183691;">"<?php echo true; ?>"</span><span style="color:#323232;">);
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">//Turn ugly license into handsome license
</span><span style="color:#323232;">$monsta_license_start </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">"===== MONSTA LICENSE START (INCLUDING THIS LINE) ====="</span><span style="color:#323232;">;
</span><span style="color:#323232;">$monsta_license_end </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">"===== MONSTA LICENSE END (INCLUDING THIS LINE) ====="</span><span style="color:#323232;">;
</span><span style="color:#323232;">$monsta_license </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">""</span><span style="color:#323232;">;
</span><span style="color:#323232;">$monsta_count </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">0</span><span style="color:#323232;">;
</span><span style="color:#323232;">$monsta_substr </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">substr</span><span style="color:#323232;">($output, </span><span style="color:#0086b3;">0</span><span style="color:#323232;">, </span><span style="color:#62a35c;">strlen</span><span style="color:#323232;">($monsta_license_start));
</span><span style="font-weight:bold;color:#a71d5d;">while </span><span style="color:#323232;">(</span><span style="color:#62a35c;">strlen</span><span style="color:#323232;">($monsta_substr) </span><span style="font-weight:bold;color:#a71d5d;">=== </span><span style="color:#62a35c;">strlen</span><span style="color:#323232;">($monsta_license_start)) {
</span><span style="color:#323232;">    $monsta_substr </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#62a35c;">substr</span><span style="color:#323232;">($output, $monsta_count, </span><span style="color:#62a35c;">strlen</span><span style="color:#323232;">($monsta_license_start));
</span><span style="color:#323232;">    $monsta_count </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$monsta_count </span><span style="font-weight:bold;color:#a71d5d;">+ </span><span style="color:#62a35c;">strlen</span><span style="color:#323232;">($monsta_license_start);
</span><span style="color:#323232;">    $monsta_license </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$monsta_license </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"</span><span style="color:#0086b3;">rn</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#323232;">$monsta_substr;
</span><span style="color:#323232;">}
</span><span style="color:#323232;">$monsta_license </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">$monsta_license_start </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#323232;">$monsta_license </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"</span><span style="color:#0086b3;">rn</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#62a35c;">substr</span><span style="color:#323232;">($output, $monsta_count) </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#323232;">$monsta_license_end </span><span style="font-weight:bold;color:#a71d5d;">. </span><span style="color:#183691;">"</span><span style="color:#0086b3;">rn</span><span style="color:#183691;">"</span><span style="color:#323232;">;
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">//Done
</span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"Here is your license </span><span style="color:#0086b3;">rn</span><span style="color:#183691;">"</span><span style="color:#323232;">;
</span><span style="color:#62a35c;">echo </span><span style="color:#323232;">$monsta_license;
</span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"Paste it into upgrade menu </span><span style="color:#0086b3;">rn</span><span style="color:#183691;">"</span><span style="color:#323232;">;
</span><span style="color:#323232;">?>
</span>

I didnt really test it that well so comment if it needs edits

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • wartaberita
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • TheResearchGuardian
  • Ask_kbincafe
  • KbinCafe
  • Testmaggi
  • Socialism
  • feritale
  • oklahoma
  • SuperSentai
  • KamenRider
  • All magazines