Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CTF Search
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CTF Search Team
CTF Search
Commits
ede5fbd8
Commit
ede5fbd8
authored
4 years ago
by
Timmy Chan
Browse files
Options
Downloads
Patches
Plain Diff
Fix manual config bug
parent
8252e873
No related branches found
No related tags found
1 merge request
!5
Feat/cve linux kernel
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
exploitdb/ctfsetup/qemu/setup.py
+1
-1
1 addition, 1 deletion
exploitdb/ctfsetup/qemu/setup.py
exploitdb/ctfsetup/qemu_setup.py
+19
-9
19 additions, 9 deletions
exploitdb/ctfsetup/qemu_setup.py
with
20 additions
and
10 deletions
exploitdb/ctfsetup/qemu/setup.py
+
1
−
1
View file @
ede5fbd8
...
...
@@ -110,7 +110,7 @@ def setup(**kwargs):
except
subprocess
.
CalledProcessError
:
verbose_log
(
"
Failed to boot QEMU, trying again with another port...
"
)
log
(
"
Booted VM image on QEMU
"
,
f
"
(PID:
{
pid
}
)
"
)
log
(
"
Booted VM image on QEMU
"
,
f
"
(PID:
{
pid
.
strip
()
}
)
"
)
def
derive_input_kwargs
(
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
exploitdb/ctfsetup/qemu_setup.py
+
19
−
9
View file @
ede5fbd8
...
...
@@ -33,12 +33,17 @@ def qemu_vm_setup(vuln, app_path, vuln_type):
if
re
.
findall
(
r
'
<|>|before|after|earlier|later|through|till|until|greater than
'
,
description
):
print
(
"
It looks like the vulnerability depends on the following kernel versions, or any version between
"
"
them.
"
)
for
version
in
version_list
:
print
(
version
.
ljust
(
8
))
# TODO: Suggest using the oldest version closest to 4.x in the list.
valid_version_number
=
get_kernel_release_number
(
version_list
[
0
])
user_input
=
input
(
f
"
Is it okay to use version
{
valid_version_number
}
? ([yes]/no)
"
).
lower
()
else
:
print
(
"
It looks like the vulnerability depends on one of the following kernel versions
"
)
# TODO: Suggest using the oldest version closest to 4.x in the list.
valid_version_number
=
get_kernel_release_number
(
version_list
[
1
])
for
version
in
version_list
:
print
(
version
.
rjust
(
8
))
user_input
=
input
(
f
"
Is it okay to use kernel version
{
valid_version_number
}
? ([yes]/no)
"
).
lower
()
if
user_input
in
[
"
y
"
,
"
yes
"
,
""
]:
kernel_version
=
valid_version_number
...
...
@@ -59,6 +64,7 @@ def qemu_vm_setup(vuln, app_path, vuln_type):
# Run full automatic qemu vm setup
setup
(
arch
=
arch
,
kernel_version
=
kernel_version
)
else
:
print
(
"
Cannot run auto
"
)
user_input
=
input
(
f
"
Do you want to manually enter specifications? ([yes]/no)
"
).
lower
()
if
user_input
in
[
"
y
"
,
"
yes
"
,
""
]:
qemu_manual_setup
()
...
...
@@ -74,12 +80,16 @@ def qemu_manual_setup():
# If the use inputs any falsy value (press enter), use the default value
user_input
=
input
(
f
"
Specify a kernel version (default
{
DEFAULT_KERNEL_VERSION
}
):
"
).
lower
()
kernel_version
=
DEFAULT_KERNEL_VERSION
or
user_input
kernel_version
=
user_input
or
DEFAULT_KERNEL_VERSION
user_input
=
input
(
f
"
Specify an architecture (default
{
DEFAULT_ARCH
}
):
"
).
lower
()
arch
=
DEFAULT_ARCH
or
user_input
arch
=
user_input
or
DEFAULT_ARCH
setup
(
arch
=
arch
,
kernel_version
=
kernel_version
)
user_input
=
input
(
f
"
Specify a gcc version (default _derived_):
"
).
lower
()
# None means it will be derived
gcc_version
=
user_input
or
None
setup
(
arch
=
arch
,
kernel_version
=
kernel_version
,
gcc_version
=
gcc_version
)
def
regex_find_all_version_strings
(
input_text
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment