博客
关于我
checksec未完待续~
阅读量:351 次
发布时间:2019-03-04

本文共 1186 字,大约阅读时间需要 3 分钟。

checksec是一个脚本软件,也就是用脚本写的一个文件,不到2000行,可用来学习shell。

源码参见
下载方法之一为
wget

checksec用来干什么?

用来检查可执行文件属性,例如PIE, RELRO, PaX, Canaries, ASLR, Fortify Source

PIE是什么意思?

(PIC:Position Independnet Code位置无关代码)
position independent executable

RELRO是什么意思?

Built with RELRO
RELRO stands for RELocation Read-Only, it is a mitigation technique to harden data sections of an ELF/process.

Pax是什么意思?

Stack Canary
ASLR是什么意思?

checksec使用方法

这里写图片描述

checksec –file /usr/sbin/sshd

这里写图片描述

源码解读:

ubuntu测试important!!!!
self.assertShellExitEquals()太重要了

  • def assertShellOutputEquals(self, text, args, stdin=None,
    stdout=subprocess.PIPE, stderr=subprocess.STDOUT, msg=”“, invert=False,
    expected=None):
  • ”’Test a shell command matches a specific output”’
  • rc, report, out = self._testlib_shell_cmd(args, stdin=stdin,
    stdout=stdout, stderr=stderr)
  • result = ‘Got exit code %d. Looking for exact text “%s” (%s)\n’ % (rc,
    text, ” “.join(args))
  • if not invert:
  • self.assertEquals(text, out, msg + result + report)
  • else:
  • self.assertNotEquals(text, out, msg + result + report)
  • if expected != None:
  • result = ‘Got exit code %d. Expected %d (%s)\n’ % (rc, expected, ”
    “.join(args))
  • self.assertEquals(rc, expected, msg + result + report)

现代Linux操作系统的栈溢出(上)

你可能感兴趣的文章
Nacos2.X源码分析:服务注册、服务发现流程
查看>>
NacosClient客户端搭建,微服务注册进nacos
查看>>
Nacos中使用ribbon
查看>>
Nacos使用OpenFeign
查看>>
Nacos使用Ribbon
查看>>
Nacos做注册中心使用
查看>>
Nacos做配置中心使用
查看>>
Nacos入门过程的坑--获取不到配置的值
查看>>
Nacos原理
查看>>
Nacos发布0.5.0版本,轻松玩转动态 DNS 服务
查看>>
Nacos启动异常
查看>>
Nacos命名空间配置_每个人用各自自己的命名空间---SpringCloud Alibaba_若依微服务框架改造---工作笔记001
查看>>
Nacos和Zookeeper对比
查看>>
Nacos在双击startup.cmd启动时提示:Unable to start embedded Tomcat
查看>>
Nacos基础版 从入门到精通
查看>>
Nacos如何实现Raft算法与Raft协议原理详解
查看>>
Nacos安装教程(非常详细)从零基础入门到精通,看完这一篇就够了
查看>>
Nacos实战攻略:从入门到精通,全面掌握服务治理与配置管理!(上)
查看>>
Nacos实战攻略:从入门到精通,全面掌握服务治理与配置管理!(下)
查看>>
Nacos心跳机制实现快速上下线
查看>>