2011-04-12 180 views
0

我和我的團隊致力於一個名爲Stealth Hunter的項目,引發腳本問題

總結關於我們的項目。隱形獵人是一個小偷捕手,它會悄悄地拍攝用戶的快照,使用被盜的筆記本或帶攝像頭的電腦,並通過電子郵件發送信息。

它是如何工作的,腳本將由所有者本身觸發。他或她可能會轉到另一臺電腦,編寫新的電子郵件併發送電子郵件至集成電子郵件,該電子郵件是早先在隱形獵手腳本中配置的(在偷來的筆記本電腦中)使用「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 [email protected] -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 

回答

1

看起來,這將檢查電子郵件一次,當機器啓動,然後立即退出。如果您希望它定期進行檢查,或許一個cron作業會比init腳本更好。

+0

我不明白。介意多解釋一下? ><」 – user704908 2011-04-13 02:39:59