Skip to content

Instantly share code, notes, and snippets.

View Munawwar's full-sized avatar
🍪
Cookies

Munawwar Munawwar

🍪
Cookies
View GitHub Profile
@Munawwar
Munawwar / TypeClipboard.md
Created September 23, 2023 10:12 — forked from ethack/TypeClipboard.md
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@Munawwar
Munawwar / selection.js
Created September 26, 2012 10:02 — forked from visnup/selection.js
IE8 equivalent of HTML5/W3C Range object's startContainer,startOffset,endContainer and endOffset properties
(function selectionPolyfill(window, document) {
if (window.getSelection || !document.selection) return;
// convert an IE TextRange to a W3C one
function convert(range, startOrEnd) {
var point = range.duplicate()
, result = {};
// point is either the start or end of the range
point.collapse(startOrEnd);