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

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

?? advanced shellcoding techniques.txt

?? 1000 HOWTOs for various needs [WINDOWS]
?? 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一区二区三区免费野_久草精品视频
中文字幕va一区二区三区| 欧美日韩和欧美的一区二区| 国产欧美1区2区3区| 99国产欧美久久久精品| 最近日韩中文字幕| 欧美三级乱人伦电影| 国产不卡视频在线观看| 一区二区三区美女视频| 成人av在线看| 欧美性受xxxx黑人xyx| 久久久精品中文字幕麻豆发布| 国产精品资源网站| 亚洲成人免费观看| 日韩一区二区三区精品视频| 国产在线播放一区| 青青草成人在线观看| 91精品国产综合久久精品麻豆 | 一区二区三区色| 欧美久久久久久蜜桃| 激情综合色综合久久综合| 中文字幕字幕中文在线中不卡视频| 欧美午夜视频网站| 国产剧情av麻豆香蕉精品| 亚洲一区二区三区四区五区黄| 精品国产露脸精彩对白| 91高清在线观看| 国产一区二区91| 日韩成人免费电影| 亚洲精品精品亚洲| 国产欧美视频在线观看| 欧美精品久久99久久在免费线| 成人综合婷婷国产精品久久| 视频一区在线播放| 一区二区三区中文免费| 国产精品欧美精品| 国产视频一区二区在线| 日韩欧美亚洲国产另类| 3d成人h动漫网站入口| 欧美剧在线免费观看网站 | 午夜欧美电影在线观看| 亚洲精品欧美在线| 亚洲人成网站精品片在线观看 | 色综合一个色综合亚洲| 国产69精品久久久久777| 欧美另类z0zxhd电影| 日本韩国欧美在线| 在线视频观看一区| 色噜噜狠狠一区二区三区果冻| 波多野结衣亚洲一区| 国产成人在线视频免费播放| 国产高清不卡一区| 91丝袜美腿高跟国产极品老师| 成人动漫精品一区二区| 91最新地址在线播放| 色8久久精品久久久久久蜜| 欧美三日本三级三级在线播放| 欧美日韩免费电影| 精品久久人人做人人爰| 欧美国产1区2区| 亚洲最色的网站| 久久精工是国产品牌吗| 粉嫩绯色av一区二区在线观看| 成人av第一页| 日韩一二三四区| 国产精品久久久久久久久动漫| 亚洲精品国产一区二区精华液| 视频在线观看一区| www.日本不卡| 亚洲精品一区在线观看| 亚洲视频1区2区| 激情成人综合网| 欧美伦理影视网| 亚洲欧美区自拍先锋| 国产伦精品一区二区三区视频青涩 | 成人精品视频一区二区三区| 91福利视频网站| 亚洲国产电影在线观看| 日韩av一区二区三区| 国产精品亚洲一区二区三区妖精 | 色综合天天综合网天天看片| 在线亚洲精品福利网址导航| 91 com成人网| 中文字幕一区二区三区在线观看| 亚洲无线码一区二区三区| 国产成人免费在线| 欧美久久一区二区| 亚洲色图视频网站| 狠狠久久亚洲欧美| 欧美日韩在线播放一区| 国产精品美女久久久久久2018 | 久久午夜色播影院免费高清| 伊人一区二区三区| 成人激情免费视频| 日韩精品一区二区三区四区 | 亚洲欧美日韩一区二区| 国产在线播放一区| 亚洲婷婷综合久久一本伊一区| 五月婷婷久久综合| 亚洲国产日韩一级| 色综合天天做天天爱| 日韩电影在线看| gogogo免费视频观看亚洲一| 在线一区二区三区四区| 色综合天天综合狠狠| 欧美tickling挠脚心丨vk| 亚洲视频电影在线| 国产激情一区二区三区四区| 欧美性猛交xxxx黑人交| 国产精品盗摄一区二区三区| 三级在线观看一区二区| 国产成人av电影在线| 91精品国产高清一区二区三区| 2023国产精品| 亚洲成人免费在线观看| 国产精品538一区二区在线| 91精品国产福利在线观看| 最新不卡av在线| 成人午夜视频网站| 久久综合久久综合久久| 日日夜夜免费精品视频| 99国产精品久| 久久精品一区二区| 日韩av一二三| 色999日韩国产欧美一区二区| 中文无字幕一区二区三区| 美女在线视频一区| 精品处破学生在线二十三| 国产一区二区美女| 欧美丰满美乳xxx高潮www| 亚洲国产综合在线| 91视频国产观看| 国产精品国产精品国产专区不片| 精品在线免费观看| 一本一本久久a久久精品综合麻豆| 国产精品乱码人人做人人爱| 久久电影网电视剧免费观看| 日韩写真欧美这视频| 婷婷丁香激情综合| 欧美电影一区二区三区| 亚洲美女一区二区三区| 国产精品99精品久久免费| 久久精品亚洲国产奇米99| 久久精品噜噜噜成人88aⅴ| 日韩精品一区二区三区中文不卡| 日韩av午夜在线观看| 日韩免费看的电影| 偷拍一区二区三区四区| 在线不卡中文字幕播放| 日韩电影在线免费观看| 欧美日韩在线直播| 青青草91视频| 91精品国产综合久久香蕉的特点| 捆绑调教美女网站视频一区| 欧美一区二区三区啪啪| 久久99久久久欧美国产| 日韩欧美在线1卡| 美女视频黄久久| 久久综合999| 韩国欧美国产1区| 亚洲国产成人私人影院tom | 国内精品伊人久久久久影院对白| 久久一区二区三区四区| 国产精品一二三在| 中文字幕色av一区二区三区| www.亚洲在线| 午夜成人免费电影| 日韩欧美国产三级电影视频| 国产一区二区剧情av在线| 久久影院视频免费| 狠狠色丁香婷婷综合久久片| 国产精品三级电影| 91在线国产观看| 亚洲r级在线视频| 日韩一区二区在线观看| 国产精品伊人色| 亚洲欧洲一区二区三区| 欧美日韩激情一区二区| 老司机免费视频一区二区三区| 亚洲国产精品成人综合| 在线国产亚洲欧美| 国产呦萝稀缺另类资源| 中文幕一区二区三区久久蜜桃| 欧美三级资源在线| 另类人妖一区二区av| 中文字幕精品在线不卡| 色香蕉久久蜜桃| 亚洲成人资源网| 国产欧美日本一区视频| 91啪在线观看| 久久精工是国产品牌吗| 国产精品看片你懂得| 欧美精品1区2区3区| 国产在线播放一区| 亚洲一二三区不卡| 精品欧美一区二区三区精品久久| 国产精品2024| 欧美哺乳videos| 波多野结衣亚洲一区| 蜜桃久久精品一区二区| 中文字幕中文字幕一区二区|