0

Okay so this is driving me crazy and I think it's just a syntax issue

path=$1
ignore=$2

length=$(curl -s -I http://10.10.10.81/$path | grep Length | cut -d " " -f2 | xargs)

if [ "$length" -ne "$ignore" ]; then
        echo $path;
fi

I'm trying to create a simple scanning tool that allows you to pass in the path and the content length to ignore. It's for pages that return 200 and a custom error page.

The problem I'm facing is that the condition is always true. No matter what I do. It's either true or I get an exception.

The above code throws the exception : integer expression expected7

With variations of the code i can get it to run but like I said, it's always true.

A bonus would be if someone knows of a better way to do this. I didn't see a response size option in dirb or wfuzz

I checked the output of both prior to the condition. The values are equal enter image description here

DotNetRussell
  • 9,716
  • 10
  • 56
  • 111

0 Answers0