Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var random_useragent = require('random-useragent');
- var http = require('http');
- var net = require('net');
- var url = require('url');
- var sys = require('sys');
- var qs = require('querystring');
- var Faker = require('Faker');
- var request = require("request");
- var emailExtensionValue = ['@wanadoo.fr', '@gmail.com', '@hotmail.com', '@hotmail.fr', '@free.fr', '@alice.fr', '@orange.fr']
- var profilVar = ['Start-up', 'Etudiant', 'Journaliste', 'Influenceur', 'Pouvoirs publics']
- var randomData = {
- emailExtensionValue: ['@wanadoo.fr', '@gmail.com', '@hotmail.com', '@hotmail.fr', '@free.fr', '@alice.fr', '@orange.fr'],
- firstName: Faker.Name.firstName(),
- lastName: Faker.Name.lastName(),
- sufixe: Faker.random.number(999),
- randomMail: getRandomElement(emailExtensionValue),
- profilVar: ['Start-up', 'Etudiant', 'Journaliste', 'Influenceur', 'Pouvoirs publics'],
- Profil: getRandomElement(profilVar),
- thePassword: Faker.random.number(1111111111, 9999999999) + Faker.Name.firstName() + "'",
- Useragent: random_useragent.getRandom()
- }
- function getRandomElement(arr) {
- return arr[Math.round(Math.random() * (arr.length - 1))]
- }
- var data = qs.stringify({
- 'first_name-38484': randomData.firstName,
- 'last_name-38484': randomData.lastName,
- 'user_login-38484': randomData.firstName + randomData.lastName + randomData.sufixe,
- 'user_email-38484': randomData.firstName + randomData.lastName + randomData.sufixe + randomData.randomMail,
- 'user_password-38484': randomData.thePassword,
- 'country': 'France',
- 'profile-type': randomData.thePassword,
- 'complment-profil-38484': '',
- 'titre-38484': '',
- 'services': '',
- 'public-adress': '',
- 'form_id': '38484',
- 'timestamp': '1446834025',
- 'request': '',
- 'role': 'member'
- });
- var data1 = qs.stringify({
- 'action': 'wti_like_post_process_vote',
- 'task': 'like',
- 'post_id': '6190',
- 'nonce': '6517d2ea5f'
- });
- var arrayCookieUser = []
- var lol = []
- var options = {
- host: 'bonjouridee.com',
- port: 80,
- path: '/inscription',
- method: 'POST',
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Content-Length': Buffer.byteLength(data),
- 'Cookie': 'ct_cookies_test=3f8a7f992813b9f13a29ea2f6a630cc2; ct_timestamp=1446835025; ct_checkjs=1967102595; cookie_notice_accepted=true;'
- }
- };
- var req = http.request(options, function(res) {
- console.log(options)
- res.setEncoding('utf8');
- res.on('data', function(chunk) {
- console.log("body: " + chunk);
- });
- var setcookie = res.headers["set-cookie"];
- if (setcookie) {
- setcookie.forEach(
- function(cookiestr) {
- var cookieSale = cookiestr.split("path=/") + "";
- var cookiePropre = cookieSale.replace(/,/g, "");
- lol.push(cookiePropre);
- }
- );
- }
- var options1 = {
- host: 'bonjouridee.com',
- port: 80,
- path: '/wp-admin/admin-ajax.php',
- method: 'POST',
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Content-Length': Buffer.byteLength(data1),
- 'Accept': 'application/json, text/javascript, */*; q=0.01',
- 'Cookie': (lol + "; ").replace(",wo", "wo").replace("wp-content/plugins; httponly,w", "w").replace("wp-admin; httponly,w", "w").replace("; httponly;", ""), // + 'ct_cookies_test=3f8a7f992813b9f13a29ea2f6a630cc2; ct_checkjs=1967102595; ct_timestamp=1446835025; cookie_notice_accepted=true;'
- }
- };
- var options2 = {
- host: 'bonjouridee.com',
- port: 80,
- path: '/payname-2/',
- method: 'GET',
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Content-Length': Buffer.byteLength(data1),
- 'Accept': 'application/json, text/javascript, */*; q=0.01',
- 'Cookie': (lol + "; ").replace(",wo", "wo").replace("wp-content/plugins; httponly,w", "w").replace("wp-admin; httponly,w", "w").replace("; httponly;", ""), // + 'ct_cookies_test=3f8a7f992813b9f13a29ea2f6a630cc2; ct_checkjs=1967102595; ct_timestamp=1446835025; cookie_notice_accepted=true;'
- }
- };
- var req = http.request(options1, function(res) {
- res.setEncoding('utf8');
- res.on('data', function(chunk) {
- console.log("body: " + chunk);
- });
- console.log(options1)
- });
- var req1 = http.request(options2, function(res) {
- res.setEncoding('utf8');
- res.on('data', function(chunk) {
- var c = ("body: " + chunk);
- var d = new RegExp(/("nonce":")[0-9a-z]*/);
- var e = c.match(d)
- if(e!== null) {
- console.log(e[0]);
- var f = e[0].substring(9, e[0].length)
- console.log(f);
- }
- });
- console.log(options1)
- });
- req.write(data1);
- req1.write(data1);
- req.end
- });
- req.write(data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement