mirror of
https://github.com/Astatin3/Auto-Shodanner.git
synced 2026-06-09 00:28:00 -06:00
Start work on search page
This commit is contained in:
@@ -97,7 +97,6 @@
|
|||||||
`
|
`
|
||||||
}
|
}
|
||||||
utils.getel('sessionTable').innerHTML = html
|
utils.getel('sessionTable').innerHTML = html
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ def setSettings(ac, data):
|
|||||||
valid = False
|
valid = False
|
||||||
|
|
||||||
if valid:
|
if valid:
|
||||||
# print(data)
|
print(data)
|
||||||
mm.vars['Scanner-Settings'] = data
|
mm.vars['Scanner-Settings'] = data
|
||||||
else:
|
else:
|
||||||
mm.sendPopupError(ac.rawClient, "Error", "There is an error in the config.")
|
mm.sendPopupError(ac.rawClient, "Error", "There is an error in the config.")
|
||||||
|
|
||||||
|
|
||||||
def onStats(stats):
|
def onStats(stats):
|
||||||
print(stats)
|
# print(stats)
|
||||||
for ac in mm.authServer.clients:
|
for ac in mm.authServer.clients:
|
||||||
if ac.currentPage == "/main/dashboard":
|
if ac.currentPage == "/main/dashboard":
|
||||||
ac.send("Scanner-Metrics", stats)
|
ac.send("Scanner-Metrics", stats)
|
||||||
|
|||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
mm = None
|
||||||
|
|
||||||
|
def init(moduleMaster):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def main():
|
||||||
|
pass
|
||||||
Executable
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "search",
|
||||||
|
"creators": ["ASTATIN3"],
|
||||||
|
"version": "1.0",
|
||||||
|
"entrypoint": "modules/search/main.py",
|
||||||
|
"tabs": [
|
||||||
|
{
|
||||||
|
"name": "Search",
|
||||||
|
"defaultPage": "Search",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"type": "page",
|
||||||
|
"name": "Search",
|
||||||
|
"requiredPermGroup": "",
|
||||||
|
"location": "modules/search/search.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Executable
+111
@@ -0,0 +1,111 @@
|
|||||||
|
<style>
|
||||||
|
|
||||||
|
main #searchBar {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
main button {
|
||||||
|
width: calc(50% - 6px);
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr button {
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<main class="container">
|
||||||
|
<button id="tagBtn" onclick="tagList()">Tags</button>
|
||||||
|
<button id="searchBtn">Search</button>
|
||||||
|
<textarea
|
||||||
|
id="searchBar"
|
||||||
|
placeholder="Search..."></textarea>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const tagBtn = document.getElementById('tagBtn')
|
||||||
|
const searchBtn = document.getElementById('searchBtn')
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
{
|
||||||
|
name: "str",
|
||||||
|
short_description: "Defines if a scan result contains text anywhere",
|
||||||
|
usage:`
|
||||||
|
str:"HTTP/1.1 200 OK" - Webpages
|
||||||
|
`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "port",
|
||||||
|
short_description: "Defines if a port is present in a scan",
|
||||||
|
usage:`
|
||||||
|
port:[port, port range, or port name]/[protocol](/[status])
|
||||||
|
|
||||||
|
port:80/tcp - Look for all open http ports
|
||||||
|
port:80/tcp/open - Look for all open http ports
|
||||||
|
port:80/tcp/filtered - Look for all filtered http ports
|
||||||
|
port:http/tcp - Look for all open http ports
|
||||||
|
port:80-90/tcp - Look for all open ports between 80 and 90
|
||||||
|
`
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
function tagDescription(tagIndex){
|
||||||
|
const tag = tags[tagIndex]
|
||||||
|
const elem = document.body
|
||||||
|
const bgcolor = 'var(--card-sectionning-background-color)'
|
||||||
|
const header = 'rgba(255,255,255,0.05)'
|
||||||
|
const textColor = 'text-white'
|
||||||
|
const title = `Tag ${tag.name} description`
|
||||||
|
|
||||||
|
utils.modal(elem, bgcolor, header, textColor, title,
|
||||||
|
`<p>${tag.short_description}<br><br>${tag.usage.replaceAll("\n", "<br>")}</p>`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function addTag(tagIndex){
|
||||||
|
const tag = tags[tagIndex]
|
||||||
|
const elem = document.body
|
||||||
|
const bgcolor = 'var(--card-sectionning-background-color)'
|
||||||
|
const header = 'rgba(255,255,255,0.05)'
|
||||||
|
const textColor = 'text-white'
|
||||||
|
const title = `Add tag ${tag.name}`
|
||||||
|
|
||||||
|
utils.modal(elem, bgcolor, header, textColor, title,
|
||||||
|
`<p>Tag "${tag.name}" - ${tag.short_description}</p><br>
|
||||||
|
<input placeholder="${tag.name}:<data>"></input>`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function tagList(){
|
||||||
|
const elem = document.body
|
||||||
|
const bgcolor = 'var(--card-sectionning-background-color)'
|
||||||
|
const header = 'rgba(255,255,255,0.05)'
|
||||||
|
const textColor = 'text-white'
|
||||||
|
const title = "Search Tags"
|
||||||
|
|
||||||
|
utils.modal(elem, bgcolor, header, textColor, title, `
|
||||||
|
<table role="grid">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Name</th>
|
||||||
|
<th scope="col">Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
${(()=>{
|
||||||
|
str = ""
|
||||||
|
for(let i=0;i<tags.length;i++){
|
||||||
|
str += "<tr>"
|
||||||
|
str += `<td>${tags[i].name}</td>`
|
||||||
|
str += `<td><button onclick="tagDescription(${i})">Click</button></td>`
|
||||||
|
str += `<td><button onclick="addTag(${i})">Add</button></td>`
|
||||||
|
str += "</tr>"
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
})()}
|
||||||
|
</tbody>
|
||||||
|
</table>`)
|
||||||
|
}
|
||||||
|
|
||||||
|
window.main = () => {}
|
||||||
|
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user