diff --git a/android-app/app/src/main/java/bypass/whitelist/util/Constants.kt b/android-app/app/src/main/java/bypass/whitelist/util/Constants.kt index dab46ec..9fcd88e 100644 --- a/android-app/app/src/main/java/bypass/whitelist/util/Constants.kt +++ b/android-app/app/src/main/java/bypass/whitelist/util/Constants.kt @@ -80,7 +80,7 @@ object VP8Defaults { const val BLANK_URL = "about:blank" -const val DESKTOP_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" +const val DESKTOP_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" object Vpn { const val ADDRESS = "10.0.0.2" diff --git a/creator-app/src/constants.ts b/creator-app/src/constants.ts index cbae8fc..f69a653 100644 --- a/creator-app/src/constants.ts +++ b/creator-app/src/constants.ts @@ -38,7 +38,7 @@ export const WINDOW_HEIGHT = 800; export const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' + - 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36'; + 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36'; export const VK_COOKIE_DOMAINS = ['vk.ru']; export const YANDEX_COOKIE_DOMAINS = ['yandex.ru', 'yandex.net', 'ya.ru']; diff --git a/ios-proxy-app/whitelist-bypass-proxy/VKAuthWebView.swift b/ios-proxy-app/whitelist-bypass-proxy/VKAuthWebView.swift index 677bbd3..27a316c 100644 --- a/ios-proxy-app/whitelist-bypass-proxy/VKAuthWebView.swift +++ b/ios-proxy-app/whitelist-bypass-proxy/VKAuthWebView.swift @@ -6,7 +6,7 @@ struct CaptchaWebView: UIViewRepresentable { func makeUIView(context: Context) -> WKWebView { let webView = WKWebView() - webView.customUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" + webView.customUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" webView.load(URLRequest(url: url)) return webView } diff --git a/ios-vpn-app/WhitelistBypassVPN/Components/CaptchaWebView.swift b/ios-vpn-app/WhitelistBypassVPN/Components/CaptchaWebView.swift index 20316c0..eeb4e5e 100644 --- a/ios-vpn-app/WhitelistBypassVPN/Components/CaptchaWebView.swift +++ b/ios-vpn-app/WhitelistBypassVPN/Components/CaptchaWebView.swift @@ -6,7 +6,7 @@ struct CaptchaWebView: UIViewRepresentable { func makeUIView(context: Context) -> WKWebView { let webView = WKWebView() - webView.customUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" + webView.customUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" webView.load(URLRequest(url: url)) return webView } diff --git a/relay/common/device.go b/relay/common/device.go index c4d52e9..62a1686 100644 --- a/relay/common/device.go +++ b/relay/common/device.go @@ -5,6 +5,9 @@ package common import ( "fmt" "math/rand/v2" + "strings" + + "github.com/kulikov0/headless-client" ) type DeviceProfile struct { @@ -35,6 +38,8 @@ type browserTemplate struct { userAgentFn func(osVersion, browserVersion string) string } +var windowsDeviceBrands = []string{"Dell", "Lenovo", "HP", "Asus", "Acer", "MSI"} + var commonScreens = [][2]int{ {1280, 720}, {1366, 768}, {1440, 900}, {1536, 864}, {1600, 900}, {1680, 1050}, {1728, 1117}, {1920, 1080}, @@ -170,3 +175,30 @@ func RandomDeviceProfile() DeviceProfile { ScreenHeight: screen[1], } } + +func chromeVersionFromUserAgent(userAgent string) string { + _, rest, found := strings.Cut(userAgent, "Chrome/") + if !found { + return "" + } + version, _, _ := strings.Cut(rest, " ") + return version +} + +func ChromeWindowsDeviceProfile() DeviceProfile { + userAgent := headless.ChromeWindows.UserAgent() + screen := commonScreens[rand.IntN(len(commonScreens))] + return DeviceProfile{ + UserAgent: userAgent, + Platform: "web", + BrowserType: "Chrome", + BrowserVersion: chromeVersionFromUserAgent(userAgent), + DeviceBrand: windowsDeviceBrands[rand.IntN(len(windowsDeviceBrands))], + DeviceModel: "PC", + DeviceType: "pc", + OS: "Windows", + OSVersion: "10", + ScreenWidth: screen[0], + ScreenHeight: screen[1], + } +} diff --git a/relay/dion/api.go b/relay/dion/api.go index 46d0234..f6a7682 100644 --- a/relay/dion/api.go +++ b/relay/dion/api.go @@ -182,7 +182,7 @@ func NewSession(httpClient *http.Client) (*Session, error) { } httpClient.Jar = jar } - return &Session{HTTPClient: httpClient, Device: common.RandomDeviceProfile()}, nil + return &Session{HTTPClient: httpClient, Device: common.ChromeWindowsDeviceProfile()}, nil } func (s *Session) RegisterGuest() (*GuestAuthResponse, error) {