Browser bot with VGS proxy
Sample of using Puppeteer with VGS alias to auto fill web forms
This demo app demonstrates a use case using users' redacted credentials or credit card information to autofill web forms.
- Installed Node.js and NPM
- Account on verygoodsecurity.com
- Sample website https://browserbot-demoform.herokuapp.com/
- Go to VGS dashboard, create a new vault in your organization
- Setup a new outbound route with wildcard
.*
as upstream to allow all traffic - Setup a default inbound route and use it to create aliases for your test credentials
- Copy the sandbox TLS certificate in
Code snippets
to your app folder
- Clone this repository and go to the folder
- Install all dependencies
npm install
- Replace the code below with your TLS cert path, vault id and proxy user credentials:
page.on('request', interceptedRequest => {
const tunnelingAgent = tunnel.httpsOverHttp({
ca: [ fs.readFileSync('sandbox-cert.pem')],
proxy: {
host: '<vault it>.sandbox.verygoodproxy.com',
port: 8080,
proxyAuth: '<username>:<password>'
}
});
const options = {
uri: interceptedRequest.url(),
method: interceptedRequest.method(),
headers: interceptedRequest.headers(),
agent: tunnelingAgent,
body: interceptedRequest.postData()
};
- Replace the code below with your VGS aliases for test personal credentials
await page.type('input[name=username]', 'tok_sandbox_8rVSERS1WKtC2H3a2mJABY');
await page.type('input[name=email]', '[email protected]');
await page.type('input[name=password]', 'tok_sandbox_t3TqVDEgkkhofo8BA6xraz');
- Replace the code below with your 2Captcha token
puppeteer.use(recaptchaPlugin({
provider:{
id: '2captcha',
token: '<2Captcha token>'
},
visualFeedback:true
}));
- Turn on logger in VGS dashboard
- Run
node puppeteer-demoform.js
- Go to logger and filter requests by method
post
to find the request to submit that form
- Use
Secure this payload
in logger and establish filters for sensitive fields in payload
- Run the app again and find the corresponding request to submit the form in logger, you will find the VGS aliases have been revealed to the original credentials