Skip to content

Commit

Permalink
New feature: fetching full permutation list
Browse files Browse the repository at this point in the history
  • Loading branch information
elceef committed Apr 19, 2021
1 parent 89fee06 commit 0943d43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion webapp/webapp.html
Expand Up @@ -195,7 +195,7 @@ <h1><img id="logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAABGCA
setTimeout(pollScan, 250);
} else {
sid = $('#sid').val()
$('#status').html('Scanned ' + data['complete'] + ' suspicious domains. Identified ' + data['registered'] + ' registered: download as <a href="/api/scans/' + sid + '/csv">CSV</a> or <a href="/api/scans/' + sid + '/json">JSON</a>');
$('#status').html('Scanned <a href="/api/scans/' + sid + '/list">' + data['complete'] + '</a> suspicious domains. Identified ' + data['registered'] + ' registered: download as <a href="/api/scans/' + sid + '/csv">CSV</a> or <a href="/api/scans/' + sid + '/json">JSON</a>');
$('#scan').text('Scan');
}
if (last_registered < data['registered']) {
Expand Down
11 changes: 11 additions & 0 deletions webapp/webapp.py
Expand Up @@ -104,6 +104,9 @@ def csv(self):
def json(self):
return list([x for x in self.permutations if len(x) > 2])

def list(self):
return '\n'.join([x.get('domain-name') for x in self.permutations])


@app.route('/')
def root():
Expand Down Expand Up @@ -165,6 +168,14 @@ def api_json(sid):
return jsonify({'message': 'Scan session not found'}), 404


@app.route('/api/scans/<sid>/list')
def api_list(sid):
for s in sessions:
if s.id == sid:
return s.list(), 200, {'Content-Type': 'text/plain', 'Content-Disposition': 'attachment; filename=dnstwist.txt'}
return jsonify({'message': 'Scan session not found'}), 404


@app.route('/api/scans/<sid>/stop', methods=['POST'])
def api_stop(sid):
for s in sessions:
Expand Down

0 comments on commit 0943d43

Please sign in to comment.