Skip to content

Instantly share code, notes, and snippets.

@xingoxu
Created May 4, 2019 22:45
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save xingoxu/c5f3b476fc1ddc1f07a10c0b525c6a35 to your computer and use it in GitHub Desktop.
Save xingoxu/c5f3b476fc1ddc1f07a10c0b525c6a35 to your computer and use it in GitHub Desktop.
See Privatter post with password
// ==UserScript==
// @name Privatter Nopassword
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://privatter.net/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let passwordInput = $('input[type=password]');
if (!passwordInput[0]) {
return;
}
const getPrivatterCookie = (url) => {
let privatterId = url.match(/privatter\.net\/(\w)\/(\d+)/i);
let privatterType;
if (privatterId == null || privatterId.length < 3) {
return [];
} else {
let date = new Date();
date.setFullYear(date.getFullYear() + 1);
privatterType = privatterId[1];
privatterId = privatterId[2];
return [`${privatterType}${privatterId}=1; path=/${privatterType}; expires=${date.toGMTString()}`, `pass_${privatterType}${privatterId}=1; path=/${privatterType}; expires=${date.toGMTString()}`];
}
}
let button = document.createElement('button');
button.className = 'btn btn-primary';
button.innerText = '見たい';
button.addEventListener('click', (e) => {
for (let i of getPrivatterCookie(location.href)) {
document.cookie = i;
}
console.log(getPrivatterCookie(location.href));
e.stopPropagation();
e.preventDefault()
setTimeout(() => {
location.reload()
}, 0);
}, false);
passwordInput.parent().append(button);
})();
@Ariah-F
Copy link

Ariah-F commented Oct 15, 2020

It worked, thank you so much!

@JCoMon
Copy link

JCoMon commented Oct 24, 2020

After clicking on the button nothing seems to be happening for me. :(

@dfmcvn
Copy link

dfmcvn commented Oct 30, 2020

Seems Privatter changed their cookies for post' pass a few days ago, the script didn't work anymore.

@xingoxu
Copy link
Author

xingoxu commented Oct 31, 2020

privatter has changed the cookie content into php's password_hash so now this script is already invalid.

@jammango17
Copy link

How to use this?

@Ranoru24
Copy link

could you update this, not working

@ArsxNova
Copy link

Aun funciona ? Alguno conoce una herramienta para "poipiku" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment