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

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

?? advanced shellcoding techniques.txt

?? 黑客培訓(xùn)教程
?? TXT
字號(hào):
  ***********************************************
     *                                             *
     * 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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看国产日韩| 欧美激情自拍偷拍| 久久 天天综合| 国产精品成人网| 精品国产一区二区三区四区四| 日本韩国一区二区三区视频| aaa亚洲精品一二三区| 亚洲欧美偷拍另类a∨色屁股| 国产一区二区在线影院| 9人人澡人人爽人人精品| 亚洲成年人网站在线观看| 美国欧美日韩国产在线播放| 日韩精品在线一区二区| 国产高清精品网站| 国产精品一二二区| 成人美女视频在线观看18| 日本亚洲天堂网| 亚洲一区二区欧美激情| 亚洲成人资源网| 水蜜桃久久夜色精品一区的特点 | 麻豆国产精品777777在线| 欧美日韩一区三区四区| 亚洲在线中文字幕| 国产成人av资源| 成人av免费在线观看| 国产日韩欧美精品一区| 久久久青草青青国产亚洲免观| 亚洲风情在线资源站| 美腿丝袜亚洲三区| 国产电影一区二区三区| 国产乱理伦片在线观看夜一区| 成人午夜私人影院| 亚洲精品亚洲人成人网在线播放| 亚洲超碰精品一区二区| 97精品视频在线观看自产线路二| 日韩久久久久久| 91网上在线视频| 亚洲视频 欧洲视频| 欧美一区二区视频观看视频| 欧美视频在线一区| 久久精品在线免费观看| 亚洲欧美日韩国产手机在线| 色婷婷亚洲婷婷| 亚洲桃色在线一区| 丁香五精品蜜臀久久久久99网站 | 免费观看久久久4p| 99久久久久免费精品国产| 久久精品视频免费观看| 色综合久久久久综合99| eeuss鲁一区二区三区| 国产成人精品三级麻豆| 欧美日韩精品三区| 99riav一区二区三区| 国精产品一区一区三区mba桃花| 成人免费一区二区三区视频| 国产成人av一区二区三区在线观看| 在线观看日韩av先锋影音电影院| 精品免费视频.| 欧美图区在线视频| 亚洲人吸女人奶水| 日韩美女在线视频| 91影视在线播放| 日韩精品亚洲一区二区三区免费| 精品国产3级a| 国产精品99久久久久久似苏梦涵| 日韩视频中午一区| 中文字幕欧美一区| 日韩欧美一级二级| 色婷婷亚洲综合| kk眼镜猥琐国模调教系列一区二区| 中文字幕一区二区三区不卡| 国产精品私房写真福利视频| 欧美性色综合网| 国产成人a级片| 日本女优在线视频一区二区| 国产精品免费观看视频| 午夜精品一区在线观看| 国产精品自产自拍| 麻豆传媒一区二区三区| 日日噜噜夜夜狠狠视频欧美人| 精品国产一区二区三区四区四| 91小视频在线免费看| 奇米777欧美一区二区| 亚洲免费观看高清完整版在线观看熊 | 亚洲欧洲制服丝袜| 2021中文字幕一区亚洲| 欧美videossexotv100| 日韩免费在线观看| 欧美大尺度电影在线| 精品国产免费久久| 久久久久国产精品免费免费搜索| 久久久久久久久久美女| 亚洲国产高清在线观看视频| 国产精品家庭影院| 亚洲国产成人av| 天天色 色综合| 精品一区二区影视| 成人一区二区在线观看| 色呦呦一区二区三区| 欧美日韩一区二区三区四区| 欧美一区二区三区在线视频| 欧美v国产在线一区二区三区| 精品精品国产高清a毛片牛牛| 国产亚洲污的网站| 亚洲欧美日韩系列| 日韩电影在线免费看| 国产一区久久久| 91社区在线播放| 欧美一区二区视频网站| 久久久国产综合精品女国产盗摄| 国产精品视频一二三| 一区二区三区在线看| 美女一区二区三区| 91网站黄www| 日韩精品在线看片z| 国产欧美精品区一区二区三区 | 亚洲综合一区二区精品导航| 石原莉奈在线亚洲二区| 国模一区二区三区白浆| 色婷婷久久久久swag精品| 日韩一区二区在线播放| 亚洲国产精品ⅴa在线观看| 午夜久久久久久久久久一区二区| 国产一区二区女| 欧美日韩精品福利| 国产精品三级av在线播放| 日精品一区二区三区| 成人av在线观| 欧美成人欧美edvon| 日韩伦理av电影| 精品夜夜嗨av一区二区三区| 91免费小视频| 久久精品欧美一区二区三区麻豆| 亚洲第四色夜色| 99国产精品久久久久久久久久久| 日韩欧美国产系列| 亚洲一区二区三区在线| 成人免费高清视频在线观看| 欧美一区三区二区| 亚洲制服丝袜一区| av中文字幕一区| xf在线a精品一区二区视频网站| 亚洲电影一级片| 色天天综合久久久久综合片| 国产色产综合产在线视频| 奇米综合一区二区三区精品视频| 色婷婷狠狠综合| 中文字幕一区二| 国产成人亚洲综合a∨婷婷图片| 日韩视频免费直播| 亚洲bdsm女犯bdsm网站| 91免费看视频| 18涩涩午夜精品.www| 国产福利一区在线观看| 日韩美一区二区三区| 免费看欧美美女黄的网站| 欧美日韩一区二区三区在线看 | 欧美群妇大交群的观看方式| 亚洲精品视频在线观看网站| 成人不卡免费av| 亚洲国产精品av| 国产不卡视频一区二区三区| 久久中文字幕电影| 国精产品一区一区三区mba视频| 欧美精品在线观看播放| 丝袜a∨在线一区二区三区不卡| 欧美日韩精品高清| 热久久一区二区| 精品伦理精品一区| 久久99九九99精品| 亚洲精品一区二区三区99| 久久99国产精品免费网站| 精品国产乱码久久久久久久| 韩日精品视频一区| 国产亚洲美州欧州综合国| 国产成人午夜精品5599 | 亚洲色图视频网| 欧美日韩国产乱码电影| 亚洲一区二区在线视频| 欧美色倩网站大全免费| 偷拍日韩校园综合在线| 欧美一区二区三区影视| 狠狠色丁香久久婷婷综合_中| 国产亚洲人成网站| 91免费精品国自产拍在线不卡| 亚洲精品乱码久久久久久久久| 欧美午夜不卡视频| 免费成人美女在线观看.| 久久久综合视频| 北条麻妃一区二区三区| 亚洲伊人伊色伊影伊综合网| 欧美老女人第四色| 麻豆视频一区二区| 中文字幕精品综合| 在线观看一区二区精品视频| 日本一区中文字幕| 国产色综合一区| 欧美伊人久久大香线蕉综合69| 日韩高清在线电影| 中文字幕国产精品一区二区|