Skip to content

Instantly share code, notes, and snippets.

@cosmicle0
Last active December 19, 2020 10:23
Show Gist options
  • Save cosmicle0/f66b8f4d88169e5050002fba1ad4015d to your computer and use it in GitHub Desktop.
Save cosmicle0/f66b8f4d88169e5050002fba1ad4015d to your computer and use it in GitHub Desktop.
A Small PowerShell Script to steal meme's

Meme Stealer

A small PowerShell script to steal meme's from a URL quickly!

Requirements:

  • SSH Access to your server (OpenSSH Private Key)
  • Full permissions to the folder you want to upload meme's to (Root shouldn't be required)
  • A domain to serve meme's from
  • wget installed on your server

Script

# Replace all values below with your own else it'll error.

#################################################################
$PrivateKey = 'location_to_private_key'
$ServerIp = 'server_ip'
$Username = 'username_on_server'
$MemeDir = 'location_to_meme_directory'
$MemeBaseUrl = 'base_url_for_domain_to_meme_directory' # Include protocol (http:// or https://). Do not keep a `/` in the end of the url. Example: `https://memes.bongo.ninja`
#################################################################

$Meme = Read-Host -Prompt 'Input the meme URL'
ssh -i $PrivateKey $Username@$ServerIp "wget $Meme -P $MemeDir"
$MemeUrl = $MemeBaseUrl + "/" + $Meme.Split("/")[-1]
Set-Clipboard -Value $MemeUrl
Write-Output ("Successfully stole the meme and copied the URL to your clipboard!")
Write-Output ("URL: " + $MemeUrl)

You can either insert this as a function in your PowerShell PROFILE or make a .ps1 file containing the script and add the file's location to your PATH.

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