Ivan Christian
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # HW 8 SS # 1 ### Brief step to installing Tor: - `sudo apt install tor` # to install tor - ![](https://i.imgur.com/syJQhaF.png) Change some configuration - `sudo systemctl restart tor` to apply changes and restart service - ![](https://i.imgur.com/hJt6uKm.png) to make sure that our installation is working as expected. - `pip3 install pysocks requests` ### Wireshark #### Normal ![](https://i.imgur.com/K7PlVIo.png) ![](https://i.imgur.com/atKJLmL.png) #### Torified ![](https://i.imgur.com/jZUorgE.png) ![](https://i.imgur.com/0Vi5MKp.png) ![](https://i.imgur.com/R48bZmX.png) Torified request has a lot of jumps ### Analysis Save request time and get the mean, median, max, min time in microseconds for both otrified and normal request. ```python import os import sys import datetime from subprocess import Popen, PIPE import pandas as pd from pprint import pprint import matplotlib.pyplot as plt def get_without_tor(sites): f2 = open("Without_TOR_RESULT.txt", "w+") dataset = {} # dataset.update({'domain': []}) for domain in sites: dataset[domain] = [] for i in range(1,31): current_milli_time = datetime.datetime.now() result = Popen(["wget","--timeout=10","-t","1", domain, '-P', 'hw-res/'],stdout = PIPE).communicate()[0] new_milli_time = datetime.datetime.now() timeTaken = new_milli_time - current_milli_time res = f"[ Domain : {domain} ][ Time Take : {str(timeTaken.microseconds)} microseconds ]\n" dataset[domain].append(timeTaken.microseconds) f2.write(f'{res}\n') df = pd.DataFrame.from_dict(dataset) new_df = {domain: {'max': 0, 'min' : 0, 'mean': 0, 'median': 0} for domain in sites} for head, values in dataset.items(): max = df[head].max() min = df[head].min() mean = df[head].mean() median = df[head].median() new_df[head].update({'max': max, 'min' : min, 'mean': mean, 'median': median}) df2 = pd.DataFrame.from_dict(new_df) os.makedirs('hw/normal', exist_ok=True) df2.to_csv('hw/normal/no-tor-statistics.csv') f2.close() def get_with_tor(sites): f2 = open("TOR_RESULT.txt", "w+") dataset = {} # dataset.update({'domain': []}) for domain in sites: dataset[domain] = [] for i in range(1,31): current_milli_time = datetime.datetime.now() result = Popen(["torify", "wget","--timeout=10","-t","1", domain, '-P', 'hw-res/'],stdout = PIPE).communicate()[0] new_milli_time = datetime.datetime.now() timeTaken = new_milli_time - current_milli_time res = f"[ Domain : {domain} ][ Time Take : {str(timeTaken.microseconds)} microseconds ]\n" dataset[domain].append(timeTaken.microseconds) f2.write(f'{res}\n') df = pd.DataFrame.from_dict(dataset) new_df = {domain: {'max': 0, 'min' : 0, 'mean': 0, 'median': 0} for domain in sites} for head, values in dataset.items(): max = df[head].max() min = df[head].min() mean = df[head].mean() median = df[head].median() new_df[head].update({'max': max, 'min' : min, 'mean': mean, 'median': median}) df2 = pd.DataFrame.from_dict(new_df) os.makedirs('hw/tor', exist_ok=True) df2.to_csv('hw/tor/tor-statistics.csv') f2.close() def main(): with open("top-20.txt", 'r') as f: sites = [line.strip() for line in f.readlines()] # get_with_tor(sites) # get_without_tor(sites) df_normal = pd.read_csv('hw/normal/no-tor-statistics.csv') df_tor = pd.read_csv('hw/tor/tor-statistics.csv') df_normal.plot.bar() plt.xticks( color='orange', rotation=45, fontweight='bold', fontsize='17', horizontalalignment='right') plt.title('Normal Request') plt.xlabel('Max (0), Min (1), Mean (2), Median (3) Timings') plt.ylabel('Normal REquest Time taken in microseconds') plt.show() plt.close() df_tor.plot.bar() plt.xticks( color='orange', rotation=45, fontweight='bold', fontsize='17', horizontalalignment='right') plt.title('Torified Request') plt.xlabel('Max (0), Min (1), Mean (2), Median (3) Timings') plt.ylabel('Torified REquest Time taken in microseconds') plt.show() plt.close() ``` #### Nrmal ![](https://i.imgur.com/JzbYUJt.png) ![](https://i.imgur.com/dFhw0PI.png) #### Torified ![](https://i.imgur.com/GVV1S5N.png) ![](https://i.imgur.com/riZT4q0.png) From the above graphs, we can easily derive that ToR introduces massive latency (and occasional time-outs) as compared to direct wget, so in order to enforce anonymity and privacy using ToR the user has to sacrifice on the performance part of the portal i.e. latency. # 2 Misconfiguration such that the applications use **native** Internet connection to conduct DNS Resolution. This is called a DNS leak where the clients' DNS requests are reveald to the ISP DNS servers, which may be the result of the the result of the ISP forcing policy (ISP forcing is when the ISPs use transparent DNS proxies). This misconfiguration will result win clients' DNS request foing to the ISP DNS servers instead of going through the Tor network. #### Possible Causes of DNS Leak 1. An misconfigured network 2. An ineffective VPN service 3. No Internet Protocol version 6 (IPv6) support: IP addresses were originally 32-bit Internet Protocol version 4 (IPv4) addresses with four sets of three digits. But 128-bit IPv6 addresses have been created to extend the pool of IP addresses and accommodate more devices. The internet is still transitioning, and some VPNs may not support IPv6, which may push a user’s DNS request outside of the encrypted tunnel. 4. Transparent DNS proxies: ISPs may forced customers to use their DNS servers even when they change their settings to a third-party VPN. If the ISP detects DNS setting changes, it uses a transparent proxy that forces a DNS leak by redirecting the user’s web activity to its own DNS servers. 5. Windows smart features: Microsoft introduced a feature known as Smart Multi-Homed Name Resolution (SMHNR) in devices using operating systems from Windows 8 onwards. The feature submits DNS requests to available servers and accepts whichever DNS server responds first. This can cause a DNS leak and leave users open to spoofing attacks This introduces the following privacy and anonymity risks introduced by misconfiguration of ToR: ### DNS Resolution: As the DNS resolution is still performed by the native network, it still provides information about which website the user is trying to contact hence giving out information about the requestor’s IP and destination portal FQDN and IP. ### Tor Exit Node Eavesdropping Exit nodes are the point in the network where an encrypted communication leaves the network for the target server. Attackers identifying nodes can then monitor the traffic and inject malicious code in presumably safe, encrypted transmissions. ### Circuit Fingerprinting Attacks: Passive Deanonymization The attacker sends crafted signals to speed up discovery of entry guards, which are first-hop routers on circuits, or use congestion attacks to bias entry guard selection towards colluding entry guards. Furthermore, all previous attacks require a malicious client to continuously attempt to connect to the hidden service. ### "Relay Early" traffic confirmation attack A traffic confirmation attack is possible when the attacker controls or observes the relays on both ends of a Tor circuit and then compares traffic timing, volume, or other characteristics to conclude that the two relays are indeed on the same circuit. If the first relay in the circuit (called the "entry guard") knows the IP address of the user, and the last relay in the circuit knows the resource or destination he/she is accessing, then together they can deanonymize him/her. ### Mouse fingerprinting: The way you move your mouse while lazily browsing the internet could be unique enough to be used to track you and even to identify and unmask you. In March 2016 a security researcher based in Barcelona, demonstrated laboratory techniques using time measurement via JavaScript at the 1-millisecond level could potentially identify and correlate a user's unique mouse movements provided the user has visited the same "fingerprinting" website with both the Tor browser and a regular browser. This proof of concept exploits the "time measurement via JavaScript" issue which has been an open ticket on the Tor Project for ten months. ### Traffic Analysis Attack Although the sender and messaging information propagated through the network is encrypted, there are ways to use what’s called “timing analysis” to monitor traffic, anticipate it flows through the network, and break the anonymity of the chain as it reaches an exit node. ### Bad apple attack The "bad apple attack" exploits Tor's design and takes advantage of insecure application use to associate the simultaneous use of a secure application with the IP address of the Tor user in question. One method of attack depends on control of an exit node or hijacking tracker responses, while a secondary attack method is based in part on the statistical exploitation of distributed hash table tracking. The results presented in the bad apple attack research paper are based on an attack launched against the Tor network by the authors of the study. The attack targeted six exit nodes, lasted for twenty-three days, and revealed a total of 10,000 IP addresses of active Tor users. This study is significant because it is the first documented attack designed to target P2P file-sharing applications on Tor. # 3 ## Opera GX ### Normal ![](https://i.imgur.com/tbNI0a7.png) ![](https://i.imgur.com/sZbJTn2.png) ### Incognito ![](https://i.imgur.com/7vyJB13.png) ![](https://i.imgur.com/hKUS8dR.png) ## Edge ### Normal ![](https://i.imgur.com/F6CKkcM.png) ### Incognito ![](https://i.imgur.com/sCtb03q.png) ## Brave ### Normal ![](https://i.imgur.com/OA8M8rb.png) ![](https://i.imgur.com/Hhpz3mN.png) ### Incognito ![](https://i.imgur.com/BysLqVF.png) ![](https://i.imgur.com/CkTMnfJ.png) ## 3.1 The Brave browser appears to be the most secure (it blocks ads and trackers) based on its ad-stripping strategy. Brave strip online ads from its websites. However what it does is the browser replace the stripped advertisements with their advertisements from its own network. These advertisements are not individually targeted but are aimed at an anonymous aggregate of the browser’s user base. Additionally, Brave has an inbuilt extension for incognito with Tor which allows for a more secure way to browse. ## 3.2 ### Enumerate browser bookmarks Adversaries may enumerate browser bookmarks to (a) learn more about compromised hosts (b) get personal information about users ( ex sites visited, social media) (c) details about internal network resources such as servers, tools/dashboards, or other related infrastructure. (d) highlight additional targets after an adversary has access to valid credentials, especially Credentials In Files associated with logins cached by a browser. To protect against browser bookmark enumeration, Brave browser uses Sync Chains to syncs bookmarks, apps, extension, browser history. User data is packed and encrypted through a 24-word seed phrase and the browser does not have access to your synced data at any given point in time. ### Private Browsing Mode With Private Browsing Mode, a temporary session is created. Thus with private browsing modes are designed primarily to prevent data and history associated with a particular browsing session from persisting on the device, or being discovered by another user of the same device. Brave’s Private Browsing with Tor has all the standard private browsing mode features, like no cookie and browser history storage, but in addition it also uses Tor as a web proxy so that your IP address is hidden when browsing the web.   ### Browser Extension and Plugs-in A browser extension is a small software application that adds a capacity or functionality to a web browser. A browser extension, also called a plug-in, can take advantage of the same application program interfaces (APIs) that JavaScript can on a web page, but the extension can do more because it also has access to its own set of APIs. Brave offers support for nearly all extensions that are compatible with chromium. In addition to Brave's compatibility with third party extensions, the browser comes with several extensions already installed such as : (a) Brave wallet (b) WebTorrent (c) Hangouts Implications of these changes Brave business model is different from the many other rival browser: it strips out ads from websites, replaces them with its own ads, then allows users to send money to sites they like. Brave presence has made mainstream browsers adopt various anti-tracking defenses. Thus improving the privacy and awareness of browser behaviour. For better anonymity, a user may also install a tracker blocker for fingerprinting protection. Privacy Badger is a browser extension developed by Electronic Frontier Foundation (EFF) that “stops advertisers and other third-party trackers from secretly tracking” the webpages visited on the browser. However, most of third-party trackers are advertisements. So, a likely implication is that most (but not all) advertisements become blocked when using Privacy Badger. #### References https://attack.mitre.org/techniques/T1217/ https://en.wikipedia.org/wiki/Private_browsing https://support.brave.com/hc/en-us/articles/360035025231-What-extensions-are-built-into-Brave- https://www.computerworld.com/article/3292619/the-brave-browser-basics-what-it-does-how-it-differs-from-rivals.html

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully