Skip to content

Commit 8fe8b93

Browse files
authored
Merge pull request #2747 from intelowlproject/develop_old
v6.3.1
2 parents 1c3a36f + 4bf6a05 commit 8fe8b93

File tree

29 files changed

+481
-125
lines changed

29 files changed

+481
-125
lines changed

.github/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
[**Upgrade Guide**](https://intelowlproject.github.io/docs/IntelOwl/installation/#update-to-the-most-recent-version)
44

5+
## [v6.3.1](https://github.com/intelowlproject/IntelOwl/releases/tag/v6.3.1)
6+
This release provides fixes to the recent added ARM support. (ARM build for v6.3.0 was broken due to some dependencies)
7+
58
## [v6.3.0](https://github.com/intelowlproject/IntelOwl/releases/tag/v6.3.0)
69

710
This release brings official support for ARM architecture. From now on, our Docker builds are multi-platform. You can now run IntelOwl in your favourite ARM machine smoothly, e.g. Apple Silicon Mac and Raspberry PI.

.github/release_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
```commandline
1212
please refer to the [Changelog](https://github.com/intelowlproject/IntelOwl/blob/develop/.github/CHANGELOG.md#v331)
1313
14-
WARNING: The release will be live within an hour!
14+
WARNING: We are building the new version of the project! The release will be officially available within 2 hours!
1515
```
1616

1717
- [ ] Wait for [dockerHub](https://hub.docker.com/repository/docker/intelowlproject/intelowl) to finish the builds

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ In 2021 IntelOwl joined the official [Docker Open Source Program](https://www.do
112112

113113
#### DigitalOcean
114114

115+
[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=128f2c68f93b&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)
116+
115117
In 2022 IntelOwl joined the official [DigitalOcean Open Source Program](https://www.digitalocean.com/open-source?utm_medium=opensource&utm_source=IntelOwl).
116118

117119

api_app/analyzers_manager/file_analyzers/detectiteasy.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import json
22
import logging
33

4-
import die
4+
from api_app.analyzers_manager.exceptions import AnalyzerRunException
5+
6+
try:
7+
import die
8+
except ImportError:
9+
die = None
510

611
from api_app.analyzers_manager.classes import FileAnalyzer
712
from tests.mock_utils import MockUpResponse
@@ -17,11 +22,20 @@ def update(self):
1722
def run(self):
1823
logger.info(f"Running DIE on {self.filepath} for {self.md5}")
1924

20-
json_report = die.scan_file(
21-
self.filepath, die.ScanFlags.RESULT_AS_JSON, str(die.database_path / "db")
22-
)
25+
if die:
26+
json_report = die.scan_file(
27+
self.filepath,
28+
die.ScanFlags.RESULT_AS_JSON,
29+
str(die.database_path / "db"),
30+
)
31+
result = json.loads(json_report)
32+
else:
33+
message = "DIE package not imported because incompatible in ARM"
34+
self.report.errors.append(message)
35+
result = {"errors": message}
36+
raise AnalyzerRunException(message)
2337

24-
return json.loads(json_report)
38+
return result
2539

2640
@staticmethod
2741
def mocked_docker_analyzer_get(*args, **kwargs):

api_app/analyzers_manager/file_analyzers/goresym.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,18 @@ def run(self):
4949
)
5050
result = self._docker_run(req_data, req_files, analyzer_name=self.analyzer_name)
5151
if "error" in result:
52-
er = (
53-
"Failed to parse file: failed to read pclntab: failed to locate pclntab"
54-
)
55-
if result["error"] == er:
56-
logger.warning(f"Not a GO-compiled file: {result['error']}")
57-
return f"Not a Go-compiled file: {result['error']}"
52+
# the error message may change based on the version of the program
53+
partial_error_keywords = ["failed", "no"]
54+
found_negative_clause = False
55+
if "pclntab" in result["error"]:
56+
for partial_error_keyword in partial_error_keywords:
57+
if partial_error_keyword in result["error"]:
58+
found_negative_clause = True
59+
break
60+
if found_negative_clause:
61+
message = f"Not a GO-compiled file: {result['error']}"
62+
logger.warning(message)
63+
raise AnalyzerRunException(message)
5864
raise AnalyzerRunException(result["error"])
5965
return result
6066

api_app/analyzers_manager/file_analyzers/phishing/phishing_form_compiler.py

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import logging
22
from datetime import date, timedelta
33
from typing import Dict
4+
from urllib.parse import urljoin
45

56
import requests
67
from faker import Faker # skipcq: BAN-B410
78
from lxml.etree import HTMLParser # skipcq: BAN-B410
89
from lxml.html import document_fromstring
910
from requests import HTTPError, Response
10-
from requests.exceptions import MissingSchema
1111

1212
from api_app.analyzers_manager.classes import FileAnalyzer
1313
from api_app.models import PythonConfig
@@ -137,32 +137,25 @@ def identify_text_input(self, input_name: str) -> str:
137137
if input_name in names:
138138
return fake_value
139139

140-
def extract_action_attribute(self, form) -> str:
140+
# guarda anche i log di errore
141+
142+
@staticmethod
143+
def extract_action_attribute(base_site: str, form) -> str:
144+
# we always return an URL to prevent MissingSchema error in request
141145
form_action: str = form.get("action", None)
142146
if not form_action:
143147
logger.info(
144-
f"'action' attribute not found in form. Defaulting to {self.target_site=}"
148+
f"'action' attribute not found in form. Defaulting to {base_site=}"
145149
)
146-
form_action = self.target_site
147-
elif form_action.startswith("/"): # pure relative url
148-
logger.info(f"Found relative url in {form_action=}")
149-
form_action = form_action.replace("/", "", 1)
150-
base_site = self.target_site
151-
152-
if base_site.endswith("/"):
153-
base_site = base_site[:-1]
154-
form_action = base_site + "/" + form_action
155-
elif (
156-
"." in form_action and "://" not in form_action
157-
): # found a domain (relative file names such as "login.php" should start with /)
158-
logger.info(f"Found a domain in form action {form_action=}")
159-
else:
160-
base_site = self.target_site
161-
162-
if base_site.endswith("/"):
163-
base_site = base_site[:-1]
164-
form_action = base_site + "/" + form_action
165-
150+
return base_site
151+
if "://" not in base_site:
152+
# if target site is a domain add a temporary default
153+
# schema so we can use urljoin as if it was an url
154+
base_site = "https://" + base_site
155+
156+
form_action = urljoin(base_site, form_action)
157+
if "://" not in form_action:
158+
form_action = "https://" + form_action
166159
logger.info(f"Extracted action to post data to: {form_action}")
167160

168161
return form_action
@@ -203,34 +196,21 @@ def compile_form_field(self, form) -> dict:
203196

204197
def perform_request_to_form(self, form) -> Response:
205198
params = self.compile_form_field(form)
206-
dest_url = self.extract_action_attribute(form)
199+
dest_url = self.extract_action_attribute(self.target_site, form)
207200
logger.info(f"Job #{self.job_id}: Sending {params=} to submit url {dest_url}")
208201
headers = {
209202
"User-Agent": self.user_agent,
210203
}
211-
try:
212-
response = requests.post(
213-
url=dest_url,
214-
data=params,
215-
headers=headers,
216-
proxies=(
217-
{"http": self.proxy_address, "https": self.proxy_address}
218-
if self.proxy_address
219-
else None
220-
),
221-
)
222-
except MissingSchema:
223-
logger.info(f"Adding default 'https://' schema to {dest_url}")
224-
response = requests.post(
225-
url="https://" + dest_url,
226-
data=params,
227-
headers=headers,
228-
proxies=(
229-
{"http": self.proxy_address, "https": self.proxy_address}
230-
if self.proxy_address
231-
else None
232-
),
233-
)
204+
response = requests.post(
205+
url=dest_url,
206+
data=params,
207+
headers=headers,
208+
proxies=(
209+
{"http": self.proxy_address, "https": self.proxy_address}
210+
if self.proxy_address
211+
else None
212+
),
213+
)
234214
logger.info(f"Request headers: {response.request.headers}")
235215
return response
236216

api_app/analyzers_manager/file_analyzers/qiling.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class Qiling(FileAnalyzer, DockerBasedAnalyzer):
2121
shellcode: bool
2222
profile: str
2323

24+
def update(self):
25+
pass
26+
2427
def config(self, runtime_configuration: Dict):
2528
super().config(runtime_configuration)
2629
self.args = [self.os, self.arch]
@@ -41,4 +44,6 @@ def run(self):
4144
raise AnalyzerRunException(report["setup_error"])
4245
if report.get("execution_error"):
4346
raise AnalyzerRunException(report["execution_error"])
47+
if report.get("qiling_not_available_error"):
48+
raise AnalyzerRunException(report["qiling_not_available_error"])
4449
return report

api_app/analyzers_manager/observable_analyzers/thug_url.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ class ThugUrl(ObservableAnalyzer, DockerBasedAnalyzer):
2323

2424
def _thug_args_builder(self):
2525
user_agent = self.user_agent
26-
if not user_agent:
27-
user_agent = (
28-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
29-
"(KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/131.0.2903.86"
30-
)
3126
dom_events = self.dom_events
3227
use_proxy = self.use_proxy
3328
proxy = self.proxy
3429
enable_awis = self.enable_awis
3530
enable_img_proc = self.enable_image_processing_analysis
3631
# make request arguments
3732
# analysis timeout is set to 5 minutes
38-
args = ["-T", "300", "-u", str(user_agent)]
33+
args = ["-T", "300"]
34+
if user_agent:
35+
args.extend(["-u", str(user_agent)])
3936
if dom_events:
4037
args.extend(["-e", str(dom_events)])
4138
if use_proxy and proxy:
@@ -53,7 +50,6 @@ def run(self):
5350
tmp_dir = secrets.token_hex(4)
5451
tmp_dir_full_path = "/opt/deploy/thug" + tmp_dir
5552
# make request data
56-
# the option -n is bugged and does not work https://github.com/intelowlproject/IntelOwl/issues/2656
5753
args.extend(["-n", tmp_dir_full_path, self.observable_name])
5854

5955
req_data = {

api_app/visualizers_manager/visualizers/domain_reputation_services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def run(self) -> List[Dict]:
238238
third_level_elements.append(
239239
self.Bool(
240240
value=printable_analyzer_name,
241-
disable=not analyzer_report.report["malicious"],
241+
disable=not analyzer_report.report.get("malicious"),
242242
)
243243
)
244244

docker/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### DO NOT CHANGE THIS VALUE !!
22
### It should be updated only when you pull latest changes off from the 'master' branch of IntelOwl.
33
# this variable must start with "REACT_APP_" to be used in the frontend too
4-
REACT_APP_INTELOWL_VERSION=v6.3.0
4+
REACT_APP_INTELOWL_VERSION=v6.3.1
55
# if you want to use a nfs volume for shared files
66
# NFS_ADDRESS=

0 commit comments

Comments
 (0)