mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
refine ip matching
fix regex to only match IPs at the beginning of a line
This commit is contained in:
parent
b71f2f67f4
commit
f2880ec3d6
1 changed files with 4 additions and 4 deletions
8
docker/elk/logstash/dist/gen_iprep_map.sh
vendored
8
docker/elk/logstash/dist/gen_iprep_map.sh
vendored
|
@ -43,9 +43,9 @@ local myFILE=$1
|
|||
myZIP=$(file $myFILE | grep -c "Zip")
|
||||
if [ "$myZIP" == "1" ]
|
||||
then
|
||||
unzip -p $myFILE | grep -o -P "\b(?:\d{1,3}\.){3}\d{1,3}/\d{1,2}\b" | xargs -I '{}' prips '{}'
|
||||
unzip -p $myFILE | grep -o -P "^\b(?:\d{1,3}\.){3}\d{1,3}/\d{1,2}\b" | xargs -I '{}' prips '{}'
|
||||
else
|
||||
grep -o -P "\b(?:\d{1,3}\.){3}\d{1,3}/\d{1,2}\b" $myFILE | xargs -I '{}' prips '{}'
|
||||
grep -o -P "^\b(?:\d{1,3}\.){3}\d{1,3}/\d{1,2}\b" $myFILE | xargs -I '{}' prips '{}'
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -60,9 +60,9 @@ local myFILE=$1
|
|||
myZIP=$(file $myFILE | grep -c "Zip")
|
||||
if [ "$myZIP" == "1" ]
|
||||
then
|
||||
unzip -p $myFILE | grep -o -P "\b(?:\d{1,3}\.){3}\d{1,3}\b"
|
||||
unzip -p $myFILE | grep -o -P "^\b(?:\d{1,3}\.){3}\d{1,3}\b"
|
||||
else
|
||||
grep -o -P "\b(?:\d{1,3}\.){3}\d{1,3}\b" $myFILE
|
||||
grep -o -P "^\b(?:\d{1,3}\.){3}\d{1,3}\b" $myFILE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue