Skip to content

Commit 2e3e99e

Browse files
emtulstinajohnson
andauthored
Make default gateway IP '.1' instead of '.254' (#175)
* Make default gateway IP '.1' instead of '.254' * Use .1 for default gateway instead of .254 * Updates to documentation: Update documentation to use new year Update documentation links to current working links Update documentation to use Mandiant instead of FireEye * Fix filepath of HTML report template * Minor code cleanup * Update CHANGELOG --------- Co-authored-by: Tina Johnson <tinajohnson.1234@gmail.com>
1 parent 7a68d00 commit 2e3e99e

13 files changed

+53
-41
lines changed

CHANGELOG.txt

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Version 3.2
2+
-----------
3+
* Use .1 for default gateway instead of .254 because this is the default Virtual
4+
Adapter address for VMWare and VirtualBox.
5+
* Update documentation to use new year
6+
* Update documentation links to current working links
7+
* Update documentation to use Mandiant instead of FireEye
8+
* Fix the filepath of HTML report template to work in all methods of installations
9+
including Pyinstaller bundles.
10+
111
Version 3.1
212
-----------
313
* HTML and text NBI after-reporting courtesy of @3V3RYONE and @tinajohnson

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175

176176
END OF TERMS AND CONDITIONS
177177

178-
Copyright (C) 2018 FireEye, Inc.
178+
Copyright (C) 2024 Mandiant, Inc.
179179

180180
Licensed under the Apache License, Version 2.0 (the "License");
181181
you may not use this file except in compliance with the License.

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
D O C U M E N T A T I O N
99

10-
FakeNet-NG 3.0 (alpha) is a next generation dynamic network analysis tool for malware
10+
FakeNet-NG 3.2 is a next generation dynamic network analysis tool for malware
1111
analysts and penetration testers. It is open source and designed for the latest
1212
versions of Windows (and Linux, for certain modes of operation). FakeNet-NG is
1313
based on the excellent Fakenet tool developed by Andrew Honig and Michael
@@ -116,10 +116,10 @@ parameter to get simple help:
116116
| | / ____ \| . \| |____| |\ | |____ | | | |\ | |__| |
117117
|_|/_/ \_\_|\_\______|_| \_|______| |_| |_| \_|\_____|
118118

119-
Version 3.0 (alpha)
119+
Version 3.2
120120
_____________________________________________________________
121121
Developed by FLARE Team
122-
Copyright (C) 2016-2023 Mandiant, Inc. All rights reserved.
122+
Copyright (C) 2016-2024 Mandiant, Inc. All rights reserved.
123123
_____________________________________________________________
124124
Usage: python -m fakenet.fakenet [options]:
125125

@@ -171,10 +171,10 @@ and an HTTP connection:
171171
| | / ____ \| . \| |____| |\ | |____ | | | |\ | |__| |
172172
|_|/_/ \_\_|\_\______|_| \_|______| |_| |_| \_|\_____|
173173

174-
Version 3.0 (alpha)
174+
Version 3.2
175175
_____________________________________________________________
176176
Developed by FLARE Team
177-
Copyright (C) 2016-2022 Mandiant, Inc. All rights reserved.
177+
Copyright (C) 2016-2024 Mandiant, Inc. All rights reserved.
178178
_____________________________________________________________
179179

180180
07/06/16 10:20:52 PM [ FakeNet] Loaded configuration file: configs/default.ini

docs/architecture.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ directly (if they are not hidden behind the ProxyListener) or through the
1212
ProxyListener. This architecture is in contrast to tools like PyNetSim (can't
1313
find an authoritative hyperlink to cite this reference) that effectively
1414
integrate all services into a bus. The benefit of this additional complexity in
15-
FakeNet-NGs architecture is that it can incorporate Listeners based on generic
15+
FakeNet-NG's architecture is that it can incorporate Listeners based on generic
1616
code that expects to directly bind to ports and manage its own sockets. The
1717
FakeNet-NG architecture is diagrammed subsequently.
1818

19-
![FakeNet-NG Architecture](https://github.com/fireeye/flare-fakenet-ng/raw/master/docs/fakenet_architecture.png "FakeNet-NG Architecture")
19+
![FakeNet-NG Architecture](https://github.com/mandiant/flare-fakenet-ng/blob/master/docs/fakenet_architecture.png "FakeNet-NG Architecture")
2020

2121
# Diverters
2222

docs/contributors.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ malware analysis on Windows XP.
1313
## Windows
1414

1515
Peter Kacherginsky [implemented
16-
FakeNet-NG](https://www.fireeye.com/blog/threat-research/2016/08/fakenet-ng_next_gen.html)
16+
FakeNet-NG](https://www.mandiant.com/resources/blog/fakenet-ng-next-gen)
1717
targeting modern versions of Windows.
1818

1919
## Linux and Core
2020

2121
Michael Bailey [implemented FakeNet-NG on
22-
Linux](https://www.fireeye.com/blog/threat-research/2017/07/linux-support-for-fakenet-ng.html),
22+
Linux](https://www.mandiant.com/resources/blog/introducing-linux-support-fakenet-ng-flares-next-generation-dynamic-network-analysis-tool),
2323
and later refactored FakeNet-NG to use this as the unified packet processing
2424
logic for both Windows and Linux.
2525

@@ -32,7 +32,7 @@ Haigh, Michael Bailey, and Peter Kacherginsky conceptualized the Proxy Listener
3232
and Hidden Listener mechanisms for introducing both of these content-based
3333
protocol detection features to FakeNet-NG. Matthew Haigh then [implemented
3434
Content-Based Protocol
35-
Detection](https://www.fireeye.com/blog/threat-research/2017/10/fakenet-content-based-protocol-detection.html).
35+
Detection](https://www.mandiant.com/content/fireeye-www/en_US/blog/threat-research/2017/10/fakenet-content-based-protocol-detection.html).
3636

3737
## HTML- and Text-Based NBI After-Reporting
3838

docs/srs.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ Analysis](https://nostarch.com/malware).
2424
## History
2525
FakeNet-NG was initially released August 3, 2016 by Peter Kacherginsky with
2626
support for Windows: [FakeNet-NG: Next Generation Dynamic Network Analysis
27-
Tool](https://www.fireeye.com/blog/threat-research/2016/08/fakenet-ng_next_gen.html).
27+
Tool](https://www.mandiant.com/resources/blog/fakenet-ng-next-gen).
2828

2929
On July 5, 2017 FakeNet-NG was updated by Michael Bailey to add support for
3030
Linux: [Introducing Linux Support for FakeNet-NG: FLARE's Next Generation
3131
Dynamic Network Analysis
32-
Tool](https://www.fireeye.com/blog/threat-research/2017/07/linux-support-for-fakenet-ng.html).
32+
Tool](https://www.mandiant.com/resources/blog/introducing-linux-support-fakenet-ng-flares-next-generation-dynamic-network-analysis-tool).
3333

3434
The next significant FakeNet-NG release was by Matthew Haigh on October 23,
3535
2017 to introduce a proxy listener to sample, identify, and route traffic to
3636
the most appropriate listener: [New FakeNet-NG Feature: Content-Based Protocol
37-
Detection](https://www.fireeye.com/blog/threat-research/2017/10/fakenet-content-based-protocol-detection.html).
37+
Detection](https://www.mandiant.com/content/fireeye-www/en_US/blog/threat-research/2017/10/fakenet-content-based-protocol-detection.html).
3838

39-
FireEye's [flare-fakenet-ng](https://github.com/fireeye/flare-fakenet-ng)
39+
Mandiant's [flare-fakenet-ng](https://github.com/mandiant/flare-fakenet-ng)
4040
repository contains `README.md` which documents usage and configuration; and
4141
`docs/internals.md` which describes Diverter internals for Linux.
4242

@@ -157,7 +157,7 @@ The Configuration Logic for parsing and validating the configuration file is
157157
spread throughout the Application, Diverter, and Listeners.
158158

159159
The configuration file is a
160-
[ConfigParser](https://docs.python.org/2/library/configparser.html)-compatible
160+
[ConfigParser](https://docs.python.org/3/library/configparser.html)-compatible
161161
file at an operator-specified location detailing how FakeNet-NG is to behave.
162162

163163
Proposed: it may be beneficial to better encapsulate and centralize the

fakenet/defaultFiles/FakeNet.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
<h3>Contact</h3>
3333

3434
For bugs, crashes, or other comments please contact <b>The FLARE Team</b> by email
35-
<b>FakeNet@fireeye.com</b>.
35+
<b>FakeNet@mandiant.com</b>.
3636
</body>
3737
</html>

fakenet/defaultFiles/FakeNet.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ FakeNet-NG is based on the excellent Fakenet tool developed by Andrew Honig and
1414

1515
Contact
1616

17-
For bugs, crashes, or other comments please contact the FLARE Team by email FakeNet@fireeye.com
17+
For bugs, crashes, or other comments please contact the FLARE Team by email FakeNet@mandiant.com

fakenet/diverters/diverterbase.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .debuglevels import *
1717
from collections import namedtuple
1818
from collections import OrderedDict
19+
from pathlib import Path
1920

2021

2122
class DivertParms(object):
@@ -1259,21 +1260,15 @@ def formatPkt(self, pkt, pid, comm):
12591260
Returns:
12601261
A str containing the log line
12611262
"""
1262-
if pid == None:
1263-
pid = 'None'
1264-
1265-
if comm == None:
1266-
comm = 'None'
1267-
12681263
logline = ''
12691264

12701265
if pkt.proto == 'UDP':
12711266
fmt = '| {label} {proto} | {pid:>6} | {comm:<8} | {src:>15}:{sport:<5} | {dst:>15}:{dport:<5} | {length:>5} | {flags:<11} | {seqack:<35} |'
12721267
logline = fmt.format(
12731268
label=pkt.label,
12741269
proto=pkt.proto,
1275-
pid=pid,
1276-
comm=comm,
1270+
pid=str(pid),
1271+
comm=str(comm),
12771272
src=pkt.src_ip,
12781273
sport=pkt.sport,
12791274
dst=pkt.dst_ip,
@@ -1304,8 +1299,8 @@ def formatPkt(self, pkt, pid, comm):
13041299
logline = fmt.format(
13051300
label=pkt.label,
13061301
proto=pkt.proto,
1307-
pid=pid,
1308-
comm=comm,
1302+
pid=str(pid),
1303+
comm=str(comm),
13091304
src=pkt.src_ip,
13101305
sport=pkt.sport,
13111306
dst=pkt.dst_ip,
@@ -1319,8 +1314,8 @@ def formatPkt(self, pkt, pid, comm):
13191314
logline = fmt.format(
13201315
label=pkt.label,
13211316
proto='UNK',
1322-
pid=pid,
1323-
comm=comm,
1317+
pid=str(pid),
1318+
comm=str(comm),
13241319
src=str(pkt.src_ip),
13251320
sport=str(pkt.sport),
13261321
dst=str(pkt.dst_ip),
@@ -1959,7 +1954,13 @@ def generate_html_report(self):
19591954
to the main working directory of flare-fakenet-ng. Called by stop() method
19601955
of diverter.
19611956
"""
1962-
template_file = os.path.join("fakenet", "configs", "html_report_template.html")
1957+
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
1958+
# Inside a Pyinstaller bundle
1959+
fakenet_dir_path = os.getcwd()
1960+
else:
1961+
fakenet_dir_path = os.fspath(Path(__file__).parents[1])
1962+
1963+
template_file = os.path.join(fakenet_dir_path, "configs", "html_report_template.html")
19631964
template_loader = jinja2.FileSystemLoader(searchpath=os.path.dirname(template_file))
19641965
template_env = jinja2.Environment(loader=template_loader)
19651966
template = template_env.get_template(os.path.basename(template_file))

fakenet/diverters/winutil.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,10 @@ def fix_gateway(self):
361361
# (Host-Only)
362362
if self.check_ipaddresses_interface(adapter) and adapter.DhcpEnabled:
363363

364-
(ip_address, netmask) = next(
365-
self.get_ipaddresses_netmask(adapter))
366-
gw_address = ip_address[:ip_address.rfind('.')] + '.254'
364+
(ip_address, netmask) = next(self.get_ipaddresses_netmask(adapter))
365+
# set the gateway ip address to be that of the virtual network adapter
366+
# https://docs.vmware.com/en/VMware-Workstation-Pro/17/com.vmware.ws.using.doc/GUID-9831F49E-1A83-4881-BB8A-D4573F2C6D91.html
367+
gw_address = ip_address[:ip_address.rfind('.')] + '.1'
367368

368369
interface_name = self.get_adapter_friendlyname(adapter.Index)
369370

fakenet/fakenet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# analysts and penetration testers.
77
#
88
# Original developer: Peter Kacherginsky
9-
# Current developer: FireEye FLARE Team (FakeNet@fireeye.com)
9+
# Current developer: Mandiant FLARE Team (FakeNet@mandiant.com)
1010

1111
import logging
1212
import logging.handlers
@@ -349,7 +349,7 @@ def main():
349349
| | / ____ \| . \| |____| |\ | |____ | | | |\ | |__| |
350350
|_|/_/ \_\_|\_\______|_| \_|______| |_| |_| \_|\_____|
351351
352-
Version 3.1
352+
Version 3.2
353353
_____________________________________________________________
354354
Developed by FLARE Team
355355
Copyright (C) 2016-2024 Mandiant, Inc. All rights reserved.

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2016-2023 Mandiant, Inc. All rights reserved.
1+
# Copyright (C) 2016-2024 Mandiant, Inc. All rights reserved.
22

33
import os
44
import platform
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name='FakeNet NG',
29-
version='3.1',
29+
version='3.2',
3030
description="",
3131
long_description="",
3232
author="Mandiant FLARE Team with credit to Peter Kacherginsky as the original developer",
@@ -37,8 +37,8 @@
3737
],
3838
package_dir={'fakenet': 'fakenet'},
3939
package_data={'fakenet': ['*.pem','diverters/*.py', 'listeners/*.py',
40-
'listeners/ssl_utils/*.py', 'listeners/ssl_utils/*.pem', 'configs/*.ini', 'defaultFiles/*',
41-
'lib/64/*', 'lib/32/*']},
40+
'listeners/ssl_utils/*.py', 'listeners/ssl_utils/*.pem', 'configs/*.ini',
41+
'configs/html_report_template.html', 'defaultFiles/*', 'lib/64/*', 'lib/32/*']},
4242
entry_points={
4343
"console_scripts": [
4444
"fakenet=fakenet.fakenet:main",

test/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def __init__(self, startingpath, singlehost=True):
905905
self.listener_host_white = 8083 # HTTP listener with host whitelists
906906
self.localhost = '127.0.0.1'
907907
self.dns_expected = '192.0.2.123'
908-
self.domain_dne = 'does-not-exist-amirite.fireeye.com'
908+
self.domain_dne = 'does-not-exist-amirite.mandiant.com'
909909
self.sender = 'from-fakenet@example.org'
910910
self.recipient = 'to-fakenet@example.org'
911911
self.smtpmsg = 'FakeNet-NG SMTP test email'

0 commit comments

Comments
 (0)