PHP는 Linux 서버 트로이 목마 감지 및 강화 기능을 구현합니다.php 기술
해킹이 자주 일어나는 사이트죠? 좀 개선해서 문제를 근본적으로 해결해 보세요. discuz 트로이목마 같은 프로그램에는 허점이 있기 때문이죠.
다음 사항을 찾아 강화하세요(멤버십 기능 비활성화, 업로드 입구 제공 안 함, 백그라운드 비밀번호 보호, PHP 강화 등을 할 수 있다면 일반적으로 문제가 없습니다).
1. 기능 코드를 기준으로 검색:
php 트로이 목마는 일반적으로
를 포함합니다.
또는
find /wwwroot/* -type f -name "*.php" |xargs grep "eval(" > /wwwroot/scan.txt
그 결과 눈에 띄는 웹쉘이 많이 발견됐고, 첨부 파일 등 디렉토리에 모두 숨겨져 있었습니다
2. 인터넷에서 PHP 코드를 사용하여 최근 수정된 파일을 검색합니다
scandir.php
내용은 다음과 같습니다.
set_time_limit(0);//시간 초과 방지
/**
*
* PHP 디렉토리 스캐닝 모니터링의 향상된 버전
*
* @author lssbing (lssbing#gmail.com)
* @date 2010-1-18
* @license BSD
* @version 1.0
*
사용하기 전에 다음 변수를 수동으로 설정해야 합니다
*
**/
/*====================== 프로그램 구성======================*/
$pass="12345";//비밀번호 설정
$jkdir="."; //모니터링 및 스캔할 디렉터리를 설정합니다. 현재 디렉터리는 '..'입니다. 뒤에 슬래시를 추가하지 마세요. 기본값은 현재 디렉터리
입니다. $logfilename="./m.log";//어디에든 로그를 저장할 경로를 설정합니다.
$exclude=array('data','images');//디렉터리 제외
$danger='eval|cmd|passthru|gzuncompress';//트로이목마 파일인지 판단하기 위해 찾아낼 위험함수 설정
$suffix='php|inc';//검사할 파일의 접미사 설정
/*===================== 구성 끝======================*/
$filename=$_GET['파일이름']
$check=$_GET['확인']
$점프오프=거짓
$url = $_SERVER['PHP_SELF']
$thisfile = end(explode('/',$url))
$jump="{$thisfile}|".implode('|',$exclude)
$jkdir_num=$file_num=$danger_num=0
정의('M_PATH',$jkdir)
정의('M_LOG',$logfilename)
if ($check=='체크')
{
$safearr = 폭발("|",$jump)
$start_time=마이크로타임(true)
safe_check($jkdir)
$end_time=마이크로타임(true)
$total=$end_time-$start_time
$file_num=$file_num-$jkdir_num
$message= "파일 수:".$file_num
$message.= "폴더 수:".$jkdir_num
$message.= "의심스러운 파일 수:".$danger_num
$message.= "실행 시간:".$total
에코 $메시지; }그밖에{
if ($_GET['m']=="del") Delete();//파일 삭제 처리 중
//파일 내용 읽기
if(isset($_GET['readfile'])){
//보기 비밀번호를 출력합니다. 비밀번호가 올바르게 확인되면 파일 내용이 출력됩니다
if(emptyempty($_POST['passchack'])){
echo"
코드 복사
코드는 다음과 같습니다.
비활성화_기능 = phpinfo,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocke,popen,proc_close, 컬_exec,curl_multi_exec,parse_ini_file,show_source,dl,escapeshellarg,escapeshellcmd
코드 복사
코드는 다음과 같습니다.
서버
{
들어보세요 80;
서버 이름 www.***.com;
색인 index.htm index.html index.php;
루트 /wwwroot/;
^([^.]*)/topic-(. ).html$ $1/portal.php?mod=topic&topic=$2 마지막으로 다시 작성하세요.
^([^.]*)/article-([0-9] )-([0-9] ).html$ $1/portal.php?mod=view&aid=$2&page=$3 마지막으로 다시 작성하세요.
^([^.]*)/forum-(w )-([0-9] ).html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 마지막으로 다시 작성하세요.
^([^.]*)/thread-([0-9] )-([0-9] )-([0-9] ).html$ $1/forum.php?mod=viewthread&tid=$2&extra 다시 작성 =page=$4&page=$3 마지막;
^([^.]*)/group-([0-9] )-([0-9] ).html$ $1/forum.php?mod=group&fid=$2&page=$3 마지막으로 다시 작성하세요.
^([^.]*)/space-(username|uid)-(. ).html$ $1/home.php?mod=space&$2=$3 last;를 다시 작성하세요.
^([^.]*)/([a-z] )-(. ).html$ $1/$2.php?rewrite=$3 마지막으로 다시 작성;
^([^.]*)/topic-(. ).html$ $1/portal.php?mod=topic&topic=$2 마지막으로 다시 작성하세요.
위치 ~ ^/images/.*.(php|php5)$
{
모두 거부하다;
}
위치 ~ ^/static/.*.(php|php5)$
{
모두 거부하다;
}
위치 ~* ^/data/(attachment|avatar)/.*.(php|php5)$
{
모두 거부하다;
}
위치 ~ .*.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fcgi.conf를 포함합니다;
}
error_page 400 /404.html;
error_page 403 /404.html;
error_page 404 /404.html;
error_page 405 /404.html;
error_page 408 /404.html;
error_page 410 /404.html;
error_page 411 /404.html;
error_page 412 /404.html;
error_page 413 /404.html;
error_page 414 /404.html;
error_page 415 /404.html;
error_page 500 /404.html;
error_page 501 /404.html;
error_page 502 /404.html;
error_page 503 /404.html;
error_page 506 /404.html;
log_format acclog "$remote_addr $request_time $http_x_readtime [$time_local] "$request_method http://$host$request_uri" $status $body_bytes_sent "$http_referer" "$http_user_agent"";
access_log /logs/access.log acclog;
}
즐거운 마음으로
위치 ~ ^/images/.*.(php|php5)$
{
모두 거부하다;
}
현재 제조 업체는
위치 ~ .*.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fcgi.conf를 포함합니다.
}
전면에는 否则限가 제조되지 않았습니다.

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











이번 장에서는 CakePHP의 환경 변수, 일반 구성, 데이터베이스 구성, 이메일 구성에 대해 알아봅니다.

PHP 8.4는 상당한 양의 기능 중단 및 제거를 통해 몇 가지 새로운 기능, 보안 개선 및 성능 개선을 제공합니다. 이 가이드에서는 Ubuntu, Debian 또는 해당 파생 제품에서 PHP 8.4를 설치하거나 PHP 8.4로 업그레이드하는 방법을 설명합니다.

CakePHP는 PHP용 오픈 소스 프레임워크입니다. 이는 애플리케이션을 훨씬 쉽게 개발, 배포 및 유지 관리할 수 있도록 하기 위한 것입니다. CakePHP는 강력하고 이해하기 쉬운 MVC와 유사한 아키텍처를 기반으로 합니다. 모델, 뷰 및 컨트롤러 gu

VS Code라고도 알려진 Visual Studio Code는 모든 주요 운영 체제에서 사용할 수 있는 무료 소스 코드 편집기 또는 통합 개발 환경(IDE)입니다. 다양한 프로그래밍 언어에 대한 대규모 확장 모음을 통해 VS Code는
