ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS

แชร์ความรู้ Linux Ubuntu Web Server บทความ การ config server Linux FreeBSD Apache
การติดตั้ง XAMPP Mysql PHP ใครต้องการแชร์ความรู้เรื่องต่างๆ เหล่านี้ให้ ท่านหรืออื่น โพสที่หมวดนี้ได้

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS
วิธีติดตั้ง

โค้ด: เลือกทั้งหมด

wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzvf maldetect-current.tar.gz
cd maldetect-*.*
./install.sh

วิธีใช้งาน maldet

โค้ด: เลือกทั้งหมด

 maldet -a /home/[pathที่ต้องการ Scan]
หรือ

โค้ด: เลือกทั้งหมด

 maldet -b /home/[pathที่ต้องการ Scan]
เพื่อให้ทำงานเป็น background

ดูรายงานผลของการ Scan หา #Malware

โค้ด: เลือกทั้งหมด

maldet --report [SCANID]
คำสั่ง update LMD
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ดู Log การทำงาน กรณีสั่ง scan ด้วย

โค้ด: เลือกทั้งหมด

 maldet -b /path
เพื่อหา [SCANID] ได้ด้วยคำสั่ง

โค้ด: เลือกทั้งหมด

cat /usr/local/maldetect/event_log
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ใช้ได้บน #FreeBSD
เพิ่มเติม TIP
Scan ระบบ Folder และ เฉพาะ เวลาสร้างหรือแก้ไข ภายในวันที่กำหนด ตัวอย่างนี้ 2 วัน

โค้ด: เลือกทั้งหมด

maldet -r /home/*/public_html 2
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

Scan ทุกโดเมน ของทุก User บน Cp #Directadmin

โค้ด: เลือกทั้งหมด

maldet -a /home/*/domains/*/public_html/
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

เช็ค result ในการ scan ครั้งสุดท้าย หรือ

โค้ด: เลือกทั้งหมด

maldet --log
ดู Logs การ scan เพื่อหา report id

โค้ด: เลือกทั้งหมด

tail -f /usr/local/maldetect/logs/event_log
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

คำสั่ง การใช้งานโดยรวม

โค้ด: เลือกทั้งหมด

-b, --background
      Execute operations in the background, ideal for large scans
      e.g: maldet -b -r /home/?/public_html 7

    -u, --update-sigs [--force]
       Update malware detection signatures from rfxn.com

    -d, --update-ver [--force]
       Update the installed version from rfxn.com

    -f, --file-list
       Scan files or paths defined in line spaced file
       e.g: maldet -f /root/scan_file_list

    -r, --scan-recent PATH DAYS
       Scan files created/modified in the last X days (default: 7d, wildcard: ?)
       e.g: maldet -r /home/?/public_html 2

    -a, --scan-all PATH
       Scan all files in path (default: /home, wildcard: ?)
       e.g: maldet -a /home/?/public_html

    -i, --include-regex REGEX
       Include paths/files from file list based on supplied posix-egrep regular
       expression.
       e.g: To include only paths named wp-content and files ending in .php:
       --include-regex ".*/wp-content/.*|.*.php$"

    -x, --exclude-regex REGEX
       Exclude paths/files from file list based on supplied posix-egrep regular
       expression.
       e.g: To exclude paths containing 'wp-content/w3tc/' and core files:
       --exclude-regex ".*wp-content/w3tc/.*|.*core.[0-9]+$"

    -m, --monitor USERS|PATHS|FILE|RELOAD
       Run maldet with inotify kernel level file create/modify monitoring
       If USERS is specified, monitor user homedirs for UID's > 500
       If FILE is specified, paths will be extracted from file, line spaced
       If PATHS are specified, must be comma spaced list, NO WILDCARDS!
       e.g: maldet --monitor users
       e.g: maldet --monitor /root/monitor_paths
       e.g: maldet --monitor /home/mike,/home/ashton

    -k, --kill-monitor
       Terminate inotify monitoring service

    -c, --checkout FILE
       Upload suspected malware to rfxn.com for review & hashing into signatures

    -l, --log
       View maldet log file events

    -e, --report SCANID email
       View scan report of most recent scan or of a specific SCANID and optionally
       e-mail the report to a supplied e-mail address
       e.g: maldet --report
       e.g: maldet --report list
       e.g: maldet --report 050910-1534.21135
       e.g: maldet --report SCANID [email protected]

    -s, --restore FILE|SCANID
       Restore file from quarantine queue to orginal path or restore all items from
       a specific SCANID
       e.g: maldet --restore /usr/local/maldetect/quarantine/config.php.23754
       e.g: maldet --restore 050910-1534.21135

    -q, --quarantine SCANID
       Quarantine all malware from report SCANID
       e.g: maldet --quarantine 050910-1534.21135

    -n, --clean SCANID
       Try to clean & restore malware hits from report SCANID
       e.g: maldet --clean 050910-1534.21135

    -U, --user USER
       Set execution under specified user, ideal for restoring from user quarantine or
       to view user reports.
       e.g: maldet --user nobody --report
       e.g: maldet --user nobody --restore 050910-1534.21135

    -co, --config-option VAR1=VALUE,VAR2=VALUE,VAR3=VALUE
       Set or redefine the value of conf.maldet config options
       e.g: maldet --config-option [email protected],quarantine_hits=1

    -p, --purge
       Clear logs, quarantine queue, session and temporary data.

    --web-proxy IP:PORT
       Enable use of HTTP/HTTPS proxy for all remote URL calls.
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ตัวอย่างการใช้
maldet Scan หาไฟล์เฉพาะ นามสกุล .php ใน path
/home/mindphp/htdocs/
เขียนเงื่อนไขการรันได้ดังนี้

โค้ด: เลือกทั้งหมด

maldet --include-regex ".*.php$"  -a /home/mindphp/htdocs/
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: ป้องกัน Server Linux ติด Backlist ด้วย Linux Malware Detect (LMD) maldet ใช้ได้ทั้ง Ubuntu และ CentOS

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ตัวอย่างการ Scan ทุก User ทุก โดเมน ที่ถูกสร้างจาก Directadmin

โค้ด: เลือกทั้งหมด

maldet --include-regex ".*.php$"  -a /home/?/domains/?/public_html/
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Google Adsense [Bot] และบุคลทั่วไป 78