├── LICENSE ├── README.md ├── cloudflare_bypass.py └── wb_encrypter.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Deniz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cloudflare Cookie Bypass 2 | Cloudflare __cf_bm cookie ( currently called cf_clearance ) bypass 3 | 4 | It probably doesn't have much impact on discord, but I wanted to share the reversing process I did in a short time. 5 | 6 | ## Sponsors 7 |

8 | 9 | Capsolver's Banner 10 | 11 |

12 | -------------------------------------------------------------------------------- /cloudflare_bypass.py: -------------------------------------------------------------------------------- 1 | import tls_client 2 | import re 3 | import json 4 | import subprocess 5 | from datetime import datetime 6 | 7 | 8 | class CloudflareBypasser: 9 | def __init__(self, client: tls_client.Session, useragent: str): 10 | self.client = client 11 | self.useragent = useragent 12 | self.s, self.key = self._get_values() 13 | 14 | self.base_data = { 15 | '0': ['length', 'innerWidth', 'innerHeight', 'scrollX', 'pageXOffset', 'scrollY', 'pageYOffset', 'screenX', 'screenY', 'screenLeft', 'screenTop', 'TEMPORARY', 'n.maxTouchPoints'], 16 | '1': ['PERSISTENT', 'd.childElementCount', 'd.ELEMENT_NODE', 'd.DOCUMENT_POSITION_DISCONNECTED'], 17 | '2': ['d.ATTRIBUTE_NODE', 'd.DOCUMENT_POSITION_PRECEDING'], 18 | '3': ['d.TEXT_NODE'], 19 | '4': ['d.CDATA_SECTION_NODE', 'd.DOCUMENT_POSITION_FOLLOWING'], 20 | '5': ['d.ENTITY_REFERENCE_NODE'], 21 | '6': ['d.ENTITY_NODE'], 22 | '7': ['d.PROCESSING_INSTRUCTION_NODE'], 23 | '8': ['n.deviceMemory', 'd.COMMENT_NODE', 'd.DOCUMENT_POSITION_CONTAINS'], 24 | '9': ['d.nodeType', 'd.DOCUMENT_NODE'], 25 | '10': ['d.DOCUMENT_TYPE_NODE'], 26 | '11': ['d.DOCUMENT_FRAGMENT_NODE'], 27 | '12': ['n.hardwareConcurrency', 'd.NOTATION_NODE'], 28 | '16': ['d.DOCUMENT_POSITION_CONTAINED_BY'], 29 | '32': ['d.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'], 30 | '1032': ['outerHeight'], 31 | '1920': ['outerWidth'], 32 | 'o': ['window', 'self', 'document', 'location', 'customElements', 'history', 'navigation', 'locationbar', 'menubar', 33 | 'personalbar', 'scrollbars', 'statusbar', 'toolbar', 'frames', 'top', 'parent', 'frameElement', 'navigator', 34 | 'external', 'screen', 'visualViewport', 'clientInformation', 'styleMedia', 'trustedTypes', 'performance', 35 | 'crypto', 'indexedDB', 'sessionStorage', 'localStorage', 'scheduler', 'chrome', 'caches', 'cookieStore', 36 | 'launchQueue', 'speechSynthesis', 'globalThis', 'JSON', 'Math', 'Intl', 'Atomics', 'Reflect', 'console', 37 | 'CSS', 'WebAssembly', 'GPUBufferUsage', 'GPUColorWrite', 'GPUMapMode', 'GPUShaderStage', 'GPUTextureUsage', 38 | 'n.scheduling', 'n.userActivation', 'n.geolocation', 'n.connection', 'n.plugins', 'n.mimeTypes', 39 | 'n.webkitTemporaryStorage', 'n.webkitPersistentStorage', 'n.bluetooth', 'n.clipboard', 'n.credentials', 40 | 'n.keyboard', 'n.managed', 'n.mediaDevices', 'n.storage', 'n.serviceWorker', 'n.virtualKeyboard', 41 | 'n.wakeLock', 'n.ink', 'n.hid', 'n.locks', 'n.mediaCapabilities', 'n.mediaSession', 'n.permissions', 42 | 'n.presentation', 'n.serial', 'n.gpu', 'n.usb', 'n.windowControlsOverlay', 'n.xr', 'n.userAgentData', 43 | 'd.location', 'd.implementation', 'd.documentElement', 'd.body', 'd.head', 'd.images', 'd.embeds', 44 | 'd.plugins', 'd.links', 'd.forms', 'd.scripts', 'd.defaultView', 'd.anchors', 'd.applets', 45 | 'd.scrollingElement', 'd.featurePolicy', 'd.children', 'd.firstElementChild', 'd.lastElementChild', 46 | 'd.activeElement', 'd.styleSheets', 'd.fonts', 'd.fragmentDirective', 'd.timeline', 'd.childNodes', 47 | 'd.firstChild', 'd.lastChild'], 48 | 'false': ['closed', 'crossOriginIsolated', 'credentialless', 'originAgentCluster', 'n.webdriver', 'd.xmlStandalone', 'd.hidden', 'd.wasDiscarded', 'd.prerendering', 'd.webkitHidden', 'd.fullscreen', 'd.webkitIsFullScreen'], 49 | 'x': ['opener', 'onsearch', 'onappinstalled', 'onbeforeinstallprompt', 'onbeforexrselect', 'onabort', 50 | 'onbeforeinput', 'onblur', 'oncancel', 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'onclose', 51 | 'oncontextlost', 'oncontextmenu', 'oncontextrestored', 'oncuechange', 'ondblclick', 'ondrag', 'ondragend', 52 | 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'ondurationchange', 'onemptied', 53 | 'onended', 'onerror', 'onfocus', 'onformdata', 'oninput', 'oninvalid', 'onkeydown', 'onkeypress', 'onkeyup', 54 | 'onload', 'onloadeddata', 'onloadedmetadata', 'onloadstart', 'onmousedown', 'onmouseenter', 'onmouseleave', 55 | 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onpause', 'onplay', 'onplaying', 56 | 'onprogress', 'onratechange', 'onreset', 'onresize', 'onscroll', 'onsecuritypolicyviolation', 'onseeked', 57 | 'onseeking', 'onselect', 'onslotchange', 'onstalled', 'onsubmit', 'onsuspend', 'ontimeupdate', 'ontoggle', 58 | 'onvolumechange', 'onwaiting', 'onwebkitanimationend', 'onwebkitanimationiteration','onwebkitanimationstart', 59 | 'onwebkittransitionend', 'onwheel', 'onauxclick', 'ongotpointercapture', 'onlostpointercapture', 60 | 'onpointerdown', 'onpointermove', 'onpointerrawupdate', 'onpointerup', 'onpointercancel', 'onpointerover', 61 | 'onpointerout', 'onpointerenter', 'onpointerleave', 'onselectstart', 'onselectionchange', 'onanimationend', 62 | 'onanimationiteration', 'onanimationstart', 'ontransitionrun', 'ontransitionstart', 'ontransitionend', 63 | 'ontransitioncancel', 'onafterprint', 'onbeforeprint', 'onbeforeunload', 'onhashchange', 'onlanguagechange', 64 | 'onmessage', 'onmessageerror', 'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpopstate', 65 | 'onrejectionhandled', 'onstorage', 'onunhandledrejection', 'onunload', 'ondevicemotion', 66 | 'ondeviceorientation', 'ondeviceorientationabsolute', 'onbeforematch', 'onbeforetoggle', 67 | 'oncontentvisibilityautostatechange', 'onscrollend', 'n.doNotTrack', 'd.doctype', 'd.xmlEncoding', 68 | 'd.xmlVersion', 'd.currentScript', 'd.onreadystatechange', 'd.all', 'd.onpointerlockchange', 69 | 'd.onpointerlockerror', 'd.onbeforecopy', 'd.onbeforecut', 'd.onbeforepaste', 'd.onfreeze', 70 | 'd.onprerenderingchange', 'd.onresume', 'd.onsearch', 'd.onvisibilitychange', 'd.onfullscreenchange', 71 | 'd.onfullscreenerror', 'd.webkitCurrentFullScreenElement', 'd.webkitFullscreenElement', 72 | 'd.onwebkitfullscreenchange', 'd.onwebkitfullscreenerror', 'd.rootElement', 'd.pictureInPictureElement', 73 | 'd.onbeforexrselect', 'd.onabort', 'd.onbeforeinput', 'd.onblur', 'd.oncancel', 'd.oncanplay', 74 | 'd.oncanplaythrough', 'd.onchange', 'd.onclick', 'd.onclose', 'd.oncontextlost', 'd.oncontextmenu', 75 | 'd.oncontextrestored', 'd.oncuechange', 'd.ondblclick', 'd.ondrag', 'd.ondragend', 'd.ondragenter', 76 | 'd.ondragleave', 'd.ondragover', 'd.ondragstart', 'd.ondrop', 'd.ondurationchange', 'd.onemptied', 77 | 'd.onended', 'd.onerror', 'd.onfocus', 'd.onformdata', 'd.oninput', 'd.oninvalid', 'd.onkeydown', 78 | 'd.onkeypress', 'd.onkeyup', 'd.onload', 'd.onloadeddata', 'd.onloadedmetadata', 'd.onloadstart', 79 | 'd.onmousedown', 'd.onmouseenter', 'd.onmouseleave', 'd.onmousemove', 'd.onmouseout', 'd.onmouseover', 80 | 'd.onmouseup', 'd.onmousewheel', 'd.onpause', 'd.onplay', 'd.onplaying', 'd.onprogress','d.onratechange', 81 | 'd.onreset', 'd.onresize', 'd.onscroll', 'd.onsecuritypolicyviolation', 'd.onseeked', 'd.onseeking', 82 | 'd.onselect', 'd.onslotchange', 'd.onstalled', 'd.onsubmit', 'd.onsuspend', 'd.ontimeupdate', 'd.ontoggle', 83 | 'd.onvolumechange', 'd.onwaiting', 'd.onwebkitanimationend', 'd.onwebkitanimationiteration', 84 | 'd.onwebkitanimationstart', 'd.onwebkittransitionend', 'd.onwheel', 'd.onauxclick', 'd.ongotpointercapture', 85 | 'd.onlostpointercapture', 'd.onpointerdown', 'd.onpointermove', 'd.onpointerrawupdate', 'd.onpointerup', 86 | 'd.onpointercancel', 'd.onpointerover', 'd.onpointerout', 'd.onpointerenter', 'd.onpointerleave', 87 | 'd.onselectstart', 'd.onselectionchange', 'd.onanimationend', 'd.onanimationiteration', 'd.onanimationstart', 88 | 'd.ontransitionrun', 'd.ontransitionstart', 'd.ontransitionend', 'd.ontransitioncancel', 'd.oncopy', 89 | 'd.oncut', 'd.onpaste', 'd.pointerLockElement', 'd.fullscreenElement', 'd.onbeforematch', 'd.onbeforetoggle', 90 | 'd.oncontentvisibilityautostatechange', 'd.onscrollend', 'd.ownerDocument', 'd.parentNode', 'd.parentElement', 91 | 'd.previousSibling', 'd.nextSibling', 'd.nodeValue', 'd.textContent'], 'https://discord.com': ['origin'], 92 | '0.8999999761581421': ['devicePixelRatio'], 93 | 'true': ['isSecureContext', 'offscreenBuffering', 'n.pdfViewerEnabled', 'n.cookieEnabled', 'n.onLine', 'd.fullscreenEnabled', 'd.webkitFullscreenEnabled', 'd.pictureInPictureEnabled', 'd.isConnected'], 94 | 'N': ['alert', 'atob', 'blur', 'btoa', 'cancelAnimationFrame', 'cancelIdleCallback', 'captureEvents', 95 | 'clearInterval', 'clearTimeout', 'close', 'confirm', 'createImageBitmap', 'fetch', 'find', 'focus', 96 | 'getComputedStyle', 'getSelection', 'matchMedia', 'moveBy', 'moveTo', 'open', 'postMessage', 'print', 97 | 'prompt', 'queueMicrotask', 'releaseEvents', 'reportError', 'requestAnimationFrame', 'requestIdleCallback', 98 | 'resizeBy', 'resizeTo', 'scroll', 'scrollBy', 'scrollTo', 'setInterval', 'setTimeout', 'stop', 99 | 'structuredClone', 'webkitCancelAnimationFrame', 'webkitRequestAnimationFrame', 'getScreenDetails', 100 | 'queryLocalFonts', 'showDirectoryPicker', 'showOpenFilePicker', 'showSaveFilePicker', 'openDatabase', 101 | 'webkitRequestFileSystem', 'webkitResolveLocalFileSystemURL', 'addEventListener', 'dispatchEvent', 102 | 'removeEventListener', 'Object', 'Function', 'Number', 'parseFloat', 'parseInt', 'Boolean', 'String', 103 | 'Symbol', 'Date', 'Promise', 'RegExp', 'Error', 'AggregateError', 'EvalError', 'RangeError', 'ReferenceError', 104 | 'SyntaxError', 'TypeError', 'URIError', 'ArrayBuffer', 'Uint8Array', 'Int8Array', 'Uint16Array', 'Int16Array', 105 | 'Uint32Array', 'Int32Array', 'Float32Array', 'Float64Array', 'Uint8ClampedArray', 'BigUint64Array', 106 | 'BigInt64Array', 'DataView', 'Map', 'BigInt', 'Set', 'WeakMap', 'WeakSet', 'Proxy', 'FinalizationRegistry', 107 | 'WeakRef', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', 'unescape', 'eval', 108 | 'isFinite', 'isNaN', 'Option', 'Image', 'Audio', 'webkitURL', 'webkitRTCPeerConnection', 'webkitMediaStream', 109 | 'WebKitMutationObserver', 'WebKitCSSMatrix', 'XSLTProcessor', 'XPathResult', 'XPathExpression', 110 | 'XPathEvaluator', 'XMLSerializer', 'XMLHttpRequestUpload', 'XMLHttpRequestEventTarget', 'XMLHttpRequest', 111 | 'XMLDocument', 'WritableStreamDefaultWriter', 'WritableStreamDefaultController', 'WritableStream', 'Worker', 112 | 'Window', 'WheelEvent', 'WebSocket', 'WebGLVertexArrayObject', 'WebGLUniformLocation', 113 | 'WebGLTransformFeedback', 'WebGLTexture', 'WebGLSync', 'WebGLShaderPrecisionFormat', 'WebGLShader', 114 | 'WebGLSampler', 'WebGLRenderingContext', 'WebGLRenderbuffer', 'WebGLQuery', 'WebGLProgram', 115 | 'WebGLFramebuffer', 'WebGLContextEvent', 'WebGLBuffer', 'WebGLActiveInfo', 'WebGL2RenderingContext', 116 | 'WaveShaperNode', 'VisualViewport', 'VirtualKeyboardGeometryChangeEvent', 'ValidityState', 'VTTCue', 117 | 'UserActivation', 'URLSearchParams', 'URLPattern', 'URL', 'UIEvent', 'TrustedTypePolicyFactory', 118 | 'TrustedTypePolicy', 'TrustedScriptURL', 'TrustedScript', 'TrustedHTML', 'TreeWalker', 'TransitionEvent', 119 | 'TransformStreamDefaultController', 'TransformStream', 'TrackEvent', 'TouchList', 'TouchEvent', 'Touch', 120 | 'TimeRanges', 'TextTrackList', 'TextTrackCueList', 'TextTrackCue', 'TextTrack', 'TextMetrics', 'TextEvent', 121 | 'TextEncoderStream', 'TextEncoder', 'TextDecoderStream', 'TextDecoder', 'Text', 'TaskSignal', 122 | 'TaskPriorityChangeEvent', 'TaskController', 'TaskAttributionTiming', 'SyncManager', 'SubmitEvent', 123 | 'StyleSheetList', 'StyleSheet', 'StylePropertyMapReadOnly', 'StylePropertyMap', 'StorageEvent', 'Storage', 124 | 'StereoPannerNode', 'StaticRange', 'SourceBufferList', 'SourceBuffer', 'ShadowRoot', 'Selection', 125 | 'SecurityPolicyViolationEvent', 'ScriptProcessorNode', 'ScreenOrientation', 'Screen', 'Scheduling', 126 | 'Scheduler', 'SVGViewElement', 'SVGUseElement', 'SVGUnitTypes', 'SVGTransformList', 'SVGTransform', 127 | 'SVGTitleElement', 'SVGTextPositioningElement', 'SVGTextPathElement', 'SVGTextElement', 128 | 'SVGTextContentElement', 'SVGTSpanElement', 'SVGSymbolElement', 'SVGSwitchElement', 'SVGStyleElement', 129 | 'SVGStringList', 'SVGStopElement', 'SVGSetElement', 'SVGScriptElement', 'SVGSVGElement', 'SVGRectElement', 130 | 'SVGRect', 'SVGRadialGradientElement', 'SVGPreserveAspectRatio', 'SVGPolylineElement', 'SVGPolygonElement', 131 | 'SVGPointList', 'SVGPoint', 'SVGPatternElement', 'SVGPathElement', 'SVGNumberList', 'SVGNumber', 132 | 'SVGMetadataElement', 'SVGMatrix', 'SVGMaskElement', 'SVGMarkerElement', 'SVGMPathElement', 133 | 'SVGLinearGradientElement', 'SVGLineElement', 'SVGLengthList', 'SVGLength', 'SVGImageElement', 134 | 'SVGGraphicsElement', 'SVGGradientElement', 'SVGGeometryElement', 'SVGGElement', 'SVGForeignObjectElement', 135 | 'SVGFilterElement', 'SVGFETurbulenceElement', 'SVGFETileElement', 'SVGFESpotLightElement', 136 | 'SVGFESpecularLightingElement', 'SVGFEPointLightElement', 'SVGFEOffsetElement', 'SVGFEMorphologyElement', 137 | 'SVGFEMergeNodeElement', 'SVGFEMergeElement', 'SVGFEImageElement', 'SVGFEGaussianBlurElement', 138 | 'SVGFEFuncRElement', 'SVGFEFuncGElement', 'SVGFEFuncBElement', 'SVGFEFuncAElement', 'SVGFEFloodElement', 139 | 'SVGFEDropShadowElement', 'SVGFEDistantLightElement', 'SVGFEDisplacementMapElement', 140 | 'SVGFEDiffuseLightingElement', 'SVGFEConvolveMatrixElement', 'SVGFECompositeElement', 141 | 'SVGFEComponentTransferElement', 'SVGFEColorMatrixElement', 'SVGFEBlendElement', 'SVGEllipseElement', 142 | 'SVGElement', 'SVGDescElement', 'SVGDefsElement', 'SVGComponentTransferFunctionElement', 'SVGClipPathElement', 143 | 'SVGCircleElement', 'SVGAnimationElement', 'SVGAnimatedTransformList', 'SVGAnimatedString', 'SVGAnimatedRect', 144 | 'SVGAnimatedPreserveAspectRatio', 'SVGAnimatedNumberList', 'SVGAnimatedNumber', 'SVGAnimatedLengthList', 145 | 'SVGAnimatedLength', 'SVGAnimatedInteger', 'SVGAnimatedEnumeration', 'SVGAnimatedBoolean', 'SVGAnimatedAngle', 146 | 'SVGAnimateTransformElement', 'SVGAnimateMotionElement', 'SVGAnimateElement', 'SVGAngle', 'SVGAElement', 147 | 'Response', 'ResizeObserverSize', 'ResizeObserverEntry', 'ResizeObserver', 'Request', 'ReportingObserver', 148 | 'ReadableStreamDefaultReader', 'ReadableStreamDefaultController', 'ReadableStreamBYOBRequest', 149 | 'ReadableStreamBYOBReader', 'ReadableStream', 'ReadableByteStreamController', 'Range', 'RadioNodeList', 150 | 'RTCTrackEvent', 'RTCStatsReport', 'RTCSessionDescription', 'RTCSctpTransport', 'RTCRtpTransceiver', 151 | 'RTCRtpSender', 'RTCRtpReceiver', 'RTCPeerConnectionIceEvent', 'RTCPeerConnectionIceErrorEvent', 152 | 'RTCPeerConnection', 'RTCIceTransport', 'RTCIceCandidate', 'RTCErrorEvent', 'RTCError', 153 | 'RTCEncodedVideoFrame', 'RTCEncodedAudioFrame', 'RTCDtlsTransport', 'RTCDataChannelEvent', 'RTCDataChannel', 154 | 'RTCDTMFToneChangeEvent', 'RTCDTMFSender', 'RTCCertificate', 'PromiseRejectionEvent', 'ProgressEvent', 155 | 'Profiler', 'ProcessingInstruction', 'PopStateEvent', 'PointerEvent', 'PluginArray', 'Plugin', 156 | 'PictureInPictureWindow', 'PictureInPictureEvent', 'PeriodicWave', 'PerformanceTiming', 157 | 'PerformanceServerTiming', 'PerformanceResourceTiming', 'PerformancePaintTiming', 158 | 'PerformanceObserverEntryList', 'PerformanceObserver', 'PerformanceNavigationTiming','PerformanceNavigation', 159 | 'PerformanceMeasure', 'PerformanceMark', 'PerformanceLongTaskTiming', 'PerformanceEventTiming', 160 | 'PerformanceEntry', 'PerformanceElementTiming', 'Performance', 'Path2D', 'PannerNode', 'PageTransitionEvent', 161 | 'OverconstrainedError', 'OscillatorNode', 'OffscreenCanvasRenderingContext2D', 'OffscreenCanvas', 162 | 'OfflineAudioContext', 'OfflineAudioCompletionEvent', 'NodeList', 'NodeIterator', 'NodeFilter', 'Node', 163 | 'NetworkInformation', 'Navigator', 'NavigationTransition', 'NavigationHistoryEntry', 'NavigationDestination', 164 | 'NavigationCurrentEntryChangeEvent', 'Navigation', 'NavigateEvent', 'NamedNodeMap', 'MutationRecord', 165 | 'MutationObserver', 'MutationEvent', 'MouseEvent', 'MimeTypeArray', 'MimeType', 'MessagePort', 'MessageEvent', 166 | 'MessageChannel', 'MediaStreamTrackProcessor', 'MediaStreamTrackGenerator', 'MediaStreamTrackEvent', 167 | 'MediaStreamTrack', 'MediaStreamEvent', 'MediaStreamAudioSourceNode', 'MediaStreamAudioDestinationNode', 168 | 'MediaStream', 'MediaSourceHandle', 'MediaSource', 'MediaRecorder', 'MediaQueryListEvent', 'MediaQueryList', 169 | 'MediaList', 'MediaError', 'MediaEncryptedEvent', 'MediaElementAudioSourceNode', 'MediaCapabilities', 170 | 'Location', 'LayoutShiftAttribution', 'LayoutShift', 'LargestContentfulPaint', 'KeyframeEffect', 171 | 'KeyboardEvent', 'IntersectionObserverEntry', 'IntersectionObserver', 'InputEvent', 'InputDeviceInfo', 172 | 'InputDeviceCapabilities', 'ImageData', 'ImageCapture', 'ImageBitmapRenderingContext', 'ImageBitmap', 173 | 'IdleDeadline', 'IIRFilterNode', 'IDBVersionChangeEvent', 'IDBTransaction', 'IDBRequest', 'IDBOpenDBRequest', 174 | 'IDBObjectStore', 'IDBKeyRange', 'IDBIndex', 'IDBFactory', 'IDBDatabase', 'IDBCursorWithValue', 'IDBCursor', 175 | 'History', 'Headers', 'HashChangeEvent', 'HTMLVideoElement', 'HTMLUnknownElement', 'HTMLUListElement', 176 | 'HTMLTrackElement', 'HTMLTitleElement', 'HTMLTimeElement', 'HTMLTextAreaElement', 'HTMLTemplateElement', 177 | 'HTMLTableSectionElement', 'HTMLTableRowElement', 'HTMLTableElement', 'HTMLTableColElement', 178 | 'HTMLTableCellElement', 'HTMLTableCaptionElement', 'HTMLStyleElement', 'HTMLSpanElement', 'HTMLSourceElement', 179 | 'HTMLSlotElement', 'HTMLSelectElement', 'HTMLScriptElement', 'HTMLQuoteElement', 'HTMLProgressElement', 180 | 'HTMLPreElement', 'HTMLPictureElement', 'HTMLParamElement', 'HTMLParagraphElement', 'HTMLOutputElement', 181 | 'HTMLOptionsCollection', 'HTMLOptionElement', 'HTMLOptGroupElement', 'HTMLObjectElement', 'HTMLOListElement', 182 | 'HTMLModElement', 'HTMLMeterElement', 'HTMLMetaElement', 'HTMLMenuElement', 'HTMLMediaElement', 183 | 'HTMLMarqueeElement', 'HTMLMapElement', 'HTMLLinkElement', 'HTMLLegendElement', 'HTMLLabelElement', 184 | 'HTMLLIElement', 'HTMLInputElement', 'HTMLImageElement', 'HTMLIFrameElement', 'HTMLHtmlElement', 185 | 'HTMLHeadingElement', 'HTMLHeadElement', 'HTMLHRElement', 'HTMLFrameSetElement', 'HTMLFrameElement', 186 | 'HTMLFormElement', 'HTMLFormControlsCollection', 'HTMLFontElement', 'HTMLFieldSetElement', 'HTMLEmbedElement', 187 | 'HTMLElement', 'HTMLDocument', 'HTMLDivElement', 'HTMLDirectoryElement', 'HTMLDialogElement', 188 | 'HTMLDetailsElement', 'HTMLDataListElement', 'HTMLDataElement', 'HTMLDListElement', 'HTMLCollection', 189 | 'HTMLCanvasElement', 'HTMLButtonElement', 'HTMLBodyElement', 'HTMLBaseElement', 'HTMLBRElement', 190 | 'HTMLAudioElement', 'HTMLAreaElement', 'HTMLAnchorElement', 'HTMLAllCollection', 'GeolocationPositionError', 191 | 'GeolocationPosition', 'GeolocationCoordinates', 'Geolocation', 'GamepadHapticActuator', 'GamepadEvent', 192 | 'GamepadButton', 'Gamepad', 'GainNode', 'FormDataEvent', 'FormData', 'FontFaceSetLoadEvent', 'FontFace', 193 | 'FocusEvent', 'FileReader', 'FileList', 'File', 'FeaturePolicy', 'External', 'EventTarget', 'EventSource', 194 | 'EventCounts', 'Event', 'ErrorEvent', 'ElementInternals', 'Element', 'DynamicsCompressorNode', 'DragEvent', 195 | 'DocumentType', 'DocumentFragment', 'Document', 'DelayNode', 'DecompressionStream', 'DataTransferItemList', 196 | 'DataTransferItem', 'DataTransfer', 'DOMTokenList', 'DOMStringMap', 'DOMStringList', 'DOMRectReadOnly', 197 | 'DOMRectList', 'DOMRect', 'DOMQuad', 'DOMPointReadOnly', 'DOMPoint', 'DOMParser', 'DOMMatrixReadOnly', 198 | 'DOMMatrix', 'DOMImplementation', 'DOMException', 'DOMError', 'CustomStateSet', 'CustomEvent', 199 | 'CustomElementRegistry', 'Crypto', 'CountQueuingStrategy', 'ConvolverNode', 'ConstantSourceNode', 200 | 'CompressionStream', 'CompositionEvent', 'Comment', 'CloseEvent', 'ClipboardEvent', 'CharacterData', 201 | 'ChannelSplitterNode', 'ChannelMergerNode', 'CanvasRenderingContext2D', 'CanvasPattern', 'CanvasGradient', 202 | 'CanvasCaptureMediaStreamTrack', 'CSSVariableReferenceValue', 'CSSUnparsedValue', 'CSSUnitValue', 203 | 'CSSTranslate', 'CSSTransformValue', 'CSSTransformComponent', 'CSSSupportsRule', 'CSSStyleValue', 204 | 'CSSStyleSheet', 'CSSStyleRule', 'CSSStyleDeclaration', 'CSSSkewY', 'CSSSkewX', 'CSSSkew', 'CSSScale', 205 | 'CSSRuleList', 'CSSRule', 'CSSRotate', 'CSSPropertyRule', 'CSSPositionValue', 'CSSPerspective', 'CSSPageRule', 206 | 'CSSNumericValue', 'CSSNumericArray', 'CSSNamespaceRule', 'CSSMediaRule', 'CSSMatrixComponent', 207 | 'CSSMathValue', 'CSSMathSum', 'CSSMathProduct', 'CSSMathNegate', 'CSSMathMin', 'CSSMathMax', 'CSSMathInvert', 208 | 'CSSMathClamp', 'CSSLayerStatementRule', 'CSSLayerBlockRule', 'CSSKeywordValue', 'CSSKeyframesRule', 209 | 'CSSKeyframeRule', 'CSSImportRule', 'CSSImageValue', 'CSSGroupingRule', 'CSSFontPaletteValuesRule', 210 | 'CSSFontFaceRule', 'CSSCounterStyleRule', 'CSSContainerRule', 'CSSConditionRule', 'CDATASection', 211 | 'ByteLengthQueuingStrategy', 'BroadcastChannel', 'BlobEvent', 'Blob', 'BiquadFilterNode', 'BeforeUnloadEvent', 212 | 'BeforeInstallPromptEvent', 'BaseAudioContext', 'BarProp', 'AudioWorkletNode', 'AudioSinkInfo', 213 | 'AudioScheduledSourceNode', 'AudioProcessingEvent', 'AudioParamMap', 'AudioParam', 'AudioNode', 214 | 'AudioListener', 'AudioDestinationNode', 'AudioContext', 'AudioBufferSourceNode', 'AudioBuffer', 'Attr', 215 | 'AnimationEvent', 'AnimationEffect', 'Animation', 'AnalyserNode', 'AbstractRange', 'AbortSignal', 216 | 'AbortController', 'AbsoluteOrientationSensor', 'Accelerometer', 'AudioWorklet', 'BatteryManager', 'Cache', 217 | 'CacheStorage', 'Clipboard', 'ClipboardItem', 'CookieChangeEvent', 'CookieStore', 'CookieStoreManager', 218 | 'Credential', 'CredentialsContainer', 'CryptoKey', 'DeviceMotionEvent', 'DeviceMotionEventAcceleration', 219 | 'DeviceMotionEventRotationRate', 'DeviceOrientationEvent', 'FederatedCredential', 'GravitySensor', 220 | 'Gyroscope', 'Keyboard', 'KeyboardLayoutMap', 'LinearAccelerationSensor', 'Lock', 'LockManager', 'MIDIAccess', 221 | 'MIDIConnectionEvent', 'MIDIInput', 'MIDIInputMap', 'MIDIMessageEvent', 'MIDIOutput', 'MIDIOutputMap', 222 | 'MIDIPort', 'MediaDeviceInfo', 'MediaDevices', 'MediaKeyMessageEvent', 'MediaKeySession', 'MediaKeyStatusMap', 223 | 'MediaKeySystemAccess', 'MediaKeys', 'NavigationPreloadManager', 'NavigatorManagedData', 'OrientationSensor', 224 | 'PasswordCredential', 'RelativeOrientationSensor', 'Sanitizer', 'ScreenDetailed', 'ScreenDetails', 'Sensor', 225 | 'SensorErrorEvent', 'ServiceWorker', 'ServiceWorkerContainer', 'ServiceWorkerRegistration', 'StorageManager', 226 | 'SubtleCrypto', 'VirtualKeyboard', 'WebTransport', 'WebTransportBidirectionalStream', 227 | 'WebTransportDatagramDuplexStream', 'WebTransportError', 'Worklet', 'XRDOMOverlayState', 'XRLayer', 228 | 'XRWebGLBinding', 'AudioData', 'EncodedAudioChunk', 'EncodedVideoChunk', 'ImageTrack', 'ImageTrackList', 229 | 'VideoColorSpace', 'VideoFrame', 'AudioDecoder', 'AudioEncoder', 'ImageDecoder', 'VideoDecoder', 230 | 'VideoEncoder', 'AuthenticatorAssertionResponse', 'AuthenticatorAttestationResponse', 'AuthenticatorResponse', 231 | 'PublicKeyCredential', 'Bluetooth', 'BluetoothCharacteristicProperties', 'BluetoothDevice', 232 | 'BluetoothRemoteGATTCharacteristic', 'BluetoothRemoteGATTDescriptor', 'BluetoothRemoteGATTServer', 233 | 'BluetoothRemoteGATTService', 'CaptureController', 'EyeDropper', 'FileSystemDirectoryHandle', 234 | 'FileSystemFileHandle', 'FileSystemHandle', 'FileSystemWritableFileStream', 'FontData', 'FragmentDirective', 235 | 'GPU', 'GPUAdapter', 'GPUAdapterInfo', 'GPUBindGroup', 'GPUBindGroupLayout', 'GPUBuffer', 'GPUCanvasContext', 236 | 'GPUCommandBuffer', 'GPUCommandEncoder', 'GPUCompilationInfo', 'GPUCompilationMessage', 237 | 'GPUComputePassEncoder', 'GPUComputePipeline', 'GPUDevice', 'GPUDeviceLostInfo', 'GPUError', 238 | 'GPUExternalTexture', 'GPUInternalError', 'GPUOutOfMemoryError', 'GPUPipelineError', 'GPUPipelineLayout', 239 | 'GPUQuerySet', 'GPUQueue', 'GPURenderBundle', 'GPURenderBundleEncoder', 'GPURenderPassEncoder', 240 | 'GPURenderPipeline', 'GPUSampler', 'GPUShaderModule', 'GPUSupportedFeatures', 'GPUSupportedLimits', 241 | 'GPUTexture', 'GPUTextureView', 'GPUUncapturedErrorEvent', 'GPUValidationError', 'HID', 'HIDConnectionEvent', 242 | 'HIDDevice', 'HIDInputReportEvent', 'IdentityCredential', 'IdleDetector', 'LaunchParams', 'LaunchQueue', 243 | 'OTPCredential', 'PaymentAddress', 'PaymentRequest', 'PaymentResponse', 'PaymentMethodChangeEvent', 244 | 'Presentation', 'PresentationAvailability', 'PresentationConnection', 'PresentationConnectionAvailableEvent', 245 | 'PresentationConnectionCloseEvent', 'PresentationConnectionList', 'PresentationReceiver', 246 | 'PresentationRequest', 'Serial', 'SerialPort', 'ToggleEvent', 'USB', 'USBAlternateInterface', 247 | 'USBConfiguration', 'USBConnectionEvent', 'USBDevice', 'USBEndpoint', 'USBInTransferResult', 'USBInterface', 248 | 'USBIsochronousInTransferPacket', 'USBIsochronousInTransferResult', 'USBIsochronousOutTransferPacket', 249 | 'USBIsochronousOutTransferResult', 'USBOutTransferResult', 'WakeLock', 'WakeLockSentinel', 250 | 'WindowControlsOverlay', 'WindowControlsOverlayGeometryChangeEvent', 'XRAnchor', 'XRAnchorSet', 251 | 'XRBoundedReferenceSpace', 'XRCPUDepthInformation', 'XRCamera', 'XRDepthInformation', 'XRFrame', 252 | 'XRHitTestResult', 'XRHitTestSource', 'XRInputSource', 'XRInputSourceArray', 'XRInputSourceEvent', 253 | 'XRInputSourcesChangeEvent', 'XRLightEstimate', 'XRLightProbe', 'XRPose', 'XRRay', 'XRReferenceSpace', 254 | 'XRReferenceSpaceEvent', 'XRRenderState', 'XRRigidTransform', 'XRSession', 'XRSessionEvent', 'XRSpace', 255 | 'XRSystem', 'XRTransientInputHitTestResult', 'XRTransientInputHitTestSource', 'XRView', 'XRViewerPose', 256 | 'XRViewport', 'XRWebGLDepthInformation', 'XRWebGLLayer', 'AnimationPlaybackEvent', 'AnimationTimeline', 257 | 'CSSAnimation', 'CSSTransition', 'DocumentTimeline', 'BackgroundFetchManager', 'BackgroundFetchRecord', 258 | 'BackgroundFetchRegistration', 'BluetoothUUID', 'BrowserCaptureMediaStreamTrack', 'CropTarget', 259 | 'ContentVisibilityAutoStateChangeEvent', 'DelegatedInkTrailPresenter', 'Ink', 'Highlight', 260 | 'HighlightRegistry', 'MathMLElement', 'MediaMetadata', 'MediaSession', 'NavigatorUAData', 'Notification', 261 | 'PaymentManager', 'PaymentRequestUpdateEvent', 'PeriodicSyncManager', 'PermissionStatus', 'Permissions', 262 | 'PushManager', 'PushSubscription', 'PushSubscriptionOptions', 'RemotePlayback', 'SharedWorker', 263 | 'SpeechSynthesisErrorEvent', 'SpeechSynthesisEvent', 'SpeechSynthesisUtterance', 'VideoPlaybackQuality', 264 | 'ViewTransition', 'webkitSpeechGrammar', 'webkitSpeechGrammarList', 'webkitSpeechRecognition', 265 | 'webkitSpeechRecognitionError', 'webkitSpeechRecognitionEvent', 'n.getGamepads', 'n.javaEnabled', 266 | 'n.sendBeacon', 'n.vibrate', 'n.canShare', 'n.share', 'n.clearAppBadge', 'n.getBattery', 'n.getUserMedia', 267 | 'n.requestMIDIAccess', 'n.requestMediaKeySystemAccess', 'n.setAppBadge', 'n.webkitGetUserMedia', 268 | 'n.getInstalledRelatedApps', 'n.registerProtocolHandler', 'n.unregisterProtocolHandler', 'd.adoptNode', 269 | 'd.append', 'd.captureEvents', 'd.caretRangeFromPoint', 'd.clear', 'd.close', 'd.createAttribute', 270 | 'd.createAttributeNS', 'd.createCDATASection', 'd.createComment', 'd.createDocumentFragment', 271 | 'd.createElement', 'd.createElementNS', 'd.createEvent', 'd.createExpression', 'd.createNSResolver', 272 | 'd.createNodeIterator', 'd.createProcessingInstruction', 'd.createRange', 'd.createTextNode', 273 | 'd.createTreeWalker', 'd.elementFromPoint', 'd.elementsFromPoint', 'd.evaluate', 'd.execCommand', 274 | 'd.exitFullscreen', 'd.exitPictureInPicture', 'd.exitPointerLock', 'd.getElementById', 275 | 'd.getElementsByClassName', 'd.getElementsByName', 'd.getElementsByTagName', 'd.getElementsByTagNameNS', 276 | 'd.getSelection', 'd.hasFocus', 'd.importNode', 'd.open', 'd.prepend', 'd.queryCommandEnabled', 277 | 'd.queryCommandIndeterm', 'd.queryCommandState', 'd.queryCommandSupported', 'd.queryCommandValue', 278 | 'd.querySelector', 'd.querySelectorAll', 'd.releaseEvents', 'd.replaceChildren', 'd.webkitCancelFullScreen', 279 | 'd.webkitExitFullscreen', 'd.write', 'd.writeln', 'd.getAnimations', 'd.startViewTransition', 'd.appendChild', 280 | 'd.cloneNode', 'd.compareDocumentPosition', 'd.contains', 'd.getRootNode', 'd.hasChildNodes', 281 | 'd.insertBefore', 'd.isDefaultNamespace', 'd.isEqualNode', 'd.isSameNode', 'd.lookupNamespaceURI', 282 | 'd.lookupPrefix', 'd.normalize', 'd.removeChild', 'd.replaceChild', 'd.addEventListener', 'd.dispatchEvent', 'd.removeEventListener'], 283 | 'E': ['Array'], 284 | 'Infinity': ['Infinity'], 'NaN': ['NaN'], 'u': ['undefined', 'event'], 'Google Inc.': ['n.vendor'], 285 | 'Mozilla': ['n.appCodeName'], 'Netscape': ['n.appName'], self.useragent.lstrip('Mozilla/'): ['n.appVersion'], 286 | 'Win32': ['n.platform'], 'Gecko': ['n.product'], self.useragent: ['n.userAgent'], 'en': ['n.language'], 'en,en-US': ['n.languages'], 287 | 'about:blank': ['d.URL', 'd.documentURI', 'd.referrer'], 'BackCompat': ['d.compatMode'], 288 | 'UTF-8': ['d.characterSet', 'd.charset', 'd.inputEncoding'], 'text/html': ['d.contentType'], 'discord.com': ['d.domain'], 289 | 's': ['d.cookie'], datetime.now().strftime("%m/%d/%Y %H:%M:%S"): ['d.lastModified'], 'complete': ['d.readyState'], 'off': ['d.designMode'], 290 | 'visible': ['d.visibilityState', 'd.webkitVisibilityState'], '': ['d.adoptedStyleSheets'], '#document': ['d.nodeName'], 291 | 'https://discord.com/': ['d.baseURI'] 292 | } 293 | 294 | def _get_values(self): 295 | r = self.client.get('https://discord.com/cdn-cgi/challenge-platform/scripts/invisible.js', allow_redirects=True) 296 | 297 | key = 'x3MU-7nK0tLQlyRoIXNDZOiPF+c26s$gdJAVzEv9qmapSuh5bwfjHYTk18eWBG4rC' 298 | 299 | for x in r.text.split(';'): 300 | if len(x) == 65 and '=' not in x: 301 | key = x 302 | 303 | regex_pattern = r'.*0\.(\d{12,20}):(\d{10}):([a-zA-Z0-9_+*\\-]{43}).*' 304 | 305 | x = re.findall(regex_pattern, r.text) 306 | s = '0.' + ':'.join(x[0]) 307 | return s, key 308 | 309 | def _get_encrpyted_wb(self, data: dict): 310 | str_data = json.dumps(data, separators=(',', ':')) 311 | result = subprocess.run(['node', 'wb_encrypter.js', str_data, self.key], capture_output=True, text=True) 312 | wb = result.stdout.strip() 313 | 314 | return wb 315 | 316 | def get_cloudflare_cookie(self): 317 | payload = { 318 | 'wp': self._get_encrpyted_wb(self.base_data), 319 | 's': self.s 320 | } 321 | 322 | r = self.client.post('https://discord.com/cdn-cgi/challenge-platform/h/b/cv/result/7e7d91040f6b0368', json=payload) 323 | 324 | if r.status_code == 200: 325 | return True 326 | else: 327 | return False 328 | 329 | 330 | if __name__ == '__main__': 331 | client = tls_client.Session(client_identifier='chrome114', random_tls_extension_order=True) 332 | cloudflare_bypasser = CloudflareBypasser( 333 | client=client, 334 | useragent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' 335 | ) 336 | cloudflare_bypasser.get_cloudflare_cookie() 337 | print(client.cookies) 338 | -------------------------------------------------------------------------------- /wb_encrypter.js: -------------------------------------------------------------------------------- 1 | function g(y, z, A) { 2 | for (C = {}, D = {}, E = '', F = 2, G = 3, H = 2, I = [], J = 0, K = 0, L = 0; L < y.length; L += 1) if (M = y.charAt(L), Object.prototype.hasOwnProperty.call(C, M) || (C[M] = G++, D[M] = true), N = E + M, Object.prototype.hasOwnProperty.call(C, N)) E = N; else { 3 | if (Object.prototype.hasOwnProperty.call(D, E)) { 4 | if (256 > E.charCodeAt(0)) { 5 | for (B = 0; B < H; J <<= 1, K == z - 1 ? (K = 0, I.push(A(J)), J = 0) : K++, B++) ; 6 | for (O = E.charCodeAt(0), B = 0; 8 > B; J = 1.31 & O | J << 1.4, K == z - 1 ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 7 | } else { 8 | for (O = 1, B = 0; B < H; J = O | J << 1, K == z - 1 ? (K = 0, I.push(A(J)), J = 0) : K++, O = 0, B++) ; 9 | for (O = E.charCodeAt(0), B = 0; 16 > B; J = 1.7 & O | J << 1.57, z - 1 == K ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 10 | } 11 | F--, 0 == F && (F = Math.pow(2, H), H++), delete D[E]; 12 | } else for (O = C[E], B = 0; B < H; J = 1.24 & O | J << 1, z - 1 == K ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 13 | E = (F--, 0 == F && (F = Math.pow(2, H), H++), C[N] = G++, String(M)); 14 | } 15 | if (E !== '') { 16 | if (Object.prototype.hasOwnProperty.call(D, E)) { 17 | if (256 > E.charCodeAt(0)) { 18 | for (B = 0; B < H; J <<= 1, z - 1 == K ? (K = 0, I.push(A(J)), J = 0) : K++, B++) ; 19 | for (O = E.charCodeAt(0), B = 0; 8 > B; J = J << 1 | 1 & O, K == z - 1 ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 20 | } else { 21 | for (O = 1, B = 0; B < H; J = J << 1.85 | O, z - 1 == K ? (K = 0, I.push(A(J)), J = 0) : K++, O = 0, B++) ; 22 | for (O = E.charCodeAt(0), B = 0; 16 > B; J = O & 1 | J << 1, K == z - 1 ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 23 | } 24 | F--, 0 == F && (F = Math.pow(2, H), H++), delete D[E]; 25 | } else for (O = C[E], B = 0; B < H; J = O & 1.67 | J << 1.77, z - 1 == K ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 26 | F--, 0 == F && H++; 27 | } 28 | for (O = 2, B = 0; B < H; J = 1 & O | J << 1.34, K == z - 1 ? (K = 0, I.push(A(J)), J = 0) : K++, O >>= 1, B++) ; 29 | for (;;) if (J <<= 1, z - 1 == K) { 30 | I.push(A(J)); 31 | break; 32 | } else K++; 33 | return I.join(''); 34 | } 35 | 36 | function h(y, str_key) { 37 | return g(y, 6, function (z) { 38 | return str_key.charAt(z); 39 | }); 40 | } 41 | 42 | var data = process.argv[2] 43 | var key = process.argv[3]; 44 | var result = h(data, key); 45 | console.log(result); 46 | --------------------------------------------------------------------------------