-
-
Notifications
You must be signed in to change notification settings - Fork 490
Phunter Analyzer #2841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Phunter Analyzer #2841
Conversation
@mlodic @fgibertoni Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also provide an example of analyzer's output ?
api_app/analyzers_manager/classes.py
Outdated
# Modified to support synchronous analyzer BBOT that return results directly in the initial response, avoiding unnecessary polling. | ||
if analyzer_name == "BBOT_Analyzer": | ||
# Modified to support synchronous analyzers that return results directly in the initial response, avoiding unnecessary polling. | ||
if analyzer_name in ["BBOT_Analyzer", "Phunter"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should refactor this.
Maybe adding an avoid_polling
parameter to the _docker_run
function which defaults to False
to keep compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
@@ -89,6 +89,7 @@ pylnk3==0.4.2 | |||
androguard==3.4.0a1 # version >=4.x of androguard raises a dependency conflict with quark-engine==25.1.1 | |||
wad==0.4.6 | |||
debloat==1.6.4 | |||
phonenumbers==9.0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed if in docker analyzer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phunter.py is also using this module so that would need to be installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that performing the check twice is not necessary. I would keep it in docker analyzer only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. But I believe it would be better in phunter.py so that it would instantly returns if invalid phone number is passed.
integrations/phunter/compose.yml
Outdated
container_name: phunter | ||
restart: unless-stopped | ||
expose: | ||
- "5000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intelowl_phoneinfoga
container is already using this port. Please use a free one
integrations/phunter/compose.yml
Outdated
@@ -0,0 +1,11 @@ | |||
services: | |||
phunter: | |||
image: intelowlproject/phunter:${REACT_APP_INTELOWL_VERSION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: intelowlproject/phunter:${REACT_APP_INTELOWL_VERSION} | |
image: intelowlproject/intelowl_phunter:${REACT_APP_INTELOWL_VERSION} |
integrations/phunter/compose.yml
Outdated
services: | ||
phunter: | ||
image: intelowlproject/phunter:${REACT_APP_INTELOWL_VERSION} | ||
container_name: phunter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
container_name: phunter | |
container_name: intelowl_phunter | |
"spam_status": "Not spammer", | ||
"phone_number": "+918929554991", | ||
"national_format": "089295 54991", | ||
"international_format": "+91 89295 54991", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this number real ? You should use a non existing number here
except ValueError as e: | ||
logger.error(f"[{self.name}] Invalid response format: {e}", exc_info=True) | ||
raise AnalyzerRunException(f"Invalid response format from Phunter API: {e}") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no error is raised then nothing is returned. We should use a default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a general Exception as fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 Didn't expect you to call for a general exception—tables have turned!
integrations/phunter/app.py
Outdated
|
||
try: | ||
logger.info("Executing Phunter CLI tool") | ||
command = ["python3", "phunter.py", "-t", formatted_number] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe consider using shlex
for safer escaping before using subprocess.run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm but as we are already using a list which i believe is safer and preferred. What you say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list is not escaping possible injection in formatted_number, so it would be safer to use shlex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
integrations/phunter/app.py
Outdated
|
||
if __name__ == "__main__": | ||
logger.info("Starting Phunter Flask API...") | ||
app.run(host="0.0.0.0", port=5000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port
integrations/phunter/app.py
Outdated
) | ||
|
||
except subprocess.CalledProcessError as e: | ||
logger.error(f"Phunter CLI failed: {e.stderr}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this as said
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replied in thread
@fgibertoni |
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
This should not be the issue stated here I think |
But I believe the issue arising because of this only.
…On Thu, 15 May 2025, 6:11 pm Federico Gibertoni, ***@***.***> wrote:
*fgibertoni* left a comment (intelowlproject/IntelOwl#2841)
<#2841 (comment)>
This should not be the issue stated here I think
—
Reply to this email directly, view it on GitHub
<#2841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQGMMT6SHJ7I57IFG6BLN3D26SDQNAVCNFSM6AAAAAB3W3P2VKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBTGY3TQOBTG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm sorry you were right about the issue but the key had to be set in the test file. |
Sure. Will do the same
…On Fri, 16 May 2025, 2:32 pm Federico Gibertoni, ***@***.***> wrote:
*fgibertoni* left a comment (intelowlproject/IntelOwl#2841)
<#2841 (comment)>
I'm sorry you were right about the issue but the key had to be set in the
test file.
You can pull the latest change from develop and should be fixed 😃
—
Reply to this email directly, view it on GitHub
<#2841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQGMMT6GTPUD5WFLP64SEGL26WSRLAVCNFSM6AAAAAB3W3P2VKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBWGA4TSOBVGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Closes #2286
Description
Please include a summary of the change and link to the related issue.
Type of change
Please delete options that are not relevant.
Checklist
develop
dumpplugin
command and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zip
and you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERS
playbook by following this guide.url
that contains this information. This is required for Health Checks._monkeypatch()
was used in its class to apply the necessary decorators.MockUpResponse
of the_monkeypatch()
method. This serves us to provide a valid sample for testing.# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.
Black
,Flake
,Isort
) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.tests
folder). All the tests (new and old ones) gave 0 errors.DeepSource
,Django Doctors
or other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules