We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Although it rains, throw not away your watering pot.
forms.py
save
forms.Form
forms.ModelForm
ModelForm
SqlInjection
from django import forms from .models import SqlInjection class SqlInjectionForm(forms.ModelForm): class Meta: model = SqlInjection fields = ('target_url', )
URL
URLS
models.py
class UrlList(models.Model): target_urls = models.TextField(null=True)
python manage.py makemigrations python manage.py migrate
UrlList
class UrlListForm(forms.ModelForm): class Meta: model = UrlList fields = ('target_urls', )
from .forms import UrlListForm def url_sql(request): if request.method == 'POST': form = UrlListForm(request.POST) if form.is_valid(): form.save() else: form = UrlListForm() return render(request, 'sqliscan/open.html', {'form': form})
open.html
<textarea>
<form action="." method="post" class="form-horizontal" role="form"> <div class="form-group col-group-sm"> <div class="col-lg-8"> <textarea rows="3" class="form-control" placeholder="URLS" name="target_urls" required></textarea> </div> </div> {% csrf_token %} <button type="submit" class="btn btn-default" > <span class="col-lg-1"><span class="glyphicon glyphicon-import"></span></span> </button> <a href="/"> <button type="submit" class="btn btn-default" > <span class="col-lg-1"><span class="glyphicon glyphicon-search"></span></span> </button> </a> </form>
task.html
Google
data-target=#myModal
id=myModal
<a href="#{{ task.task_id }}" data-toggle="modal" data-target="#{{ task.task_id }}"> <span class="glyphicon glyphicon-arrow-down"></span> </a> <div class="modal fade" id="{{ task.task_id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button data-dismiss="modal" class="close" type="button"> <span aria-hidden="true">×</span> <span class="sr-only">Close</span> </button> <h4 class="modal-title">SCAN LOG</h4> </div> <div class="modal-body"> {{ task.scan_log }} </div> <div class="modal-footer"> <button data-dismiss="modal" class="btn btn-default" type="button">关闭</button> </div> </div> </div> </div>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
0x01 DSScan
forms.py
save
方法forms.Form
,需要自写save
方法forms.ModelForm
,ModelForm
具有save
方法,能将表单中的数据保存至数据库forms.ModelForm
,表单与SqlInjection
数据模型相对应save
方法URL
到数据库中,用上面的表单即可实现URL
到数据库中,就需要在数据模型中新建一张数据表,存储这些URLS
models.py
URLS
SqlInjection
改为UrlList
URLS
即可保存至数据库中,其中模板文件open.html
利用<textarea>
来显示表单open.html
表单部分,两个按钮,一个提交,一个扫描task.html
模态框Google
查了后得知是之前生成的模态框对象数据未清楚导致,但是不管怎么样清楚都无效,所以就只能利用不同任务对应不同模态框来实现输出对应数据data-target=#myModal
和id=myModal
两两对应,所以只需修改这两处即可The text was updated successfully, but these errors were encountered: