Skip to content

Commit

Permalink
fix portscan
Browse files Browse the repository at this point in the history
  • Loading branch information
gloxec committed Mar 4, 2021
1 parent 0bbe99b commit c67e20e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions CrossC2Kit/scanner/ServerScan/serverscan.cna
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
include(script_resource("CrossC2Kit.cna"));

sub printUsage_portscan_dyn {
blog($1, "cc2_serverscan\nby: trim\nUsage: cc2_portscan <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_portscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
blog($1, "cc2_portscan_dyn\nby: trim\nUsage: cc2_portscan_dyn <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_portscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
}

sub printUsage_ServerScan_dyn {
blog($1, "cc2_serverscan\nby: trim\nUsage: cc2_serverscan <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_serverscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
blog($1, "cc2_serverscan_dyn\nby: trim\nUsage: cc2_serverscan_dyn <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_serverscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
}

sub printUsage_portscan {
blog($1, "cc2_serverscan\nby: trim\nUsage: cc2_portscan <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_portscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
blog($1, "cc2_portscan\nby: trim\nUsage: cc2_portscan <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_portscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
}

sub printUsage_ServerScan {
blog($1, "cc2_serverscan\nby: trim\nUsage: cc2_serverscan <linux(32)/osx> <host> <port> <scan_type>\n\n\thost:\t192.168.1.1\n\t\t\t192.168.1.1-10\n\t\t\t192.168.1.*\n\t\t\t192.168.1.0/24\n\tport:\t21,22,80-99,8000-8080 ...\n\tscan_type: icmp / tcp\nEx:\n\tcc2_serverscan linux 10.20.10.1/24 22,445,80-99,8000-8080 tcp");
}


ssh_alias cc2_portscan_dyn {
$taskName = "cc2_portscan";
$taskType = "so";
Expand Down Expand Up @@ -101,11 +100,11 @@ ssh_alias cc2_portscan {
$transportArg = $host . "^" . $port . "^" . $scan_type;

if ($arch eq "osx") {
$loadlib = "scanner/ServerScan/osx/crossc2_portscan.dylib";
$loadlib = "scanner/ServerScan/osx/portscan";
} else if ($arch eq "linux32") {
$loadlib = "scanner/ServerScan/linux/SO/crossc2_portscan386.so";
$loadlib = "scanner/ServerScan/linux/ELF/portscan386";
} else if ($arch eq "linux") {
$loadlib = "scanner/ServerScan/linux/SO/crossc2_portscan.so";
$loadlib = "scanner/ServerScan/linux/ELF/portscan";
} else {
berror($beaconid, "*[error]: system");
printUsage_portscan($beaconid);
Expand Down Expand Up @@ -135,11 +134,11 @@ ssh_alias cc2_serverscan {
$transportArg = $host . "^" . $port . "^" . $scan_type;

if ($arch eq "osx") {
$loadlib = "scanner/ServerScan/osx/cc2_serverscan.dylib";
$loadlib = "scanner/ServerScan/osx/serverscan";
} else if ($arch eq "linux32") {
$loadlib = "scanner/ServerScan/linux/SO/crossc2_serverscan386.so";
$loadlib = "scanner/ServerScan/linux/SO/serverscan386";
} else if ($arch eq "linux") {
$loadlib = "scanner/ServerScan/linux/SO/crossc2_serverscan.so";
$loadlib = "scanner/ServerScan/linux/SO/serverscan";
} else {
berror($beaconid, "*[error]: system");
printUsage_ServerScan($beaconid);
Expand Down

0 comments on commit c67e20e

Please sign in to comment.