亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? advanced shellcoding techniques.txt

?? a collection of mega hacking tools
?? TXT
字號:
  ***********************************************
     *                                             *
     * Advanced Shellcoding Techniques - by Darawk *
     *                                             *
     ***********************************************

Introduction

This paper assumes a working knowledge of basic shellcoding techniques, and x86 assembly, I will not rehash these in this paper.  I hope to teach you some of the lesser known shellcoding techniques that I have picked up, which will allow you to write smaller and better shellcodes.  I do not claim to have invented any of these techniques, except for the one that uses the div instruction.



The multiplicity of mul

This technique was originally developed by Sorbo of darkircop.net.  The mul instruction may, on the surface, seem mundane, and it's purpose obvious.  However, when faced with the difficult challenge of shrinking your shellcode, it proves to be quite useful.  First some background information on the mul instruction itself.

mul performs an unsigned multiply of two integers.  It takes only one operand, the other is implicitly specified by the %eax register.  So, a  common mul instruction might look something like this:

movl $0x0a,%eax
mul $0x0a

This would multiply the value stored in %eax by the operand of mul, which in this case would be 10*10.  The result is then implicitly stored in EDX:EAX.  The result is stored over a span of two registers because it has the potential to be considerably larger than the previous value, possibly exceeding the capacity of a single register(this is also how floating points are stored in some cases, as an interesting sidenote).

So, now comes the ever-important question.  How can we use these attributes to our advantage when writing shellcode?  Well, let's think for a second, the instruction takes only one operand, therefore, since it is a very common instruction, it will generate only two bytes in our final shellcode.  It multiplies whatever is passed to it by the value stored in %eax, and stores the value in both %edx and %eax, completely overwriting the contents of both registers, regardless of whether it is necessary to do so, in order to store the result of the multiplication.  Let's put on our mathematician hats for a second, and consider this, what is the only possible result of a multiplication by 0?  The answer, as you may have guessed, is 0.  I think it's about time for some example code, so here it is:

xorl %ecx,%ecx
mul %ecx

What is this shellcode doing?  Well, it 0's out the %ecx register using the xor instruction, so we now know that %ecx is 0.  Then it does a mul %ecx, which as we just learned, multiplies it's operand by the value in %eax, and then proceeds to store the result of this multiplication in EDX:EAX.  So, regardless of %eax's previous contents, %eax must now be 0.  However that's not all, %edx is 0'd now too, because, even though no overflow occurs, it still overwrites the %edx register with the sign bit(left-most bit) of %eax.  Using this technique we can zero out three registers in only three bytes, whereas by any other method(that I know of) it would have taken at least six.


The div instruction

Div is very similar to mul, in that it takes only one operand and implicitly divides the operand by the value in %eax.  Also like, mul it stores the result of the divide in %eax.  Again, we will require the mathematical side of our brains to figure out how we can take advantage of this instruction.  But first, let's think about what is normally stored in the %eax register.  The %eax register holds the return value of functions and/or syscalls.  Most syscalls that are used in shellcoding will return -1(on failure) or a positive value of some kind, only rarely will they return 0(though it does occur).  So, if we know that after a syscall is performed, %eax will have a non-zero value, and that  the instruction divl %eax will divide %eax by itself, and then store the result in %eax, we can say that executing the divl %eax instruction after a syscall will put the value 1 into %eax.  So...how is this applicable to shellcoding? Well, their is another important thing that %eax is used for, and that is to pass the specific syscall that you would like to call to int $0x80.  It just so happens that the syscall that corresponds to the value 1 is exit().  Now for an example:

       
xorl %ebx,%ebx
mul %ebx
push %edx
pushl   $0x3268732f
pushl   $0x6e69622f
mov %esp, %ebx
push %edx
push %ebx
mov %esp,%ecx
movb $0xb, %al  #execve() syscall, doesn't return at all unless it fails, in which case it returns -1
int $0x80

divl %eax  # -1 / -1 = 1
int $0x80

Now, we have a 3 byte exit function, where as before it was 5 bytes.  However, there is a catch, what if a syscall does return 0?  Well in the odd situation in which that could happen, you could do many different things, like inc %eax, dec %eax, not %eax anything that will make %eax non-zero.  Some people say that exit's are not important in shellcode, because your code gets executed regardless of whether or not it exits cleanly.  They are right too, if you really need to save 3 bytes to fit your shellcode in somewhere, the exit() isn't worth keeping.  However, when your code does finish, it will try to execute whatever was after your last instruction, which will most likely produce a SIG ILL(illegal instruction) which is a rather odd error, and will be logged by the system.  So, an exit() simply adds an extra layer of stealth to your exploit, so that even if it fails or you can't wipe all the logs, at least this part of your presence will be clear.



Unlocking the power of leal

The leal instruction is an often neglected instruction in shellcode, even though it is quite useful.  Consider this short piece of shellcode.

xorl %ecx,%ecx
leal 0x10(%ecx),%eax

This will load the value 17 into eax, and clear all of the extraneous bits of eax.  This occurs because the leal instruction loads a variable of the type long into it's desitination operand.  In it's normal usage, this would load the address of a variable into a register, thus creating a pointer of sorts.  However, since ecx is 0'd and 0+17=17, we load the value 17 into eax instead of any kind of actual address.  In a normal shellcode we would do something like this, to accomplish the same thing:

xorl %eax,%eax
movb $0x10,%eax

I can hear you saying, but that shellcode is a byte shorter than the leal one, and you're quite right.  However, in a real shellcode you may already have to 0 out a register like ecx(or any other register), so the xorl instruction in the leal shellcode isn't counted.  Here's an example:

xorl    %eax,%eax
xorl    %ebx,%ebx
movb    $0x17,%al
int    $0x80
       
xorl %ebx,%ebx
leal 0x17(%ebx),%al
int $0x80

Both of these shellcodes call setuid(0), but one does it in 7 bytes while the other does it in 8.  Again, I hear you saying but that's only one byte it doesn't make that much of a difference, and you're right, here it doesn't make much of a difference(except for in shellcode-size pissing contests =p), but when applied to much larger shellcodes, which have many function calls and need to do things like this frequently, it can save quite a bit of space.



Conclusion

I hope you all learned something, and will go out and apply your knowledge to create smaller and better shellcodes.  If you know who invented  the leal technique, please tell me and I will credit him/her.  

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
9191成人精品久久| 欧美国产精品中文字幕| 日本色综合中文字幕| 天堂一区二区在线| 欧美天堂一区二区三区| 中文字幕亚洲区| 高清不卡在线观看| 久久久亚洲精品石原莉奈| 麻豆精品新av中文字幕| 欧美一区二区三区小说| 视频在线观看91| 精品伦理精品一区| 国产一区二区三区免费观看| 91麻豆精品国产91久久久久久久久| 伊人一区二区三区| 欧美日韩国产首页| 美女视频一区在线观看| 日韩欧美成人激情| 国产91精品一区二区麻豆网站| 国产视频在线观看一区二区三区| 国产精品69久久久久水密桃| 日本一区二区三级电影在线观看| 岛国精品一区二区| 亚洲午夜免费福利视频| 精品1区2区3区| 亚洲视频资源在线| 国产精品麻豆99久久久久久| 亚洲高清视频的网址| 欧美成人伊人久久综合网| 男女性色大片免费观看一区二区 | 韩国欧美国产一区| 欧美国产综合色视频| 91麻豆高清视频| 精品一区二区三区免费| 一区二区三区鲁丝不卡| 精品国产一区二区三区久久影院| 不卡视频在线看| 成人一区二区视频| 亚洲精品国产精品乱码不99 | 色婷婷亚洲综合| 国产一区二区福利| 亚洲一区二区精品视频| 国产精品网站一区| 久久综合久久99| 日韩天堂在线观看| 91黄视频在线| 一本大道综合伊人精品热热| 国产一区亚洲一区| 免费久久99精品国产| 亚洲最大成人网4388xx| 国产精品对白交换视频 | 国产精品色在线观看| 欧美一区二区免费| 欧美精三区欧美精三区| 欧美精品久久久久久久多人混战 | 日本91福利区| 青青青伊人色综合久久| 日韩制服丝袜先锋影音| 免费看欧美美女黄的网站| 国产99久久久久| 国产精品一区二区91| 国产99久久久精品| 91同城在线观看| 欧美日韩和欧美的一区二区| 欧美色视频在线观看| 欧美日韩激情一区| 日韩欧美第一区| 国产视频一区二区在线观看| 国产清纯在线一区二区www| 日本一区二区三区国色天香 | 在线观看视频91| 538在线一区二区精品国产| 欧美一区二区福利在线| 精品国产精品网麻豆系列| 国产精品色哟哟| 午夜av区久久| 国产精品 欧美精品| 91香蕉国产在线观看软件| 欧美一卡在线观看| 国产精品传媒入口麻豆| 七七婷婷婷婷精品国产| 国产91精品免费| 91麻豆精品国产91久久久资源速度| 91香蕉视频mp4| 91丨porny丨蝌蚪视频| 色综合天天综合网天天看片| 日韩你懂的在线观看| 最好看的中文字幕久久| 麻豆成人久久精品二区三区红| 不卡一二三区首页| 久久奇米777| 国产中文字幕一区| 欧美刺激午夜性久久久久久久| 亚洲欧洲精品成人久久奇米网| 久久精品国产精品亚洲红杏| 日本乱码高清不卡字幕| 国产精品热久久久久夜色精品三区| 免费一级欧美片在线观看| 色综合久久88色综合天天| 日本一区二区电影| 国产一区二区三区av电影| 在线综合视频播放| 美女视频一区在线观看| 欧美一级生活片| 久久国产乱子精品免费女| 欧美乱妇一区二区三区不卡视频| 一区二区三区在线影院| 91伊人久久大香线蕉| 亚洲精品福利视频网站| 色吊一区二区三区| 亚洲一区二区三区爽爽爽爽爽| 色综合欧美在线视频区| 亚洲精选视频免费看| 欧美视频日韩视频在线观看| 无吗不卡中文字幕| 欧美成人三级电影在线| 国产精品一区二区在线播放| 亚洲国产精品黑人久久久| 91香蕉视频污| 免费久久精品视频| 中文字幕在线观看不卡| 欧美日韩一区久久| 国产成人精品综合在线观看| 一区二区三区四区亚洲| 91麻豆精品国产91久久久资源速度| 激情五月激情综合网| 中文字幕视频一区二区三区久| 欧美日韩日日摸| 国产成人免费高清| 蜜桃久久精品一区二区| 亚洲欧美另类久久久精品| 精品国产乱码久久久久久浪潮| 91在线观看免费视频| 激情文学综合网| 免费在线观看成人| 一区二区三区日韩在线观看| 久久久久久久久久久久久久久99| 色婷婷综合中文久久一本| 国产精品自在在线| 蜜桃传媒麻豆第一区在线观看| 日本一区二区免费在线| 日韩欧美不卡在线观看视频| 欧美日韩成人综合| 欧美性猛交一区二区三区精品| 国产成人精品网址| 国产不卡在线一区| 国产一区二区电影| 国产麻豆91精品| 日韩国产成人精品| 男人的天堂久久精品| 日本亚洲视频在线| 强制捆绑调教一区二区| 青青草97国产精品免费观看无弹窗版| 亚洲一区二区三区三| 午夜精品久久久久久久| 亚洲午夜免费电影| 日一区二区三区| 久久国产精品露脸对白| 国产资源在线一区| 成人国产视频在线观看| 99国产精品久| 精品视频资源站| 精品久久久久久久一区二区蜜臀| 99久久精品国产一区二区三区| 免费在线观看成人| 国产91丝袜在线观看| 在线视频亚洲一区| 欧美大片免费久久精品三p| 久久久亚洲午夜电影| 亚洲免费伊人电影| 久久99国产精品久久99果冻传媒| 国产精品羞羞答答xxdd| 99久久综合99久久综合网站| 日本道免费精品一区二区三区| 91精品国产全国免费观看| 国产清纯美女被跳蛋高潮一区二区久久w| 综合久久久久久| 美腿丝袜亚洲综合| 色综合久久中文字幕| 91精品国产综合久久久久久漫画 | 91视频一区二区| 欧美一区二区视频在线观看| 2023国产精品视频| 日本强好片久久久久久aaa| 成人免费视频app| 日韩一区和二区| 亚洲午夜在线电影| 99精品国产99久久久久久白柏| 精品国产不卡一区二区三区| 一区二区三区在线观看欧美| 国产美女在线观看一区| 日韩欧美卡一卡二| 天堂久久久久va久久久久| 日本韩国欧美在线| 国产精品视频第一区| 成人深夜福利app| 欧美激情资源网| 91网址在线看| 亚洲综合成人在线| 欧美精品粉嫩高潮一区二区|