<commit_before>#!/bin/sh

# hostfile - List of subnets or addresses which to scan for a given port
# outpath - Path to store output
# port - Port to scan for

if [ -z "$2" ]; then
	echo usage: nmss.sh hostfile outpath port
	exit 1
fi

tmpfile=`mktemp`

outfile="nmss-`date +%s`.out"
out="${2}/${outfile}"

nmap -iL $1 -sS -p 22 -P0 -T4 -oG $tmpfile

cat $tmpfile | grep '\/open\/' | awk '{ print $2 }' > $out
cat $tmpfile | grep '\/filtered\/' | awk '{ print $2 }' > ${out}.filtered

rm -f ${2}/lastscan
(cd ${2} && ln -s $outfile lastscan)

rm -f $tmpfile

exit 0<commit_msg>fix option parsing, store raw scan results with processed<commit_after>#!/bin/sh

# hostfile - List of subnets or addresses which to scan for a given port
# outpath - Path to store output
# port - Port(s) to scan for, comma seperated no spaces

if [ -z "$3" ]; then
	echo usage: nmss.sh hostfile outpath port
	exit 1
fi

tmpfile=`mktemp`

outfile="nmss-`date +%s`.out"
out="${2}/${outfile}"

nmap -iL $1 -sS -p $3 -P0 -T4 -oG $tmpfile

cat $tmpfile | grep '\/open\/' | awk '{ print $2 }' | sort | uniq > $out
cat $tmpfile > ${out}.nmap

rm -f ${2}/lastscan
(cd ${2} && ln -s $outfile lastscan)

rm -f $tmpfile

exit 0
{'fraction_non_alphanumeric': 0.16764459346186086, 'fraction_numerical': 0.020117351215423303, 'mean_word_length': 3.234042553191489, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2583499', 'n_tokens_mistral': 491, 'n_tokens_neox': 465, 'n_words': 170}