博客
关于我
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操作系统的栈溢出(上)

你可能感兴趣的文章
MySQL之CRUD
查看>>
MySQL之DML
查看>>
Mysql之IN 和 Exists 用法
查看>>
Mysql之主从复制
查看>>
mysql之分组查询GROUP BY,HAVING
查看>>
mysql之分页查询
查看>>
Mysql之备份与恢复
查看>>
mysql之子查询
查看>>
MySQL之字符串函数
查看>>
mysql之常见函数
查看>>
Mysql之性能优化--索引的使用
查看>>
mysql之旅【第一篇】
查看>>
Mysql之索引选择及优化
查看>>
mysql之联合查询UNION
查看>>
mysql之连接查询,多表连接
查看>>
mysql乱码
查看>>
Mysql事务。开启事务、脏读、不可重复读、幻读、隔离级别
查看>>
MySQL事务与锁详解
查看>>
MySQL事务原理以及MVCC详解
查看>>
MySQL事务及其特性与锁机制
查看>>