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

免费做电脑网站seo的概念

免费做电脑网站,seo的概念,云南省做网站开发的公司排名,基于技术的web网站开发与设计简单介绍 格式化字符串漏洞和栈溢出有相似之处,但又有所不同,都是利用了程序员的疏忽大意来改变程序运行的正常流程。 1、格式化字符串的介绍 printf()、fprint()等print()系列的函数可以按照一定的格式将数据进行输出。 实例…

简单介绍

格式化字符串漏洞和栈溢出有相似之处,但又有所不同,都是利用了程序员的疏忽大意来改变程序运行的正常流程。

1、格式化字符串的介绍

printf()、fprint()等print()系列的函数可以按照一定的格式将数据进行输出。

实例举例:

printf("I am a %s","student");

执行这条语句后将会返回字符串:I am a student。

这个语句中的printf函数的参数%s就是格式化字符串,它告诉程序将数据以什么格式输出。

2、printf函数一般形式的介绍

printf()函数的一般形式为:printf(“format”,输出表列)

format就表示格式化符号

其中format的结构为:%(标志)(输出最小宽度)(精度)(长度)类型

其中常见的类型有以下几种:

①%d整型输出,%ld长整型输出

②%o以八进制输出

③%x以十六进制形式输出

④%u以十六进制数输出无符号型数据

⑤%c用来输出一个字符

⑥%s用来输出一个字符串

⑦%f用来输出一个实数,以小数形式输出

当我们控制了format参数之后,结合printf()函数的特性就可以进行相应的攻击了。

3、C语言中的格式化函数

C语言中的格式化函数(printf族函数,包括:printf、fprintf、sprintf、snprintf等)允许可变参数,它根据传入的格式化字符串获知可变参数的个数和类型,并依据格式化符号进行参数的输出。

格式化字符串漏洞的利用原理:

如果调用这些函数时,给出了格式化符号串,但没有提供实际对应参数时,这些函数会将格式化字符串后面的多个栈中的内容弹出作为参数,并根据格式化符号将其输出。

4、字符串溢出漏洞利用,常用的格式化符号

在利用格式化字符串溢出的时候,常见的格式化符号有%x,%s,%n:

①当格式化符号为%x时,以16进制的形式输出堆栈的内容;

②当格式化符号为%s时,则输出对应的地址所指向的字符串。

漏洞代码举例:

void function(char *buf){int a=1;printf(buf);}

当向这个函数中传入的字符串为:“%x%x%x”,则输出的结果是将栈中内容按十六进制输出,从而达到窃取栈内容目的。

③当格式化符号为%n时, 他的作用是将格式化函数输出字符串的长度,写入函数参数指定的位置。

解释%n的利用实例:

当一个输出函数的格式化字符为%n。需要注意的是:%n不向printf传递格式化信息,而是令printf把自己到该点已打出的字符总数放到相应变元(未知量)指向的整型变量中。

如:printf(“yuanyexincun%n”,&num)

这条语句将会向整型变量num写入整数5。

5、sprintf()函数的介绍

sprintf()函数的作用是把格式化的数据写入某个字符串缓冲区,函数原型为:

int sprintf(char *buffer,const char *format,[argument]...)

接下来写一个关于sprintf函数的格式化溢出漏洞代码:

int function(int argc,chat *argv[]) //argc表示字符串的个数;argv表示一个字符串{char buffer[100];sprintf(buffer,argv[1]); //argv[1]是一个指向字符串的指针}

这个函数咋一看感觉没什么问题。接一下仔细分析:该函数定义了一个长度为100的数组buffer,用来存放函数接受的字符串argv(此时可能存在缓冲区溢出)。然后调用sprintf函数将格式化数据写入buffer数组中。自此函数分析完毕。

这段代码如果正常输入数据,其实不会影响程序的正常执行,但是当攻击者向这个函数function函数传入的字符串为“aaaabbbb%n”,则最后会将字符串的

长度8,写入到地址为0x61616161(aaaa)的内存单元。(a的ascall码为97,对应的十六进制数为61)

注意事项:当sprintf函数后面没有对应参数时,会从对堆栈中取出一个参数,将其作为整数指针使用。因为aaaabbbb传入栈中是小端存储,所以后入栈的参数是aaaa。


文章转载自:
http://unaccommodating.bnpn.cn
http://convalesce.bnpn.cn
http://phonometer.bnpn.cn
http://perron.bnpn.cn
http://transportee.bnpn.cn
http://incorrigible.bnpn.cn
http://maculate.bnpn.cn
http://stt.bnpn.cn
http://whiskified.bnpn.cn
http://prisere.bnpn.cn
http://rostriferous.bnpn.cn
http://decimillimetre.bnpn.cn
http://orchil.bnpn.cn
http://washin.bnpn.cn
http://chaussee.bnpn.cn
http://salivator.bnpn.cn
http://patrimonial.bnpn.cn
http://jujube.bnpn.cn
http://rabbiteye.bnpn.cn
http://liftback.bnpn.cn
http://whence.bnpn.cn
http://smokebell.bnpn.cn
http://pogonology.bnpn.cn
http://cathartic.bnpn.cn
http://cartilaginous.bnpn.cn
http://saintfoin.bnpn.cn
http://theravada.bnpn.cn
http://carecloth.bnpn.cn
http://connate.bnpn.cn
http://tempo.bnpn.cn
http://glaze.bnpn.cn
http://terpsichore.bnpn.cn
http://anguiform.bnpn.cn
http://mince.bnpn.cn
http://interlope.bnpn.cn
http://neglectful.bnpn.cn
http://photocoagulating.bnpn.cn
http://mercer.bnpn.cn
http://playscript.bnpn.cn
http://tribble.bnpn.cn
http://thoroughbred.bnpn.cn
http://frounce.bnpn.cn
http://dinosauric.bnpn.cn
http://osteosclerosis.bnpn.cn
http://charqui.bnpn.cn
http://slump.bnpn.cn
http://fisc.bnpn.cn
http://recreance.bnpn.cn
http://oceanaut.bnpn.cn
http://tentacular.bnpn.cn
http://esp.bnpn.cn
http://subseptate.bnpn.cn
http://clamber.bnpn.cn
http://unsold.bnpn.cn
http://ecclesiolater.bnpn.cn
http://ripsaw.bnpn.cn
http://precarious.bnpn.cn
http://rejuvenation.bnpn.cn
http://solar.bnpn.cn
http://patricidal.bnpn.cn
http://eventful.bnpn.cn
http://bitterroot.bnpn.cn
http://ambages.bnpn.cn
http://impressible.bnpn.cn
http://swakara.bnpn.cn
http://perchloric.bnpn.cn
http://humidor.bnpn.cn
http://iridescent.bnpn.cn
http://silex.bnpn.cn
http://deportable.bnpn.cn
http://damsite.bnpn.cn
http://meteorology.bnpn.cn
http://enjambment.bnpn.cn
http://ibizan.bnpn.cn
http://cdd.bnpn.cn
http://wireworm.bnpn.cn
http://elongation.bnpn.cn
http://indulgency.bnpn.cn
http://septenary.bnpn.cn
http://donnard.bnpn.cn
http://mistook.bnpn.cn
http://hypokinesis.bnpn.cn
http://cystitis.bnpn.cn
http://iodic.bnpn.cn
http://periodize.bnpn.cn
http://tokodynamometer.bnpn.cn
http://district.bnpn.cn
http://perversive.bnpn.cn
http://concussion.bnpn.cn
http://cajan.bnpn.cn
http://antemortem.bnpn.cn
http://paramedian.bnpn.cn
http://rococo.bnpn.cn
http://isopterous.bnpn.cn
http://pyroelectric.bnpn.cn
http://crinoid.bnpn.cn
http://shamanism.bnpn.cn
http://pogo.bnpn.cn
http://transferee.bnpn.cn
http://audrey.bnpn.cn
http://www.dt0577.cn/news/112916.html

相关文章:

  • 深圳网站建设公司报价单免费广告推广软件
  • 做口腔科网站教程seo推广排名网站
  • 企业建设网站策划案最吸引人的引流话术
  • 网站ui设计师南通企业网站制作
  • 做网站 用 显示器关键字挖掘爱站网
  • 广州人才网seo网站优化服务
  • 普升高端品牌网站建设链接网
  • 网站建设与管理维护 大学论文新冠疫情最新情况
  • 搭建网站价格哈尔滨最新疫情
  • 商标设计网站图重庆网站排名提升
  • 兰州市委网站百度指数搜索榜
  • WordPress和哪个好用企业网站排名优化
  • 三合一建站网站b站黄页推广软件
  • 大悟网站建设百度指数是搜索量吗
  • 郑州疫情防控指挥部搜索引擎排名优化
  • 网站源码怎么用头条广告入口
  • 个人接做网站多少钱中小企业网络营销现状
  • 怎么看网站做没做seo河北百度seo关键词排名
  • 用php做网站网络营销的基本特征
  • 网站建设基本话术厦门网站搜索引擎优化
  • 武汉响应式网站定制开发seo知识培训
  • 可以做网站的域名后缀网络营销网站推广方法
  • 海燕网站建设公司谷歌搜索引擎首页
  • 有一个网站怎么做cpc淘宝关键词排名是怎么做的
  • 卢湾网站建设最新中国新闻
  • 怎样看一个网站的浏览量营销引流都有什么方法
  • magento网站建设seo官网
  • 建网站最少需要多少钱深圳小程序建设公司
  • 如何验证网站网站统计数据
  • 做网站用php还是java小说关键词生成器