Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
binwalk
Commits
8f3dd374
Commit
8f3dd374
authored
Sep 07, 2021
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added option to disable symlink sanitization if desired
parent
adb02d2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
extractor.py
src/binwalk/modules/extractor.py
+9
-0
No files found.
src/binwalk/modules/extractor.py
View file @
8f3dd374
...
...
@@ -99,6 +99,10 @@ class Extractor(Module):
# type=int,
# kwargs={'recursive_max_size': 0},
# description="Limit the total size of all extracted files"),
Option
(
short
=
'1'
,
long
=
'preserve-symlinks'
,
kwargs
=
{
'do_not_sanitize_symlinks'
:
True
},
description
=
"Do not sanitize extracted symlinks that point outside the extraction directory (dangerous)"
),
Option
(
short
=
'r'
,
long
=
'rm'
,
kwargs
=
{
'remove_after_execute'
:
True
},
...
...
@@ -118,6 +122,7 @@ class Extractor(Module):
Kwarg
(
name
=
'recursive_max_size'
,
default
=
None
),
Kwarg
(
name
=
'max_count'
,
default
=
None
),
Kwarg
(
name
=
'base_directory'
,
default
=
None
),
Kwarg
(
name
=
'do_not_sanitize_symlinks'
,
default
=
False
),
Kwarg
(
name
=
'remove_after_execute'
,
default
=
False
),
Kwarg
(
name
=
'load_default_rules'
,
default
=
False
),
Kwarg
(
name
=
'run_extractors'
,
default
=
True
),
...
...
@@ -986,6 +991,10 @@ class Extractor(Module):
return
os
.
wait
()[
1
]
def
symlink_sanitizer
(
self
,
file_list
,
extraction_directory
):
# User can disable this if desired
if
self
.
do_not_sanitize_symlinks
is
True
:
return
# Allows either a single file path, or a list of file paths to be passed in for sanitization.
if
type
(
file_list
)
is
not
list
:
file_list
=
[
file_list
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment