Knockpy
Knockpy Agent Setup for Subdomain Enum

Knockpy Command

Using {{rootDomain}} ReconNess replace {{rootDomain}} to the root domain, for example, yahoo.com if we define that as a root domain adding the Target
1
python /app/knock/knockpy/knockpy.py {{rootDomain}}
Copied!

Knockpy Script

1
using ReconNess.Core.Models;
2
3
if (lineInputCount < 17)
4
{
5
return new ScriptOutput();
6
}
7
8
var match = System.Text.RegularExpressions.Regex.Match(lineInput, @"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*(\d{1,3})?\s*([a-z]*)\s*(([a-zA-Z0-9][a-zA-Z0-9-_]*\.)*[a-zA-Z0-9]*[a-zA-Z0-9-_]*[[a-zA-Z0-9]+)");
9
if (match.Success && match.Groups.Count > 4)
10
{
11
return new ScriptOutput
12
{
13
Ip = match.Groups[1].Value,
14
Subdomain = match.Groups.Count == 5 ? match.Groups[3].Value : match.Groups[4].Value,
15
Note = lineInput
16
};
17
}
18
19
return new ScriptOutput();
Copied!
Check the Readme on GitHub to know more about the Script.

Knockpy Dockerfile Entry

1
# -------- Agents dependencies --------
2
3
# To allow run knockpy the docker
4
5
RUN apt-get update && apt-get install -y git python2.7 python-pip python-dnspython
6
RUN git clone https://github.com/guelfoweb/knock
7
RUN cd knock && python setup.py install
8
9
# -------- End Agents dependencies --------
Copied!

Knockpy Command for Docker

1
python /app/knock/knockpy/knockpy.py {{rootDomain}}
Copied!
Last modified 1yr ago