Skip to content

Commit 7d06bc4

Browse files
committed
update to v1.5
1 parent b7135c5 commit 7d06bc4

File tree

15 files changed

+79277
-7
lines changed

15 files changed

+79277
-7
lines changed

BypassFramework.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/usr/bin/python
22

3-
from termcolor import colored
4-
import os
5-
import logging
6-
import sys
73
from core.functions import *
84
import readline
95
from module.memory.CreateFiber import *
106
from module.memory.QueueUserAPC import *
117
from module.Separation.imageShell import *
8+
from module.darkexe.darkexe import *
9+
from termcolor import colored
1210

1311
python_version = sys.version_info[0]
1412

@@ -34,6 +32,11 @@
3432
if command == "help":
3533
help()
3634

35+
if command.split(" ")[0] == "exe":
36+
shellcode_add = input("\033[4mPlease input Your exe:\033[0m" + colored(" >>", "green"))
37+
darkarmour = Darkexe()
38+
darkarmour.run(args=shellcode_add)
39+
3740
if command.split(" ")[0] == "shellcode":
3841
readline.set_completer(shellcode_completer)
3942
readline.parse_and_bind("tab: complete")

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
\|
1313
1414
15-
v1.0 stable !
15+
v1.5 stable !
1616
author lengyi@HongHuSec Lab !
1717
1818
FourEye BypassFrameWork | BypassAV your shellcode && exe
@@ -46,8 +46,12 @@ https://www.bilibili.com/video/BV1zy4y1S7ZM/
4646

4747
大多数方法均为网上已经公开的方法,本人只是对其整合、优化,多来自于ired,感谢其分享精神。
4848

49+
## update
50+
51+
12.14:增加其对exe的免杀,方法参考@bats3c
52+
4953
## TODO
5054

5155
- 增加更多的免杀、shellcode加密方法
52-
- 增加直接对exe进行免杀
56+
5357

0 Bytes
Binary file not shown.

core/functions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import os
55

66

7+
8+
79
oct_commands = ["exe","shellcode","list","back","help","exit"]
810
shellcode_commands = ["xor","rot13","list","execute","png","exit","back"]
911

@@ -55,6 +57,8 @@ def shellcode2_execute():
5557
except:
5658
print(colored("[-]error\n","cyan"))
5759

60+
61+
5862
def banner():
5963
version = '\33[43m V1.0 Beta \033[0m'
6064
Yellow = '\33[33m'
@@ -73,7 +77,7 @@ def banner():
7377
\|
7478
{1}
7579
76-
{3}v1.0 stable !{1}
80+
{3}v1.5 stable !{1}
7781
{3}author lengyi@HongHuSec Lab !{1}
7882
7983
{2} FourEye BypassFrameWork | BypassAV your shellcode && exe {1}
2.42 KB
Binary file not shown.

module/darkexe/build/main.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#define key0 0x5a
2+
#define key1 0x5f
3+
#define key2 0x2a
4+
#define key3 0x4a
5+
#define key4 0x62
6+
7+
VOID FixImageIAT(PIMAGE_DOS_HEADER dos_header, PIMAGE_NT_HEADERS nt_header);
8+
LPVOID MapImageToMemory(LPVOID base_addr);

module/darkexe/build/pe_image.h

Lines changed: 78869 additions & 0 deletions
Large diffs are not rendered by default.

module/darkexe/darkexe.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import sys
2+
from module.darkexe.lib import compile
3+
from module.darkexe.lib import auxiliary
4+
from module.darkexe.lib import encryption
5+
from termcolor import colored
6+
7+
8+
class Darkexe(object):
9+
def __init__(self):
10+
super(Darkexe, self).__init__()
11+
self.enc_algos = ["xor"]
12+
self.compile_binary = compile.Binary()
13+
14+
def _do_encrypt(self):
15+
print(f"[i] Begining encryption via {self.crypt_type.upper()}")
16+
keys_used = {}
17+
for loop in range(self.loops):
18+
if self.crypt_type == "xor":
19+
crypt = encryption.XOR()
20+
if loop == 0:
21+
bytes, len, key = crypt.crypt_file(True, crypt.key, infile=self.in_file)
22+
else:
23+
bytes, len, key = crypt.crypt_file(True, crypt.key, infile=None, data=bytes, data_length=len)
24+
keys_used[str(loop)] = key
25+
if loop != self.loops - 1:
26+
bytes = auxiliary.clean_hex_output(bytes)
27+
return bytes, len, keys_used
28+
29+
30+
def _do_jmp(self):
31+
bytes, length, keys_used = self._do_encrypt()
32+
33+
keys = []
34+
for i in keys_used: keys.append(hex(int(i)))
35+
36+
pe_image = auxiliary.prepare_pe_image(length, bytes)
37+
auxiliary.write_pe_image(pe_image)
38+
39+
auxiliary.write_header_file(keys_used, jmp=True)
40+
file_clean = auxiliary.write_decrypt("./module/darkexe/src/jmp_loader/main.c", self.loops)
41+
42+
self.compile_binary.compile("./module/darkexe/src/jmp_loader/main.c", self.out_file)
43+
auxiliary.clean_up("./module/darkexe/src/jmp_loader/main.c", file_clean)
44+
print(f"[+] Wrote {auxiliary.get_size('/root/' + self.out_file)} bytes to /root/{self.out_file}")
45+
46+
47+
48+
def _parse_args(self, args):
49+
self.jmp = True
50+
self.in_file = args
51+
self.crypt_type = 'xor'
52+
self.loops = 5
53+
self.out_file = auxiliary.gen_rand_filename() + ".exe"
54+
55+
def _do_crypt(self):
56+
print(f"[i] Started armouring {self.in_file} ({auxiliary.get_size(self.in_file)} bytes)")
57+
if self.jmp:
58+
self._do_jmp()
59+
60+
def run(self, args):
61+
62+
file_add = args
63+
64+
self._parse_args(args=file_add)
65+
self._do_crypt()
66+
2.89 KB
Binary file not shown.
762 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)