问题描述
|
我和我的团队致力于一个名为“隐形猎人”的项目,
总结一下我们的项目。 Stealth Hunter是一个小偷捕手,它将使用被盗的笔记本电脑或带网络摄像头的PC默默地为用户拍摄快照,并通过电子邮件发送信息。
它是如何工作的,脚本将由所有者本身触发。他或她可能会转到另一台PC,撰写新电子邮件,然后将电子邮件发送到集成电子邮件,该电子邮件已在先前的“隐形猎人”脚本中(在被盗的笔记本电脑中)配置为“ STOLEN”主题电子邮件。但是什么也没发生。它假设触发了脚本,也许是错误的。
因此,问题是脚本不会触发它。脚本可能有问题吗?希望有人可以看看它。谢谢。
这是我们完整的隐形猎人脚本-http://www.mediafire.com/?nfvv748g5ctri29
这是主行/代码(也包含在上面的链接中)。
# ! /bin/sh
### BEGIN INIT INFO
# Provides: Stealth Hunter
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Stealth Hunter catcher
# Description: Stealth Hunter is a thief catcher
# It will silently take a snapshot of user using a stolen notebook
# or pc with webcam and send back an email.
### END INIT INFO
# Author: shunter
CONFIGURE=\"No\"
# Reads config file
[ -r /etc/default/shunter ] && . /etc/default/shunter
if [ $CONFIGURED != \"Yes\" ]; then
echo \"/etc/default/shunter not configured yet!\"
echo \"Exiting ...\"
exit 0
fi
PASSWORD=$(encrypt-decrypt decode $PASS | awk \'$0!~/^$/ {print $0}\')
do_start()
{
ping -c 2 google.com > /dev/null 2>&1
if [ $? -eq 0 ]; then
#echo \"Checking alert mail ...\"
check_mail=$(wget -T 3 -t 1 -q --secure-protocol=TLSv1 --no-check-certificate --user=$USER --password=$PASSWORD https://mail.google.com/mail/feed/atom -O - |grep \"$ALERT\")
if [ $? -eq 0 ];
then
#echo \"Alert mail found,this notebook/pc might been stolen!!\"
#echo \"Retrieving ip adress ...\"
IP=$(wget -q -O - whatismyip.org |tail) && wait $!
DATE=`date`
#echo \"Taking snapshot ...\"
mplayer tv:// -tv driver=v4l2:width=320:height=240:outfmt=uyvy:device=/dev/video0 -frames 3 -vo jpeg:outdir=/tmp >/dev/null 2>&1 && wait $!
#echo -n \"Sending mail ...\"
sendEmail -f shunter@google.com -t $USER -s $MAIL_SERV:$PORT -xu $USER -xp $PASSWORD -u $TITLE -m \"$MESSAGE\\nIP : $IP DATE: $DATE\\n\" -a $ATTACHMENT >/dev/null
#echo \"Done.\"
exit
else
#echo \"No alert message found ..exiting.\"
exit
fi
else
#echo \"Not online ...\"
exit
fi
}
case \"$1\" in
start)
do_start
;;
stop)
echo \"This option is not supported.\"
;;
restart)
echo \"This option is not supported\"
;;
*)
echo \"Usage: /etc/init.d/$0 {start|stop|restart}\"
exit 1
;;
esac
exit 0
解决方法
看起来,这将在启动计算机时检查一次电子邮件,然后立即退出。如果您希望它保持定期检查,那么cron作业可能是一项
比初始化脚本更好的选择。