def console(): bugbit, bugtype = core.GetBit() counts = core.GetCounts() ports = core.GetPort() services = core.GetServices() target = core.GetTargetCount() if 'targetscan' in session: urls = session['targetscan'].split() redispool.hincrby('targetscan', 'waitcount', len(urls)) for url in urls: queue.enqueue(SZheScan, url) # SZheScan.delay(url) session.pop('targetscan') try: lastscantime = BaseInfo.query.order_by(BaseInfo.id.desc()).first().date except: lastscantime = "暂无扫描" pass if request.method == 'GET': return render_template('console.html', bugbit=bugbit, bugtype=bugtype, counts=counts, lastscantime=lastscantime, ports=ports, services=services, target=target) else: session['targetscan'] = request.form.get('urls') return redirect(url_for('console'))
def console(): bugbit, bugtype = core.GetBit() counts = core.GetCounts() ports = core.GetPort() services = core.GetServices() target = core.GetTargetCount() try: lastscantime = BaseInfo.query.order_by(BaseInfo.id.desc()).first().date except: lastscantime = "暂无扫描" pass if request.method == 'GET': return render_template('console.html', bugbit=bugbit, bugtype=bugtype, counts=counts, lastscantime=lastscantime, ports=ports, services=services, target=target) else: urls = request.form.get('urls') urls = urls.split() print(urls) for url in urls: redispool.hincrby('targetscan', 'waitcount', 1) executor.submit(SZheConsole, urls) target = core.GetTargetCount() return render_template('console.html', bugbit=bugbit, bugtype=bugtype, counts=counts, lastscantime=lastscantime, ports=ports, services=services, target=target)