Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app 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
| var CryptoJS = require("crypto-js");//replace thie with script tag in browser env | |
| //encrypt | |
| var rawStr = "hello world!"; | |
| var wordArray = CryptoJS.enc.Utf8.parse(rawStr); | |
| var base64 = CryptoJS.enc.Base64.stringify(wordArray); | |
| console.log('encrypted:', base64); | |
| //decrypt | |
| var parsedWordArray = CryptoJS.enc.Base64.parse(base64); |
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
| // We support the GET, POST, HEAD, and OPTIONS methods from any origin, | |
| // and allow any header on requests. These headers must be present | |
| // on all responses to all CORS preflight requests. In practice, this means | |
| // all responses to OPTIONS requests. | |
| const corsHeaders = { | |
| "Access-Control-Allow-Origin": "*", | |
| "Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS", | |
| "Access-Control-Max-Age": "86400", | |
| } |
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
| Question Answer Source Metadata SuggestedQuestions IsContextOnly Prompts QnaId | |
| need to expose an application To expose your application hosted on a Web App or Virtual Machine you will need to submit a request for an Application Gateway entry. Please click [HERE](https://pgcloud.atlassian.net/wiki/spaces/CO/pages/738656294/How+to+Request+for+Application+Gateway+Setup+or+Modification+for+External+Facing+Applications) to follow the instructions to raise the request. d01cd46f-3253-4738-be14-d7a998e4594d-KB.tsv [] false [] 23 | |
| expose app To expose your application hosted on a Web App or Virtual Machine you will need to submit a request for an Application Gateway entry. Please click [HERE](https://pgcloud.atlassian.net/wiki/spaces/CO/pages/738656294/How+to+Request+for+Application+Gateway+Setup+or+Modification+for+External+Facing+Applications) to follow the instructions to raise the request. d01cd46f-3253-4738-be14-d7a998e4594d-KB.tsv [] false [] 23 | |
| setup public application To expose your application hosted on a We |
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 mongodb = require("mongodb") | |
| const MongoClient = mongodb.MongoClient; | |
| let _db; | |
| // Connect to the database | |
| const mongoConnect = (cb) => { | |
| MongoClient.connect( | |
| //connection string here | |
| { useUnifiedTopology: true } |
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
| async.parallel([ | |
| function(callback) { | |
| setTimeout(function() { | |
| console.log('Task One'); | |
| callback(null, 1); | |
| }, 200); | |
| }, | |
| function(callback) { | |
| setTimeout(function() { | |
| console.log('Task Two'); |
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
| [ | |
| { | |
| "questionId": "C614B380-8DF9-11EA-AB12-0800200C9A66", | |
| "question": "You want to be able to store application logs from your Kubernetes Cluster for more than a year to be able to analyze them and monitor frequency errors. What is your best option to stream and store logs?", | |
| "subQuestion": "", | |
| "domain": "cdmp-gcp-simulated-exam", | |
| "difficulty": "medium", | |
| "answers": { | |
| "a": "Configure Cloud Logging for your cluster and do nothing because logs are stored forever.", | |
| "b": "Use pubsub to send the logs to a subscriber and process them using DataProc", |
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
| How to ssh from google cloudshell to google GCP VM instances | |
| - even instances with blocked ssh and instances with no public IP address | |
| Why is this different than using ssh from any other terminal? | |
| A. The IP address of the cloudshell is not known in advance and the ranges are not published. | |
| B. Changes to the /root/.ssh folder will be lost when the instance stops. | |
| C. There is no way to add a tag to the cloudshell | |
| D. The cloudshell has no Service Account but uses the identity of the person logging into the GCP web cloud console. | |
| E. Tm GCP VM might not even have a public IP address and might be in a different subnet. |
NewerOlder