Skip to content

Commit 0047975

Browse files
committed
Fixing Injection into other process script
Minor changes to Checmarx intergration code added installer for ZAP, MySQL and Sqlite
1 parent 5ce643b commit 0047975

File tree

6 files changed

+133
-11
lines changed

6 files changed

+133
-11
lines changed

3rdParty/CheckMarx/2.6.3_WSDL_files/CxPortalWebService.cs renamed to 3rdParty/CheckMarx/2.6.3_WSDL_files/CxPortalWebService._2.6.3.cs

File renamed without changes.

3rdParty/CheckMarx/Util - CheckMarx - Create proxy files for CxWebService.h2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
var topPanel = "Util - CheckMarx - Create proxy files for CxWebService".popupWindow(700,400);
22
//var topPanel = panel.clear().add_Panel();
3-
var webRoot_Folder = "_cxProxy".tempDir(false);
3+
var webRoot_Folder = "_cxProxy".tempDir(false);
4+
45
var webBrowser = topPanel.insert_Right().add_WebBrowser();
56
var folderViewer = topPanel.add_FolderViewer(webRoot_Folder);
67

7-
var baseUrl = "http://local:57879/Cxwebinterface";
8-
var wsdlUrl = "http://local/CxWebInterface/CxWebService.asmx";
8+
var baseUrl = "http://localhost:59750/Cxwebinterface";
9+
//var wsdlUrl = "http://local/CxWebInterface/CxWebService.asmx";
10+
var wsdlUrl = "http://checkmarx.teammentor.net/CxWebInterface/CxWebService.asmx";
911
var asmxFileName = wsdlUrl.fileName();
1012
var webServiceNamespace = "http://Checkmarx.com/"; // note: just http://Checkmarx.com will not work
1113

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Diagnostics;
3+
using O2.Kernel;
4+
using O2.Kernel.ExtensionMethods;
5+
using O2.DotNetWrappers.ExtensionMethods;
6+
using O2.XRules.Database.Utils;
7+
//O2File:Tool_API.cs
8+
9+
namespace O2.XRules.Database.APIs
10+
{
11+
public class testInstall
12+
{
13+
public static void test()
14+
{
15+
new MySql_Install().start();
16+
}
17+
}
18+
19+
public class MySql_Install : Tool_API
20+
{
21+
public MySql_Install()
22+
{
23+
config("ZAProxy",
24+
"https://zaproxy.googlecode.com/files/ZAP_WEEKLY_D-2013-05-20.zip".uri(),
25+
@"ZAP_D-2013-05-20\zap.bat");
26+
installFromZip_Web();
27+
}
28+
//
29+
30+
public Process start()
31+
{
32+
if (this.isInstalled())
33+
return this.Executable.startProcess();
34+
return null;
35+
}
36+
}
37+
}

3rdParty/Snoop/Process Injection Tests/Injected_Dll.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@ public class Test
2929

3030
public static void info(string message)
3131
{
32-
Debug.Write("[Info] " + message);
33-
var type = assembly.GetType("O2.Kernel.PublicDI");
34-
var method = type.GetMethod("get_log");
35-
var kConfig = method.Invoke(null, new object[] { });
36-
var info = kConfig.GetType().GetMethod("i");
37-
info.Invoke(kConfig, new object[] { message});
32+
//Debug.Write("[Info] " + message);
33+
try
34+
{
35+
var type = assembly.GetType("O2.Kernel.PublicDI");
36+
var method = type.GetMethod("get_log");
37+
var kConfig = method.Invoke(null, new object[] { });
38+
var info = kConfig.GetType().GetMethod("info");
39+
info.Invoke(kConfig, new object[] {message, new object[] { }});
40+
}
41+
catch(Exception ex)
42+
{
43+
Debug.Write("[Error in Info] " + ex.Message);
44+
Debug.Write("[Error in Info] " + ex.StackTrace);
45+
}
3846
}
3947

4048
public static void startProcess(string exe)
@@ -90,8 +98,8 @@ public static Assembly compileFile(string file)
9098

9199
var errorMessageProperty = compileEngineType.GetField("sbErrorMessage");
92100

93-
info("errorMessageProperty: " + errorMessageProperty);
94-
info("errorMessageProperty: " + errorMessageProperty.GetValue(compileEngine));
101+
//info("errorMessageProperty: " + errorMessageProperty);
102+
//info("errorMessageProperty: " + errorMessageProperty.GetValue(compileEngine));
95103

96104
if (compiledAssembly != null)
97105
info("Compiled file ok to: " + compiledAssembly.Location);
@@ -119,6 +127,7 @@ public static void executeDefaultO2Script()
119127
{
120128
info("compiling Default O2 Script: " + file);
121129
var compiledAssembly = compileFile(file);
130+
info("after compilation");
122131
if (compiledAssembly == null)
123132
info("Error: in injectO2Script, failed to compile: " + file);
124133
else
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Diagnostics;
3+
using O2.Kernel;
4+
using O2.Kernel.ExtensionMethods;
5+
using O2.DotNetWrappers.ExtensionMethods;
6+
using O2.XRules.Database.Utils;
7+
//O2File:Tool_API.cs
8+
9+
namespace O2.XRules.Database.APIs
10+
{
11+
public class testInstall
12+
{
13+
public static void test()
14+
{
15+
new MySql_Install().start();
16+
}
17+
}
18+
19+
public class MySql_Install : Tool_API
20+
{
21+
public MySql_Install()
22+
{
23+
config("MySql",
24+
"http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.11-win32.zip".uri(),
25+
@"mysql-5.6.11-win32\bin\mysql.exe");
26+
installFromZip_Web();
27+
}
28+
//
29+
30+
public Process start()
31+
{
32+
if (this.isInstalled())
33+
return this.Executable.startProcess("--help");
34+
return null;
35+
}
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Diagnostics;
3+
using O2.Kernel;
4+
using O2.Kernel.ExtensionMethods;
5+
using O2.DotNetWrappers.ExtensionMethods;
6+
using O2.XRules.Database.Utils;
7+
//O2File:Tool_API.cs
8+
9+
namespace O2.XRules.Database.APIs
10+
{
11+
public class testInstall
12+
{
13+
public static void test()
14+
{
15+
new MySql_Install().start();
16+
}
17+
}
18+
19+
public class MySql_Install : Tool_API
20+
{
21+
public MySql_Install()
22+
{
23+
config("sqlite",
24+
"http://www.sqlite.org/2013/sqlite-shell-win32-x86-3071700.zip".uri(),
25+
@"sqlite3.exe");
26+
installFromZip_Web();
27+
}
28+
//
29+
30+
public Process start()
31+
{
32+
if (this.isInstalled())
33+
return this.Executable.startProcess();
34+
return null;
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)