searchng website

This commit is contained in:
vulpine 2020-08-12 17:21:36 -04:00
commit 1c7a658f42
6 changed files with 142 additions and 0 deletions

13
.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
index
index/
index/*
content
content
content/
content/*
urls.txt
crawled
crawled/
crawled/*
dep.sh

4
footer.html Normal file
View File

@ -0,0 +1,4 @@
</div>
<br>
<a href="https://xfnw.ttm.sh/git/huntnw">source</a>

18
header.html Normal file
View File

@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>shoxf</title>
<h1>shoxf</h1>
a powerful regex-based search engine for nmap results kinda like shodan
<div class='wrapper'>
<div class='box search-container'>
<form action="./">
<input type="text" placeholder="Search.." name="q">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>

11
huntnw Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
QUERY=`echo $1| sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'`
for fn in $(grep -rEic "$QUERY" index | grep -v ':0' | sort -t: -nrk2 | awk -F: '{print $1}');do
PA=$fn
echo "<div class='box'><a href='$PA'>$PA</a><p>"`grep -i "$QUERY" $PA | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'`"</p></div>"
done

22
index.cgi Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
echo "Content-Type: text/html"
echo
cat header.html
Q=$(echo "$QUERY_STRING" | sed -n 's/^.*q=\([^&]*\).*$/\1/p' | sed "s/%20/ /g" | sed "s/+/ /g")
if [[ $Q ]]
then
./huntnw "$Q"
[ -z $(./huntnw "$Q") ] && echo "<div class='box'>No results :(</div>"
fi
cat footer.html

74
style.css Normal file
View File

@ -0,0 +1,74 @@
body {
background: black;
font-family: monospace;
color: #aea;
}
.preview, .box {
border: 1px solid #aea;
padding: 10px;
border-radius: 10px;
margin-top: 5px;
}
.wrapper {
width: 700px;
margin: 0 auto;
}
a {
text-decoration: none;
color: #aea;
}
a:hover {
text-decoration: underline;
}
code, kbd, pre {
background: #333;
color: #aea;
}
pre {
padding: 10px;
border-radius: 2px;
border: 1px solid #aea;
}
.search-container input[type=text] {
padding: 6px;
margin-top: 3px;
font-size: 17px;
border: 3px solid #aea;
color: #aea;
background: #333;
}
.search-container button {
float: left;
padding: 8px 10px;
margin-top: 3px;
margin-right: 16px;
background: #333;
font-size: 17px;
border: none;
cursor: pointer;
color:#aea;
}
.search-container button:hover {
background: #111;
}
@media screen and (max-width:700px) {
.wrapper {
width: 100%;
}
}