Monthly Archives: December 2015

python scan IP range



import sh

print "Scanning..."
# ping range 8.8.8.7 - 8.8.8.9
for num in range(7,10):
    # declare ip address
    address = "8.8.8." + str(num)

    # check if host is alive using PING
    try:
        # bash equivalent: ping -c 1 > /dev/null
        sh.ping(address, "-c 1", _out="/dev/null")
        print "ping to", address, "OK"
    except sh.ErrorReturnCode_1:
        print "no response from", address


cpanel skip spf check for ip range

Go to WHM
Go to "Exim Configuration"
Go to the "Advanced Editor" tab
Scroll to/locate the section labeled "spf_bl (Reject SPF failures)"
If it is checked, uncheck it (this disabled the default SPF behavior)
Make sure the section just above it labeled "custom_begin_mailauth" is checked (enabled) and paste the below snippet in the text box:
deny
hosts = ! +backupmx_hosts
message = SPF: $sender_host_address is not allowed to send mail from $sender_address_domain
spf = fail

qmail spfbehavior

cat /var/qmail/control/spfbehavior

0 to disable.
1 selects ’annotate-only’ mode, where qmail-smtpd will annotate incoming email with Received-SPF fields, but will not reject any messages.
2 will produce temporary failures on DNS lookup problems so you can make sure you always have meaningful Received-SPF headers.
3 selects ’reject’ mode, where incoming mail will be rejected if the SPF record says ’fail’.
4 selects a more strict rejection mode, which is like ’reject’ mode, except that incoming mail will also be rejected when the SPF record says ’softfail’.
5 will also reject when the SPF record says ’neutral’.
6 if no SPF records are available at all (or a syntax error was encountered).