Skip to content

Commit

Permalink
Merge pull request #796 from m-1-k-3/http_crawler
Browse files Browse the repository at this point in the history
little fix
  • Loading branch information
m-1-k-3 committed Sep 19, 2023
2 parents 1c785ce + 4ca8c46 commit 10b9b5d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/L25_web_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ check_curl_ret() {

CURL_RET_CODE="$(echo "${CURL_RET}" | cut -d: -f1 || true)"
CURL_RET_SIZE="$(echo "${CURL_RET}" | cut -d: -f2 || true)"
print_output "[*] CURL_RET: $CURL_RET / ${HTTP_RAND_REF_SIZE} / Port: ${PORT_}" "no_log"
# print_output "[*] CURL_RET: $CURL_RET / ${HTTP_RAND_REF_SIZE} / Port: ${PORT_}" "no_log"

if [[ "${CURL_RET_CODE}" -eq 200 ]]; then
if [[ "${HTTP_RAND_REF_SIZE}" == "NA" ]] || [[ "${CURL_RET_SIZE}" != "${HTTP_RAND_REF_SIZE}" ]]; then
Expand Down Expand Up @@ -326,7 +326,7 @@ web_access_crawler() {
if [[ -n "${WEB_FILE}" ]] && ! [[ "${CRAWLED_ARR[*]}" == *" ${WEB_FILE} "* ]]; then
echo -e "\\n[*] Testing $ORANGE$PROTO://$IP_:$PORT_/$WEB_FILE$NC" >> "$LOG_PATH_MODULE/crawling_$IP_-$PORT_.log"
CURL_RET="$(timeout --preserve-status --signal SIGINT 2 curl "${CURL_OPTS[@]}" "$PROTO""://""$IP_":"$PORT_""/""$WEB_FILE" -o /dev/null -w '%{http_code}:%{size_download}')"
check_curl_ret "${IP_}" "${PORT_}""${CURL_RET}"
check_curl_ret "${IP_}" "${PORT_}" "${CURL_RET}"
CRAWLED_ARR+=( "${WEB_FILE}" )
fi

Expand All @@ -336,7 +336,7 @@ web_access_crawler() {
if [[ -n "${WEB_DIR_L1}" ]] && ! [[ "${CRAWLED_ARR[*]}" == *" ${WEB_DIR_L1}/${WEB_FILE} "* ]]; then
echo -e "\\n[*] Testing $ORANGE$PROTO://$IP_:$PORT_/${WEB_DIR_L1}/${WEB_FILE}$NC" >> "$LOG_PATH_MODULE/crawling_$IP_-$PORT_.log"
CURL_RET="$(timeout --preserve-status --signal SIGINT 2 curl "${CURL_OPTS[@]}" "$PROTO""://""$IP_":"$PORT_""/""${WEB_DIR_L1}""/""$WEB_FILE" -o /dev/null -w '%{http_code}:%{size_download}')"
check_curl_ret "${IP_}" "${PORT_}""${CURL_RET}"
check_curl_ret "${IP_}" "${PORT_}" "${CURL_RET}"
CRAWLED_ARR+=( "${WEB_DIR_L1}/${WEB_FILE}" )
fi

Expand All @@ -346,7 +346,7 @@ web_access_crawler() {
if [[ -n "${WEB_DIR_L2}" ]] && [[ "${WEB_DIR_L2}" != "${WEB_DIR_L1}" ]] && ! [[ "${CRAWLED_ARR[*]}" == *" ${WEB_DIR_L2}/${WEB_FILE} "* ]]; then
echo -e "\\n[*] Testing $ORANGE$PROTO://$IP_:$PORT_/${WEB_DIR_L2}/${WEB_FILE}$NC" >> "$LOG_PATH_MODULE/crawling_$IP_-$PORT_.log"
CURL_RET="$(timeout --preserve-status --signal SIGINT 2 curl "${CURL_OPTS[@]}" "$PROTO""://""$IP_":"$PORT_""/""${WEB_DIR_L2}""/""$WEB_FILE" -o /dev/null -w '%{http_code}:%{size_download}')"
check_curl_ret "${IP_}" "${PORT_}""${CURL_RET}"
check_curl_ret "${IP_}" "${PORT_}" "${CURL_RET}"
CRAWLED_ARR+=( "${WEB_DIR_L2}/${WEB_FILE}" )
fi

Expand All @@ -356,7 +356,7 @@ web_access_crawler() {
if [[ -n "${WEB_DIR_L3}" ]] && [[ "${WEB_DIR_L3}" != "${WEB_DIR_L2}" ]] && [[ "${WEB_DIR_L3}" != "${WEB_DIR_L1}" ]] && ! [[ "${CRAWLED_ARR[*]}" == *" ${WEB_DIR_L3}/${WEB_FILE} "* ]]; then
echo -e "\\n[*] Testing $ORANGE$PROTO://$IP_:$PORT_/${WEB_DIR_L3}/${WEB_FILE}$NC" >> "$LOG_PATH_MODULE/crawling_$IP_-$PORT_.log"
CURL_RET="$(timeout --preserve-status --signal SIGINT 2 curl "${CURL_OPTS[@]}" "$PROTO""://""$IP_":"$PORT_""/""${WEB_DIR_L3}""/""$WEB_FILE" -o /dev/null -w '%{http_code}:%{size_download}')"
check_curl_ret "${IP_}" "${PORT_}""${CURL_RET}"
check_curl_ret "${IP_}" "${PORT_}" "${CURL_RET}"

CRAWLED_ARR+=( "${WEB_DIR_L3}/${WEB_FILE}" )
fi
Expand Down Expand Up @@ -397,7 +397,7 @@ web_access_crawler() {
print_output "[*] Testing ${ORANGE}${PROTO}://${IP_}:${PORT_}/${FILE_QEMU_TEST}${NC}" "no_log"
echo -e "\\n[*] Testing ${ORANGE}${PROTO}://${IP_}:${PORT_}/${FILE_QEMU_TEST}${NC}" >> "${LOG_PATH_MODULE}/crawling_${IP_}-${PORT_}.log"
CURL_RET="$(timeout --preserve-status --signal SIGINT 2 curl "${CURL_OPTS[@]}" "$PROTO""://""$IP_":"$PORT_""/""${FILE_QEMU_TEST}" -o /dev/null -w '%{http_code}:%{size_download}' || true)"
check_curl_ret "${IP_}" "${PORT_}""${CURL_RET}"
check_curl_ret "${IP_}" "${PORT_}" "${CURL_RET}"
done
done
done
Expand Down

0 comments on commit 10b9b5d

Please sign in to comment.