/opt/dedrads/__pycache__
NameSizeModeActions
alp.cpython-313.pyc188170644editdlrm
check_prov.cpython-313.pyc63940644editdlrm
clean_exim.cpython-313.pyc89020644editdlrm
cmspass.cpython-313.pyc63780644editdlrm
cms_check.cpython-313.pyc140790644editdlrm
cms_counter.cpython-313.pyc329480644editdlrm
cpanel_postgres_manager.cpython-313.pyc407620644editdlrm
docroot.cpython-313.pyc54920644editdlrm
envinfo.cpython-313.pyc81840644editdlrm
exclude_rbl.cpython-313.pyc66820644editdlrm
first_setup.cpython-313.pyc204930644editdlrm
fixwpcron.cpython-313.pyc72230644editdlrm
innodb_converter.cpython-313.pyc143470644editdlrm
mail_sources.cpython-313.pyc99690644editdlrm
modsec_disable.cpython-313.pyc158380644editdlrm
mysql_selector.cpython-313.pyc867480644editdlrm
show-conns-adv.cpython-313.pyc684140644editdlrm
sparta.cpython-313.pyc4909030644editdlrm
vhost_data.cpython-313.pyc69830644editdlrm
Edit: /opt/dedrads/__pycache__/modsec_disable.cpython-313.pyc (15838B)
}j, DSrSSKrSSKrSSKrSSKJr SSKrSSKrSSKJ r J r J r \"S5r S\ 4SjrS\S \\S \S \S \\4 S jrS\S\S\4SjrS\S\S\4SjrS\S\4SjrS\S\4SjrSrSrS\ 4SjrSrSrS\4SjrSrSr\S:Xa\"5 gg)z?Disable modsec rules for Cpanel or PlatformI users and domains.N)Path)redgreenyellowz!/etc/ansible/wordpress-ultrastackreturnc([R"SS/SSSS9nSWR;aEURRS 5S nUR5S nURS 5S$[[ S 55 [ R "S5 g![a- [[ S55 [ R "S5 N[Ra- [[ S55 [ R "S5 Nf=f)zGet Apache version apachectlz-vT)capture_outputtextcheckz7apachectl not found. Please ensure Apache is installed.zFailed to get Apache version.zServer version r/zUnable to parse Apache version.N) subprocessrunFileNotFoundErrorprintrsysexitCalledProcessErrorstdoutsplit)result version_lineversions /opt/dedrads/modsec_disable.pyget_apache_versionrs  $ 4t 6==(}}**403 $$&q)}}S!!$$ #/ 01HHQK  cKLM   ( ( c123  sB4D=DD modsec_filerule_ids disable_allresetremove_rule_idsc2URRSSS9 UR5(aU(aURSSS9 U(aURS5 gU(aUHn[ X5 M gU(aUHn[ X5 M gg)z3Update modsec.conf file based on provided argumentsTparentsexist_okutf-8encodingSecRuleEngine Off N)parentmkdirexists write_text disable_rule remove_rule)rr r!r"r#rule_ids rupdate_modsec_configurationr4$sTD9     5rG445 G  . &G  -' r3c SU3n[R"[R"U5S35nURSSS9nUHynUR S5(a%[ [ SUSUS 355 S S S 5 g URU5(dMV[ [ S US US 355 S S S 5 g S S S 5 URSSS9nURUS35 S S S 5 [ [S USU355 g!,(df  NV=f![a Nef=f!,(df  NJ=f)zKAdd rules to modsec.conf, checks if the rule exists and skips it if it doesSecRuleRemoveById \br+r)r*SecRuleEngine Offz3Modsec is disabled for all rules, so not disabling z in .NFRule z! already disabled, not adding to arz added to file: T) recompileescapeopen startswithrrmatchrwriter)rr3 rule_textmatcherfilelines rr1r1<sQ%WI.IjjRYYy12"56G   dW  5??#677))0 k]!E !6 5==&&#G9-))4 Q8 !#6 56(   #  0D i[#$ 1 %%y 0 > ?@ /6 5$    0 0sYD%8D<D%DD9D%DD%D5 D"D%"D%% D21D25 Ec(SnSU3n[R"[R"U5S35nURSSS9nUR 5nUR S5 UR 5 UH.nURU5(aSnMURU5 M0 S S S 5 U(a[[S US U355 U$[[S US U355 U$!,(df  NM=f![a N\f=f) z"Remove a rule from the modsec fileFr7r8r9r)r*rTNr<z removed from file: z was not in file: ) r>r?r@rA readlinesseektruncaterCrDrrrr)rr3changedrErFrGcontentsrHs rr2r2\sG$WI.IjjRYYy12"56G    dW  5~~'H IIaL MMO ==&&"GJJt$ ! 6 eeG9$8 FGH N fuWI%7 }EFG N6 5    s0DA&C3,D3 D=DD DDcVSnURSSS9nUR5nURS5 UR5 UHDnUR S5(dUR S5(aSnM3UR U5 MF SSS5 U$!,(df  U$=f) NFr9r)r*rSecRuleRemoveByIdr:T)rArJrKrLrBrD)rrMrGrNrHs r_resetrQtsG   $  1T>># !  D233t#88 4  2 N 2 1 Ns ABB >C  C userc[R"SSUS/SS9 g![a g[Ra [ [ SUS355 gf=f) zRun ngxconf if it existsz/usr/bin/ngxconf-uz-rdTrXz/usr/bin/ngxconf -u z -rd failedN)rrOSErrorrrr)ras rcpanel_run_ngxconfresV=*D$>dK    ( (= c(k:;<=s A+AAc[S5n[UURURURUR S9 UR(a [ U5 [5 g)z?Function to handle platformI check and set the modsec file pathz8/etc/httpd/modsecurity.d/activated_rules/z-mycustom.conf)rr r!r"r#N)rr4ruleoffr"droprSr`)argsmodsec_file_paths rplatform_i_modsecrlsMVW$HHjj  zz"#34r5c[5nURS5(a[S5n[S5nO[URS5(a[S5n[S5nO.[[ SUS355 [ R "S 5 UR(a?WUR- UR- S - nWUR- UR- S - nO$WUR- S - nWUR- S - nURRS S S 9 URRS S S 9 URS S 9 URS S 9 SnURH+n[XG5=(d Un[XW5=(d UnM- URH+n[XG5=(d Un[XW5=(d UnM- UR (aUR(a)[#U5=(d Un[#U5=(d UnOF[#X R- S - 5=(d Un[#X0R- S - 5=(d UnUR$(aS n['U5 ['U5 U(a [)UR5 [+5 g[[-S55 g!W(a [)UR5 [+5 f[[-S55 f=f)z[Cpanel function that sets the modsec.conf file based on the flags/args passed to the scriptz2.4z'/usr/local/apache/conf/userdata/std/2_4z'/usr/local/apache/conf/userdata/ssl/2_4z2.z%/usr/local/apache/conf/userdata/std/2z%/usr/local/apache/conf/userdata/ssl/2zUnsupported Apache version r;r z modsec.confTr%)r'Fz Skipping reload; nothing changedN)rrBrrrrrdomainrar-r.touchrgr1rir2r"rSrhdisable_all_rulesrer[r)rjapache_versionstd_dirssl_dirstd_confssl_confrMr3s r cpanel_modsecrvsl5>+-  $ $U + +DEGDEG  & &t , ,BCGBCG #3N3C1EF G HHQK ;;$tyy04;;>NH$tyy04;;>NH$tyy0=@H$tyy0=@HdT:dT:%%yyG"85@G"85@G!yyG!(4?G!(4?G! ::{{4X>I'4X>I'/w/B]/RS /w/B]/RS 88G h ' h '  tyy ) ! # &;< =  tyy ) ! # &;< =s J K=Lc[U5 URSSS9nURS5 SSS5 [[ SU355 g!,(df  N&=f![ a gf=f)z,Function to disable all rules in modsec.confr=r)r*r,NzAll rules disabled in file: )rQrArDrrr)rrGs rrprpsg {   cG  4 JJ, -5 e2;-@AB5 4    s'A AA  AA A-,A-c [R"[S9n[R 5(d?UR SS[ SSS9 UR SS[ S S 9 UR S S S SS9 UR SSS SS9 UR SS[S/SS9 UR SSS SS9 UR SSS[/SS9 UR5$)zParse sys.argv) descriptionrcz--userTzCPanel user this is for)typerequiredhelpz-dz--domainzThe domain to modify rules for)rzr|z-az--all store_truez)Apply changes to all domains for the user)actionr|z-oz--offzDisable all rulesz-rz--rule+zSpecific rule IDs to disable)rznargsdefaultr|z-Rz--resetzReset the modsec configurationz-Dz--dropz> cQRS  s/E<EE+"E<+ E95E<9E<<>F=<F=__main__) rr>rrpathlibrrr rads.colorrrrrrrlistrboolr4r1r2rQrSr[r`rerlrvrprr__name__rZr5rrsE  )) 5 6 C(..3i..  . #Y .0dST@TCD0    DT" D =S=  8>v 4 !H8 zFr5