Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 8:02 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
PostPosted: Sun Jan 10, 2010 12:01 pm 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
I'm having a problem with the "Add configuration" option. When I try to create a configuration and submit it, "Could not add config:" is displayed and the insert fails.

I added "echo $sql;" to audit_config_add_ajax.php to echo the query so I could input it manually using phpmyadmin.

Here is the query it echos:

[code]INSERT INTO audit_configurations ( audit_cfg_name, audit_cfg_action, audit_cfg_type, audit_cfg_os, audit_cfg_max_audits, audit_cfg_ldap_conn, audit_cfg_audit_conn, audit_cfg_ldap_user, audit_cfg_ldap_pass, audit_cfg_ldap_server, audit_cfg_ldap_page, audit_cfg_audit_user, audit_cfg_audit_pass, audit_cfg_ip_start, audit_cfg_ip_end, audit_cfg_pc_list, audit_cfg_win_vbs, audit_cfg_lin_sft, audit_cfg_lin_sft_lst, audit_cfg_sft_lst, audit_cfg_ldap_use_conn, audit_cfg_audit_use_conn, audit_cfg_nmap_int, audit_cfg_nmap_srv, audit_cfg_nmap_udp, audit_cfg_nmap_tcp_syn, audit_cfg_nmap_url, audit_cfg_ldap_path, audit_cfg_wait_time, audit_cfg_lin_url, audit_cfg_filter, audit_cfg_filter_case, audit_cfg_nmap_path, audit_cfg_com_path, audit_cfg_command_list, audit_cfg_log_enable, audit_cfg_filter_inverse, audit_cfg_cmd_list, audit_cfg_mysql_ids, audit_cfg_command_interact, audit_cfg_audit_local, audit_cfg_win_url, audit_cfg_win_sft, audit_cfg_win_uuid) VALUES ( 'comp','pc', 'iprange','windows', '10', 'nothing', 'nothing', AES_ENCRYPT('user@domain.com', 'openaudit'), AES_ENCRYPT('password','openaudit'), 'hostname', '1000', AES_ENCRYPT('user@domain.com','openaudit'), AES_ENCRYPT('password','openaudit'), '192.168.1.2', '3','', '//domain.edu/netlogon/openaudit/audit.vbs','0', '0','0', '0','0', '7', '1', '1', '1', '', 'DC=mydomain,DC=com', '600','', '','0', '','', '', '1', '0', '', '','0', '0','', '1','mac')[/code]

"Could not add config:" is the error displayed by the php code."mysql_error()" returns blank.

If I take the above query and enter it manually into phpmyadmin I get this error:

[code]Incorrect integer value: 'nothing' for column 'audit_cfg_ldap_conn' at row 1
[/code]

I can change the 2 "nothing" values to "0" run it again, and it is correctly entered into the table.

So how can this be fixed? I suspect the problem lies somewhere in "audit_config_add_ajax.php" possibly in these lines:

[code]$ldap_use_conn = ( $_POST['select_ldap_cred'] != "nothing" ) ? '1' : '0';
$audit_use_conn = ( $_POST['select_audit_cred'] != "nothing" ) ? '1' : '0';[/code]

Is the assignment to interger values failing for some reason?

I'm running SVN 1227 on Windows Server 2003 SP2 with IIS. MYSQL is version "Server version: 5.0.45-community-nt." The problem occurs in both IE 8 and Firefox 3.5.


Attachments:
File comment: Error I get manually entering the query
phpmyadminerror.JPG
phpmyadminerror.JPG [ 104.29 KiB | Viewed 4792 times ]
File comment: Example input screen from audit_configuration.php
audit_configuration.JPG
audit_configuration.JPG [ 67.77 KiB | Viewed 4792 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 11, 2010 7:08 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
Ok I commented out the strict mode setting in the C:\Program Files\MySQL\MySQL Server 5.0\my.ini file:

[code]# Set the SQL mode to strict
#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"[/code]

I can add configurations and create schedules now. The schedules don't seem to run yet, but I've made progress. BTW, strict mode is on by default in MYSQL 5.0.


Top
 Profile  
Reply with quote  
PostPosted: Sat May 01, 2010 2:43 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
[quote="jpmorgan"]BTW, strict mode is on by default in MYSQL 5.0.
And it would seem the developers have it turned off. I'm having similar issues in the new OpenAudit version 2 alpha as well.

Regarding the original problem the errors are caused by these lines in the code to build the SQL input:[code]audit_cfg_ldap_conn='{$_POST['select_ldap_cred']}',
audit_cfg_audit_conn='{$_POST['select_audit_cred']}',[/code]When strict mode is off and the POST values are "nothing" and MySQL converts the invalid "nothing" to 0 and everything works. When strict is on "nothing" is not a valid integer value and we get an error. A proper fix would be to test if these POST values are "nothing" and store 0 otherwise just store the post value.

Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group