Author: Fish
Date: Sat Jun 11 14:11:06 2005
New Revision: 178
Modified:
branches/3.0/ChangeLog
branches/3.0/opsb.c (contents, props changed)
branches/3.0/opsb.h (contents, props changed)
branches/3.0/opsb_help.c (contents, props changed)
branches/3.0/proxy.c (contents, props changed)
Log:
akill support, open proxy reporting and correctly set targetip when we boot for the first time
Modified: branches/3.0/ChangeLog
==============================================================================
--- branches/3.0/ChangeLog (original)
+++ branches/3.0/ChangeLog Sat Jun 11 14:11:06 2005
@@ -1,6 +1,8 @@
Open Proxy Scanning Bot Module for NeoStats Changelog.
==============================================================================
3.0.a3-dev - Mark (M) & Fish (F)
+ - AKILL support and open proxy reporting (F)
+ - Get default targetip when starting up correctly (F)
- Simplify command path. (M)
- Fix event and command return values. (M)
- Clean up config.h entries. (M)
@@ -90,4 +92,4 @@
- added to exclusion list who added the exclusion, and the reason
* Version 1.0Beta1 * 31/8/2002 * Fish
-- Initial Release
\ No newline at end of file
+- Initial Release
Modified: branches/3.0/opsb.c
==============================================================================
--- branches/3.0/opsb.c (original)
+++ branches/3.0/opsb.c Sat Jun 11 14:11:06 2005
@@ -86,7 +86,7 @@
static bot_setting opsb_settings[]=
{
- {"TARGETIP", opsb.targetip, SET_TYPE_IPV4, 0, MAXHOST,NS_ULEVEL_ADMIN, NULL, opsb_help_set_targetip, opsb_set_cb, (void*)"10.1.1.24" },
+ {"TARGETIP", opsb.targetip, SET_TYPE_IPV4, 0, MAXHOST,NS_ULEVEL_ADMIN, NULL, opsb_help_set_targetip, opsb_set_cb, (void*)0 },
{"TARGETPORT", &opsb.targetport, SET_TYPE_INT, 0, 65535, NS_ULEVEL_ADMIN, NULL, opsb_help_set_targetport, opsb_set_cb, (void*)6667 },
{"AKILL", &opsb.doakill, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, opsb_help_set_akill, opsb_set_cb, (void*)1 },
{"AKILLTIME", &opsb.akilltime, SET_TYPE_INT, 0, 20736000,NS_ULEVEL_ADMIN, NULL, opsb_help_set_akilltime, opsb_set_cb, (void*)TS_ONE_DAY },
@@ -98,6 +98,7 @@
{"CACHESIZE", &opsb.cachesize, SET_TYPE_INT, 0, 10000, NS_ULEVEL_ADMIN, NULL, opsb_help_set_cachesize, opsb_set_cb, (void*)1000 },
{"VERBOSE", &opsb.verbose, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, opsb_help_set_verbose, opsb_set_cb, (void*)1 },
{"EXCLUSIONS", &opsb.exclusions, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, opsb_help_set_exclusions, opsb_set_exclusions_cb, (void *)0 },
+ {"DOREPORT", &opsb.doreport, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, opsb_help_set_doreport, opsb_set_cb, (void *)1},
{NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL },
};
@@ -745,13 +746,6 @@
nlog (LOG_WARNING, "Can't Load opsb. No Ports Defined for Scanner. Did you install Correctly?");
return NS_FAILURE;
}
- /* XXX needs work */
- if (strlen(opsb.targetip) <= 0) {
- strlcpy(opsb.targetip, me.uplink, MAXHOST);
- }
- if (init_scanengine() != NS_SUCCESS) {
- return NS_FAILURE;
- }
return NS_SUCCESS;
}
@@ -767,6 +761,12 @@
int ModSynch (void)
{
SET_SEGV_LOCATION();
+ if (strlen(opsb.targetip) <= 0) {
+ strlcpy(opsb.targetip, inet_ntoa(me.srvip.sin_addr), MAXHOST);
+ }
+ if (init_scanengine() != NS_SUCCESS) {
+ return NS_FAILURE;
+ }
opsb_bot = AddBot (&opsb_botinfo);
if (opsb.confed == 0) {
AddTimer (TIMER_TYPE_INTERVAL, unconf, "unconf", TS_ONE_MINUTE);
@@ -789,5 +789,5 @@
int ModFini( void )
{
- return NS_SUCCESS;
+ return NS_SUCCESS;
}
Modified: branches/3.0/opsb.h
==============================================================================
--- branches/3.0/opsb.h (original)
+++ branches/3.0/opsb.h Sat Jun 11 14:11:06 2005
@@ -71,6 +71,7 @@
int cachesize;
int cachehits;
int doakill;
+ int doreport;
int verbose;
int exclusions;
list_t *ports;
@@ -144,5 +145,5 @@
extern const char *opsb_help_set_verbose [];
extern const char *opsb_help_set_exclusions[];
extern const char *opsb_help_set_cachesize[];
-
+extern const char *opsb_help_set_doreport[];
#endif /* OPSB_H */
Modified: branches/3.0/opsb_help.c
==============================================================================
--- branches/3.0/opsb_help.c (original)
+++ branches/3.0/opsb_help.c Sat Jun 11 14:11:06 2005
@@ -175,3 +175,9 @@
"Use global exclusion list in addition to local exclusion list",
NULL
};
+const char *opsb_help_set_doreport[] = {
+ "Enable Open Proxy Reporting",
+ "\2DOREPORT <ON|OFF>\2",
+ "Enable OPSB reporting of Open Proxies back to Secure.irc-chat.net",
+ NULL
+};
Modified: branches/3.0/proxy.c
==============================================================================
--- branches/3.0/proxy.c (original)
+++ branches/3.0/proxy.c Sat Jun 11 14:11:06 2005
@@ -269,7 +269,7 @@
if (inet_aton(opsb.targetip, &addr) != 0) {
laddr = htonl(addr.s_addr);
} else {
- nlog(LOG_ERROR, "Couldn't Setup connect address for init_scan_engine");
+ nlog(LOG_ERROR, "Couldn't Setup connect address for init_scan_engine: %s", opsb.targetip);
return NS_FAILURE;
}
/* taken from libopm */
@@ -588,7 +588,9 @@
void open_proxy(conninfo *connection)
{
scaninfo *scandata = connection->scandata;
-
+ Client *u;
+ char buf[1400];
+
SET_SEGV_LOCATION();
if (scandata->doneban == 1)
@@ -599,11 +601,16 @@
irc_chanalert (opsb_bot, "Banning %s (%s) for Open Proxy - %s(%d)", scandata->who, scandata->lookup, type_of_proxy(connection->type), connection->port);
irc_globops (opsb_bot, "Banning %s (%s) for Open Proxy - %s(%d)", scandata->who, scandata->lookup, type_of_proxy(connection->type), connection->port);
if (scandata->reqclient) irc_prefmsg (opsb_bot, scandata->reqclient, "Banning %s (%s) for Open Proxy - %s(%d)", scandata->who, scandata->lookup, type_of_proxy(connection->type), connection->port);
-#if 0
+ u = FindUser(scandata->who);
+ if (u)
+ irc_prefmsg(opsb_bot, u, "An %s open proxy was found on port %d from your host. Please see http://secure.irc-chat.net/op.php?f=opsb&t=%d&p=%d&ip=%s", type_of_proxy(connection->type), connection->port, connection->type, connection->port, inet_ntoa(scandata->ip));
if (opsb.doakill)
- /* XXX IP */
- irc_akill (opsb_bot, "", "*", opsb.akilltime, "Open Proxy found on your host. %s(%d)", type_of_proxy(connection->type), connection->port);
-#endif
+ irc_akill (opsb_bot, inet_ntoa(scandata->ip), "*", opsb.akilltime, "An %s open proxy was found on port %d from your host. Please see http://secure.irc-chat.net/op.php?f=opsb&t=%d&p=%d&ip=%s", type_of_proxy(connection->type), connection->port, connection->type, connection->port, inet_ntoa(scandata->ip));
+ if (opsb.doreport) {
+ /* type\nport\nip\nnetwork\n */
+ ircsnprintf(buf, 1400, "%d\n%d\n%s\n%s\n", connection->type, connection->port, inet_ntoa(scandata->ip), me.name);
+ sendtoMQ(UPDATE_OPSBREPORT, buf, strlen(buf));
+ }
/* no point continuing the scan if they are found open */
scandata->state = GOTOPENPROXY;
/* XXX end scan */
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.