from pathlib import Path import json,csv,hashlib,statistics,datetime,re,collections,html,zipfile,sys R=Path(__file__).resolve().parent.parent P=R/'private-raw'; O=R/'share'; O.mkdir(exist_ok=True) for d in ['evidence','data','methods','reports/en','reports/zh-Hant']:(O/d).mkdir(parents=True,exist_ok=True) def read(p):return json.loads(Path(p).read_text(encoding='utf-8-sig')) def sha(p):return hashlib.sha256(Path(p).read_bytes()).hexdigest() def trace(x):return dict(s.split('=',1) for s in x.get('body','').splitlines() if '=' in s) def dt(s):return datetime.datetime.fromisoformat(s.replace('Z','+00:00')) def med(a):return round(statistics.median(a),3) if a else None def num(v):return '-' if v is None else f'{v:.1f}' labels={'baseline_pre':'Baseline before','japan_beta_safe':'Japan Beta','singapore_beta_safe':'Singapore Beta','hongkong_beta_safe':'Hong Kong Beta Max - initial','hongkong_beta_retest':'Hong Kong Beta Max - repeat','hongkong_sola_safe':'Hong Kong Sola Max','hongkong_20_safe':'Hong Kong 2.0 Max','baseline_post':'Baseline after'} source_files=[]; rounds=[]; summaries=[] exit_map={} def exit_id(ip): if not ip:return None if ip not in exit_map:exit_map[ip]=f'EXIT-{len(exit_map)+1:02d}' return exit_map[ip] baseline=trace(read(P/'baseline_pre_http.json')[0]['before'])['ip'];exit_id(baseline) fields=['at','returncode','http_code','size_download','size_upload','time_total','time_starttransfer','speed_download','speed_upload','stderr','ssl_verify_result','http_version','url'] for label,title in labels.items(): p=P/f'{label}_http.json';a=read(p);source_files.append(p) clean=[] for x in a: b=trace(x['before']);e=trace(x['after']) row={k:x.get(k) for k in ['at','run','download_mbps','upload_mbps','http_ttfb_median_ms','http_failed_samples']};row['condition']=title row.update(exit_before=exit_id(b.get('ip')),exit_after=exit_id(e.get('ip')),country_before=b.get('loc'),country_after=e.get('loc'),colo_before=b.get('colo'),colo_after=e.get('colo')) for direction in ['download','upload']: row[direction+'_returncode']=x[direction]['returncode'];row[direction+'_http']=x[direction].get('http_code');row[direction+'_bytes']=x[direction].get('size_'+direction) rounds.append(row) clean.append(dict(row,download={k:x['download'].get(k) for k in fields},upload={k:x['upload'].get(k) for k in fields},latency=[{k:l.get(k) for k in fields} for l in x['latency']])) s={'condition':title,'label':label,'runs':len(a),'download_successes':sum(x['download_mbps'] is not None for x in a),'upload_successes':sum(x['upload_mbps'] is not None for x in a),'download_median_mbps':med([x['download_mbps'] for x in a if x['download_mbps'] is not None]),'upload_median_mbps':med([x['upload_mbps'] for x in a if x['upload_mbps'] is not None]),'ttfb_median_of_run_medians_ms':med([x['http_ttfb_median_ms'] for x in a if x['http_ttfb_median_ms'] is not None]),'ttfb_failed_requests':sum(x['http_failed_samples'] for x in a),'countries':sorted({trace(x[k]).get('loc','unknown') for x in a for k in ['before','after']}),'first_at':a[0]['at'],'last_at':a[-1]['after']['at']} summaries.append(s);(O/'data'/f'{label}.json').write_text(json.dumps(clean,indent=2),encoding='utf-8') with (O/'data/rounds.csv').open('w',encoding='utf-8',newline='') as f: w=csv.DictWriter(f,fieldnames=list(rounds[0]));w.writeheader();w.writerows(rounds) with (O/'data/summary.csv').open('w',encoding='utf-8',newline='') as f: keys=[k for k in summaries[0] if k!='countries'];w=csv.DictWriter(f,fieldnames=keys);w.writeheader();w.writerows({k:v for k,v in x.items() if k in keys} for x in summaries) # Browser reports are exported from the visible table, not hidden browser state. dns_specs=[('Baseline after','baseline_dns_webrtc_browser.json'),('Singapore Beta','singapore_dns_webrtc_browser.json'),('Hong Kong Beta Max','hongkong_beta_dns_webrtc_browser.json'),('Hong Kong Sola Max','hongkong_sola_dns_webrtc_browser.json'),('Hong Kong 2.0 Max','hongkong_20_dns_webrtc_browser.json')] dns=[];resolver_map={} for title,name in dns_specs: p=P/name;a=read(p);source_files.append(p);table=a.get('dns_table',a.get('visible_table',''));rr=[] for line in table.splitlines()[1:]: cells=line.split('\t') if len(cells)<4:continue ip,hostname,isp,country=cells[:4] if ip not in resolver_map:resolver_map[ip]=f'RESOLVER-{len(resolver_map)+1:02d}' rr.append({'id':resolver_map[ip],'isp':isp,'location_reported_by_site':country.strip(),'_ip':ip}) rtc=a.get('webrtc_summary','');r=a.get('webrtc',{}) matches=False if rtc: http_match=re.search(r'IPv4 Address\s*\t\s*([^\s]+)',rtc);public_match=re.search(r'Public IP Address\s*\t\s*([^\s]+)',rtc) matches=bool(http_match and public_match and http_match.group(1)==public_match.group(1)) elif r.get('public_ip'): matches=r['public_ip']==json.loads(read(P/'singapore_beta_after_switch_identity.json')['ipify']['body']).get('ip') dns.append({'condition':title,'at_utc':a['at_utc'],'resolvers':rr,'webrtc_no_leak_label':('No Leak' in rtc or 'No Leak' in r.get('result','')),'webrtc_http_exit_match':matches,'webrtc_summary':rtc,'rtc_old':r}) base_resolvers={x['_ip'] for x in dns[0]['resolvers']} for x in dns: x['exact_overlap_with_baseline']=len({r['_ip'] for r in x['resolvers']}&base_resolvers) x['isp_counts']=dict(collections.Counter(r['isp'] for r in x['resolvers'])) x['resolver_count']=len(x['resolvers']) for r in x['resolvers']:r.pop('_ip') x.pop('webrtc_summary');x.pop('rtc_old') (O/'data/dns_webrtc.json').write_text(json.dumps(dns,indent=2),encoding='utf-8') faults=[] for name,title in [('beta','Hong Kong Beta Max'),('sola','Hong Kong Sola Max'),('20','Hong Kong 2.0 Max')]: p=P/f'hongkong_{name}_fault_action.json';action=read(p);source_files.append(p);t=dt(action['at']) p=P/f'hongkong_{name}_fault_watch_availability.jsonl';a=[json.loads(s) for s in p.read_text(encoding='utf-8-sig').splitlines() if s.strip()];source_files.append(p) after=[x for x in a if dt(x['at'])>=t];fallback=[x for x in after if x['returncode']==0 and x.get('trace',{}).get('ip')==baseline];first=dt(fallback[0]['at']) if fallback else None restored=[x for x in after if first and dt(x['at'])>first and x['returncode']==0 and x.get('trace',{}).get('loc')=='HK' and x.get('trace',{}).get('ip')!=baseline] f={'condition':title,'action_at':action['at'],'action_result':action['result'],'watch_samples':len(a),'fallback_successful_http_samples':len(fallback),'first_fallback_request_at':fallback[0]['at'] if fallback else None,'first_fallback_request_start_delay_s':round((first-t).total_seconds(),3) if first else None,'first_observed_HK_after_fallback_at':restored[0]['at'] if restored else None,'observed_fallback_span_s':round((dt(fallback[-1]['at'])-first).total_seconds(),3) if fallback else None,'verdict':'FAIL: tested request fell back to disconnected baseline' if fallback else 'No observed fallback in sample window'} faults.append(f) rows=[{k:x[k] for k in ['at','sample','elapsed_seconds','returncode','request_seconds']}|{'country':x.get('trace',{}).get('loc'),'exit_id':exit_id(x.get('trace',{}).get('ip'))} for x in a] (O/'data'/f'hongkong_{name}_fault_watch.json').write_text(json.dumps(rows,indent=2),encoding='utf-8') (O/'data/fault_summary.json').write_text(json.dumps(faults,indent=2),encoding='utf-8') sec=read(P/'installed_security.json');source_files.append(P/'installed_security.json') security={'at':sec['at'],'executables':[{'name':x['name'],'version':x['version'],'sha256':x['sha256'],'signature_status':x['signature_status'],'signer':x['signer'],'builtin_users_file_rights':'ReadAndExecute, Synchronize; no write ACE observed'} for x in sec['executables']],'tcp_listen':sec['tcp_listen'],'udp':sec['udp'],'scope':'One local binding snapshot; no independent remote-host reachability or service authorization exploit test.'} (O/'data/installed_security.json').write_text(json.dumps(security,indent=2),encoding='utf-8') for protocol in ['beta','sola','20']: p=P/f'hongkong_{protocol}_ipv6.json';a=read(p);source_files.append(p) (O/'data'/p.name).write_text(json.dumps([{'at':x['at'],'url':x['url'],'curl_returncode':x['exitcode'],'result':'No usable IPv6 destination resolved with forced IPv6 on this configuration' if x['exitcode']==6 else 'See private raw'} for x in a],indent=2),encoding='utf-8') # Resource counters are CPU deltas, never lifetime CPU values. resources=[];p=P/'resource_samples.jsonl';source_files.append(p) a=[json.loads(s) for s in p.read_text(encoding='utf-8-sig').splitlines() if s.strip()] for label in ['singapore_beta_safe','hongkong_beta_safe','hongkong_sola_safe','hongkong_20_safe']: b=read(P/f'{label}_http.json');start=dt(b[0]['at']);end=dt(b[-1]['after']['at']);q=[x for x in a if start<=dt(x['at'])<=end] rates=[] for prev,cur in zip(q,q[1:]): elapsed=(dt(cur['at'])-dt(prev['at'])).total_seconds();pd={v['Id']:v['CPU'] for v in prev['processes']};cd={v['Id']:v['CPU'] for v in cur['processes']} if elapsed>0 and pd.keys()==cd.keys():rates.append(sum(max(0,cd[k]-pd[k]) for k in cd)/elapsed/20*100) rss=[sum(v['WorkingSet64'] for v in x['processes'])/1048576 for x in q] resources.append({'condition':labels[label],'samples_during_throughput_window':len(q),'mean_cpu_percent_of_20_logical_cpus':round(statistics.mean(rates),3) if rates else None,'median_sum_process_rss_MiB':med(rss),'peak_sum_process_rss_MiB':round(max(rss),3) if rss else None}) (O/'data/resource_summary.json').write_text(json.dumps(resources,indent=2),encoding='utf-8') (O/'data/resource_samples.jsonl').write_text(''.join(json.dumps(x)+'\n' for x in a),encoding='utf-8') identities=[] for p in sorted(P.glob('*_identity.json')): x=read(p);cf=trace(x['cloudflare']);v6=x.get('ipify_v6',{});body=v6.get('body','') try:reported_v6=':' in json.loads(body).get('ip','') except Exception:reported_v6=False identities.append({'label':x['label'],'at':x['at'],'country':cf.get('loc'),'colo':cf.get('colo'),'exit_id':exit_id(cf.get('ip')),'trace_returncode':x['cloudflare']['returncode'],'trace_http':x['cloudflare'].get('http_code'),'api6_returncode':v6.get('returncode'),'api6_http':v6.get('http_code'),'api6_reported_address_is_ipv6':reported_v6,'api6_remote_socket_family':6 if ':' in v6.get('remote_ip','') else (4 if v6.get('remote_ip') else None)}) source_files.append(p) (O/'data/identity_checks.json').write_text(json.dumps(identities,indent=2),encoding='utf-8') facts={'generated_at':datetime.datetime.now(datetime.timezone.utc).isoformat(),'installed_version':'2.6.2+3162','performance':summaries,'dns':dns,'faults':faults,'resources':resources,'security':security,'privacy':'Full public IPs, account header and original unedited screenshots stay in the local private-raw/original evidence folders. Public data uses stable exit/resolver IDs. English screenshots are genuine captures; Japanese/Singapore English captures were retaken after the throughput tests.'} (O/'data/facts.json').write_text(json.dumps(facts,indent=2),encoding='utf-8') # Deterministic document privacy crops; no generated pixels or translated screenshot text. from PIL import Image as PILImage,ImageDraw gallery=[] for stem,caption in [ ('hongkong_beta_connected_EN','Hong Kong Beta Max / initial connected state'), ('hongkong_sola_connected_EN','Hong Kong Sola Max / connected state'), ('hongkong_20_connected_EN','Hong Kong 2.0 Max / connected state'), ('beta_filter_safe_mode_EN','Beta protocol filter / Safe Mode selected'), ('sola_filter_safe_mode_EN','Sola protocol filter / Safe Mode selected'), ('protocol_20_filter_safe_mode_EN','2.0 protocol filter / Safe Mode selected'), ('hongkong_beta_after_core_fault_EN','Beta after forced core stop / Not connected'), ('hongkong_sola_after_core_fault_EN','Sola after forced core stop / Connected, Detecting'), ('hongkong_20_after_core_fault_EN','2.0 after forced core stop / Connected, Detecting'), ('japan_beta_english_retake_EN','Japan Beta / English retake after original measurement'), ('singapore_beta_english_retake_EN','Singapore Beta / English retake after original measurement'), ('final_disconnected_baseline_EN','Final state / manual disconnect for baseline')]: p=R/'evidence'/f'{stem}.png';im=PILImage.open(p);box=(0,165,im.width,min(690,im.height));out=O/'evidence'/f'{stem}_crop.png';im.crop(box).save(out) meta=read(p.with_suffix('.json'));meta.get('window',{}).pop('title',None);meta.update(original_sha256=sha(p),crop_box=box,privacy_crop='Top account/IP header and bottom navigation omitted; actual UI pixels only; no translation or generated screenshot content.',caption=caption) (out.with_suffix('.json')).write_text(json.dumps(meta,indent=2),encoding='utf-8');gallery.append((out,caption,meta['at_utc']));source_files.extend([p,p.with_suffix('.json')]) browser_gallery=[] for stem,title in [('hongkong_beta','Hong Kong Beta Max'),('hongkong_sola','Hong Kong Sola Max'),('hongkong_20','Hong Kong 2.0 Max'),('baseline','Disconnected baseline')]: dns_name=stem+'_dns_extended_EN.png';rtc_name=stem+'_webrtc_EN.png';count=next(x['resolver_count'] for x in dns if x['condition']==('Baseline after' if stem=='baseline' else title)) pair=[] for name,kind in [(dns_name,'DNS Extended'),(rtc_name,'WebRTC')]: p=P/name;im=PILImage.open(p).convert('RGB');draw=ImageDraw.Draw(im) if kind=='DNS Extended': bottom=min(im.height,int(411+count*34.7+8));draw.rectangle((328,110,730,146),fill='#808080');draw.rectangle((150,411,320,bottom),fill='#808080');box=(140,100,min(1120,im.width),bottom) else: draw.rectangle((268,185,650,212),fill='#808080');draw.rectangle((268,400,650,430),fill='#808080');box=(90,110,min(1018,im.width),min(430,im.height)) out=O/'evidence'/name.replace('.png','_redacted.png');im.crop(box).save(out) meta={'source_local_relative_path':p.relative_to(R).as_posix(),'source_sha256':sha(p),'crop_box':box,'processing':'Deterministic privacy masks over public IP fields and DNS address column. English UI content is otherwise original. SDP excluded from WebRTC crop. No AI-generated content or translated UI; gray masks are deliberate privacy redactions.','purpose':title+' / '+kind} out.with_suffix('.json').write_text(json.dumps(meta,indent=2),encoding='utf-8');source_files.append(p);pair.append(out) browser_gallery.append((title,pair)) # Refer to private originals with hashes rather than silently presenting redacted files as originals. with (O/'data/raw_source_hashes.csv').open('w',encoding='utf-8',newline='') as f: w=csv.writer(f);w.writerow(['local_original_relative_path','bytes','sha256']);w.writerows((str(p.relative_to(R)).replace('\\','/'),p.stat().st_size,sha(p)) for p in dict.fromkeys(source_files)) for name in ['live_http.py','availability.py','build_live_report.py']:(O/'methods'/name).write_bytes((R/'methods'/name).read_bytes()) from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet,ParagraphStyle from reportlab.lib.enums import TA_LEFT from reportlab.platypus import SimpleDocTemplate,Paragraph,Spacer,Table,TableStyle,PageBreak,Image,KeepTogether from reportlab.lib.pagesizes import A4 pdfmetrics.registerFont(TTFont('MSJH','C:/Windows/Fonts/msjh.ttc',subfontIndex=0));pdfmetrics.registerFont(TTFont('MSJH-B','C:/Windows/Fonts/msjhbd.ttc',subfontIndex=0)) styles=getSampleStyleSheet();styles.add(ParagraphStyle(name='BodyX',fontName='MSJH',fontSize=9,leading=14,spaceAfter=8,wordWrap='CJK'));styles.add(ParagraphStyle(name='TitleX',fontName='MSJH-B',fontSize=24,leading=31,textColor=colors.HexColor('#123f47'),spaceAfter=18));styles.add(ParagraphStyle(name='HeadX',fontName='MSJH-B',fontSize=15,leading=21,textColor=colors.HexColor('#123f47'),spaceAfter=10));styles.add(ParagraphStyle(name='SmallX',fontName='MSJH',fontSize=7.3,leading=10,spaceAfter=5,wordWrap='CJK'));styles.add(ParagraphStyle(name='CellX',fontName='MSJH',fontSize=7.1,leading=10,wordWrap='CJK')) W=A4[0]-84 def par(s,style='BodyX'):return Paragraph(html.escape(str(s)).replace('\n','
'),styles[style]) def table(rows,widths=None): data=[[par(c,'CellX') for c in row] for row in rows];t=Table(data,colWidths=widths or [W/len(rows[0])]*len(rows[0]),repeatRows=1,hAlign='LEFT');t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),colors.HexColor('#d9eeeb')),('VALIGN',(0,0),(-1,-1),'TOP'),('BOTTOMPADDING',(0,0),(-1,-1),7),('TOPPADDING',(0,0),(-1,-1),7),('LINEBELOW',(0,0),(-1,0),.6,colors.HexColor('#2d7374')),('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white,colors.HexColor('#f4f7f7')]) ]));return t def header(c,d): c.setFont('MSJH',8);c.setFillColor(colors.HexColor('#45656a'));c.drawString(42,A4[1]-28,'VPN TEST | INSTALLED WINDOWS CLIENT | 2026-11-17');c.drawRightString(A4[0]-42,25,str(d.page));c.line(42,A4[1]-34,A4[0]-42,A4[1]-34) def report(zh=False): story=[];texts=[] def add(s,style='BodyX'):story.append(par(s,style));texts.append(s) def h(en,z):add(z if zh else en,'HeadX') def p(en,z):add(z if zh else en) def page():story.append(PageBreak()) title='星連VPN Windows 實機安全與性能測試' if zh else 'SingLink VPN Windows\nLive Security and Performance Assessment' add(title,'TitleX');add('2.6.2+3162 | Hong Kong Beta Max / Sola Max / 2.0 Max','HeadX') p('Assessment date: 17 November 2026, UTC+08:00. New installed-client evidence only. Open-source protocol/prototype audits are separate deliverables.','測試日期:2026 年 11 月 17 日,UTC+08:00。本報告使用新採集的已安裝客戶端證據;開源協議及原型軟體審計另行交付。') h('Decision: remediation required before a fail-closed claim','結論:宣稱異常斷線保護前須先修復') p('A controlled singcore.exe crash caused successful HTTPS requests to return through the disconnected baseline in all three Hong Kong protocol profiles. This contradicts fail-closed behavior for the tested crash condition. The baseline itself is behind an upstream router VPN; physical ISP exposure was not established.','香港三種協議設定在受控 singcore.exe 核心崩潰測試中,均有 HTTPS 請求成功回退至未連線基準出口。就此次核心崩潰情境,未達流量封鎖預期。基準本身經過上游路由器 VPN,未證實暴露實體寬帶出口。') p('Normal-session WebRTC tests reported No Leak for the three Hong Kong profiles. DNS showed a mixed resolver set that overlapped the baseline. Neither finding supports an unqualified overall security pass.','香港三種設定的正常連線 WebRTC 均顯示 No Leak。DNS 出現與基準重疊的混合解析器。這些結果不能支持不附條件的整體安全通過。') story.append(table([['Hong Kong profile','Successful down median Mbps','Upload median Mbps','Download completions'],*[ [s['condition'].replace('Hong Kong ',''),num(s['download_median_mbps']),num(s['upload_median_mbps']),f"{s['download_successes']}/{s['runs']}"] for s in summaries if s['label'].startswith('hongkong') ]],[183,109,109,W-401])) p('Only completed transfers contribute to throughput medians. Initial Beta downloads had two 40-second timeouts; the later repeat is shown separately. Numbers are supplemental HTTPS measurements, not a fixed-server line-capacity benchmark.','僅完整傳輸計入吞吐中位數。Beta 初測有兩次 40 秒逾時;後續複測另列。數值為補充性 HTTPS 測量,並非固定伺服器的線路容量測速。') p('Commissioned testing of a user-supplied paid account; the user states it was self-funded. No payment receipt was inspected. This is a bounded assessment, not a certification or an independent server-side no-logs audit.','本次為使用者委託、使用者提供的付費帳號測試;使用者表示自行付費,未查驗付款憑證。這是限定範圍的實測評估,並非認證或獨立伺服器無日誌審計。') page();h('1. Subject, environment and measurement method','1. 對象、環境與測試方法') p('Installed application: SingLinkVPN.exe, version 2.6.2+3162, on Windows 11 Pro build 26200. Intel Core i7-12700H, 14 cores / 20 logical CPUs, approximately 63.8 GiB visible RAM. WLAN link rate shown by Windows was 2.2 Gbps; this is not measured internet throughput.','對象為已安裝 SingLinkVPN.exe,版本 2.6.2+3162;Windows 11 Pro build 26200,i7-12700H,14 核心/20 邏輯處理器,可見記憶體約 63.8 GiB。Windows 顯示 Wi-Fi 連線速率 2.2 Gbps,這不是網際網路實測吞吐。') p('Safe Mode was already selected. Network Adapter Mode was on, IPv6 toggle off, Smart on. These security-related options were not changed. The account UI showed Max, infinite expiry and 15.97 GB remaining out of 100 GB at the start; infinite expiry does not establish unlimited data.','原設定已選 Safe Mode,Network Adapter Mode 開啟、IPv6 選項關閉、Smart 開啟;未變更這些安全設定。開始時帳號顯示 Max、到期日無限、剩餘 15.97 GB/100 GB;到期日無限不等於流量無限。') p('The user locates the computer in Taiwan and confirms the Wi-Fi router already uses another VPN. The router was not changed. Before/after disconnected baselines therefore measure the upstream VPN path, not a bare physical-ISP connection. Other VPN adapters were present but reported disconnected in the inventory.','使用者確認電腦在台灣,且 Wi-Fi 路由器另有 VPN,測試未修改路由器。前後未連線基準代表上游 VPN 路徑,不能當作無 VPN 的實體 ISP 基準。系統另有 VPN 網卡,盤點時顯示未連線。') p('For each performance condition: three runs, exact 50,000,000-byte HTTPS download and 10,000,000-byte synthetic random upload to speed.cloudflare.com; five fresh zero-payload requests per run for HTTP time to first byte (TTFB). curl certificate validation remained enabled. A 40-second operation limit applies to each request.','每個性能情境測三輪:向 speed.cloudflare.com 下載 50,000,000 bytes、上傳 10,000,000 bytes 自產隨機資料;每輪五次零負載新連線計算 HTTP 首位元組時間 TTFB。保留 curl 憑證驗證,每個請求上限 40 秒。') p('The desktop client was connected through its UI. Cloudflare trace before and after each run supplied independent host-observed exit/country/colo evidence. --noproxy * disables an explicit HTTP proxy; it does not bypass the Windows TUN route. HTTP TTFB is not ICMP RTT, jitter, or Speedtest latency.','透過桌面客戶端介面實際連線;每輪前後的 Cloudflare trace 提供本機觀測的出口、國別及機房代碼。--noproxy * 僅停用明確指定的 HTTP 代理,不會繞過 Windows TUN 路由。HTTP TTFB 不能稱為 ICMP RTT、抖動或 Speedtest 延遲。') p('Cloudflare is anycast; the destination colo changes across routes. No fixed-server Ookla speed run was used in this report. Results must not be converted into formal retention percentages or generalized to protocol design quality.','Cloudflare 使用 anycast,機房可能隨路由改變。本報告未採用固定伺服器的 Ookla 測速,不把結果換算成正式速度保留率,也不由單點性能推論協議設計優劣。') p('The reference test specification was treated as a reference, not as authority to extend actions. This accelerated single-Windows run does not claim multi-platform coverage, a full-session video, a one-hour soak, streaming/P2P coverage, or a complete cryptographic review.','提供的測試規範作為參考文件,不當作擴大操作授權。本次加速單台 Windows 實測不宣稱涵蓋多平台、全程錄影、一小時耐久、串流/P2P,或完整密碼學審計。') page();h('2. Performance and reliability','2. 性能與可靠性') story.append(table([['Condition','Down Mbps','Up Mbps','HTTP TTFB ms','Down OK'],*[[s['condition'],num(s['download_median_mbps']),num(s['upload_median_mbps']),num(s['ttfb_median_of_run_medians_ms']),f"{s['download_successes']}/{s['runs']}"] for s in summaries]],[215,75,75,80,W-445])) p('The initial Hong Kong Beta Max downloads timed out after receiving 14,318,060 and 2,670,583 of 50,000,000 bytes. Only the third completed (32.816 Mbps). Its upload runs were 2.908, 4.532 and 85.389 Mbps. All five-request TTFB groups completed, so latency success did not imply sustained-transfer success.','香港 Beta Max 初測兩次下載分別只收到 14,318,060、2,670,583/50,000,000 bytes 就逾時;只有第三次完成(32.816 Mbps)。三次上傳為 2.908、4.532、85.389 Mbps。各組五次 TTFB 請求均成功,顯示小請求成功不代表長傳輸成功。') p('The verified repeat used the same Hong Kong Beta Max exit as the initial test and completed all three downloads. Preserve both sessions: the repeat does not erase initial failures. Time, network load, upstream VPN and destination behavior remain possible confounders; root cause was not isolated.','核對後的 Beta Max 複測使用與初測相同的香港出口,三次下載均完成。兩組資料都保留,複測不能抹去初測失敗;時間、負載、上游 VPN 和目的端行為均可能影響,尚未隔離根因。') p('Japan and Singapore Beta were measured earlier in the same live session and are supplemental regional observations. The English client screenshots for those nodes were genuinely retaken at about 06:28, after their original throughput runs; they are not presented as contemporaneous performance captures.','日本、新加坡 Beta 為同一實機測試較早的區域補充數據。兩地英文客戶端畫面約於 06:28 真實重連補拍,晚於原性能測試,不冒充原測速當下的畫面。') p('The initial Japan built-in network tool reported Apple 59 ms and Google 57 ms. This was app-reported, was captured in the original language, and is not used as an independent latency result in the English evidence set.','日本初測的內建網路工具顯示 Apple 59 ms、Google 57 ms。這屬客戶端自報、原語言截圖,不作為英文證據組的獨立延遲結果。') h('Resource observation during throughput windows','吞吐測試期間資源觀測') story.append(table([['Condition','Samples','Mean host CPU %','Median / peak RSS MiB'],*[[x['condition'],x['samples_during_throughput_window'],num(x['mean_cpu_percent_of_20_logical_cpus']),num(x['median_sum_process_rss_MiB'])+' / '+num(x['peak_sum_process_rss_MiB'])] for x in resources]],[215,55,105,W-375])) p('CPU uses consecutive process-CPU counter deltas divided by elapsed time and 20 logical CPUs. RSS is the sum of the four processes and can double-count shared pages. Very short windows have few samples. Japan throughput preceded resource sampling and has no comparable load result.','CPU 由相鄰程序累計 CPU 秒數差值除以實際時間,再按 20 邏輯處理器正規化。RSS 為四程序工作集相加,可能重複計入共享頁;短窗口樣本少。日本測速早於資源採樣,沒有可比負載數據。') page();h('3. Every retained performance round','3. 保留的每一輪性能數據') story.append(table([['Condition / run','Local time +08','Down Mbps','Up Mbps','TTFB ms'],*[[x['condition']+f" / {x['run']}",x['at'][11:23],num(x['download_mbps']),num(x['upload_mbps']),num(x['http_ttfb_median_ms'])] for x in rounds]],[224,80,65,65,W-434])) add('A dash is an incomplete transfer, not zero speed. Source: data/rounds.csv and per-condition JSON. Byte counts, return codes and HTTP status are retained.','SmallX') page();h('4. DNS, WebRTC and IPv6','4. DNS、WebRTC 與 IPv6') story.append(table([['Condition','Resolvers','Provider counts','Exact baseline overlap','WebRTC'],*[[x['condition'],x['resolver_count'],'; '.join(f'{k}: {v}' for k,v in x['isp_counts'].items()),x['exact_overlap_with_baseline'],'No Leak*' if x['webrtc_no_leak_label'] else 'See data'] for x in dns]],[135,45,180,80,W-440])) p('DNS used the browser Extended test (six rounds). The new disconnected baseline is collected after the connected tests. Exact resolver overlap is calculated from the original addresses before redaction. Provider/city strings are the test site database labels, not independently proved operator ownership or physical location.','DNS 使用瀏覽器 Extended test 六輪,連線測試後重新建立未連線基準。地址遮蔽前以原始值計算解析器精確重疊;業者/城市為測試網站資料庫標籤,未獨立證實實際營運者或物理位置。') p('The connected Hong Kong profiles retained PacketHub resolvers also seen on the baseline, alongside Eons Data Communications (Beta/Sola) or Google (2.0). This establishes baseline-overlapping DNS resolution, not an all-clear result. Because the upstream router VPN remained active, the capture did not isolate host DNS routing, browser DNS behavior, upstream resolver forwarding or the physical ISP.','香港連線設定仍見到基準中的 PacketHub 解析器,同時有 Eons Data Communications(Beta/Sola)或 Google(2.0)。可確認 DNS 與基準重疊,不能判定完全通過;因上游路由器 VPN 仍開啟,未隔離本機 DNS 路由、瀏覽器 DNS、上游轉送及實體 ISP 的影響。') p('* BrowserLeaks reported No Leak in each observed normal-session test; public STUN and HTTP addresses matched in the visible result. Hong Kong pages did not expose a literal LAN address. Singapore used an mDNS local candidate. This is a test of this browser/configuration, not proof for every application or all UDP traffic. The disconnected baseline also says No Leak, illustrating why the website label alone is insufficient.','* BrowserLeaks 正常連線測試均標示 No Leak,當時頁面可見的公網 STUN 與 HTTP 地址相符。香港頁面未顯示明文 LAN 地址,新加坡使用 mDNS 本機候選。這只驗證此瀏覽器及設定,不能代表所有應用或全部 UDP。未連線基準亦標示 No Leak,說明不能只依網站標籤判斷 VPN 是否安全。') p('The IPv6 feature was off. Forced curl --ipv6 requests to api6.ipify.org and Cloudflare trace returned code 6 on all three Hong Kong profiles: no usable IPv6 destination was resolved in this configuration. BrowserLeaks showed no public IPv6 address there. A missing native IPv6 path limits leak-test coverage and is not proof that an enabled dual-stack deployment is safe.','IPv6 功能原為關閉。三種香港設定強制 curl --ipv6 請求 api6.ipify.org 及 Cloudflare trace 均回傳代碼 6,該設定無可用 IPv6 目的地址解析,BrowserLeaks 亦未顯示公網 IPv6。缺少原生 IPv6 路徑限制了驗證能力,不能證明開啟雙棧後仍安全。') p('Singapore api6 returned an IPv6-formatted reported address over a curl connection whose remote socket address was IPv4. This is not treated as proof of native host IPv6 transport or an IPv6 leak. No microphone, camera or location permissions were granted.','新加坡 api6 經 curl 遠端 socket 為 IPv4 的連線回傳 IPv6 格式地址,不能據此當作原生本機 IPv6 傳輸或 IPv6 洩漏。未授予麥克風、攝影機或定位權限。') page();h('5. High-priority finding: crash-time fallback','5. 優先問題:核心崩潰時流量回退') p('Finding LC-01 | High, analyst-assigned; no CVSS score claimed. Preconditions: installed 2.6.2+3162, Safe Mode, Network Adapter Mode on, one selected Hong Kong profile, existing upstream router VPN. Action: terminate only the verified C:\\Program Files\\SingLinkVPN\\singcore.exe process, without manually disconnecting first.','問題 LC-01|分析者評定高優先級,未宣稱 CVSS 分數。前提:2.6.2+3162、Safe Mode、Network Adapter Mode 開啟、選取香港協議設定、上游路由器 VPN 存在。操作:先不手動斷開,僅結束已核對路徑 C:\\Program Files\\SingLinkVPN\\singcore.exe 的核心程序。') p('An independent curl Cloudflare trace ran approximately once per second with a 3-second timeout. The baseline address was compared exactly. Successful post-stop requests used that same baseline address in all three profiles. The failure is loss of the local VPN boundary under this specific crash, even though the upstream VPN still masks the physical ISP.','獨立 curl Cloudflare trace 約每秒一次,每請求上限 3 秒;使用原始地址精確比對基準。三種設定均在停止核心後成功經相同基準地址出站。問題是此次核心崩潰時本機 VPN 邊界失效,儘管上游 VPN 仍遮蔽實體 ISP。') story.append(table([['Profile','Stop time +08','First fallback request','Fallback samples','Observed span s'],*[[x['condition'],x['action_at'][11:23],x['first_fallback_request_at'][11:23] if x['first_fallback_request_at'] else '-',x['fallback_successful_http_samples'],num(x['observed_fallback_span_s'])] for x in faults]],[140,95,110,80,W-425])) p('These are request start times and finite sampled spans, not packet-level leak latency or a continuous all-traffic duration. In-flight requests, scheduler timing and sampling gaps limit precision. All profiles were recovered via the normal client control and a Hong Kong exit was observed again.','表中為請求起始時間及有限採樣跨度,不是封包級洩漏延遲,也不是全部流量連續暴露時長;在途請求、排程及採樣空隙限制精度。三種設定都已透過正常客戶端控制恢復,並再次觀察香港出口。') p('During Sola/2.0 crash observation, screenshots still displayed Connected with Detecting in the top status; Beta eventually showed Not connected. The exact UI transition duration was not continuously recorded. A manual end-of-test disconnect is a separate action and is not counted as a kill-switch failure.','Sola/2.0 故障觀察截圖仍顯示 Connected,頂部為 Detecting;Beta 後來顯示 Not connected。未連續錄影取得完整介面轉換時間。測試結尾的手動斷開另行記錄,不算入斷網保護失敗。') p('Recommended fix: maintain traffic blocking independently of the core process lifetime; gate user-traffic routes until authenticated tunnel readiness; keep UI protection state aligned with actual route availability. Retest core crash, helper failure, sleep/resume, Wi-Fi changes and node switching using fresh TCP, UDP, DNS and IPv6 canaries on an isolated non-VPN upstream. No firewall or product-code modifications were made in this assessment.','建議:讓流量封鎖獨立於核心程序生命週期,經驗證隧道就緒後才放行使用者路由,並同步介面保護狀態與實際路由。修復後在無上游 VPN 的隔離網路,以新 TCP、UDP、DNS、IPv6 測試流量複測核心崩潰、輔助服務故障、睡眠喚醒、Wi-Fi 切換及節點切換。本次未修改防火牆或產品程式。') page();h('6. Installed binary and local surface checks','6. 已安裝程式與本機介面檢查') story.append(table([['Executable','Authenticode','SHA-256'],*[[x['name'],x['signature_status'],x['sha256']] for x in security['executables']]],[125,85,W-210])) p('Windows Authenticode returned Valid for all four running executables with publisher SingLink LLC. This validates the observed signatures under current Windows trust, not software absence of vulnerabilities, source correspondence, update-signature enforcement or dependency integrity.','Windows Authenticode 對四個運行程式均回報 Valid,發行者為 SingLink LLC。這驗證目前 Windows 信任下的觀測簽章,不代表無漏洞、與開源碼一致、更新必定驗章或所有依賴完整可信。') p('The executable-file ACL snapshot showed ReadAndExecute/Synchronize for BUILTIN\\Users, without a write ACE on these four files. Parent directories, DLL search order, service IPC authentication, named pipes and privilege escalation were not exhaustively tested.','四個執行檔的 ACL 快照中,BUILTIN\\Users 為 ReadAndExecute/Synchronize,未見寫入 ACE。未全面測試父目錄、DLL 搜尋順序、服務 IPC 認證、命名管道或提權。') story.append(table([['Protocol','Local binding','Process'],*[['TCP',f"{x['LocalAddress']}:{x['LocalPort']}",str(x['OwningProcess'])] for x in sec['tcp_listen']],*[['UDP',f"{x['LocalAddress']}:{x['LocalPort']}",str(x['OwningProcess'])] for x in sec['udp']]],[65,330,W-395])) p('No wildcard TCP/UDP listener was observed in the selected process snapshot. Bindings were loopback or tunnel-local addresses. This local snapshot does not prove that another host cannot reach a service; no external reachability scan or authentication exploit was performed. PID values refer to the snapshot and change when a core restarts.','該程序快照未見 TCP/UDP wildcard 監聽;地址為 loopback 或隧道本機地址。單台快照不能證明其他主機一定不可達,未進行外部可達性掃描或認證漏洞利用。PID 對應快照,核心重啟後會改變。') page();h('7. Assurance boundaries, evidence and next steps','7. 驗證邊界、證據與後續處理') p('The UI labels Beta, Sola and 2.0 identify selected product profiles. No deployed outer-tunnel handshake/cipher was independently decoded. End-to-end HTTPS certificate/TLS metadata describes the destination HTTPS connection and cannot establish the VPN outer cipher. The Japan AES-256 upgrade described by the user is recorded as a user statement, not downgraded to AES-128 and not falsely marked independently verified.','Beta、Sola、2.0 為實際選取的產品設定標籤。未獨立解析部署中隧道外層握手/加密套件;目的站 HTTPS 憑證及 TLS 資料不能證明 VPN 外層演算法。使用者表示日本已升級 AES-256,記為使用者說明,不誤寫為 AES-128,也不冒稱已獨立驗證。') p('No packet capture or decryption was performed in this new live run. No interception certificate was installed. Therefore this run does not establish outer-tunnel plaintext absence, replay resistance, forward secrecy, handshake authentication, server logging behavior or a no-logs policy. A source audit is not substituted for those deployment checks.','本次新實機測試未抓包或解密,未安裝攔截憑證。因此不能由本次資料證明隧道外層無明文、抗重放、前向保密、握手認證、伺服器記錄內容或無日誌政策;也不以開源碼審計替代部署驗證。') p('Coverage completed: real UI connection and host exit checks, three-run throughput, short HTTP probes, six-round browser DNS for Hong Kong, browser WebRTC, forced-IPv6 checks under IPv6-off configuration, controlled core-crash fallback/recovery, executable signatures/ACLs, local listeners and sampled resources. No clean bill of health is issued.','已完成:真實介面連線與本機出口核對、三輪吞吐、短 HTTP 請求、香港六輪瀏覽器 DNS、WebRTC、IPv6 關閉設定下的強制 IPv6 檢查、受控核心崩潰回退與恢復、執行檔簽章/ACL、本機監聽與資源採樣。不出具整體安全無問題結論。') p('Still needed for broader assurance: isolated dual-stack upstream; packet-scoped canaries without collecting unrelated applications; binary-to-source provenance; deployed protocol cryptographic audit/fuzzing; update/rollback and IPC attack tests; server-side configuration, access controls and logging review; longer stability and cross-platform tests. These are explicitly untested, not passed.','要擴大安全保證,仍需:隔離雙棧上游、能排除其他程式流量的限定封包測試、二進位與原始碼溯源、部署協議密碼學審計/模糊測試、更新回滾與 IPC 攻擊面、伺服器設定/權限/記錄審查、較長穩定性及跨平台測試。這些明列未測,並非通過。') p('Evidence: data/rounds.csv; per-condition JSON; dns_webrtc.json; fault_summary.json and timestamped watch samples; installed_security.json; resource_summary.json; English client crops with original-image hashes; raw_source_hashes.csv. Methods are included. Full originals remain local and are not in the share ZIP.','證據:data/rounds.csv、逐情境 JSON、dns_webrtc.json、fault_summary.json 及逐筆時間戳觀測、installed_security.json、resource_summary.json、附原圖雜湊的英文客戶端裁切圖、raw_source_hashes.csv;另附方法程式。完整原始資料保留本機,不納入分享 ZIP。') p('Privacy processing is explicit: account/avatar/IP header cropped from client screenshots; exit and resolver identifiers pseudonymized in shared structured data; original source hashes retained. Screenshots are not machine-translated or synthesized. A mistakenly selected non-target node attempt was quarantined locally and excluded from Hong Kong metrics.','隱私處理明確標示:客戶端截圖裁去帳號/頭像/IP 頂欄,分享結構資料使用出口及解析器代號,保留原始來源雜湊。截圖未機器改字或生成。一次誤選非目標節點的資料保留在本機隔離區,不計入香港數據。') p('The client was left manually disconnected at the end, matching its initial connection state; Safe Mode and existing security settings were retained. Only synthetic transfer data and ordinary test requests were sent to the named measurement services; no account credentials or collected evidence were uploaded to those services.','結尾客戶端手動保持未連線,與初始連線狀態相符;保留 Safe Mode 和原安全設定。僅向上述測試服務送出自產傳輸資料及一般測試請求,未上傳帳號憑證或採集的證據。') for i in range(0,len(gallery),4): page();add('English screenshot evidence / genuine UI crops','HeadX');add('Account/IP header omitted. Original SHA-256 and capture time: evidence/*.json. English Japan/Singapore images are later retakes.','SmallX') for j in [i,i+2]: pair=gallery[j:min(j+2,len(gallery))];cells=[] for path,caption,at in pair: im=PILImage.open(path);width=208;cells.append([par(caption,'SmallX'),par(at,'SmallX'),Image(str(path),width=width,height=width*im.height/im.width)]) t=Table([[c for c in cells]],colWidths=[W/2]*len(cells));t.setStyle(TableStyle([('VALIGN',(0,0),(-1,-1),'TOP')]));story.append(t);story.append(Spacer(1,12)) for title,images in browser_gallery: page();add('English browser evidence / '+title,'HeadX');add('Original English pages. Gray blocks mask IP fields; metadata records original hashes and crop boxes. DNS address comparison uses the private originals, not the masked image.','SmallX') for name,path in zip(['DNS Extended / six rounds','WebRTC / normal-session result'],images): add(name,'SmallX');im=PILImage.open(path);story.append(Image(str(path),width=W-12,height=(W-12)*im.height/im.width));story.append(Spacer(1,10)) folder=O/'reports'/('zh-Hant' if zh else 'en');stem='SingLink_Installed_Client_Assessment_20261117_'+('zh-Hant' if zh else 'EN') doc=SimpleDocTemplate(str(folder/f'{stem}.pdf'),pagesize=A4,rightMargin=42,leftMargin=42,topMargin=48,bottomMargin=42,title=title.replace('\n',' '),author='VPN Test - User-commissioned local assessment');doc.build(story,onFirstPage=header,onLaterPages=header) (folder/f'{stem}.txt').write_text('\n\n'.join(texts),encoding='utf-8') return str(folder/f'{stem}.pdf') paths=[report(False),report(True)] (O/'START_HERE.html').write_text('''SingLink installed client evidence

Installed Windows Client Assessment

17 November 2026 | 2.6.2+3162 | Real host measurements | Separate from source audits.

Remediation required: all three Hong Kong protocol profiles fell back to the disconnected baseline during controlled core crashes. This is a bounded finding; upstream router VPN remained active.

This share folder omits full IPs, account header, unredacted originals and source audits. Original local evidence is in the parent test directory. Evidence images and data use English.

''',encoding='utf-8') (O/'README_PRIVACY_AND_SCOPE.txt').write_text(facts['privacy']+'\nThis is an installed-product live assessment. No source-code audit results were reused as live measurements.\nSee data/raw_source_hashes.csv for original evidence references.\nFull raw originals: sibling private-raw and original evidence folders on the owner PC only.\n',encoding='utf-8') manifest=''.join(f'{sha(p)} {p.relative_to(O).as_posix()}\n' for p in sorted(O.rglob('*')) if p.is_file() and p.name!='SHA256SUMS.txt');(O/'SHA256SUMS.txt').write_text(manifest,encoding='utf-8') print(json.dumps({'pdfs':paths,'summaries':summaries,'dns':[{k:x[k] for k in ['condition','resolver_count','isp_counts','exact_overlap_with_baseline']} for x in dns],'faults':faults,'resources':resources},ensure_ascii=False,indent=2))