public static void createNewTargetAndAddItToListBox(ListBox lbTargetListBox, string strNewTargetName, string strFullPathToCurrentProject) { OrgBasePaths obp = OrgBasePaths.GetPaths(); if (lbTargetListBox.Items.Contains(strNewTargetName)) { MessageBox.Show("Target already exists, you cannot create a duplicating target!"); return; } int iNumberOfCurrentTargets = lbTargetListBox.Items.Count; // We need to remove any periods because it fouls up the loading of the xml files. string sanitizedTargetName = strNewTargetName.Replace('.', '_'); string strFullPathToNewTarget = Path.GetFullPath(Path.Combine(strFullPathToCurrentProject, sanitizedTargetName)); string strFullPathToNewTargetXmlFile = Path.Combine(strFullPathToNewTarget, sanitizedTargetName) + ".xml"; if (!Directory.Exists(strFullPathToNewTarget)) { Directory.CreateDirectory(strFullPathToNewTarget); } File.Copy(obp.EmptyProjectFilePath, strFullPathToNewTargetXmlFile); lbTargetListBox.Items.Add(sanitizedTargetName); lbTargetListBox.SelectedIndex = iNumberOfCurrentTargets; }
private void btTest_Click(object sender, System.EventArgs e) { OrgBasePaths obp = OrgBasePaths.GetPaths(); configVariablesForKeyboardHook(); txtXmlFile.Text = @"Z:\ABN\ORG data\testProject\Target\finding 1.xml"; string strPathToXmlFile = txtXmlFile.Text; utils.authentic.loadXmlFileInTargetAuthenticView(axAuthentic1, strPathToXmlFile, obp.ProjectSchemaPath, obp.SpsFindingsPath); }
public static void createNewProjectAndAddItToListBox(ListBox lbTargetListBox, string strNewProjectName) { OrgBasePaths obp = OrgBasePaths.GetPaths(); UserProfile up = UserProfile.GetUserProfile(); string strFullPathToNewProject = Path.GetFullPath(Path.Combine(up.ProjectFilesPath, strNewProjectName)); Directory.CreateDirectory(strFullPathToNewProject); string strFullPathToNewProjectXmlFile = Path.GetFullPath(Path.Combine(strFullPathToNewProject, strNewProjectName + ".xml")); File.Copy(obp.EmptyProjectFilePath, strFullPathToNewProjectXmlFile); lbTargetListBox.Items.Add(strNewProjectName); lbTargetListBox.SelectedIndex = utils.windowsForms.findItemInListBox(lbTargetListBox, strNewProjectName); }
static void Main() { VulnReportHelpers.setBaseDirBasedOnExecutionEnvironment(); VulnReportHelpers.confirmExistenceOfRequiredFilesAndFolders(); VulnReportHelpers.loadCustomORGdata(); bool bByPassSplashPage = false; // Set this to true to bypass the Splash page (useful when in development mode) frmSplashPage sp = new frmSplashPage(bByPassSplashPage); if (bByPassSplashPage || (sp.ShowDialog() == DialogResult.OK)) { OrgBasePaths obp = OrgBasePaths.GetPaths(); obp.initiatePaths(); Application.Run(new PenTest_Reporter()); } }