Skip to content

Commit d37e4ea

Browse files
committed
Added "-host" to bruteforce
1 parent 9c8af60 commit d37e4ea

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.thisisnzed</groupId>
77
<artifactId>SSHScanner</artifactId>
8-
<version>1.0-SNAPSHOT</version>
8+
<version>1.0.1-SNAPSHOT</version>
99
<properties>
1010
<maven.compiler.source>8</maven.compiler.source>
1111
<maven.compiler.target>8</maven.compiler.target>

src/main/java/com/thisisnzed/sshscanner/SSHScanner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public SSHScanner(final String[] args) {
2424
this.argumentParser = new ArgumentParser(this.configuration, args);
2525
this.configuration.set("combo", "combo.txt");
2626
this.configuration.set("threads", 1);
27+
this.configuration.set("host", "");
2728
this.configuration.set("port", 22);
2829
this.configuration.set("timeout", 6000);
2930
this.configuration.set("webhook", "");
@@ -40,7 +41,7 @@ public SSHScanner(final String[] args) {
4041
public void start() {
4142
IntStream.range(0, Integer.parseInt(String.valueOf(this.configuration.get("threads")))).forEach(i -> new Thread(() -> {
4243
while (true) {
43-
final String host = (random.nextInt(254) + 1) + "." + (random.nextInt(254) + 1) + "." + (random.nextInt(254) + 1) + "." + (random.nextInt(254) + 1);
44+
final String host = String.valueOf(this.configuration.get("host")).equals("") ? (random.nextInt(254) + 1) + "." + (random.nextInt(254) + 1) + "." + (random.nextInt(254) + 1) + "." + (random.nextInt(254) + 1) : (String) this.configuration.get("host");
4445
if (!hosts.containsKey(host))
4546
this.combo.getCombo().stream().filter(combo -> hosts.getOrDefault(host, true)).forEach(combo -> hosts.put(host, session.connect(host, combo[0], combo[1])));
4647
}

0 commit comments

Comments
 (0)