checksec未完待续~

checksec是一个脚本软件,也就是用脚本写的一个文件,不到2000行,可用来学习shell。
源码参见
http://www.trapkit.de/tools/checksec.html
https://github.com/slimm609/checksec.sh/
下载方法之一为
wget https://github.com/slimm609/checksec.sh/archive/1.6.tar.gz

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

PIE是什么意思?
(PIC:Position Independnet Code位置无关代码)
position independent executable
https://access.redhat.com/blogs/766093/posts/1975793
https://en.wikipedia.org/wiki/Position-independent_code

RELRO是什么意思?
http://fedoraproject.org/wiki/Security_Features_Matrix
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()太重要了
http://bazaar.launchpad.net/~ubuntu-bugcontrol/qa-regression-testing/master/view/head:/scripts/test-kernel-security.py

http://markmail.org/message/xndxxbczqquqipzv

  • 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操作系统的栈溢出(上)
http://www.freebuf.com/articles/system/24177.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值