上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页
摘要: How to Add a System CallKernel : 2.6.18編譯環境 : Fedora Core 6假設要加的system call為 sys_project, 有一個int的輸入參數一、在linux source code的部份(以linux代表source code的根目錄)linux/arch/i386/kernel/syscall_table.S的最後面加上要新增的system call名稱如果syscall_table.S的最後面長得像這樣...long sys_tee/* 315 */.long sys_vmsplice.long sys_move_pages那麼 阅读全文
posted @ 2013-09-20 21:36 jeremyatchina 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 4月14日很多硬件的功能,物尽其用却未必好过软实现,Linux出于可移植性及其它原因,常常选择不去过分使用硬件特性。比如Linux只使用四个segment,分别是__USER_CS、__USER_DS、__KERNEL_CS、__KERNEL_DS,因为Paging可以完成segmentation的工作,而且可以完成的更好。而且这样简化了很多,统一了逻辑地址和线性地址。而TSS存在每CPU一个的GDT中,虽然每个process的TSS不同,但Linux2.6却不利用其中的hardwarecontextswitch(虽然低版本使用)以一个farjmp来实现任务转换,而用一系列的mov指令来实现。 阅读全文
posted @ 2013-09-20 14:48 jeremyatchina 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 关于CR0.WP我们知道CR0的WP位可以关闭内核写保护。他和页表的R/W位有关。Intel手册中的描述绕来绕去似乎一直没有说到重点。When the processor is in supervisor mode and the WP flag in register CR0 is clear (itsstate following reset initialization), all pages are both readable and writable (write-protection is ignored). When the processor is in user mode, 阅读全文
posted @ 2013-09-18 13:03 jeremyatchina 阅读(961) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked listhttp://angelonotes.blogspot.tw/2011/08/reverse-singly-linked-list.htmlSource123456789101112131415161718192021222324252627282930313233343536373839#include typedef struct Node { char data; struct Node* next;} Node;void print_list(Node* root) { while (root) { printf("%c 阅读全文
posted @ 2013-09-11 09:11 jeremyatchina 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #include const char shell[]="\x0f\x01\xf8\xe8\5\0\0\0\x0f\x01\xf8\x48\xcf";int main(){ }$ gcc -o disassembly disassembly.c$objdump -D disassembly | less$ /shell08048410 : 8048410: 0f 01 f8 swapgs 8048413: e8 05 00 00 00 call 804841d 8048418: 0f 01 f8 ... 阅读全文
posted @ 2013-08-27 16:55 jeremyatchina 阅读(369) 评论(0) 推荐(0) 编辑
摘要: // ==UserScript==// @name plugin-dodo_chatroom// @namespace // @description Have fun in dodo chatroom// @author Jeremy huang// @homepage // @include *doo.idv.tw/*// ==/UserScript==var $;// Add jQuery(function(){ if (typeof unsafeWindow.jQuery == 'undefined') { ... 阅读全文
posted @ 2013-08-27 13:24 jeremyatchina 阅读(2472) 评论(0) 推荐(0) 编辑
摘要: 一般来说,一个C的工程中一定要做一些这方面的工作,因为你会涉及到跨平台,不同的平台会有不同的字长,所以利用预编译和typedef可以让你最有效的维护你的代码。为了用户的方便,C99标准的C语言硬件为我们定义了这些类型,我们放心使用就可以了。按照posix标准,一般整形对应的*_t类型为:1字节 uint8_t2字节 uint16_t4字节 uint32_t8字节 uint64_t附:C99标准中inttypes.h的内容00001 /*00002inttypes.h0000300004Contributors:00005Createdby Marek Michalkiewicz 000... 阅读全文
posted @ 2013-08-26 09:53 jeremyatchina 阅读(500) 评论(0) 推荐(0) 编辑
摘要: phpinfo ()CTRL+ F–enable-pcntl今天居然可以用到.哈 狗屎运. 来自t00ls 阅读全文
posted @ 2013-08-25 19:23 jeremyatchina 阅读(530) 评论(0) 推荐(0) 编辑
摘要: selinux与kernel 0daykernel NULL pointer的利用需要把shellcode映射到内存0处, 大家在测试exp的时候,总能发现一个规律, 开着selinux就能溢出成功, 关闭就不能溢出成功了。 看了下内核源码,终于搞清楚了: mmap在做匿名映射的时候,会经过LSM层来做安全验证, LSM初始化的时候,会将selinux作为它的第一验证模块, capablity作为它的第2验证模块。这2个模块在做mmap映射的时候,都指向了dummy_file_mmap_addr这个函数:usr/src/debug/kernel-2.6.18/linux-2.6.18.i686 阅读全文
posted @ 2013-08-22 13:27 jeremyatchina 阅读(663) 评论(0) 推荐(0) 编辑
摘要: Nelson Elhage最近发现了一个内核设计上的漏洞, 通过利用这个漏洞可以将一些以前只能dos的漏洞变成可以权限提升的漏洞。当fork一个进程在的时候, copy_process执行如下操作:static struct task_struct *copy_process(unsigned long clone_flags,unsigned long stack_start,struct pt_regs *regs,unsigned long stack_size,int __user *child_tidptr,struct pid *pid,int trace){p->set_c 阅读全文
posted @ 2013-08-22 11:01 jeremyatchina 阅读(1559) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页