[prev in list] [next in list] [prev in thread] [next in thread] 

List:       os-sim-commits
Subject:    [Os-sim-commits] os-sim/www/forensics base_qry_common.php, 1.17,
From:       Juan Manuel Albarracin <jmalbarracin () users ! sourceforge ! net>
Date:       2009-09-30 9:03:13
Message-ID: E1Msv5d-00033g-ME () 23jxhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/os-sim/os-sim/www/forensics
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11683/www/forensics

Modified Files:
	base_qry_common.php base_qry_main.php index.php 
	vars_session.php 
Log Message:
Fixed payload search


Index: vars_session.php
===================================================================
RCS file: /cvsroot/os-sim/os-sim/www/forensics/vars_session.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- vars_session.php	24 Sep 2009 16:08:16 -0000	1.5
+++ vars_session.php	30 Sep 2009 09:03:11 -0000	1.6
@@ -91,7 +91,7 @@
     $_SESSION['time_cnt'] = $_GET['time_cnt'];
     $_SESSION['time_range'] = $_GET['time_range'];
 }
-// PLAYLOAD
+// PAYLOAD
 // IP
 // LAYER 4 PROTO
 //print_r($_GET);

Index: base_qry_common.php
===================================================================
RCS file: /cvsroot/os-sim/os-sim/www/forensics/base_qry_common.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- base_qry_common.php	3 Sep 2009 16:02:51 -0000	1.17
+++ base_qry_common.php	30 Sep 2009 09:03:11 -0000	1.18
@@ -446,6 +446,7 @@
     GLOBAL $db, $join_sql, $where_sql, $criteria_sql, $sql, $debug_mode, $caller, \
$DBtype;  /* XXX-SEC */
     GLOBAL $cs;
+
     /* the JOIN criteria */
     $ip_join_sql = " LEFT JOIN iphdr ON acid_event.sid=iphdr.sid AND \
                acid_event.cid=iphdr.cid ";
     $tcp_join_sql = " LEFT JOIN tcphdr ON acid_event.sid=tcphdr.sid AND \
acid_event.cid=tcphdr.cid "; @@ -733,8 +734,14 @@
         }
     }
     /* ********************** Payload Criteria \
                ***************************************** */
-    $tmp_payload = "";
+    //$tmp_payload = "";
     if (DataRows2sql($data, $data_cnt, $data_encode, $tmp_payload) == 0) \
$cs->criteria['data']->SetFormItemCnt(0); +	//echo "<br><br><br>";
+	//print_r($data);
+	//print_r("data_cnt: [".$data_cnt."]");
+	//print_r($cs->criteria['data']->isEmpty());
+	//print_r("criteria_ sql: [".$criteria_sql."]");
+	//print_r("tmp_payload: [".$tmp_payload."]");
     if (!$cs->criteria['data']->isEmpty()) {
         $criteria_sql = $criteria_sql . $tmp_payload;
         $join_sql = $data_join_sql . $join_sql;

Index: base_qry_main.php
===================================================================
RCS file: /cvsroot/os-sim/os-sim/www/forensics/base_qry_main.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- base_qry_main.php	24 Sep 2009 16:21:52 -0000	1.13
+++ base_qry_main.php	30 Sep 2009 09:03:11 -0000	1.14
@@ -59,6 +59,7 @@
 *                    was selected for action
 * $action_lst[]: array of (sid,cid) of all alerts on screen
 */
+
 include ("base_conf.php");
 include ("vars_session.php");
 include ("$BASE_path/includes/base_constants.inc.php");
@@ -70,6 +71,8 @@
 include_once ("$BASE_path/base_qry_common.php");
 $et = new EventTiming($debug_time_mode);
 $cs = new CriteriaState("base_qry_main.php", "&amp;new=1&amp;submit=" . _QUERYDBP);
+//echo "<br><br><br>";
+
 // Check role out and redirect if needed -- Kevin
 $roleneeded = 10000;
 $BUser = new BaseUser();
@@ -80,8 +83,9 @@
 /*
 printr($_GET);
 print "<HR>";
-printr($_SESSION);
+
 */
+//print_r($_SESSION);
 /* This call can include many values. */
 $submit = ImportHTTPVar("submit", VAR_DIGIT | VAR_PUNC | VAR_LETTER, array(
     _SELECTED,
@@ -101,8 +105,7 @@
 /* Search Box. DK */
 /* For your own mental health, skip over until 20 or 30 lines below :P */
 //require_once("/usr/share/ossim/include/ossim_error.inc");
-echo "<br>";
-print_r($submit);
+
 if ($submit == "Signature") {
 
     $search_str = ImportHTTPVar("search_str", VAR_DIGIT | VAR_PUNC | VAR_LETTER);
@@ -117,14 +120,24 @@
     $_GET['sig'][0] = "LIKE";
     $_GET['sig'][1] = $search_str;
     $_GET['submit'] = $submit = _QUERYDB;
-} elseif ($submit == "Payload") {
 
+} elseif ($submit == "Payload") {
     $search_str = ImportHTTPVar("search_str", VAR_DIGIT | VAR_PUNC | VAR_LETTER);
-    $_GET["data"][0][1] = "LIKE";
-    $_GET["data"][0][2] = $search_str;
-    $_GET['submit'] = $submit = _QUERYDB;;
+    $_GET["search"] = 1;
+    $_GET["data_cnt"] = 1;
+    $_GET["data"][0] = array("","LIKE",$search_str,"","");
+    $_GET['submit'] = $submit = _QUERYDB;  
+//	echo "<br><br>";
+//	echo "dentro de payload<br>";
+
 }
 
+//print_r($_POST);
+//print_r($_GET);
+//echo get_include_path();
+//set_include_path(".:/usr/share/php:/usr/share/ossim/include/");
+//echo phpinfo();
+//print_r($_SESSION);
 /* Connect to the Alert database */
 $db = NewBASEDBConnection($DBlib_path, $DBtype);
 $db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, \
$alert_user, $alert_password); @@ -187,11 +200,13 @@
     $_POST['submit'] = $submit;
     $cs->ReadState(); /* save the search criteria       */
     // Solve error when payload is searched cnt = 1
-    if ($_GET{"data"} {
-        0
-    } {
-        2
-    } != "") $cs->criteria['data']->criteria_cnt = 1;
+//    if ($_GET{"data"} {
+//        0
+//    } {
+//        2
+//    } != "") $cs->criteria['data']->criteria_cnt = 1;
+
+   if ($_GET["data"][0][2] != "") $cs->criteria['data']->criteria_cnt = 1;
     $submit = _QUERYDB; /* restore the real submit value  */
     $_POST['submit'] = $submit;
 }
@@ -202,6 +217,7 @@
 $qs->AddCannedQuery("last_udp", $last_num_alerts, _LASTUDP, "time_d");
 $qs->AddCannedQuery("last_icmp", $last_num_alerts, _LASTICMP, "time_d");
 $qs->AddCannedQuery("last_any", $last_num_alerts, _LASTALERTS, "time_d");
+
 $page_title = _QUERYRESULTS;
 if ($qs->isCannedQuery()) if (!array_key_exists("minimal_view", $_GET)) \
PrintBASESubHeader($page_title . ": " . $qs->GetCurrentCannedQueryDesc() , \
$page_title . ": " . $qs->GetCurrentCannedQueryDesc() , $cs->GetBackLink() , 1);  \
else PrintBASESubHeader($page_title . ": " . $qs->GetCurrentCannedQueryDesc() , \
$page_title . ": " . $qs->GetCurrentCannedQueryDesc() , "", 1); @@ -227,8 +243,10 @@
 }
 /* Run the SQL Query and get results */
 if ($submit == _QUERYDB || $submit == _QUERYDBP || $submit == _SELECTED || $submit \
== _ALLONSCREEN || $submit == _ENTIREQUERY || $qs->isCannedQuery() || \
                ($qs->GetCurrentSort() != "" && $qs->GetCurrentSort() != "none")) {
-    /* Init and run the action */
+
+	/* Init and run the action */
 	$criteria_clauses = ProcessCriteria();
+	//print_r($criteria_clauses);
     $from = "FROM acid_event " . $criteria_clauses[0];
     $where = "";
     if ($criteria_clauses[1] != "") $where = "WHERE " . $criteria_clauses[1];
@@ -256,6 +274,7 @@
     $qs->AddValidActionOp(_ENTIREQUERY);
     $qs->SetActionSQL("SELECT acid_event.sid, acid_event.cid $from $where");
     $et->Mark("Initialization");
+
     $qs->RunAction($submit, PAGE_QRY_ALERTS, $db);
     $et->Mark("Alert Action");
 
@@ -267,8 +286,10 @@
 else {
 	include ("$BASE_path/base_qry_form.php");
 }
+
 $qs->SaveState();
 
+
 echo "\n</FORM>\n";
 if (!array_key_exists("minimal_view", $_GET)) {
     PrintBASESubFooter();

Index: index.php
===================================================================
RCS file: /cvsroot/os-sim/os-sim/www/forensics/index.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- index.php	1 Jul 2009 10:53:52 -0000	1.2
+++ index.php	30 Sep 2009 09:03:11 -0000	1.3
@@ -61,6 +61,7 @@
 echo (_TITLE . $BASE_VERSION); ?></title>
   <link rel="stylesheet" type="text/css" href="styles/<?php
 echo ($base_style); ?>" />
+
 </head>
 <body onload="javascript:document.loginform.login.focus();">
   <div class="mainheadertitle">&nbsp;


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Os-sim-commits mailing list
Os-sim-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/os-sim-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic