Giter Site home page Giter Site logo

diff.sh's People

Stargazers

 avatar  avatar

diff.sh's Issues

diif.sh

!/bin/bash

while true
do
diff $1 $2 >date +%Y-%m-%d-%H:%M:%S.txt

保存成时间的形式

txt=$(find /Users/yangxiaodi/python/ -name *.txt)
: <<!EOF!
Only=$(cat $txt)
for Only in $Only
do
echo 老板有文件出现了,快狙击。
done
echo 老板,我还很安全
!EOF!

wcc=$(cat $txt | grep Only)

第一个检测

if [[ $wcc == Only* ]]
then
echo 老板,我被上传东西啦,快来救我,我是attack/date +%Y-%m-%d-%H:%M:%S.txt这个文件
mkdir attack
mv $txt attack
rm -r $2
cp -r $1 $2
echo 报告老板,我已经把文件删除了。请老板放心
else
echo 老板放心,我抗日
mkdir 666
mv $txt 666
fi

出现only 就rm 2 然后cp 1 2

第二个检测php文件改变被写入shell

${var1/$var2/} 会把var2里面的删除 在和var2比较

比如一个字符串 去掉了he 如果还等于原来的字符串,那么就是该字符串里面没有he才会等于,如果不等于,证明字符串里面有he,然后被去掉了,去掉后和原来的就不等了

wce=$(cat 666/date +%Y-%m-%d-%H:%M:%S.txt)
var1="eval"
var2="system"
var3="POST"
var4="include"

里面要是TURE我就说我有木马,如果是false就说我没木马

muma=$(([[ "${wce/$var1/}" != "$wce" ]] || [[ "${wce/$var2/}" != "$wce" ]] || [[ "${wce/$var3/}" != "$wce" ]] || [[ "${wce/$var4/}" != "$wce" ]] ) && echo "我有木马" || echo "我没木马")
if [[ $muma == '我有木马' ]]
then
echo 老板,我好像存在shell啦,快来救我
rm -r $2
cp -r $1 $2
echo 我已经自己解决了,请老板cat 666/date +%Y-%m-%d-%H:%M:%S.txt 一下就知道哪里出问题了
else
echo 老板放心,全家老小全部平安无事
fi
sleep 10
ps -ef | grep diif.sh | grep -v grep | cut -c 9-15 | xargs kill -s 9
done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.