-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Closes #224 Closes #225 Closes #226 Code Cleanup. File(s): base_ag_main.php : base_local_rules.php : includes/base_krnl.php : includes/base_net.inc.php : includes/base_state_citems.inc.php : includes/base_state_query.inc.php Code Cleanup. File(s): base_common.php Code Cleanup. Issue(s): #222 Function(s): Removed: BuildIPFormVars(), BuildSrcIPFormVars(), & BuildDstIPFormVars(). Function(s): BuildIPFormVar( ip, addr_type, criteria_instance ) Returns HTTP Query String fragment containing IP Address search criteria; or empty string on invalid IP. Note: Curently the NULL_IP constant is also treated as valid foe backward compatibility reasons. This "feature" will be removed in the future, when code depending on NULL_IP being in the HTTP Query String is removed. File(s): base_db_common.php : includes/base_db.inc.php Code Cleanup. Issue(s): #226 File(s): base_maintenance.php : composer.json : includes/base_auth.inc.php : includes/base_capabilities.php Code Cleanup. Issue(s): #225 File(s): base_stat_ipaddr.php Issue(s): #217 Code Cleanup. File(s): base_stat_uaddr.php Issue(s): #223 Code Cleanup. File(s): includes/base_log_error.inc.php Issue(s): #226 Function(s): returnBuildError( Desc, Opt, dll ) Added dll paramater to provide more meaningful error reports for Windows installations. File(s): includes/base_rtl.php Code Cleanup. Bumped RTL Version to 0.0.12 Issue(s): #224 #225 Function(s): BCMi() Returns true if BCMath is installed, false otherwise. : GMPi() Returns true if GMP is installed, false otherwise. : IPv6i() Returns true if RTL can handle IPv6 on this installation. Sets New Constant BASE_RTL_IPv6 accordingly. File(s): includes/base_state_criteria.inc.php Issue(s): #218 Unit Test(s): Covers BuildIPFormVar(), the following in the CriteriaState Class, ReadState().
- Loading branch information
1 parent
9bfe278
commit 119d8c6
Showing
26 changed files
with
944 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,9 +229,8 @@ function PrintPortscanEvents($db, $ip) | |
</TABLE>'; | ||
} | ||
|
||
function PrintEventsByIP($db, $ip) | ||
{ | ||
GLOBAL $debug_mode; | ||
function PrintEventsByIP( $db, $ip ){ | ||
GLOBAL $debug_mode; | ||
|
||
if (!isset($ip)) | ||
{ | ||
|
@@ -287,16 +286,16 @@ function PrintEventsByIP($db, $ip) | |
{ | ||
SQLTraceLog(__FILE__ . ":" . __LINE__ . ":" . __FUNCTION__ . ": After BuildSigByID()"); | ||
} | ||
$tmp_iplookup = 'base_qry_main.php?new=1'. | ||
'&sig%5B0%5D=%3D&sig%5B1%5D='.(rawurlencode(GetSignatureName($unique_events[$i], $db))). | ||
'&num_result_rows=-1'. | ||
'&submit='._QUERYDBP.'&current_view=-1&ip_addr_cnt=2'. | ||
BuildIPFormVars($ip); | ||
|
||
$tmp_sensor_lookup = 'base_stat_sensor.php?'. | ||
'sig%5B0%5D=%3D&sig%5B1%5D='. | ||
(rawurlencode($unique_events[$i])). | ||
'&ip_addr_cnt=2'.BuildIPFormVars($ip); | ||
$tmp_iplookup = 'base_qry_main.php?new=1' | ||
. '&sig%5B0%5D=%3D&sig%5B1%5D=' | ||
. rawurlencode(GetSignatureName($unique_events[$i], $db)) | ||
. '&num_result_rows=-1&submit=' | ||
. _QUERYDBP . '&current_view=-1&ip_addr_cnt=2' | ||
. BuildIPFormVar($ip, 3); | ||
$tmp_sensor_lookup = 'base_stat_sensor.php?' | ||
. 'sig%5B0%5D=%3D&sig%5B1%5D=' | ||
. rawurlencode($unique_events[$i]) | ||
. '&ip_addr_cnt=2' . BuildIPFormVar($ip, 3); | ||
|
||
echo " <TD align='center'> <A HREF=\"$tmp_iplookup\">$total</A> "; | ||
echo " <TD align='center'> <A HREF=\"$tmp_sensor_lookup\">$num_sensors</A> "; | ||
|
@@ -305,33 +304,29 @@ function PrintEventsByIP($db, $ip) | |
echo '</TR>'; | ||
} | ||
|
||
echo "</TABLE>\n"; | ||
PrintFramedBoxFooter(0,2); | ||
} | ||
|
||
$Sep = ' | '; // Separator. | ||
if ( sizeof($sig) != 0 && strstr($sig[1], "spp_portscan") ) | ||
$sig[1] = ""; | ||
|
||
/* Build new link for criteria-based sensor page | ||
* -- ALS <[email protected]> | ||
*/ | ||
$tmp_sensor_lookup = 'base_stat_sensor.php?ip_addr_cnt=2'. | ||
BuildIPFormVars($ip); | ||
// Build new link for criteria-based sensor page - ALS <[email protected]> | ||
$tmp_sensor_lookup = 'base_stat_sensor.php?ip_addr_cnt=2' | ||
. BuildIPFormVar($ip, 3); | ||
|
||
$tmp_srcdst_iplookup = 'base_qry_main.php?new=2&num_result_rows=-1' | ||
. '&submit=' . _QUERYDBP . '&current_view=-1&ip_addr_cnt=2' | ||
. BuildIPFormVar($ip, 3); | ||
|
||
$tmp_srcdst_iplookup = 'base_qry_main.php?new=2'. | ||
'&num_result_rows=-1'. | ||
'&submit='._QUERYDBP.'&current_view=-1&ip_addr_cnt=2'. | ||
BuildIPFormVars($ip); | ||
$tmp_src_iplookup = 'base_qry_main.php?new=2&num_result_rows=-1' | ||
. '&submit=' . _QUERYDBP . '&current_view=-1&ip_addr_cnt=1' | ||
. BuildIPFormVar($ip, 1); | ||
|
||
$tmp_src_iplookup = 'base_qry_main.php?new=2'. | ||
'&num_result_rows=-1'. | ||
'&submit='._QUERYDBP.'&current_view=-1&ip_addr_cnt=1'. | ||
BuildSrcIPFormVars($ip); | ||
$tmp_dst_iplookup = 'base_qry_main.php?new=2&num_result_rows=-1' | ||
. '&submit=' . _QUERYDBP . '&current_view=-1&ip_addr_cnt=1' | ||
. BuildIPFormVar($ip, 2); | ||
|
||
$tmp_dst_iplookup = 'base_qry_main.php?new=2'. | ||
'&num_result_rows=-1'. | ||
'&submit='._QUERYDBP.'&current_view=-1&ip_addr_cnt=1'. | ||
BuildDstIPFormVars($ip); | ||
echo '<CENTER>'; | ||
printf ("<FONT>"._PSALLALERTSAS.":</FONT>",$ip,$netmask); | ||
echo ' | ||
|
@@ -351,25 +346,39 @@ function PrintEventsByIP($db, $ip) | |
<A HREF="http://www.db.ripe.net/whois?query='.$ip.'" target="_NEW">RIPE</A> | | ||
<A HREF="http://wq.apnic.net/apnic-bin/whois.pl?do_search=Search&searchtext='.$ip.'" target="_NEW">APNIC</A> | | ||
<A HREF="http://lacnic.net/cgi-bin/lacnic/whois?lg=EN&query='.$ip.'" target="_NEW">LACNIC</A><BR></FONT>'; | ||
// Have no idea why this code is here. | ||
// Commenting it out as it was ccontributing to Issue #5 | ||
// $octet=preg_split("/\./", $ip); | ||
// $classc=sprintf("%03s.%03s.%03s",$octet[0],$octet[1],$octet[2]); | ||
print '<FONT>'._PSEXTERNAL.': '; | ||
if (isset($external_dns_link)){ | ||
print '<A HREF="'.$external_dns_link.$ip.'" target="_NEW">DNS</A>'; | ||
} | ||
if (isset($external_whois_link)){ | ||
print ' | <A HREF="'.$external_whois_link.$ip.'" target="_NEW">whois</A>'; | ||
} | ||
if (isset($external_all_link)){ | ||
print ' | <A HREF="'.$external_all_link.$ip.'" target="_NEW">Extended whois</A>'; | ||
} | ||
print ' | <A HREF="http://www.dshield.org/ipinfo.php?ip='.$ip.'&Submit=Submit" target="_NEW">DShield.org IP Info</A> | '. | ||
'<A HREF="http://www.trustedsource.org/query.php?q='.$ip.'" target="_NEW">TrustedSource.org IP Info</A> | '. | ||
'<A HREF="http://isc.sans.org/ipinfo.html?ip='.$ip.'" target="_NEW">ISC Source/Subnet Report</A><BR> </FONT>'; | ||
// Have no idea why this code is here. | ||
// Commenting it out as it was ccontributing to Issue #5 | ||
// $octet=preg_split("/\./", $ip); | ||
// $classc=sprintf("%03s.%03s.%03s",$octet[0],$octet[1],$octet[2]); | ||
print _PSEXTERNAL . ': '; | ||
if( isset($external_dns_link) ){ | ||
NLIO( | ||
"<a href='" . $external_dns_link . $ip | ||
. "' target='_NEW'>DNS</a>$Sep", 2 | ||
); | ||
} | ||
if( isset($external_whois_link) ){ | ||
NLIO( | ||
"<a href='" . $external_whois_link . $ip | ||
. "' target='_NEW'>whois</a>$Sep", 2 | ||
); | ||
} | ||
if( isset($external_all_link) ){ | ||
NLIO( | ||
"<a href='" . $external_all_link . $ip | ||
. "' target='_NEW'>Extended whois</a>$Sep", 2 | ||
); | ||
} | ||
NLIO( | ||
"<a href='" . 'https://www.dshield.org/ipinfo.html?ip=' . $ip | ||
. "' target='_NEW'>DShield.org IP Info</a>$Sep", 2 | ||
); | ||
NLIO( | ||
"<a href='" . 'https://isc.sans.edu/ipinfo.html?ip=' . $ip | ||
. "' target='_NEW'>ISC Source/Subnet Report</a>", 2 | ||
); | ||
NLIO('<br/>'); | ||
|
||
|
||
echo '</CENTER>'; | ||
echo '<HR>'; | ||
|
||
|
@@ -472,6 +481,6 @@ function PrintEventsByIP($db, $ip) | |
PrintPortscanEvents($db, $ip); | ||
echo ' </CENTER>'; | ||
} | ||
NLIO('</form>',2); | ||
NLIO('</form>', 2); | ||
PrintBASESubFooter(); | ||
?> |
Oops, something went wrong.