Skip to content

Commit

Permalink
Merge pull request #593 from matterpreter/readd-rastamount-cidr-opt
Browse files Browse the repository at this point in the history
Adding back the CIDR option
  • Loading branch information
ChrisTruncer authored Nov 7, 2022
2 parents 48678fa + 302ef7e commit 9dd4cf0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CS/EyeWitness/EyeWitness.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,30 @@
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\netstandard1.1\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.IPNetwork, Version=2.6.427.0, Culture=neutral, PublicKeyToken=717343cc2c25edcf, processorArchitecture=MSIL">
<HintPath>..\packages\IPNetwork2.2.6.427\lib\net45\System.Net.IPNetwork.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand Down
27 changes: 27 additions & 0 deletions CS/EyeWitness/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class Options
[Option('f', "file", Group = "Input Source", HelpText = "Specify a new-line separated file of URLs", Default = null)]
public string File { get; set; }

[Option('i', "cidr", Group = "Input Source", HelpText = "Specify an IP CIDR", Default = null)]
public string IpAddresses { get; set; }

[Option('o', "output", Required = false, HelpText = "Specify an output directory (one will be created if non-existent)", Default = null)]
public string Output { get; set; }

Expand Down Expand Up @@ -508,6 +511,30 @@ static void Main(string[] args)
}
}
if (o.IpAddresses != null)
{
Console.WriteLine("[+] Using IP addresses");
try
{
if (!IPNetwork.TryParse(o.IpAddresses, out var parsed))
{
Console.WriteLine("[-] ERROR: Failed to parse IP Addresses");
return;
}
var ipAddress = parsed.ListIPAddress().Distinct().ToList();
var strings = new List<string>();
ipAddress.ForEach(i => strings.Add(i.ToString()));
allUrls = strings.ToArray();
}
catch (Exception e)
{
Console.WriteLine($"[-] ERROR: {e.Message}");
return;
}
}
Options.Instance = o;
})
.WithNotParsed(errs => DisplayHelp(parserResult));
Expand Down
8 changes: 8 additions & 0 deletions CS/EyeWitness/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
4 changes: 4 additions & 0 deletions CS/EyeWitness/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
<package id="CommandLineParser" version="2.7.82" targetFramework="net45" />
<package id="Costura.Fody" version="4.1.0" targetFramework="net45" />
<package id="Fody" version="6.1.1" targetFramework="net45" developmentDependency="true" />
<package id="IPNetwork2" version="2.6.427" targetFramework="net45" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
<package id="System.Buffers" version="4.5.1" targetFramework="net45" />
<package id="System.Memory" version="4.5.5" targetFramework="net45" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net45" />
</packages>

0 comments on commit 9dd4cf0

Please sign in to comment.