PageSourceSearch

https://pentesting-notes.vercel.app/assets/js/664e7bc9.1cb59b7c.js

js pentesting-notes.vercel.app collected 2026-10-03 07:28:52 UTC 7,067 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpentix=self.webpackChunkpentix||[]).push([[1877],{7119:(i,e,a)=>{a.d(e,{A:()=>n});const n=a.p+"assets/images/image-3d440aa7a67a7486ba6b58d07707775a.png"},8453:(i,e,a)=>{a.d(e,{R:()=>o,x:()=>l});var n=a(6540);const s={},r=n.createContext(s);function o(i){const e=n.useContext(r);return n.useMemo((function(){return"function"==typeof i?i(e):{...e,...i}}),[e,i])}function l(i){let e;return e=i.disableParentContext?"function"==typeof i.components?i.components(s):i.components||s:o(i.components),n.createElement(r.Provider,{value:e},i.children)}},9357:(i,e,a)=>{a.r(e),a.d(e,{assets:()=>t,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"docs/WebSockets vulnerabilities/WebSockets nima","title":"WebSockets nima","description":"HTTP va WebSocket o\u2018rtasidagi farq","source":"@site/docs/docs/WebSockets vulnerabilities/WebSockets nima.md","sourceDirName":"docs/WebSockets vulnerabilities","slug":"/docs/WebSockets vulnerabilities/WebSockets nima","permalink":"/docs/docs/WebSockets vulnerabilities/WebSockets nima","draft":false,"unlisted":false,"editUrl":"https://github.com/acadbek/pentesting-notes/docs/docs/WebSockets vulnerabilities/WebSockets nima.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"CSWSH nima","permalink":"/docs/docs/WebSockets vulnerabilities/CSWSH nima"}}');var s=a(4848),r=a(8453);const o={},l=void 0,t={},d=[{value:"Avval HTTP ni eslab olaylik",id:"avval-http-ni-eslab-olaylik",level:2},{value:"WebSocket nima qiladi?",id:"websocket-nima-qiladi",level:2},{value:"Manipulating the WebSocket handshake",id:"manipulating-the-websocket-handshake",level:2},{value:"WebSocket'ni xavfsiz qilish uchun nimalar qilish kerak?",id:"websocketni-xavfsiz-qilish-uchun-nimalar-qilish-kerak",level:2}];function c(i){const e={blockquote:"blockquote",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...i.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"HTTP va WebSocket o\u2018rtasidagi farq",src:a(7119).A+"",width:"1456",height:"572"})}),"\n",(0,s.jsx)(e.h2,{id:"avval-http-ni-eslab-olaylik",children:"Avval HTTP ni eslab olaylik"}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"HTTP \u2014 bu so\u2018rov (request) va javob (response)."})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"Masalan:"})}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:"Sen saytdan sahifa ochasan \u2014 browser so\u2018rov yuboradi."}),"\n",(0,s.jsx)(e.li,{children:"Server faqat javob qaytaradi, va aloqa tugaydi."}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"websocket-nima-qiladi",children:"WebSocket nima qiladi?"}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"WebSocket esa boshqacha ishlaydi:"})}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:"Faqat 1 marta serverga ulanasan."}),"\n",(0,s.jsx)(e.li,{children:"Shundan keyin browser va server o\u2018rtasida doimiy ochiq aloqa bo\u2018ladi."}),"\n",(0,s.jsx)(e.li,{children:"Endi har ikki tomon istagan payt xabar yuborishi mumkin."}),"\n"]}),"\n",(0,s.jsxs)(e.blockquote,{children:["\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"Burp yordamida WebSocket xabarlarini tuta olasan, o\u2018zgartirib yubora olasan. Bu orqali saytni kutmagan xatolarini topasan!"})}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"manipulating-the-websocket-handshake",children:"Manipulating the WebSocket handshake"}),"\n",(0,s.jsx)(e.p,{children:"WebSocket aloqasi boshlanishi paytida yuboriladigan HTTP headerlarni o\u2018zgartirib,\nzaif joylarni topish va ekspluatatsiya qilish degani."}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"WebSocket handshake bosqichi qanday?"})}),"\n",(0,s.jsx)(e.p,{children:"Browser serverga HTTP request yuboradi (special headerlar bilan):"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-http",children:"GET /chat HTTP/1.1\nHost: victim-site.com\nUpgrade: websocket\nConnection: Upgrade\nSec-WebSocket-Key: xyz\nCookie: session=abcd1234\n"})}),"\n",(0,s.jsx)(e.p,{children:"Mana shu birinchi so\u2018rovda (handshake request) yuborilgan headerlar orqali hujum qilish mumkin."}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"Qanday hujumlar mumkin?"})}),"\n",(0,s.jsxs)(e.blockquote,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"X-Forwarded-For forgery"})," - Agar server X-Forwarded-For headerga ishonib IP tekshirsa, uni o'zgartirib aldash mumkin."]}),"\n"]}),"\n",(0,s.jsxs)(e.blockquote,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Session hijacking"}
1)," - Handshake'da Cookie yuboriladi. Agar eski yoki boshqa session ID ni qo\u2018ysak, boshqa user nomidan ulanib olamiz."]}),"\n"]}),"\n",(0,s.jsxs)(e.blockquote,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Custom header"})," - Ba'zi serverlar o\u2018ziga xos headerlar tekshiradi (X-Auth-Token, Device-ID kabi). Bularni o'zgartirib sistemani aldash mumkin."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.strong,{children:"Oddiy misol:"})}),"\n",(0,s.jsxs)(e.p,{children:["Agar server ",(0,s.jsx)(e.code,{children:"X-Forwarded-For"})," headerga qarab:"]}),"\n",(0,s.jsxs)(e.p,{children:['"Agar IP ichki tarmoqdan bo\u2018lsa \u2014 admin huquq beraman" desa,\nBiz WebSocket handshake\'da ',(0,s.jsx)(e.code,{children:"X-Forwarded-For"}),": ",(0,s.jsx)(e.code,{children:"127.0.0.1"}),' qo\u2018shib yuboramiz.\nServer o\u2018ylaydi: "Ha, bu localhostdan keldi", va sizga admin sifatida qaraydi.']}),"\n",(0,s.jsx)(e.h2,{id:"websocketni-xavfsiz-qilish-uchun-nimalar-qilish-kerak",children:"WebSocket'ni xavfsiz qilish uchun nimalar qilish kerak?"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"WSS protokoli ishlat"})," - ",(0,s.jsx)(e.code,{children:"wss://"})," \u2014 TLS orqali shifrlangan aloqa (xavfsiz). ",(0,s.jsx)(e.code,{children:"ws://"})," esa ochiq, xavfli."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"WebSocket URL'ni hard-code qil"})," - URL foydalanuvchi inputiga bog\u2018liq bo\u2018lmasin. (Hujumchi URL\u2019ni o\u2018zgartirib sizni aldashi mumkin.)"]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Handshake'ni CSRF'dan himoya qil"})," - WebSocket ochishda Origin tekshirish, token ishlatish kerak. Aks holda Cross-site WebSocket hijacking bo\u2018ladi."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Har ikkala tomonda input'ni tekshir"})," - Server va browser WebSocket orqali kelgan ma\u2019lumotni ishonmasdan qabul qilsin, tekshirib ishlasin (SQLi, XSS oldini olish uchun)."]}),"\n"]}),"\n"]})]})}function h(i={}){const{wrapper:e}={...(0,r.R)(),...i.components};return e?(0,s.jsx)(e,{...i,children:(0,s.jsx)(c,{...i})}):c(i)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.