Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 46ed427

Browse files
authored
Merge pull request #8 from EmmaTinten/master
Adding check for HTTP 403 (forbidden)
2 parents b30bd7f + 72f0e4b commit 46ed427

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

check_nsc_web.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ func main() {
253253
}
254254
defer res.Body.Close()
255255

256+
// check http status code
257+
// getting 403 here means we're not allowed on the target (e.g. allowed hosts)
258+
if res.Status == "403" {
259+
fmt.Println("HTTP 403: Forbidden.")
260+
os.Exit(3)
261+
}
262+
256263
if flagVerbose {
257264
dumpres, err := httputil.DumpResponse(res, true)
258265
if err != nil {

0 commit comments

Comments
 (0)