Hint for HELP

I have rooted the machine with public exploits but would like to do it with node js and credentials way. Can anyone please nudge me in right direction?