飞机联程票是什么意思| 为什么会连续两天遗精| 吃苋菜有什么好处| 妇科千金片主要治什么| 蛇进家是什么意思| 宫颈管积液什么意思| 眼睛干涩用什么药| 乙肝核心抗体高是什么意思| 什么是修辞手法| 梦见老公不理我是什么意思| 变应性鼻炎是什么意思| 小孩做ct对身体有什么影响| 吃惊的什么| 菊花代表什么| 人参不能和什么一起吃| 太妃糖为什么叫太妃糖| 依赖是什么意思| 黑枸杞和什么一起泡水喝比较好| 什么和什么不能一起吃| fdi是什么意思| 女人吃什么补月牙最快| 紫色和蓝色混合是什么颜色| 什么是音序| 头发汗多是什么原因| 8月15日什么星座| 喉咙疼吃什么药| 高血压适合吃什么食物| 甲减对胎儿有什么影响| 什么是狐臭| 梦见西红柿什么意思| 最大的沙漠是什么沙漠| 好整以暇什么意思| 独是什么生肖| 奢饰品是什么意思| 晴空万里什么意思| 静脉血是什么颜色| 萤火虫为什么越来越少| 公历是什么意思| 天牛长什么样子| 老人脚肿吃什么药消肿| 毛发旺盛女生什么原因引起的| 病是什么结构| hs医学上是什么意思| 复杂囊肿是什么意思| 十恶大败是什么意思| 肌酐测定是查什么| 金色搭配什么颜色好看| 什么叫幸福| 僵尸为什么怕糯米| 手淫多了有什么危害| 鹅蛋脸适合什么刘海| 成吉思汗是什么意思| 多吃西瓜有什么好处| 慢性胃炎能吃什么水果| 宫保鸡丁宫保是指什么| 大小姐是什么意思| a型血与o型血生的孩子是什么血型| 三五成群十双在是什么生肖| 总是放屁是什么原因| 什么都值得买| 做完人流可以吃什么| od是什么意思| 月结是什么意思| 答辩是什么| 6月23日是什么节日| 生吃西红柿有什么好处和坏处| 丈二和尚摸不着头脑是什么意思| 商品下架是什么意思| 孕妇有狐臭擦什么最好| 轭是什么意思| 什么叫批次线| 痰带血丝是什么原因| 体能是什么| 资深是什么意思| 宝宝风寒感冒吃什么药最好| 不长毛的猫叫什么名字| 眩晕是什么原因| 遁入空门是什么意思| 什么是负数| 看见喜鹊有什么预兆| 启读什么| 科员是什么职务| 纸包鸡什么意思| 1999年出生的属什么| 出圈什么意思| 免运费是什么意思| 伯爵是什么意思| 淀粉样变性是什么病| 甲减要多吃什么食物好| 移民澳洲需要什么条件| 曹操的父亲叫什么名字| 肥大肾柱是什么意思| 秘书是干什么的| 蜱虫长什么样子图片| 肥皂是什么做的| 新生儿拉肚子是什么原因引起的| 得偿所愿是什么意思| 洧是什么意思| dvf是什么品牌| 锁骨疼是什么原因| 赫兹是什么意思| 猪胰是什么东西| 脸长的人适合什么发型| 梅毒是什么样的| 头疼吃什么药最有效| 雌激素过高是什么原因造成的| 欧阳修是什么居士| 观音殿求什么| 上火吃什么| 转氨酶高吃什么食物好| 逆转是什么意思| 金字旁加者念什么| 焦虑挂什么科| 治疗早泄吃什么药| 盘古是一个什么样的人| 身体皮肤痒是什么原因| 梦见自己死了又活了是什么意思| 海澜之家属于什么档次| 北上广深是什么意思| 义眼是什么意思| 狗狗睡姿代表什么图解| 属鸡的本命佛是什么佛| 性早熟有什么危害| 己巳是什么意思| 尿白细胞弱阳性是什么意思| 指甲有竖纹是什么原因| 少年白头发是什么原因| 精神恍惚是什么意思| 9月12号是什么星座| 2019属什么| 产后吃什么对身体恢复好| 什么是沉香| 脚气看什么科| 内分泌失调是什么意思| 起死回生是什么意思| 嗓子总有痰吃什么药| 煲汤放什么药材补气血| 什么叫生化| rangerover是什么车| 水猴子是什么动物| 来例假喝什么好| 蛋白粉和乳清蛋白粉有什么区别| 润滑油是什么| 纷扰是什么意思| 女性腰疼应该挂什么科| 刹那芳华是什么意思| 小孩干咳吃什么药| 剁椒鱼头属于什么菜系| 什么止咳效果最好最快| 体寒吃什么好| 为什么突然长痣| 欧米茄属于什么档次| 什么是玄关| 梦见打狼是什么预兆| 男人壮阳吃什么最快| torch是什么意思| 小孩咳嗽吃什么药效果最好| 铭是什么意思| 白细胞阳性什么意思| bf是什么意思| 总是流鼻血是什么原因| 支气管发炎用什么药| 牙痛不能吃什么东西| 夏天水肿的原因是什么| 白细胞2个加号是什么意思| 黄绿色是什么颜色| 关节炎吃什么药好得快| 梦见背小孩是什么意思| 狂犬疫苗什么时候打| 春眠不觉晓的晓是什么意思| 小孩咬人是什么原因| 左心室强光点是什么意思| 投胎什么意思| 医院dr检查是什么| 结节病变是什么意思| 一什么田野| 血尿酸偏高是什么原因| 高血压吃什么药| 今年气温为什么这么高| 外油内干是什么肤质| 痛风能吃什么菜谱大全| 什么植物最好养| 二甲双胍为什么晚上吃| 强痛定又叫什么| 什么是人设| 10月30是什么星座| 尖锐湿疣的症状是什么| 星期狗什么意思| 郁是什么生肖| 4.25是什么星座| 甲状腺斑块是什么意思| 粘纤是什么材质| 孩子睡觉出汗多是什么原因| 妈妈的爱是什么| 胆在什么位置| 尿酸高吃什么药| 免运费是什么意思| 什么绿绿| bulova是什么牌子的手表| 母仪天下什么意思| bys是什么药| 查贫血挂什么科| 什么叫捞女| 痔疮饮食要注意什么| 维生素b12又叫什么| 六月六吃什么| 水是由什么组成的| 吃什么补精子快| 胆没了对身体有什么影响| 屏保什么意思| 胸椎退行性变什么意思| 前列腺彩超能查出什么| 梦见大风大雨预示什么| 孔子孟子什么关系| dha是什么| 不在服务区是什么意思| 什么鱼适合清蒸| 剌是什么意思| 喝红茶对身体有什么好处| 羊肉不能和什么食物一起吃| 朝对什么| 海鲜不能和什么食物一起吃| 过敏性紫癜有什么症状| 团五行属什么| 鲱鱼罐头那么臭为什么还有人吃| 81年的鸡是什么命| 阴部瘙痒用什么药| 年岁是什么意思| 血脂挂什么科| 正常尿液是什么颜色| 权志龙为什么这么火| 生水是什么意思| 自助餐是什么意思| 烧烤用什么油| 04属什么生肖| as是什么| 一姐是什么意思| 孙五行属什么| 栓是什么意思| 3月9日是什么星座| 退行性病变是什么意思| 着床后需要注意什么| 快乐是什么意思| 孩子疱疹性咽峡炎吃什么药| 胆囊壁欠光滑是什么意思| 有什么无什么的成语| 山竹里面黄黄的是什么| 为什么打呼噜| 一九七二年属什么生肖| 身体上有小红点是什么病| 双子后面是什么星座| 什么什么有力| 胸腔疼痛挂什么科| 崩溃什么意思| 不成敬意是什么意思| edo是什么意思| 1994是什么年| 怀孕喝什么牛奶好| 拉肚子吃什么药效果好| 美帝是什么意思| 长期戴耳机有什么危害| 燕窝有什么好处| 2007是什么年| 什么样的水果| 百度Jump to content

新疆特色果品质量安全多项关键技术达世界先进水平

From Wikipedia, the free encyclopedia
(Redirected from Alphanumeric shellcode)
百度 格局转圜之时,有的骑墙观察,有的主动适应,有的试图抗拒,尤其是美国这样年轻的天选之国,可谓亘古未有之大变局,他的焦虑与心慌,真不是装出来的。

Shellcode is executable code intended to be used as a payload for exploiting a software vulnerability. The term includes shell because the attack originally described an attack that opens a command shell that the attacker can use to control the target machine, but any code that is injected to gain access that is otherwise not allowed can be called shellcode. For this reason, some consider the name shellcode to be inaccurate.[1]

An attack commonly injects data that consists of executable code into a process before or as it exploits a vulnerability to gain control. The program counter is set the shellcode entry point so that that the shellcode runs. Deploying shellcode is often accomplished by including the code in a file that a vulnerable process downloads and then loads into its memory.

Common wisdom dictates that to maximum effectiveness, a shellcode payload should be small.[2] Machine code provides the flexibility needed to accomplish the goal. Shellcode authors leverage small opcodes to create compact shellcode.[3][4]

Types

[edit]
Local

A local shellcode attack allows an attacker to gain elevated access privilege on their computer. In some cases, exploiting a vulnerability can be achieved by causing an error such as buffer overflow. If successful, the shellcode enables access to the machine via the elevated privileges granted to the targeted process.

Remote

A remote shellcode attack targets a process running on a remote machine – on the same local area network, intranet, or on the internet. If successful, the shellcode provides access to the target machine across the network. The shellcode normally opens a TCP/IP socket connection to allow access to a shell on the target machine.

A remote shellcode attack can be categorized by its behavior. If the shellcode establishes the connection it is called a reverse shell, or a connect-back shellcode. On the other hand, if the attacker establishes the connection, the shellcode is called a bindshell because the shellcode binds to a certain port on the victim's machine. A bindshell random port skips the binding part and listens on a random port.[a] A socket-reuse shellcode is an exploit that establishes a connection to the vulnerable process that is not closed before the shellcode runs so that the shellcode can re-use the connection to allow remote access. Socket re-using shellcode is more elaborate, since the shellcode needs to find out which connection to re-use and the machine may have many open connections.[5]

A firewall can detect outgoing connections made by connect-back shellcode as well as incoming connections made by bindshells, and therefore, offers some protection against an attack. Even if the system is vulnerable, a firewall can prevent the attacker from connecting to the shell created by the shellcode. One reason why socket re-using shellcode is used is that it does not create new connections and, therefore, is harder to detect and block.

Download and execute

A download and execute shellcode attack downloads and executes malware on the target system. This type of shellcode does not spawn a shell, but rather instructs the machine to download a certain executable file from the network and execute it. Nowadays, it is commonly used in drive-by download attacks, where a victim visits a malicious webpage that in turn attempts to run such a download and execute shellcode in order to install software on the victim's machine.

A variation of this attack downloads and loads a library.[6][7] Advantages of this technique are that the code can be smaller, that it does not require the shellcode to spawn a new process on the target system, and that the shellcode does not need code to clean up the targeted process as this can be done by the library loaded into the process.

Staged

When the amount of data that an attacker can inject into the target process is too limited to achieve the desired effect, it may be possible to deploy shellcode in stages that progressively provide more access. The first stage might do nothing more than download the second stage than then provides the desired access.

Egg-hunt

An egg-hunt shellcode attack is a staged attack in which the attacker can inject shellcode into a process but does not know where in the process it is. A second-stage shellcode, generally smaller than the first, is injected into the process to search the process's address space for the first shellcode (the egg) and executes it.[8]

Omelet

An omelet shellcode attack, similar to egg-hunt, looks for multiple small blocks of data (eggs) and combines them into a larger block (omelet) that is then executed. This is used when an attacker is limited on the size of injected code but can inject multiple.[9]

Encoding

[edit]

Shellcode is often written in order to work around the restrictions on the data that a process will allow. General techniques include:

Optimize for size

Optimize the code to decrease its size.

Self-modifying code

Modify its own code before executing it to use byte values that are otherwise restricted.

Encryption

To avoid intrusion detection, encode as self-decrypting or polymorphic.

Character encoding

An attack that targets a browser might obfuscate shellcode in a JavaScript string using an expanded character encoding.[10] For example, on the IA-32 architecture, here's two unencoded no-operation instructions (used in a NOP slide):

90             NOP
90             NOP

As encoded:

Null-free

Shellcode must be written without zero-value bytes when it is intended to be injected into a null-terminated string that is copied in the target process via the usual algorithm (i.e. strcpy) of ending the copy at the first zero byte – called the null character in common character sets. If the shellcode contained a null, the copy would be truncated and not function properly. To produce null-free code from code that contains nulls, one can replace machine instructions that contain zeroes with instructions that don't. For example, on the IA-32 architecture the instruction to set register EAX to 1 contains zeroes as part of the literal (1 expands to 0x00000001).

B8 01000000    MOV EAX,1

The following instructions accomplish the same goal (EAX containing 1) without embedded zero bytes by first setting EAX to 0, then incrementing EAX to 1:

33C0           XOR EAX,EAX
40             INC EAX
Text

An alphanumeric shellcode consists of only alphanumeric characters (0–9, A–Z and a–z).[11][12] This type of encoding was created by hackers to obfuscate machine code inside what appears to be plain text. This can be useful to avoid detection of the code; to allow the code to pass through filters that scrub non-alphanumeric characters from strings.[b]. A similar type of encoding is called printable code and uses all printable characters (alphanumeric plus symbols like !@#%^&*). A similarly restricted variant is ECHOable code not containing any characters which are not accepted by the ECHO command. It has been shown that it is possible to create shellcode that looks like normal text in English.[13] Writing such shellcode requires in-depth understanding of the instruction set architecture of the target machines. It has been demonstrated that it is possible to write alphanumeric code that is executable on more than one machine,[14] thereby constituting multi-architecture executable code.

A work-around was published by Rix in Phrack 57[11] in which he shows that it is possible to turn any code into alphanumeric code. Often, self-modifying code is leveraged because it allows the code to have byte values that otherwise are not allowed by replacing coded values at runtime. A self-modifying decoder can be created that initially uses only allowed bytes. The main code of the shellcode is encoded, also only using bytes in the allowed range. When the output shellcode is run, the decoder modifies its code to use instructions it requires and then decodes the original shellcode. After decoding the shellcode, the decoder transfers control to it. It has been shown that it is possible to create arbitrarily complex shellcode that looks like normal English text.[13]

Modern software uses Unicode to support Internationalization and localization. Often, input ASCII text is converted to Unicode before processing. When an ASCII (Latin-1 in general) character is transformed to UTF-16 (16-bit Unicode), a zero byte is inserted after each byte (character) of the original text. Obscou proved in Phrack 61[12] that it is possible to write shellcode that can run successfully after this transformation. Programs that can automatically encode any shellcode into alphanumeric UTF-16-proof shellcode exist, based on the same principle of a small self-modifying decoder that decodes the original shellcode.

Compatibility

[edit]

Generally, shellcode is deployed as machine code since it affords relatively unprotected access to the target process. Since machine code is compatible within a relatively narrow computing context (processor, operating system and so on), a shellcode fragment has limited compatibility. Also, since a shellcode attack tends to work best when the code is small and targeting multiple exploits increases the size, typically the code targets only one exploit. None the less, a single shellcode fragment can work for multiple contexts and exploits.[15][16][17] Versatility can be achieved by creating a single fragment that contains an implementation for multiple contexts. Common code branches to the implementation for the runtime context.

Analysis

[edit]

As shellcode is generally not executable on its own, in order to study what it does, it is typically loaded into a special process. A common technique is to write a small C program that contains the shellcode as data (i.e. in a byte buffer), and transfers control to the instructions encoded in the data function pointer or inline assembly code). Another technique is to use an online tool, such as shellcode_2_exe, to embed the shellcode into a pre-made executable husk which can then be analyzed in a standard debugger. Specialized shellcode analysis tools also exist, such as the iDefense sclog project (originally released in 2005 in the Malcode Analyst Pack). Sclog is designed to load external shellcode files and execute them within an API logging framework. Emulation-based shellcode analysis tools also exist such as the sctest application which is part of the cross-platform libemu package. Another emulation-based shellcode analysis tool, built around the libemu library, is scdbg which includes a basic debug shell and integrated reporting features.

See also

[edit]

Notes

[edit]
  1. ^ The bindshell random port is the smallest stable bindshell shellcode for x86_64 available to date.
  2. ^ in part, such filters were a response to non-alphanumeric shellcode exploits

References

[edit]
  1. ^ Foster, James C.; Price, Mike (2025-08-06). Sockets, Shellcode, Porting, & Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals. Elsevier Science & Technology Books. ISBN 1-59749-005-9.
  2. ^ Anley, Chris; Koziol, Jack (2007). The shellcoder's handbook: discovering and exploiting security holes (2 ed.). Indianapolis, Indiana, UA: Wiley. ISBN 978-0-470-19882-7. OCLC 173682537.
  3. ^ Foster, James C. (2005). Buffer overflow attacks: detect, exploit, prevent. Rockland, MA, USA: Syngress. ISBN 1-59749-022-9. OCLC 57566682.
  4. ^ "Tiny Execve sh - Assembly Language - Linux/x86". GitHub. Retrieved 2025-08-06.
  5. ^ BHA (2025-08-06). "Shellcode/Socket-reuse". Retrieved 2025-08-06.
  6. ^ SkyLined (2025-08-06). "Download and LoadLibrary shellcode released". Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  7. ^ "Download and LoadLibrary shellcode for x86 Windows". 2025-08-06. Retrieved 2025-08-06.
  8. ^ Skape (2025-08-06). "Safely Searching Process Virtual Address Space" (PDF). nologin. Retrieved 2025-08-06.
  9. ^ SkyLined (2025-08-06). "w32 SEH omelet shellcode". Skypher.com. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  10. ^ "JavaScript large number of unescape patterns detected". Archived from the original on 2025-08-06.
  11. ^ a b rix (2025-08-06). "Writing ia32 alphanumeric shellcodes". Phrack. 0x0b (57). Phrack Inc. #0x0f of 0x12. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  12. ^ a b obscou (2025-08-06). "Building IA32 'Unicode-Proof' Shellcodes". Phrack. 11 (61). Phrack Inc. #0x0b of 0x0f. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  13. ^ a b Mason, Joshua; Small, Sam; Monrose, Fabian; MacManus, Greg (November 2009). English Shellcode (PDF). Proceedings of the 16th ACM conference on Computer and Communications Security. New York, NY, USA. pp. 524–533. Archived (PDF) from the original on 2025-08-06. Retrieved 2025-08-06. (10 pages)
  14. ^ "Multi-architecture (x86) and 64-bit alphanumeric shellcode explained". Blackhat Academy. Archived from the original on 2025-08-06.
  15. ^ eugene (2025-08-06). "Architecture Spanning Shellcode". Phrack. Phrack Inc. #0x0e of 0x12. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  16. ^ nemo (2025-08-06). "OSX - Multi arch shellcode". Full disclosure. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  17. ^ Cha, Sang Kil; Pak, Brian; Brumley, David; Lipton, Richard Jay (2025-08-06) [2025-08-06]. Platform-Independent Programs (PDF). Proceedings of the 17th ACM conference on Computer and Communications Security (CCS'10). Chicago, Illinois, USA: Carnegie Mellon University, Pittsburgh, Pennsylvania, USA / Georgia Institute of Technology, Atlanta, Georgia, USA. pp. 547–558. doi:10.1145/1866307.1866369. ISBN 978-1-4503-0244-9. Archived (PDF) from the original on 2025-08-06. Retrieved 2025-08-06. [1] (12 pages) (See also: [2])
[edit]
乌梅是什么水果做的 痛经吃什么药好 备孕叶酸什么时候吃最好 买二手苹果手机要注意什么 压测是什么意思
艾灸是什么 小孩记忆力差什么原因 什么一梦 空调什么牌子好 梦见赢钱了是什么预兆
牙齿发酸是什么病征兆 鱼漂什么牌子的好 神经衰弱吃什么药好 为什么会得甲减 随喜赞叹是什么意思
经常口腔溃疡吃什么维生素 私处长痘痘是什么原因 调和油是什么意思 胃阳不足吃什么中成药 腰果不能和什么一起吃
切除胆囊有什么影响hcv9jop2ns8r.cn 5点是什么时辰hcv9jop6ns1r.cn 青蛙靠什么呼吸hcv7jop6ns3r.cn 邮编什么意思hcv9jop6ns9r.cn 肝功高是什么原因引起的hcv9jop7ns2r.cn
洋葱吃多了有什么坏处naasee.com 牡蛎是什么hcv8jop8ns9r.cn 三唑磷主要打什么虫dajiketang.com 发来贺电是什么意思hcv8jop6ns8r.cn 口中发甜是什么原因zhiyanzhang.com
什么是低密度脂蛋白胆固醇hcv8jop5ns1r.cn c肽测定是什么意思hcv8jop5ns0r.cn 长裙配什么鞋子好看hcv9jop4ns6r.cn 耳朵发痒是什么原因hcv9jop5ns0r.cn 嘴巴里长水泡是什么原因hcv8jop6ns3r.cn
央企与国企有什么区别hcv8jop1ns7r.cn 甲状腺有什么功能helloaicloud.com 瑞字属于五行属什么hcv9jop1ns9r.cn 白带黄什么原因hcv9jop6ns2r.cn 宫颈肥大有什么症状hcv9jop2ns6r.cn
百度