background preloader

Hacking Time

Facebook Twitter

Penetration Testing Framework 0.59. VulnerabilityAssessment.co.uk. VulnerabilityAssessment.co.uk. Black Hat USA 2013 | Archives. Keynotes Briefings A Practical Attack against MDM Solutions Spyphones are surveillance tools surreptitiously planted on a users handheld device. While malicious mobile applications mainly phone fraud applications distributed through common application channels - target the typical consumer, spyphones are nation states tool of attacks. Why? How are these mobile cyber-espionage attacks carried out? A Tale of One Software Bypass of Windows 8 Secure Boot Windows 8 Secure Boot based on UEFI 2.3.1 Secure Boot is an important step towards securing platforms from malware compromising boot sequence before the OS. Above My Pay Grade: Cyber Response at the National Level Incident response is usually a deeply technical forensic investigation and mitigation for an individual organization. This talk will discuss exactly how, detailing the flow of national security incident response in the United States using the scenario of a major attack on the finance sector.

Android: one root to own them all. Metasploit Framework下的Exploit应用开发中文手册 - About:Blank H4cking - 51CTO技术博客. Metasploit Framework系列视频教程 - cnbird's blog. Shellcode Tutorial 1: Introduction and Tools Setup | Project Shellcode. Introduction The assembly tutorials contained within this site are aimed towards creating assembly code in the aim to get you ready to create your own assembly and shellcode - which would hopefully be included with the "Project Shellcode Development Framework". What are the differences between windows shellcode and Linux shellcode? ( Linux, unlike windows, provides a direct way to interface with the kernel through the int 0x80 interface. A complete listing of the Linux syscall table can be found at Windows on the other hand, does not have a direct kernel interface. So, what about windows? There are multitudes of ways to find the addresses of the functions that you need to use in your shellcode. Dynamically finding function addresses will be addressed in a later tutorial.

Lets setup your environment! Cd /home/Administrator/shellcode/ gcc -o arwin arwin.c. 64-bit Linux Shellcode | Mark Loiseau. Writing shellcode isn’t fundamentally different from writing ordinary assembly. If you can get an assembly routine to run on a given architecture, it’s usually not difficult to convert it to runnable shellcode. In fact, before going through the motions presented in this tutorial, I had never written any shellcode. From a low-level programming perspective, I found the challenges and limitations presented by shellcoding to be interesting, so I gave it a shot.

Most of the shellcode on the internet right now is targeted toward 32-bit POSIX-compliant computers, and it will usually work on 64-bit systems without modification. This post outlines an efficient process for writing, testing and finalizing shellcode specifically targeted to 64-bit Linux systems. Writing 64-bit shellcode Exit shellcode (sys_exit)Testing shellcode with stub.c“Hello World!” This guide assumes you have nasm, nasm2shell (tarball here) and a basic understanding of assembly and syscalls.

Sys_exit(return_code) Voila. Nulls. 黑客志 | 破解我吧:一次ELF文件的解构之旅. 一个朋友最近发给我一个他编写的据称很难破解的程序,让我找出它的密码,经过几个小时的Hacking,我顺利找到了密码,并且在这个过程中,除了学到许多新技术之外,还有几个特别有意思的地方,我认为值得写篇文章与大家分享下。 答应接受他的挑战几分钟后,我就收到了一个名叫“hackme"的二进制文件,感兴趣的同学可以先下载这个文件自己尝试下,然后再回头来看看这篇文章,如果你在破解过程中有什么收获,记得发封[hackme]打头的邮件到manohar dot vanga at gmail dot com和我分享哦,另外,你也可以参加Hacker News上到讨论。 试试手气 首先,我随机测试了一组密码,和我想的一样,失败,下面是我得到的消息: $ . /hackmePassword, please? 有趣的是,当我试图通过GDB调试这个文件时,我得到了下面这句特别的欢迎词: $ gdb . Program exited with code 0364. ptrace也是同样的结果: $ strace . 明知故犯 尽管密码以明文形式保存的可能性接近于0,我还是决定试试 首先,我检查了这个二进制文件中的符号信息有没有被抽取(strip)过: $ file hackmehackme: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamicallylinked (uses shared libs), for GNU/Linux 2.6.27, stripped 很不幸,这是一个抽取过的程序,这条路走不通,GDB对于抽取过的二进制基本不起作用,于是我决定看看这个二进制文件中包含的明文字符串信息: $ strings hackme/lib/ld-linux.so.2libdl.so.2__gmon_start___Jv_RegisterClassesdlopendlsymlibc.so.6_IO_stdin_used__libc_start_mainrandomGLIBC_2.1GLIBC_2.0PTRhQVhE[^Ph[^_]8%':!

我尝试了所有的明文字符串作为密码,不对,很自然的结果,不过这个输出还是提供了一些有用的信息,至少我知道了输入正确密码后我会看到什么,那就是这句”Congratulations! " $ ltrace . 反汇编 很好! ELF文件解析和反汇编_小鱼. Linux上exploit基础知识 - debug - 博客大巴. Linux反汇编代码理解 - .的日志 - 网易博客. ~~~~~C语言代码example.cint triangle( int width, int height){int arr{0,1,2,3,4};int area;area = width * height /2;return (area);}void main(){triangle(5,4);} ~~~~~gdb反汇编代码$ gdb example(gdb) disass mainDump of assembler code for function main:0x080483f6 <+0>: push %ebp0x080483f7 <+1>: mov %esp,%ebp0x080483f9 <+3>: sub $0x8,%esp0x080483fc <+6>: movl $0x4,0x4(%esp)0x08048404 <+14>: movl $0x5,(%esp)0x0804840b <+21>: call 0x80483b4 <triangle>0x08048410 <+26>: leave 0x08048411 <+27>: ret End of assembler dump.

~~~~~栈使用情况 ~~~~~部分汇编代码解释 main: mov %esp,%ebp ;esp-->ebp sub $0x8,%esp ;esp-8-->esp movl $0x4,0x4(%esp) ;4-->esp+4 movl $0x5,(%esp) ;5-->esp call 0x80483b4 <triangle> ;跳转到 0x80483b4,同时将下一条指令的地址(0x08048410)压栈(即ret) triangle: sub $0x20,%esp ;esp-20-->esp movl $0x0,-0x18(%ebp) ;0-->ebp-18 movl $0x1,-0x14(%ebp) ;1-->ebp-14 movl $0x2,-0x10(%ebp) ;2-->ebp-10 movl $0x3,-0xc(%ebp) ;3-->ebp-c movl $0x4,-0x8(%ebp) ;4-->ebp-8 mov 0x8(%ebp),%eax ;ebp+8(即param1:5)-->eax imul 0xc(%ebp),%eax ;ebp+c(即param2:4)*eax(即param1:5) 对 Linux 专家非常有用的 20 个命令 - 技术翻译. C语言的反汇编代码(BP,SP的关系)-dzsdyz. Linux反编译全攻略 - zqp2013的专栏. 转自: 一个简单的linux crackme的逆向 前言 最不喜欢的就是写破解教程,酒后一时冲动,老夫卿发少年狂,许下将写一篇linux平台逆向的文章的诺言,作此文实非颇不得已。 在此申明:本文在技术上非常初级,并没有用到什么高深的技术,本人水平亦有限,如有差错,还请见谅! 开始之前的准备 正如C语言教程从 hello world 开始,我们也由一个 crackme 说开去。 首先我们看看程序基本信息: 打开控制台,切换到程序所在目录。 代码: [ncc2008@localhost]$ objdump -x cm2 cm2: file format elf32-i386 cm2 architecture: i386, flags 0x00000102: EXEC_P, D_PAGED start address 0x08048080 程序头: LOAD off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12 filesz 0x000005b8 memsz 0x000005b8 flags r-x LOAD off 0x000005b8 vaddr 0x080495b8 paddr 0x080495b8 align 2**12 filesz 0x0000002c memsz 0x0000002c flags rw- Sections: Idx Name Size VMA LMA File off Algn SYMBOL TABLE: no symbols 我们可以看到start address是0x08048080,但有一个问题是Sections下面却什么都没有。

从上面的信息中可以看到程序被UPX压缩了,接下来请确信你系统中已有UPX,如果没有请到上面给出的程序链接中下载。 [ncc2008@localhost crack]$ upx -d cm2 Ultimate Packer for eXecutables Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 UPX 1.25 Markus F.X.J. 转换成 这样将好看多了。 看不懂? [讨论]linux内核溢出研究系列 - 技术讨论{ Technique Discussions } - 邪恶八进制信息安全团队技术讨论组 努力为祖国的信息安全撑起一片蓝天. C语言的反汇编代码(BP,SP的关系)-dzsdyz. Linux下使用objdump+vim+xxd进行反汇编并修改指令 - 枯龙吟的日志. 前段时间花了一个星期时间马马虎虎算是对汇编入了门吧(好吧,其它我还是什么都不懂),最近又开始对汇编有点兴趣了,于是想试下反汇编的感觉并尝试自己修改下指令据说对一个程序反汇编后再修改的方法是以十六进制的方式打开程序,然后再通过一些工具找到相关的位置再用相关工具计算出偏移量等然后再做修改,不过我从来没搞过反汇编,对汇编也是一知半解的样子,所以就没那么专业了,至于能不能直接使用汇编的助记符修改我还不知道,估计应该是有这样的工具吧,不过我没搜索过,所以只尝试下十六进制下以汇编指令的十六进制形式进行修改了,如果有那样的修改方法我希望你能够告诉我,谢谢在linux下反汇编我们可以使用gdb这个调试器也可以使用objdump这个工具,当然还有其它工具,不过这里我就不说了,然后用十六进制打开文件我们可以使用xxd,我们通过在vim内部调用xxd来对文件进行十六进制模式下修改,当然还有其它的十六进制编辑器,这里我也就不说了,因为我也就是玩玩,毕竟最近还在学习Win32 API(我真蛋疼),下面就从一个简单的程序开始吧 大家先看这个程序,很简单,一个主函数,还有一个jmp函数,正常情况下在编译链接后执行是不可能调用到jmp函数的,但我们要做的就是通过反汇编然后修改指令,让该程序在执行完主函数里的printf函数之后跳转到我们jmp函数的首地址以执行jmp函数 没有采用一些特殊的见不得人的手段的话该程序运行后的效果是这样的然后我们以二进制形式打开可执行程序文件,vim可以使用-b选项来用二进制形式打开文件vim -b jmp 可以看到是这个样子的,然后我们使用xxd以十六进制模式对该文件进行编译如上图中的那样:%!

Xxd%表示我们当前的文件,! 表示我们要执行一个外部命令(程序)现在我们反汇编下这个程序objdump -S -M intel jmp 后面的那个jmp不是汇编指令,是一个函数名,当然是个在c语言中是一个合法的标记符,但在汇编语言中我们不要将标号设置成这样,这个指令经过汇编编译器编译后应该是类似这样的jmp 80483c4这里的80483c4是0x080483c4也就是jmp函数的地址所以我们已经知道了我们的指令是什么,但是怎么用十六进制进行表示呢? 通过计算之后我们得到的结果是0xd2ffffff记住数据在内存中的存储顺序哦,所以我们最终的代码为e9 d2 ff ff ff. Linux反编译全攻略 - zqp2013的专栏. Reverse Engineering Linux x86 - 综合课件. Reverse Engineering Linux Binaries - Reverse Engineering Linux ELF --- - 培训资料. Capture The Flag (CTF) and Pentest Training Tools. 脱壳入门初级教学 - 看雪安全论坛. 4.用内存断点找OEP Author:Lenus From: www.popbase.net & www.pediy.com E-mail:Lenus_M@163.com -------------------------------------------------- 1.前言 发现论坛中很多兄弟在询问:什么是二次内存断点,三次内存断点。 还有很多人对内存断点的原理不是很明白。 其实只要懂得壳是如何解压代码的,那么就完全可以按自己的喜欢来下断。 本文要解决的问题是: 1.什么是内存断点? 2.如何在寻找OEP时使用内存断点。 3.内存断点的局限性。 内存断点分为:内存访问断点,内存写入断点。

004AE242 A1 00104000 mov eax,dword ptr ds:[004AE24C] //004AE24C处的内存读取 004AE247 A3 00104000 mov dword ptr ds:[004AE24C],eax //004AE24C处的内存写入 004AE24C 83C0 01 add eax,1 //004AE24C处的内存执行 那么我们应该如何中断在上面的几行呢? 到这里你可能不明白了,为什么内存访问断点能中断在004AE247这一句对004AE24C的写入,而且还能中断在004AE24C的执行呢? 其实很简单,我们只要仔细体会一下“内存访问”这四个字的含义遍可以知道,当我们对004AE24C进行读取的时候需要“访问”他吧,当我对004AE24C进行写入的时候也需要“访问”他吧!! 所以我们不难得出下面的结论: 1.内存写入中断的地方,一定是也可以用内存访问中断。 总结一下:内存断点不修改改原代码,不会像普通断点那样因为修改代码被程序校验而导致中断失败;对于区段的访问只是区域大了一点,其原理和上面分析的三行代码是一样的。 Ii.如何使用内存断点来寻找OEP呢? 正如我们知道的,壳如果要把原来加密或压缩的代码运行起来就必须要解压和解密原来的代码。 相信很多人到这里已经明白了,为什么在教程中到达了某一个时候,某一行的时候。 让我来做一个假设吧,假设我是一个壳的作者。 这里注意上面虽然下了两次内存访问断点,但是本质是不一样的,目的也是不一样的。 总结一下:如果我们知道壳在什么地方对code段解压完毕我们就可以使用内存断点,找到OEP。 Iii.实战 情况2.