"Find HTTP Basic or Digest Authentication usage"
from pmcheck import *
import re

class http_auth(check):
	"Find HTTP Basic or Digest Authentication usage"

	def req_hl_parse(self, l, t):
		if re.search('^Authorization:\sBasic', l, re.IGNORECASE):
			desc = "[*] Basic auth seen: %s" % (l.strip())
			self.add_single(desc, id=t['id'])
		elif re.search('^Authorization:\sDigest', l, re.IGNORECASE):
			desc = "[*] Digest auth seen: %s" % (l.strip())
			self.add_single(desc, id=t['id'])
