# -*- coding: utf-8 -*- import jjencode from jjdecode import JJDecoder a = '"/><script>alert("i love hacking~")</script>' enc = jjencode.JJEncoder(a).encoded_text print(enc) #print(JJDecoder(enc).decode())
import sys import jjencode print "Injecting copyright info code ..." print "Destination file: " + sys.argv[1] file1 = open(sys.argv[1]) file1_contents = file1.read() # Injecting copyright info code # ig.system.context.save(); # ig.system.context.font = "20px Arial"; # ig.system.context.textBaseline = "bottom"; # ig.system.context.textAlign = "right"; # ig.system.context.fillText('This version is for demo purposes only. Copyright MarketJS.com', ig.system.width-1, ig.system.height-1); # ig.system.context.restore(); uglifiedFunction = 'ig.system.context.save(),ig.system.context.fillStyle="#FFFFFF",ig.system.context.font="20px Arial",ig.system.context.textBaseline="bottom",ig.system.context.textAlign="right",ig.system.context.fillText("For demo purposes only. Copyright MarketJS.com",ig.system.width-1,ig.system.height-1),ig.system.context.restore();' jjencodedText = jjencode.JJEncoder(uglifiedFunction, '_').encoded_text new_code = file1_contents.replace('this.COPYRIGHT;', jjencodedText) file1.close() file2 = open(sys.argv[1], 'w') file2.write(new_code) file2.close()
import sys import jjencode print "Injecting domainlock breakout attempt info code ..." print "Destination file: " + sys.argv[1] file1 = open(sys.argv[1]) file1_contents = file1.read() # Injecting domainlock breakout attempt info code # window.dba = {}; # window.dba.dlwf = function(){ # window.alert("Attempted software breach. Please contact [email protected]"); # }; # Object.freeze(window.dba); dbaf = 'window.dba={},window.dba.dlwf=function(){window.alert("Attempted software breach. Please contact [email protected]")},Object.freeze(window.dba);' jjencodedText = jjencode.JJEncoder(dbaf, '_').encoded_text new_code = file1_contents.replace('this.DOMAINLOCK_BREAKOUT_ATTEMPT;', jjencodedText) file1.close() file2 = open(sys.argv[1], 'w') file2.write(new_code) file2.close()
import sys import jjencode print "Injecting framebreaker ..." print "Destination file: " + sys.argv[1] file1 = open(sys.argv[1]) file1_contents = file1.read() # Inject framebreaker code restricted_domain = 'marketjs.com' # should be https://marketjs.com, once SSL is up framebreaker = 'if(document.referrer.indexOf(\"' + restricted_domain + '\")<0){if(top!=self){console.log(\"showing anti-piracy layer ...\");$(\"#anti-piracy\").show();top.location.replace(self.location.href);}}' jjencodedText = jjencode.JJEncoder(framebreaker, '_').encoded_text new_code = file1_contents.replace('this.FRAMEBREAKER;',jjencodedText) file1.close() file2 = open(sys.argv[1],'w') file2.write(new_code) file2.close()