Skip to content

Instantly share code, notes, and snippets.

@mehdichaouch
Last active November 29, 2022 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehdichaouch/7c5ec0da765728723fc2f7b2f7d3193f to your computer and use it in GitHub Desktop.
Save mehdichaouch/7c5ec0da765728723fc2f7b2f7d3193f to your computer and use it in GitHub Desktop.
⚠️ Console XSS Warning & others messages 🚨 display message to visitors in console

⚠️ Console XSS Warning & others messages 🚨

TOC

Example Discord

n = {
    "SELF_XSS_HEADER": "Attends !",
    "SELF_XSS_LINE_1": "Si quelqu'un t'a dit de copier/coller quelque chose ici, il y a à peu près 11 chances sur 10 que ce soit une arnaque.",
    "SELF_XSS_LINE_2": "Coller quelque chose ici pourrait donner aux assaillants accès à ton compte Discord.",
    "SELF_XSS_LINE_3": "À moins que tu comprennes exactement ce que tu fais, ferme cette fenêtre et reste en sécurité.",
    "SELF_XSS_LINE_4": "Si tu comprends exactement ce que tu fais, tu devrais venir travailler avec nous {url}"
};

console.log("%c" + n.SELF_XSS_HEADER, "color: #5865f2; -webkit-text-stroke: 2px black; font-size: 72px; font-weight: bold;");
console.log("%c" + n.SELF_XSS_LINE_1, "font-size: 16px;");
console.log("%c" + n.SELF_XSS_LINE_2, "font-size: 18px; font-weight: bold; color: red;");
console.log("%c" + n.SELF_XSS_LINE_3, "font-size: 16px;");
console.log("%c" + n.SELF_XSS_LINE_4.replace("{url}", location.origin + "/jobs"), "font-size: 16px;");

Result: image

Example GitLab

const HANDSHAKE = String.fromCodePoint(0x1f91d);
const MAG = String.fromCodePoint(0x1f50e);
const ROCKET = String.fromCodePoint(0x1f680);

const logHello = () => {
  // eslint-disable-next-line no-console
  console.log(
    `%cWelcome to GitLab!%c

Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute!,

${HANDSHAKE} Contribute to GitLab: https://about.gitlab.com/community/contribute/
${MAG} Create a new GitLab issue: https://gitlab.com/gitlab-org/gitlab/-/issues/new')
${ROCKET} We like your curiosity! Help us improve GitLab by joining the team: https://about.gitlab.com/jobs/
`,
    `padding-top: 0.5em; font-size: 2em;`,
    'padding-bottom: 0.5em;',
  );
};

logHello()

Result: image

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