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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? advanced shellcoding techniques.txt

?? 黑客培訓教程
?? 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.  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品va在线观看| 国产99久久久精品| 亚洲一线二线三线视频| 日本乱人伦aⅴ精品| 国产老妇另类xxxxx| 久久成人羞羞网站| 久久婷婷国产综合精品青草| 99精品欧美一区二区蜜桃免费| 日韩福利视频导航| 亚洲猫色日本管| 久久久精品中文字幕麻豆发布| 欧美日韩在线亚洲一区蜜芽| 成人免费毛片片v| 九九国产精品视频| 日韩激情在线观看| 国产精品久久久99| 91精品办公室少妇高潮对白| 亚洲高清免费观看高清完整版在线观看| 成人免费视频免费观看| 国产精品久久久久一区 | 不卡的av在线| 一区二区理论电影在线观看| 欧美亚洲日本国产| 久草精品在线观看| 国产午夜精品美女毛片视频| 91亚洲精品一区二区乱码| 亚洲综合另类小说| 国产亚洲成年网址在线观看| 色综合久久久久久久| 午夜亚洲国产au精品一区二区| 精品欧美黑人一区二区三区| 成人妖精视频yjsp地址| 日韩成人免费看| 中文字幕成人网| 精品国产伦一区二区三区免费| 91日韩一区二区三区| 日韩成人免费看| 亚洲女女做受ⅹxx高潮| 久久er99热精品一区二区| 亚洲精品日韩专区silk| 欧美一级淫片007| 亚洲免费观看高清完整版在线| 久久99国产精品麻豆| 亚洲成人你懂的| 久久99国产精品久久99果冻传媒| 国产精品无码永久免费888| 欧洲色大大久久| 欧美色窝79yyyycom| 欧洲亚洲精品在线| 亚洲国产精品精华液2区45| 日韩精品专区在线影院重磅| 亚洲精品一区二区精华| 国产日韩视频一区二区三区| 日本一区二区在线不卡| 中文字幕成人在线观看| 国产精品传媒视频| www.日本不卡| 国产宾馆实践打屁股91| 韩日精品视频一区| 国产在线国偷精品产拍免费yy| 国产自产v一区二区三区c| 日本人妖一区二区| 精品一区二区在线视频| 美女视频一区在线观看| 亚洲成年人网站在线观看| 亚洲一卡二卡三卡四卡五卡| 一区二区成人在线观看| 亚洲综合久久av| 亚洲国产成人精品视频| 美女视频一区二区| 青青草国产成人av片免费| 久久99热这里只有精品| 韩国av一区二区三区四区| 国产不卡在线一区| 欧美午夜精品一区二区三区| 欧美一级夜夜爽| 国产欧美一区二区在线观看| 成人免费一区二区三区视频| 亚洲一二三四久久| 日韩精品电影在线观看| 久久av中文字幕片| 欧美日韩精品一区二区三区蜜桃| 精品视频在线免费| 亚洲欧美综合另类在线卡通| 欧美精品亚洲一区二区在线播放| 欧美va亚洲va| 亚洲色欲色欲www| 亚洲小说欧美激情另类| 成人欧美一区二区三区在线播放| 国产精品久久久久婷婷| 91在线视频免费观看| 奇米777欧美一区二区| 日本在线不卡视频一二三区| 蜜桃久久久久久| av一区二区三区四区| 91麻豆精品国产91久久久资源速度| 日韩国产成人精品| 91麻豆国产福利精品| 精品日韩欧美一区二区| 亚洲色图一区二区| 精品一区二区三区在线观看 | 在线播放/欧美激情| 国产欧美日韩视频在线观看| 日韩电影在线一区二区三区| 一道本成人在线| 国产精品三级av在线播放| 国产在线一区观看| 91久久线看在观草草青青| 日韩欧美在线综合网| 最新久久zyz资源站| 丁香婷婷深情五月亚洲| 精品国产伦一区二区三区免费| 国产成人午夜电影网| 国产原创一区二区| 午夜久久电影网| 五月天激情小说综合| 99九九99九九九视频精品| 久久久久久久久久美女| 婷婷综合五月天| 欧美少妇xxx| 亚洲人吸女人奶水| 国产成都精品91一区二区三| 精品福利在线导航| 美腿丝袜在线亚洲一区| 在线不卡一区二区| 天堂资源在线中文精品| 色老汉av一区二区三区| 亚洲美女屁股眼交| 99免费精品视频| 中文字幕的久久| 国产1区2区3区精品美女| 久久久美女毛片| 国产福利不卡视频| 国产色产综合色产在线视频| 国产精品一二二区| 国产亚洲精品精华液| 国产激情91久久精品导航| 久久夜色精品一区| 精品午夜一区二区三区在线观看| 欧美电视剧在线观看完整版| 久热成人在线视频| 精品国产91久久久久久久妲己| 青青草精品视频| 精品成人一区二区三区| 国产酒店精品激情| 欧美国产日韩精品免费观看| 99久久精品国产导航| 伊人色综合久久天天人手人婷| 欧美中文一区二区三区| 日韩黄色在线观看| 日韩精品一区二区在线| 黄色成人免费在线| 亚洲国产高清aⅴ视频| 91亚洲精品乱码久久久久久蜜桃| 亚洲黄色小视频| 在线成人免费视频| 久草中文综合在线| 久久疯狂做爰流白浆xx| wwwwxxxxx欧美| 99久久免费国产| 亚洲大尺度视频在线观看| 91精品蜜臀在线一区尤物| 国产自产高清不卡| 自拍偷拍国产精品| 欧美日韩不卡视频| 国产精品自拍在线| 亚洲另类中文字| 秋霞影院一区二区| 香蕉久久夜色精品国产使用方法 | 欧美日韩国产综合一区二区| 国产伦精品一区二区三区免费迷 | 色综合久久综合网97色综合| 国产色爱av资源综合区| 亚洲成人一区在线| 国产91精品免费| 亚洲一线二线三线视频| 日韩午夜小视频| 99精品欧美一区二区三区综合在线| 偷拍一区二区三区| 久久精品人人爽人人爽| 在线亚洲高清视频| 久久国产精品一区二区| 亚洲免费观看高清完整| 欧美不卡123| 91日韩在线专区| 国产在线精品国自产拍免费| 一区二区视频在线| 久久这里只有精品6| 在线观看www91| 国产麻豆精品theporn| 亚洲成人在线观看视频| 国产精品视频在线看| 日韩亚洲欧美一区| proumb性欧美在线观看| 美腿丝袜亚洲综合| 伊人色综合久久天天人手人婷| 久久久久国产精品人| 欧美日韩激情一区二区| 白白色 亚洲乱淫| 国产在线精品国自产拍免费|