-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
27 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
# @Contact : [email protected] | ||
|
||
import os | ||
import ast | ||
import codecs | ||
import json | ||
from django.contrib.auth.decorators import login_required | ||
|
@@ -44,7 +45,7 @@ def tasklog(req, task_id): | |
ResultFlow = get_resultflow_class(task_id) | ||
rfs = ResultFlow.objects.all() | ||
|
||
task.parameter_config = " ".join(eval(task.parameter_config)).replace('\\', '/') | ||
task.parameter_config = " ".join(ast.literal_eval(task.parameter_config)).replace('\\', '/') | ||
resultflowdict = {} | ||
|
||
for rf in rfs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
# @Author : LoRexxar | ||
# @File : tasks.py | ||
# @Contact : [email protected] | ||
|
||
import ast | ||
|
||
from django.contrib.auth.decorators import login_required | ||
from django.http import JsonResponse, HttpResponseNotFound | ||
from django.views.generic import TemplateView | ||
|
@@ -29,7 +32,7 @@ def get_context_data(self, **kwargs): | |
|
||
for task in context['tasks']: | ||
task.is_finished = int(task.is_finished) | ||
task.parameter_config = " ".join(eval(task.parameter_config)).replace('\\', '/') | ||
task.parameter_config = " ".join(ast.literal_eval(task.parameter_config)).replace('\\', '/') | ||
|
||
return context | ||
|
||
|
@@ -50,7 +53,7 @@ def get(request, task_id): | |
newevilfuncs = NewEvilFunc.objects.filter(scan_task_id=task_id).all() | ||
|
||
task.is_finished = int(task.is_finished) | ||
task.parameter_config = " ".join(eval(task.parameter_config)).replace('\\', '/') | ||
task.parameter_config = " ".join(ast.literal_eval(task.parameter_config)).replace('\\', '/') | ||
|
||
for taskresult in taskresults: | ||
taskresult.is_unconfirm = int(taskresult.is_unconfirm) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ | |
# @File : views.py | ||
# @Contact : [email protected] | ||
|
||
|
||
import ast | ||
|
||
from django.contrib.auth.decorators import login_required | ||
from django.shortcuts import render, redirect | ||
from web.index.models import ScanTask | ||
|
@@ -16,7 +19,7 @@ def index(req): | |
tasks = ScanTask.objects.all().order_by("-id") | ||
for task in tasks: | ||
task.is_finished = int(task.is_finished) | ||
task.parameter_config = " ".join(eval(task.parameter_config)).replace('\\', '/') | ||
task.parameter_config = " ".join(ast.literal_eval(task.parameter_config)).replace('\\', '/') | ||
|
||
data = {'tasks': tasks} | ||
|
||
|