Code: Select all
for /f "tokens=7*" %a in ('findstr /c:"NIST SP 800-53 Revision 4 ::" test1.txt') do @echo %a %b
for /f "tokens=9*" %a in ('findstr /c:"Vuln ID:" test1.txt') do @echo %a
I have a text file which I need 2 items pulled from. The 2 items I'm requesting to retrieve:
Item1 = Vuln ID: referenced number
Item2 = NIST SP 800-53 Revision 4 :: CM-6 b, simply the value which comes after "NIST SP 800-53 Revision 4 ::" which is not a value always the same for Item1.
Each "V" number is unique, the number never is the same. Item 2 appears some lines down from Item1. Item 2 sometimes appears multiple times for Item1.
For example, in the example text provided, Vuln ID: V-1070 has NIST SP 800-53 Revision 4 :: CM-6 b showing. But for Vuln ID: V-1089, there are multiple listing for "NIST SP 800-53 Revision 4 ::".
In retrospect, what I am requesting support is to combine my batchs attempt from above to read the sample text and output into the following file .cvs format:
I'm running Windows10 if this helps too.
I can't presently upload or attached my test1.txt file (error: invalid file extension: test1.txt); however, I'll try to copy/paste a portion of my text file. If needed, I can be reached via private message if you need a complete copy of the text file..
thank you for your concerted effort, very respectfully, Booga73
contents of the test1.txt text file:
Code: Select all
Windows 7 Security Technical Implementation Guide
Rule Title: Physical security of the Automated Information System (AIS) does not meet requirements.
STIG ID: 1.001 Rule ID: SV-24996r1_rule Vuln ID: V-1070
Discussion:
Inadequate physical protection can undermine all other security precautions utilized to protect the system.
Documentable: No
Responsibility:
System Administrator
Check Content:
Interview the SA to determine if equipment is located in an access controlled area.
Note: Servers will be located in rooms, or locked cabinets, that are accessible only to authorized systems personnel. Authorized user access
should be verified at two points (i.e. building access and server room).
Fix Text:
Relocate equipment to a controlled access area.
CCI: CCI-000366
The organization implements the security configuration settings.
NIST SP 800-53 :: CM-6 b
NIST SP 800-53A :: CM-6.1 (iv)
NIST SP 800-53 Revision 4 :: CM-6 b
Windows 7 Security Technical Implementation Guide
Rule Title: Shared user accounts must not be permitted on the system.
STIG ID: 1.008 Rule ID: SV-25000r2_rule Vuln ID: V-1072
Discussion:
Shared accounts (accounts where two or more people log on with the same user identification) do not provide adequate identification and
authentication.
Documentable: No
Responsibility:
System Administrator
Check Content:
Determine if any shared accounts exist. If no shared accounts exist, this is NA.
Any shared account must be documented with the ISSO.
Note: As an example, a shared account may be permitted for a help desk or a site security personnel machine, if that machine is standalone and
has no access to the network.
Fix Text:
Create or update shared accounts documentation that minimally contains the name of the shared account(s), the system(s) on which the accounts
exist, and the individuals who have access to the accounts.
CCI: CCI-000764
The information system uniquely identifies and authenticates organizational users (or processes acting on behalf of organizational users).
NIST SP 800-53 :: IA-2
NIST SP 800-53A :: IA-2.1
NIST SP 800-53 Revision 4 :: IA-2
Windows 7 Security Technical Implementation Guide
Rule Title: Permissions for event logs must conform to minimum requirements.
STIG ID: 2.001 Rule ID: SV-25133r3_rule Vuln ID: V-1077
Discussion:
Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises
that have occurred, as well as detect attacks.
Documentable: No
Responsibility:
System Administrator
Check Content:
Verify the permissions on the event logs. Standard user accounts or groups must not have access. The default permissions listed below satisfy
this requirement.
Navigate to the log file location. The default location is the "%SystemRoot%\System32\winevt\Logs" directory.
For each log file below, right click the file and select "Properties".
Select the "Security" tab.
Select the "Advanced" button, then "Continue", and respond to any UAC prompts.
Log Files:
Application.evtx
Security.evtx
System.evtx
Permissions:
Eventlog - Full Control
SYSTEM - Full Control
Administrators - Full Control
If the permissions for the file are not as restrictive as those listed, this is a finding.
If the organization has an "Auditors" group from previous requirements, the assignment of Full Control permissions to this group would not be a
finding.
Fix Text:
Maintain the permissions on the event logs. Standard user accounts or groups must not have access. The default permissions listed below
satisfy this requirement.
Navigate to the log file location. The default location is the "%SystemRoot%\System32\winevt\Logs" directory.
For each log file below, right click the file and select "Properties".
Select the "Security" tab.
Select the "Advanced" button, then "Continue", and respond to any UAC prompts.
Log Files:
Application.evtx
Security.evtx
System.evtx
Permissions:
Eventlog - Full Control
SYSTEM - Full Control
Administrators - Full Control
If the organization has an "Auditors" group from previous requirements, this group may be assigned Full Control.
If the location of the logs has been changed, when adding Eventlog to the permissions, it must be entered as "NT Service\Eventlog".
CCI: CCI-000162
The information system protects audit information from unauthorized access.
NIST SP 800-53 :: AU-9
NIST SP 800-53A :: AU-9.1
NIST SP 800-53 Revision 4 :: AU-9
CCI: CCI-000163
The information system protects audit information from unauthorized modification.
NIST SP 800-53 :: AU-9
NIST SP 800-53A :: AU-9.1
NIST SP 800-53 Revision 4 :: AU-9
CCI: CCI-000164
The information system protects audit information from unauthorized deletion.
NIST SP 800-53 :: AU-9
NIST SP 800-53A :: AU-9.1
NIST SP 800-53 Revision 4 :: AU-9
Windows 7 Security Technical Implementation Guide
Rule Title: The required legal notice must be configured to display before console logon.
STIG ID: 3.011 Rule ID: SV-25046r5_rule Vuln ID: V-1089
Discussion:
Failure to display the logon banner prior to a logon attempt will negate legal proceedings resulting from unauthorized access to system resources.
Documentable: No
Responsibility:
System Administrator
Check Content:
Analyze the system using the Security Configuration and Analysis snap-in.
Expand the Security Configuration and Analysis tree view.
Navigate to Local Policies >> Security Options.
The policy referenced configures the following registry value:
Registry Hive: HKEY_LOCAL_MACHINE
Registry Path: \SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\
Value Name: LegalNoticeText
Value Type: REG_SZ
Value: See message text above
Fix Text:
Configure the policy value for Computer Configuration
CCI: CCI-000048
The information system displays an organization-defined system use notification message or banner before granting access to the system that
provides privacy and security notices consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and
guidance.
NIST SP 800-53 :: AC-8 a
NIST SP 800-53A :: AC-8.1 (ii)
NIST SP 800-53 Revision 4 :: AC-8 a
CCI: CCI-000050
The information system retains the notification message or banner on the screen until users acknowledge the usage conditions and take explicit
actions to log on to or further access.
NIST SP 800-53 :: AC-8 b
NIST SP 800-53A :: AC-8.1 (iii)
NIST SP 800-53 Revision 4 :: AC-8 b
CCI: CCI-001384
The information system, for publicly accessible systems, displays system use information organization-defined conditions before granting further
access.
NIST SP 800-53 :: AC-8 c
NIST SP 800-53A :: AC-8.2 (i)
NIST SP 800-53 Revision 4 :: AC-8 c 1
CCI: CCI-001385
The information system, for publicly accessible systems, displays references, if any, to monitoring that are consistent with privacy accommodations
for such systems that generally prohibit those activities.
NIST SP 800-53 :: AC-8 c
NIST SP 800-53A :: AC-8.2 (ii)
NIST SP 800-53 Revision 4 :: AC-8 c 2
CCI: CCI-001386
The information system for publicly accessible systems displays references, if any, to recording that are consistent with privacy accommodations for
such systems that generally prohibit those activities.
NIST SP 800-53 :: AC-8 c
NIST SP 800-53A :: AC-8.2 (ii)
NIST SP 800-53 Revision 4 :: AC-8 c 2
CCI: CCI-001387
The information system for publicly accessible systems displays references, if any, to auditing that are consistent with privacy accommodations for
such systems that generally prohibit those activities.
NIST SP 800-53 :: AC-8 c
NIST SP 800-53A :: AC-8.2 (ii)
NIST SP 800-53 Revision 4 :: AC-8 c 2
CCI: CCI-001388
The information system, for publicly accessible systems, includes a description of the authorized uses of the system.
NIST SP 800-53 :: AC-8 c
NIST SP 800-53A :: AC-8.2 (iii)
NIST SP 800-53 Revision 4 :: AC-8 c 3
Windows 7 Security Technical Implementation Guide
Rule Title: The system must lockout accounts after 3 invalid logon attempts within a specified time period.
STIG ID: 4.002 Rule ID: SV-25015r2_rule Vuln ID: V-1097
Discussion:
The account lockout feature, when enabled, prevents brute-force password attacks on the system.
Documentable: No
Responsibility:
System Administrator
Third Party Tools:
HK
Check Content:
Analyze the system using the Security Configuration and Analysis snap-in.
Expand the Security Configuration and Analysis tree view.
Navigate to Account Policies >> Account Lockout Policy.
If the "Account lockout threshold" is "0" or more than "3" attempts, this is a finding.
Fix Text:
Configure the policy value for Computer Configuration >> Windows Settings
CCI: CCI-000044
The information system enforces the organization-defined limit of consecutive invalid logon attempts by a user during the organization-defined
time period.
NIST SP 800-53 :: AC-7 a
NIST SP 800-53A :: AC-7.1 (ii)
NIST SP 800-53 Revision 4 :: AC-7 a
CCI: CCI-000205
The information system enforces minimum password length.
NIST SP 800-53 :: IA-5 (1) (a)
NIST SP 800-53A :: IA-5 (1).1 (i)
NIST SP 800-53 Revision 4 :: IA-5 (1) (a)
CCI: CCI-002142
The information system terminates shared/group account credentials when members leave the group.
NIST SP 800-53 Revision 4 :: AC-2 (10)