Skip to content

Commit d99533c

Browse files
authored
Merge pull request #73 from odedshimon/cli-single-command-mode
Cli single command mode - better input checks + readme update
2 parents 4d7eb1c + 41b33c5 commit d99533c

File tree

3 files changed

+73
-3
lines changed

3 files changed

+73
-3
lines changed

BruteShark/BruteSharkCli/Single Command Runner/SingleCommandFlags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace BruteSharkCli
77
{
88
public class SingleCommandFlags
99
{
10-
[Option('d', "input-dir", Required = false, HelpText = "The input directory containing the files to be processed.")]
10+
[Option('d', "input-dir", Required = false, SetName ="dir_input", HelpText = "The input directory containing the files to be processed.")]
1111
public string InputDir { get; set; }
1212

13-
[Option('i', "input", Required = false, Separator = ',', HelpText = "The files to be processed seperated by comma")]
13+
[Option('i', "input", Required = false, SetName = "files_input", Separator = ',', HelpText = "The files to be processed seperated by comma")]
1414
public IEnumerable<string> InputFiles { get; set; }
1515

1616
[Option('m', "modules", Required = false , Separator = ',', HelpText = "The modules to be separterd by comma: Credentials, FileExtracting, NetworkMap")]

BruteShark/BruteSharkCli/Single Command Runner/SingleCommandRunner.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,21 @@ private void PrintFileStatusUpdate(object sender, FileProcessingStatusChangedEve
7474

7575
private void SetupRun()
7676
{
77+
// That can happen when the user enter vesion \ help commad, exit gracefully.
78+
if (_cliFlags is null)
79+
{
80+
Environment.Exit(0);
81+
}
82+
7783
// Load modules.
78-
if (_cliFlags.Modules != null)
84+
if (_cliFlags?.Modules?.Any() == true)
7985
{
8086
LoadModules(ParseCliModuleNames(_cliFlags.Modules));
8187
}
88+
else
89+
{
90+
throw new Exception("No mudules selected");
91+
}
8292

8393
if (_cliFlags.InputFiles.Count() != 0 && _cliFlags.InputDir != null)
8494
{

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,66 @@ This module tries to extract files from UDP / TCP sessions (Therefore, note that
9999
## BruteSharkDesktop
100100
The GUI is pretty self-explanatory, just load the wanted files, configure the wanted modules and press the run button.
101101
## BruteSharkCli
102+
BruteSharkCli has two modes: single command and shell mode.
103+
The single command mode works by geting all the relevant parameters for the processing and then printing the results to stdout or files.
104+
The shell mode allows to perform each step individually.
105+
##### Single Command Mode
106+
Print the help menu:
107+
108+
C:\Users\King\Desktop\BruteSharkCli>BruteSharkCli.exe --help
109+
BruteSharkCli 1.0.0.0
110+
Copyright c 2018
111+
112+
-d, --input-dir The input directory containing the files to be processed.
113+
114+
-i, --input The files to be processed seperated by comma
115+
116+
-m, --modules The modules to be separterd by comma: Credentials, FileExtracting, NetworkMap
117+
118+
-o, --output Output direcorty for the results files.
119+
120+
--help Display this help screen.
121+
122+
--version Display version information.
123+
124+
Get credentials from all files in a directory (passwords and hashes will be printed to stdout):
125+
126+
C:\Users\King\Desktop\BruteSharkCli>BruteSharkCli.exe -m Credentials -d "C:\Users\King\Desktop\Pcap Files"
127+
[+] Started analyzing 5 files
128+
File : Ftp.pcap Processing Started
129+
Found: Network Credential: 192.168.0.114=>192.168.0.193(FTP) => csanders:echo
130+
File : Ftp.pcap Processing Finished
131+
File : HTTP - Basic Authentication.pcap Processing Started
132+
Found: Network Credential: 192.168.0.4=>192.254.189.169(HTTP Basic Authentication) => test:fail
133+
Found: Network Credential: 192.168.0.4=>192.254.189.169(HTTP Basic Authentication) => test:fail2
134+
Found: Network Credential: 192.168.0.4=>192.254.189.169(HTTP Basic Authentication) => test:fail3
135+
Found: Network Credential: 192.168.0.4=>192.254.189.169(HTTP Basic Authentication) => test:test
136+
File : HTTP - Basic Authentication.pcap Processing Finished
137+
File : IMAP - Authenticate CRAM-MD5.cap Processing Started
138+
Found: Hash: 10.0.2.101=>10.0.1.102:10.0.1.102(IMAP) CRAM-MD5 => aGVtbWluZ3dheSAyOWYyMGI2NjkzNDdhYTA4MTc0OTA2NWQ5MDNhNDllNA==
139+
File : IMAP - Authenticate CRAM-MD5.cap Processing Finished
140+
File : SMB - NTLMSSP (smb3 aes 128 ccm).pcap Processing Started
141+
Found: Hash: 10.160.64.139=>10.160.65.202:10.160.65.202(NTLMSSP) NTLMv2 => 39dbdbeb1bdd29b07a5d20c8f82f2cb701010000000000008a8ce7a9f4ced201e7969a04872c16890000000002000800530055005300450001000c0057005300320030003100360004000e0073007500730065002e006400650003001c005700530032003000310036002e0073007500730065002e006400650005000e0073007500730065002e0064006500070008008a8ce7a9f4ced20100000000
142+
File : SMB - NTLMSSP (smb3 aes 128 ccm).pcap Processing Finished
143+
File : SMTP - Auth Login.pcap Processing Started
144+
Found: Network Credential: 10.10.1.4=>74.53.140.153(SMTP (Auth Login)) => [email protected]:punjab@123
145+
File : SMTP - Auth Login.pcap Processing Finished
146+
[X] Bruteshark finished processing
147+
148+
Get credentials from all files in a directory and also export extracted hashes (if found) to a Hashcat input files.
149+
150+
BruteSharkCli.exe -m Credentials -d C:\Users\King\Desktop\Pcap_Examples -o C:\Users\King\Desktop\Results
151+
152+
Run multiple modules on all files in a directory and also export all the results.
153+
154+
BruteSharkCli.exe -m Credentials,NetworkMap,FileExtracting -d C:\Users\King\Desktop\Pcap_Examples -o C:\Users\King\Desktop\Results
155+
156+
##### Shell Mode
157+
Just type
158+
159+
BruteSharkCli.exe
160+
161+
And then navigate using the following commands.
102162
| Keyword | Description |
103163
|-------------------|-----------------------------------------------------------------------------------------|
104164
| help | Print help menu |

0 commit comments

Comments
 (0)