Skip to content

Instantly share code, notes, and snippets.

View nicoandmee's full-sized avatar
🏠
Working from home

Nico Kokonas nicoandmee

🏠
Working from home
View GitHub Profile
@nicoandmee
nicoandmee / startup.sh
Created March 26, 2019 03:09
puppeteer on ubuntu linux ami (xvfb setup) + cloudwatch metric for autoscaling
#!/bin/bash
export HOME=/home/ubuntu
export PM2_HOME=$HOME/.pm2
export NODE_ENV=production
export NPM_TOKEN="TOKEN"
export LOCAL_HOSTNAME=$(curl http://169.254.169.254/latest/meta-data/local-hostname)
export PUBLIC_HOSTNAME=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
TIMEZONE=$(echo "America/Chicago
@nicoandmee
nicoandmee / puppeteer-bot.js
Created March 26, 2019 20:29
disguisePage - undetectable puppeteer
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 3000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Mobile Intel(R) 4 Seri
@nicoandmee
nicoandmee / dist-proxy.js
Created March 28, 2019 08:31
dist-proxy master
#!/usr/bin/env node --harmony
const crypto = require('crypto');
const fs = require('fs');
try {
fs.writeFileSync('proxy-manager.key', crypto.randomBytes(24).toString('hex'), { flag: 'wx' }, (err) => {});
} catch (e) {
// ignore error
}
function activeXDetect(e) {
return componentVersion = document.body.getComponentVersion("{" + e + "}", "ComponentID"),
null != componentVersion ? componentVersion : !1
}
function stripIllegalChars(e) {
for (t = "",
e = e.toLowerCase(),
i = 0; i < e.length; i++)
"\n" != e.charAt(i) && "/" != e.charAt(i) && "\\" != e.charAt(i) ? t += e.charAt(i) : "\n" == e.charAt(i) && (t += "n");
return t
@nicoandmee
nicoandmee / upwork-distill.js
Created April 14, 2019 05:31
upwork browser fingerprint (v1)
"use strict";
void 0 === window.console && (window.console = {
log: function() {},
debug: function() {}
});
void 0 === window.localStorage && (window.localStorage = {
getItem: function() {},
setItem: function() {}
});
"undefined" == typeof JSON && (JSON = {
@nicoandmee
nicoandmee / guard.js
Last active August 29, 2023 09:53
cvs browser fingerprinting
! function e(t, r, n) {
function i(o, s) {
if (!r[o]) {
if (!t[o]) {
var c = "function" == typeof require && require;
if (!s && c) return c(o, !0);
if (a) return a(o, !0);
var d = new Error("Cannot find module '" + o + "'");
throw d.code = "MODULE_NOT_FOUND", d
@nicoandmee
nicoandmee / citimobile-state-machine.js
Last active January 14, 2020 05:34
Citibank Bot Detection Sample
(function(a) {
var b = {},
c = {};
var d = Function.prototype.bind,
e = Function.prototype.call,
f = e.bind(d, e),
g = f(Function.prototype.apply),
h = f(Array.prototype.push),
i = f(Array.prototype.slice),
const storageGet = chrome.storage.local.get;
const TimeoutDelay = 2 * 1000;
let allowInjection = true;
let storedObjectPrefix = getRandomString();
let storageElems;
let notificationTimeoutID;
if (window.frameElement != null && window.frameElement.sandbox != null) {
@nicoandmee
nicoandmee / clickElementHandle.js
Last active September 16, 2020 12:32
clickElementHandle - puppeteer click without bot detect
async clickElementHandle(handle, {
selector,
} = {}) {
return puppeteerErrorRetry(async () => {
if (!handle) {
this.logger.warn('clickElementHandle-empty-handle', await this.dump({
selector,
}));
return false;
}
@nicoandmee
nicoandmee / citibank-fingerprint.js
Created June 5, 2019 10:30
browser fingerprinting by citi
/***************************************
* @preserve
* ForeSee Web SDK: Utils Library
* Built June 01, 18 13:03:06
* Code version: 19.6.8
* Template version: 19.6.8
***************************************/
_fsDefine(["require", "fs"], function (t, e) {
function i(t, e) {
var i = (65535 & t) + (65535 & e);