Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import dns.resolver
main_domain = "mail-out.ovh.net."
cur_mailout=1
while True:
try:
mail_out_answer = dns.resolver.query('mo' + str(cur_mailout) + '.' + main_domain,'A')
except dns.resolver.NXDOMAIN:
# platform = Red Hat Enterprise Linux 7
. /usr/share/scap-security-guide/remediation_functions
populate login_banner_text
login_banner_text="^(You[\s\n]+are[\s\n]+accessing[\s\n]+a[\s\n]+U.S.[\s\n]+Government[\s\n]+\(USG\)[\s\n]+Information[\s\n]+System[\s\n]+\(IS\)[\s\n]+that[\s\n]+is[\s\n]+provided[\s\n]+for[\s\n]+USG-authorized[\s\n]+use[\s\n]+only.[\s\n]*By[\s\n]+using[\s\n]+this[\s\n]+IS[\s\n]+\(which[\s\n]+includes[\s\n]+any[\s\n]+device[\s\n]+attached[\s\n]+to[\s\n]+this[\s\n]+IS\),[\s\n]+you[\s\n]+consent[\s\n]+to[\s\n]+the[\s\n]+following[\s\n]+conditions\:[\s\n]*-[\s\n]*The[\s\n]+USG[\s\n]+routinely[\s\n]+intercepts[\s\n]+and[\s\n]+monitors[\s\n]+communications[\s\n]+on[\s\n]+this[\s\n]+IS[\s\n]+for[\s\n]+purposes[\s\n]+including,[\s\n]+but[\s\n]+not[\s\n]+limited[\s\n]+to,[\s\n]+penetration[\s\n]+testing,[\s\n]+COMSEC[\s\n]+monitoring,[\s\n]+network[\s\n]+operations[\s\n]+and[\s\n]+defense,[\s\n]+personnel[\s\n]+misconduct[\s\n]+\(PM\),[\s\n]+law[\s\n]+enforcement[\s\n]+\(LE\),[\s\n]+and[\s\n]+coun
@ptitoliv
ptitoliv / eval.xml
Last active December 26, 2017 16:44
Remediation test for smartcard packages installation
<Rule id="install_smartcard_packages" selected="false" severity="medium">
<title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Install Smart Card Packages For Multifactor Authentication</title>
<description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Configure the operating system to implement multifactor authentication by
installing the required packages with the following command:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ sudo yum install esc pam_pkcs11 authconfig-gtk</html:pre>
</description>
<reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">CCI-001954</reference>
<reference href="http://iase.disa.mil/stigs/os/general/Pages/index.aspx">SRG-OS-000375-GPOS-00160</reference>
<reference href="http://iase.disa.mil/stigs/Pages/stig-viewing-guidance.aspx">SV-87041r2_rule</reference>
@ptitoliv
ptitoliv / ovh_mail_out_list.py
Last active November 1, 2017 14:52
OVH Mail out Resolver
#!/usr/bin/env python
import dns.resolver
main_domain = "mail-out.ovh.net."
cur_mailout=1
while True:
try:
mail_out_answer = dns.resolver.query('mo' + str(cur_mailout) + '.' + main_domain,'A')
except dns.resolver.NXDOMAIN: