<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/21010" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2021-07-19T07:06:22-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/21010</id>

		<entry>
		<author><name><![CDATA[Gulio]]></name></author>
		<updated>2021-07-19T07:06:22-04:00</updated>

		<published>2021-07-19T07:06:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110125#p110125</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110125#p110125"/>
		<title type="html"><![CDATA[ProxyCheck On Connect]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110125#p110125"><![CDATA[
Here is miss the proc connect:check the regex and codes for check ip on connect and scan port reply and check exemp ip from list<br>can someone help to do it this proc who have time and desire<br>thx in advance<br><div class="codebox"><p>Code: </p><pre><code>################################################################################################  ##  Proxycheck  -   dnsbl.tcl for eggdrop       ##  ################################################################################################################################################################################################      ____                __                 ###########################################  ####     / __/___ _ ___ _ ___/ /____ ___   ___   ###########################################  ####    / _/ / _ `// _ `// _  // __// _ \ / _ \  ###########################################  ####   /___/ \_, / \_, / \_,_//_/   \___// .__/  ###########################################  ####        /___/ /___/                 /_/      ###########################################  ####                                             ###########################################  ##################################################################################################  ##                             Start Setup.                                         ##  ############################################################################################################################################################################################################################################################################################## ProxyCheck On Connect #######################################################################                                                                                          #### This script use blacklist dns to check on connect the Ip ####################################                                                                                          #### The Checker IP comes from reply match and common proxy socks ports ##########################                                                                                          #### The Script need to show report in channel only what is match as Proxy / VPN / SOCKS #########                                                                                          #### When the scripts is disabled need to show also the Ip matched from port or BL ###############                                                                                          ################################################################################################set dnsbl(chrep) "#test"bind pub -|- .check check:switchbind pub -|- .ipadd exemps:cmdbind pub -|- .ipdel "exemps:cmdbind pub -|- .addport "exemps:cmdbind pub -|- .delport "exemps:cmdbind pub -|- .adddns "exemps:cmdbind pub -|- .deldns "exemps:cmdproc check:switch {nick uhost hand chan text} {if {![onchan $nick $::dnsbl(chrep)]} { return }if {$text eq "on"} {setuser $::owner XTRA check onputserv "PRIVMSG $::dnsbl(chrep) $nick : ANTIPROXY is ON"} elseif {$text eq "off"} {setuser $::owner XTRA check offputserv "PRIVMSG $::dnsbl(chrep) $nick : ANTIPROXY is OFF"} else {putserv "PRIVMSG $::dnsbl(chrep) $nick : Syntax: The right command is: .check on/off."}}#The first check is to check if the Ip exist on ExempList to allow and to show report this ip nick ip is exemp and matched from BL on port or replyset exemps(file) "exemps.txt"#The second check is to match the IP with Port of proxy $ socks 4/5 List and if is matched to zline the IP#example: "Connected: Nick: $nick - IP: $ip - Reverse: $reverse --&gt; 1 match from BL drone.dnsbl.org: on Port: $exemps(portfile)"set exemps(portfile) "portscan.txt"#This create the list of blacklist who each dnsbl to check and give report in channel report who from all blacklist matched the ip and to give zline to the ip#example: "Connected: Nick: $nick - IP: $ip - Reverse: $reverse --&gt; 1 match from BL drone.dnsbl.org Reply: 2"set exemps(dnslist) "dnsbl-list.txt"set dnsbl(type) "record"#Every blacklist need to check with reply belowe and when the ip is matched from Bl to show and reply number who match the ipset dnsbl(reply) "1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 32; 37; 38; 40; 100; 213; 255;"#Action ban for gline/zline/gzline/akill/klineset dnsbl(action) "zline"#Ban Time Duration from gline/zline/gzline/akill/klineset dnsbl(ban-time) "1d"#Here we set the ban reason for gline/zline/gzline/akill/klineset dnsbl(reason) "Decteted Proxy/Vpn"bind raw * NOTICE connect:checkproc connect:check {from key text} {# what regex code need in this body to scan check ip and variables ??? #}if {![file exists $exemps(file)]} {set file        [open $exemps(file) w]close $file}if {![file exists $exemps(portfile)]} {set file        [open $exemps(portfile) w]close $file}if {![file exists $exemps(dnslist)]} {set file        [open $exemps(dnsfile) w]close $file}proc check_ip {ip} {global exempsset file        [open $exemps(file) r]set fdata       [split [read $file] \n]close $fileforeach entry $fdata {if {[string match $entry $ip]} {return 1}}return 0}proc check_port {port} {global exempsset file        [open $exemps(portfile) r]set fdata       [split [read $file] \n]close $fileforeach entry $fdata {if {[string match -nocase $entry $port]} {return 1}}return 0}proc check_dnsbl {dnsbl} {global exempsset file        [open $exemps(dnsfile) r]set fdata       [split [read $file] \n]close $fileforeach entry $fdata {if {[string match -nocase $entry $dnsbl]} {return 1}}return 0}proc exemps:cmd {nick host hand chan arg} {global exempsif {![onchan $nick $::dnsbl(chrep)]} { return }set arg1        [lindex [split $arg] 0]set type [string trim $::lastbind "."]switch $type {ipadd {if {$arg1 == ""} {putserv "PRIVMSG $::dnsbl(chrep) Syntax: .addip / .delip 109.23.* or .addip / .delip 109.23.16.24 "return}set file                        [open $exemps(file) "r"]set data                        [read $file]close $fileset lines                       [lrange [split $data "\n"] 0 end-1]set current_place       [lsearch -exact $lines $arg1]if { $current_place != "-1" } {putserv "PRIVMSG $::dnsbl(chrep) $nick: This Ip $arg1 exist on ExempList"return}set file                        [open $exemps(file) a]puts $file $arg1close $fileputserv "PRIVMSG $::dnsbl(chrep) $nick: This Ip $arg1 ADDED succesfully in ExempList"}ipdel {array set exempsdel [list]set file                        [open $exemps(file) "r"]set data                        [read $file]close $fileset lines                       [lrange [split $data "\n"] 0 end-1]set current_place       [lsearch -exact $lines $arg1]if {$current_place == "-1"} {putserv "PRIVMSG $::dnsbl(chrep) $nick: This Ip $arg1 dont exist on ExempList"return}set delete                      [lreplace $lines $current_place $current_place]set files                       [open $exemps(file) "w"]puts $files [join $delete "\n"]flush $filesclose $filesset file                        [open $exemps(file) "r"]set data                        [read $file]close $fileif {[string is space $data]} {set files [open $exemps(file) "w"]close $files}putserv "PRIVMSG $::dnsbl(chrep) $nick: This Ip $arg1 REMOVED succesfully from ExempList"}addport {if {$arg1 == ""} {putserv "PRIVMSG $::RepChan(report_chan) Syntax: .addport 8080 / .delport 8080"return}set file                        [open $exemps(portfile) "r"]set data                        [read $file]close $fileset lines                       [lrange [split $data "\n"] 0 end-1]set current_place       [lsearch -exact $lines $arg1]if { $current_place != "-1" } {putserv "PRIVMSG $::dnsbl(chrep) $nick: This Port $arg1 exist on PORT-List"return}set file                        [open $exemps(portfile) a]puts $file $arg1close $fileputserv "PRIVMSG $::dnsbl(chrep) $nick: This Port $arg1 ADDED succesfully in PORT-List"}delport {array set exempsdel [list]set file                        [open $exemps(portfile) "r"]set data                        [read $file]close $fileset lines                       [lrange [split $data "\n"] 0 end-1]set current_place       [lsearch -exact $lines $arg1]if {$current_place == "-1"} {putserv "PRIVMSG $::dnsbl(chrep) $nick: This Port $arg1 dont exist on PORT-List"return}set delete                      [lreplace $lines $current_place $current_place]set files                       [open $exemps(portfile) "w"]puts $files [join $delete "\n"]flush $filesclose $filesset file                        [open $exemps(portfile) "r"]set data                        [read $file]close $fileif {[string is space $data]} {set files [open $exemps(portfile) "w"]close $files}putserv "PRIVMSG $::RepChandnsbl(chrep) $nick: This Port $arg1 REMOVED succesfully from PORT-List"}adddns {if {$arg1 == ""} {putserv "PRIVMSG $::RepChan(report_chan) Syntax: .adddns drone.dnsbl.org / .deldns drone.dnsbl.org "return}set file                        [open $exemps(portfile) "r"]set data                        [read $file]close $fileset lines                       [lrange [split $data "\n"] 0 end-1]set current_place       [lsearch -exact $lines $arg1]if { $current_place != "-1" } {putserv "PRIVMSG $::dnsbl(chrep) $nick: This BL $arg1 exist on DNSBL-List"return}set file                        [open $exemps(portfile) a]puts $file $arg1close $fileputserv "PRIVMSG $::dnsbl(chrep) $nick: This BL $arg1 ADDED succesfully in DNSBL-List"}deldns {array set exempsdel [list]set file                        [open $exemps(portfile) "r"]set data                        [read $file]close $fileset lines                       [lrange [split $data "\n"] 0 end-1]set current_place       [lsearch -exact $lines $arg1]if {$current_place == "-1"} {putserv "PRIVMSG $::dnsbl(chrep) $nick: This BL $arg1 dont exist on DNSBL-List"return}set delete                      [lreplace $lines $current_place $current_place]set files                       [open $exemps(portfile) "w"]puts $files [join $delete "\n"]flush $filesclose $filesset file                        [open $exemps(portfile) "r"]set data                        [read $file]close $fileif {[string is space $data]} {set files [open $exemps(portfile) "w"]close $files}putserv "PRIVMSG $::RepChandnsbl(chrep) $nick: This BL $arg1 REMOVED succesfully from DNSBL-List"}}}putlog "ProxyCheck - Loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12887">Gulio</a> — Mon Jul 19, 2021 7:06 am</p><hr />
]]></content>
	</entry>
	</feed>
