<commit_before>#!/bin/bash
#
# File: start-cs-server.bash
#
# Description: Start the CobaltStrike server
#
################################################################################

# Get a list of IP addresses to start server on
IPaddr=( $(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'  ) )
i=0
declare -a IPaddr
CSPATH="/opt/cobaltstrike"

# Test that CS directory exists
if [[ ! -d ${CSPATH} ]]; then
   echo "[-] CobaltStrike directory does not exist: $CSPATH"
   echo "[-] Verify the path or intall and update variable CSPATH"
   echo "[-] Exiting..."
   exit 1
fi

# Gather IP addresses for server to listen on
echo "*** IP Select Menu ***"
for IP in $IPaddr; do
   echo "   $i) $IP"
   ((i=i+1))
done

echo -n "Select the IP to listen on [0]: "
read serverIP

echo "Value select is: ${IPaddr[$serverIP]}"
cd $CSPATH 

echo -n "Enter password for CobaltStrike Server [password]: "
read CSPASS

# Start CobaltStrike server
if [[ x${CSPASS} == "x" ]]; then
   echo "./teamserver ${IPaddr[$serverIP]} password"
   ./teamserver ${IPaddr[$serverIP]} password
else
   echo "./teamserver ${IPaddr[$serverIP]} ${CSPASS}"
   ./teamserver ${IPaddr[$serverIP]} ${CSPASS}
fi
<commit_msg>Corrected issue with extracting multiple IP addresses from server<commit_after>#!/bin/bash
#
# File: start-cs-server.bash
#
# Description: Start the CobaltStrike server
#
################################################################################

# Get a list of IP addresses to start server on
IPaddr=( $(ifconfig | grep 'inet addr:' | cut -d: -f2 | awk '{ {printf $1" ";next;}1}' ) )
i=0

CSPATH="/opt/cobaltstrike"

# Test that CS directory exists
if [[ ! -d ${CSPATH} ]]; then
   echo "[-] CobaltStrike directory does not exist: $CSPATH"
   echo "[-] Verify the path or intall and update variable CSPATH"
   echo "[-] Exiting..."
   exit 1
fi

# Gather IP addresses for server to listen on
echo "*** IP Select Menu ***"
for IP in ${IPaddr[*]}; do
   echo "   $i) $IP"
   ((i=i+1))
done

echo -n "Select the IP to listen on [0]: "
read serverIP

echo "Value select is: ${IPaddr[$serverIP]}"
cd $CSPATH 

echo -n "Enter password for CobaltStrike Server [password]: "
read CSPASS

# Start CobaltStrike server
if [[ x${CSPASS} == "x" ]]; then
   echo "./teamserver ${IPaddr[$serverIP]} password"
   ./teamserver ${IPaddr[$serverIP]} password
else
   echo "./teamserver ${IPaddr[$serverIP]} ${CSPASS}"
   ./teamserver ${IPaddr[$serverIP]} ${CSPASS}
fi

{'fraction_non_alphanumeric': 0.2107823267126064, 'fraction_numerical': 0.005674908796108634, 'mean_word_length': 4.152400835073069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7632053', 'n_tokens_mistral': 838, 'n_tokens_neox': 819, 'n_words': 283}