<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrea Scarpino</title>
    <description>The latest articles on DEV Community by Andrea Scarpino (@ilpianista).</description>
    <link>https://dev.to/ilpianista</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F638184%2F08982b15-dbdf-4a1a-a571-b6f219b2e5c2.jpeg</url>
      <title>DEV Community: Andrea Scarpino</title>
      <link>https://dev.to/ilpianista</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ilpianista"/>
    <language>en</language>
    <item>
      <title>Sniffing Android apps network traffic</title>
      <dc:creator>Andrea Scarpino</dc:creator>
      <pubDate>Thu, 15 Sep 2022 00:00:00 +0000</pubDate>
      <link>https://dev.to/ilpianista/sniffing-android-apps-network-traffic-10i5</link>
      <guid>https://dev.to/ilpianista/sniffing-android-apps-network-traffic-10i5</guid>
      <description>&lt;p&gt;Back in the days, it was really easy to sniff the network traffic made by the Apps in Android. You could do it in a few minutes by adding mitmproxy’s certificate and setting the HTTP proxy on your wifi network settings. That was it. But things have changed (for good) and that’s no longer the case. However, I still want to sniff the network traffic made by the Apps in Android.&lt;/p&gt;

&lt;p&gt;How? Well, I can no longer use my smartphone to do it, but I can set up the Android emulator, install the application via the Google Play Store and sniff the network traffic it generates on my PC \o/&lt;/p&gt;

&lt;p&gt;Let’s get started. First, install the Android SDK and create an Android virtual device using Android API 30 and x86 architecture (any API and any architecture is fine). However, we need an image without Google Play Store preinstalled as we need a writable &lt;code&gt;/system&lt;/code&gt; folder to inject mitmproxy’s certificate later. That’s okay, because we’ll install the Play Store manually.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo no | ./Android/Sdk/tools/bin/avdmanager create avd -n Pixel_5_API_30 --abi google_apis/x86 --package 'system-images;android-30;google_apis;x86'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the virtual device with the additional &lt;code&gt;-writable-system&lt;/code&gt; flag which permits us to make &lt;code&gt;/system&lt;/code&gt; writable. I also have to unset &lt;code&gt;QT_QPA_PLATFORM=&lt;/code&gt;because I’m on wayland and the emulator doesn’t support it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;QT_QPA_PLATFORM= ./Android/Sdk/emulator/emulator @Pixel_5_API_30 -writable-system

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let’s download the &lt;a href="https://opengapps.org/"&gt;OpenGAPPs&lt;/a&gt; that match our API and architecture. Select the &lt;code&gt;pico&lt;/code&gt; variant because we don’t need anything else, just the Play Store.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -OL 'https://master.dl.sourceforge.net/project/opengapps/x86/20220503/open_gapps-x86-11.0-pico-20220503.zip'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ve to decompress it in order to get and push &lt;code&gt;Phonesky.apk&lt;/code&gt; to the virtual device. We also need to whitelist its permissions (thank you to the &lt;a href="https://github.com/FriendlyNeighborhoodShane/MinMicroG"&gt;MinMicroG&lt;/a&gt;guys).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;unzip open_gapps-x86-11.0-pico-20220503.zip
lzip -d Core/vending-x86.tar.lz
tar xf vending-x86.tar
adb root
adb shell avbctl disable-verification # adb disable-verity makes the emulator crash
adb reboot
adb wait-for-device
adb root
adb remount
adb push vending-x86/nodpi/priv-app/Phonesky/Phonesky.apk /system/priv-app/
curl -O https://raw.githubusercontent.com/FriendlyNeighborhoodShane/MinMicroG/master/res/system/etc/permissions/com.android.vending.xml
adb push com.android.vending.xml /system/etc/permissions/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, create a dedicated user to run mitmproxy as it’s written in the &lt;a href="https://docs.mitmproxy.org/stable/howto-transparent/#work-around-to-redirect-traffic-originating-from-the-machine-itself"&gt;documentation&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo useradd --create-home mitmproxyuser
sudo iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitmproxyuser --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitmproxyuser --dport 443 -j REDIRECT --to-port 8080
sudo -u mitmproxyuser -H bash -c 'mitmproxy --mode transparent --showhost --set block_global=false'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mandatory copy’n’paste from the mitmproxy documentation page: &amp;gt; Note, as soon as you add the iptables rules, you won’t be able to perform successful network calls until you start mitmproxy.&lt;/p&gt;

&lt;p&gt;At this point we are almost there, we just need another step to add the mitmproxy certificate as it’s written in the &lt;a href="https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/#3-insert-certificate-into-system-certificate-store"&gt;documentation page&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hashed_name=`sudo openssl x509 -inform PEM -subject_hash_old -in ~mitmproxyuser/.mitmproxy/mitmproxy-ca-cert.cer | head -1`
sudo adb push ~mitmproxyuser/.mitmproxy/mitmproxy-ca-cert.cer /system/etc/security/cacerts/$hashed_name.0
adb shell chmod 664 /system/etc/security/cacerts/$hashed_name.0
adb reboot

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now have the Play Store, login with your Google account and install the App you need.&lt;/p&gt;

&lt;p&gt;That’s it! Happy sniffing!&lt;/p&gt;

</description>
      <category>android</category>
      <category>howto</category>
    </item>
    <item>
      <title>I went out for dinner and I took some endpoint</title>
      <dc:creator>Andrea Scarpino</dc:creator>
      <pubDate>Fri, 25 Feb 2022 00:00:00 +0000</pubDate>
      <link>https://dev.to/ilpianista/i-went-out-for-dinner-and-i-took-some-endpoint-3mph</link>
      <guid>https://dev.to/ilpianista/i-went-out-for-dinner-and-i-took-some-endpoint-3mph</guid>
      <description>&lt;p&gt;Three weeks ago I went out to a pub for dinner. Due to covid restrictions there are no paper menus anymore and the waitress gave me a card to place my order.&lt;/p&gt;

&lt;p&gt;The card she gave me had a QR code and a 5-digit number. I scanned the QR code and opened the website it pointed to. To login I used that 5-digit number. I placed my order. So far so good.&lt;/p&gt;

&lt;p&gt;When suddenly a hamburger button caught my attention. I pressed it, but mostly I clicked on the first item in the menu because, judging by its text, it seemed “nice” to have a look at the order I had just placed:&lt;/p&gt;

&lt;p&gt;&lt;a href="///images/order_hamburger_button.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sU0tB-mp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/order_hamburger_button_thumb.jpg" alt="Hamburger button" width="708" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="///images/order_history.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JCdO1B5b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/order_history_thumb.jpg" alt="Order history" width="360" height="731"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Uh?! 4751€?! Definitely not me! To my surprice that page listed many orders, not just mine, and they were also old. That’s interesting.&lt;/p&gt;

&lt;p&gt;Once back home, I wanted to understand it more. I opened the website in my browser, but I failed to login because my 5-digit number “expired”, then I gave it a few tries by increasing it and it worked :-)&lt;/p&gt;

&lt;p&gt;I took a look at the JavaScript files to find the one that makes the request to retrieve the orders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$.ajax({
  type: "POST",
  url: '/include/ajax.php?f=getlist&amp;amp;t=orders',
  data: {
    src:[
      {
        name:"self_cart_id",
        value:app.table_id,
        compare:"equal"
      }
    ],
    orderby: "id DESC"
  }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s do the same request, changing the &lt;code&gt;value&lt;/code&gt; (&lt;code&gt;app.table_id&lt;/code&gt;) parameter and see what happens:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl 'https://$HOST/include/ajax.php?f=getlist&amp;amp;t=orders' -X POST --data-raw "src%5B0%5D%5Bname%5D=self_cart_id&amp;amp;src%5B0%5D%5Bvalue%5D=1&amp;amp;src%5B0%5D%5Bcompare%5D=equal&amp;amp;orderby=id+DESC"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I got fewer orders. Then I increase the &lt;code&gt;table_id&lt;/code&gt; and I got even less orders. Mmm, I take a second look at the parameters and then I realize that’s a query statement! At this point I played a bit with the parameters until I removed the &lt;code&gt;value&lt;/code&gt; parameter completly. Well, now I got 347752 orders and they are even paginated:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"success": 1,
"pag": "1",
"per_pag": 500,
"total_records": 347752,
"total_pages": 696,

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fortunately, there was no sensitive information. I got all the orders made in the last ~2 years from all the pubs scattered around italy (the pub is part of a franchising), but nothing sensitive.&lt;/p&gt;

&lt;p&gt;Back to the JavaScript file, there were few interesting calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    url: '/include/ajax.php?f=get&amp;amp;t=customers&amp;amp;id='+app.customer_id,
    url: '/include/ajax.php?f=edit_customer&amp;amp;t=self_cart&amp;amp;id='+app.table_id,
    url: '/include/ajax.php?f=getlist&amp;amp;t=categories',
    url: '/include/ajax.php?f=getlist&amp;amp;t=products',
    url: '/include/ajax.php?f=get&amp;amp;t=products&amp;amp;id='+$(this).attr("data-id"),
    url: '/include/ajax.php?f=edit_product&amp;amp;t=self_cart&amp;amp;id='+app.table_id,

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I tried with the most tempting, &lt;code&gt;customers&lt;/code&gt;, and here we go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl 'https://$HOST/include/ajax.php?f=getlist&amp;amp;t=customers'

"success": 1,
"pag": 1,
"per_pag": 500,
"total_records": 11928,
"total_pages": 24,
"rows": [
    {
        "surname": "&amp;lt;REDACTED&amp;gt;",
        "name": "&amp;lt;REDACTED&amp;gt;",
        "email": "&amp;lt;REDACTED&amp;gt;",
        "mobile": "&amp;lt;REDACTED&amp;gt;",
        "addresses": [
            {
                "name": "&amp;lt;REDACTED&amp;gt;",
                "surname": "",
                "address": "&amp;lt;REDACTED&amp;gt;",
                "zipcode": "&amp;lt;REDACTED&amp;gt;",
                "city": "&amp;lt;REDACTED&amp;gt;",
                "province": "&amp;lt;REDACTED&amp;gt;",
                "coord": "44.6&amp;lt;REDACTED&amp;gt;, 10.6&amp;lt;REDACTED&amp;gt;",
                "doorphone": "&amp;lt;REDACTED&amp;gt;",
                            }
        ]
        "barcode": "https:\/\/api.$ANOTHER_HOST\/include\/barcode.php?f=png&amp;amp;s=code-128&amp;amp;d=1",

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That single request returned 500 out of 11928 results that include full names, phone numbers and addresses of real persons.&lt;/p&gt;

&lt;p&gt;Back to the JavaScript file, the &lt;code&gt;edit_product&lt;/code&gt; call is also very tempting (what if I change the price of a product, place my order, and then restore the original price?), but I had already eaten dinner and didn’t try it.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;code&gt;$ANOTHER_HOST&lt;/code&gt; domain got my attention because it points to a different domain. I googled it and I then realized that this pub was using an e-commerce made by a company that claims on their website that they serve 570 restaurants in Italy. Which makes that 11928 &lt;strong&gt;way larger&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To confirm this, I first googled the footer text in the e-commerce and actually found ~100 other websites using it that are affected by the same issue. Then, I found others using DNS enumeration targeting the $ANOTHER_HOST domain.&lt;/p&gt;

&lt;p&gt;I warned the company about the unauthenticated endpoints and the possible data leak affecting them and their customers. They politely replied that they don’t provide bug bounties and the endpoints have been patched.&lt;/p&gt;

</description>
      <category>security</category>
      <category>privacy</category>
      <category>italy</category>
    </item>
    <item>
      <title>I'm back in the boat</title>
      <dc:creator>Andrea Scarpino</dc:creator>
      <pubDate>Fri, 11 Jun 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/ilpianista/i-m-back-in-the-boat-1ckg</link>
      <guid>https://dev.to/ilpianista/i-m-back-in-the-boat-1ckg</guid>
      <description>&lt;p&gt;In mid-2014 I first heard about &lt;a href="https://jolla.com"&gt;Jolla&lt;/a&gt; and &lt;a href="https://sailfishos.org"&gt;Sailfish OS&lt;/a&gt; and immediately bought a Jolla 1; wrote apps; participated in the IGG campaign for Jolla Tablet; bought the TOHKBD2; applied for (and got) Jolla C.&lt;/p&gt;

&lt;p&gt;Sounds like the beginning of a good story doesn’t it?&lt;/p&gt;

&lt;p&gt;Well, by the beginning of 2017 I had sold everything (except the tablet, we all know &lt;a href="https://blog.jolla.com/jolla-tablet-project-update/"&gt;what happened&lt;/a&gt; to that one).&lt;/p&gt;

&lt;p&gt;So what happened?? I was a happy Sailfish user, but Jolla’s false promises disappointed me.&lt;/p&gt;

&lt;p&gt;Yet, despite all that, I still think about Sailfish OS to this day. I think it’s because, despite &lt;a href="https://reviewjolla.blogspot.com/p/sailfish-os-open-source-licencing-stage.html"&gt;some proprietary components&lt;/a&gt;, the ecosystem around Sailfish OS is ultimately open source. And that’s what interests me. It also got &lt;a href="https://blog.jolla.com/koli/"&gt;a fresh update&lt;/a&gt; which solves some of the problems that where there 5 years ago.&lt;/p&gt;

&lt;p&gt;Nowadays, &lt;strong&gt;thanks to the community&lt;/strong&gt; , Sailfish OS can be installed on &lt;a href="https://wiki.merproject.org/wiki/Adaptations/libhybris"&gt;many devices&lt;/a&gt;, even if with some less components, but I’m looking for that complete experience and so I asked on the &lt;a href="https://forum.sailfishos.org"&gt;forum&lt;/a&gt; if there was someone willing to sell his Xperia device with or without the license… and I got one for free. Better still, in exchange for some apps!&lt;/p&gt;

&lt;p&gt;To decide which applications to create, I therefore took a look at that ecosystem. I started with the apps I use daily on Android and looked for the Sailfish OS alternative (spoiler: I’m impressed, good job guys!).&lt;/p&gt;

&lt;p&gt;I am writing them all here because I am sure it will be useful to someone else:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AntennaPod (podcast app) -&amp;gt; &lt;a href="https://gitlab.com/cy8aer/podqast"&gt;PodQast&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ariane (gemini protocol browser)&lt;/li&gt;
&lt;li&gt;AsteroidOS (AsteroidOS sync) -&amp;gt; &lt;a href="https://github.com/AsteroidOS/starfish"&gt;Starfish&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Connectbot (ssh client) -&amp;gt; built-in (Terminal)&lt;/li&gt;
&lt;li&gt;Conversation (xmpp client) -&amp;gt; built-in (Messaging)&lt;/li&gt;
&lt;li&gt;Davx5 (caldav/cardav) -&amp;gt; built-in (Account)&lt;/li&gt;
&lt;li&gt;DroidShows (TV series) -&amp;gt; &lt;a href="https://github.com/corecomic/seriesfinale"&gt;SeriesFinale&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Element (Matrix client) -&amp;gt; &lt;a href="https://github.com/R1tschY/harbour-determinant"&gt;Determinant&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Endoscope (camera stream)&lt;/li&gt;
&lt;li&gt;Fedilab (Mastodon client) -&amp;gt; &lt;a href="https://github.com/dysk0/harbour-tooter"&gt;Tooter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;ForkHub (GitHub client) -&amp;gt; &lt;a href="https://github.com/black-sheep-dev/harbour-sailhub"&gt;SailHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;FOSS Browser -&amp;gt; built-in (&lt;a href="https://github.com/sailfishos/sailfish-browser"&gt;Browser&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;FreeOTP -&amp;gt; &lt;a href="https://github.com/seiichiro0185/sailotp"&gt;SailOTP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Glider (hacker news reader) -&amp;gt; &lt;a href="https://gitlab.com/ilpianista/harbour-SailHN"&gt;SailHN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;K-9 Mail -&amp;gt; built-in (Mail)&lt;/li&gt;
&lt;li&gt;KDE Connect (KDE sync) -&amp;gt; &lt;a href="https://github.com/R1tschY/harbour-sailfishconnect"&gt;SailfishConnect&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Keepassx (password manager) -&amp;gt; &lt;a href="https://github.com/jobe-m/ownkeepass"&gt;ownKeepass&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Labcoat (GitLab client)&lt;/li&gt;
&lt;li&gt;Lemmur (Lemmy client)&lt;/li&gt;
&lt;li&gt;MasterPassword (password manager) -&amp;gt; &lt;a href="https://gitlab.com/ilpianista/harbour-MPW"&gt;MPW&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MuPDF (PDF reader) -&amp;gt; built-in (Documents)&lt;/li&gt;
&lt;li&gt;Newpipe (YouTube client) -&amp;gt; &lt;a href="https://github.com/direc85/harbour-ytplayer"&gt;YTPlayer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Nextcloud (Nextcloud files) -&amp;gt; &lt;a href="https://github.com/fredldotme/harbour-owncloud"&gt;GhostCloud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Notes (Nextcloud notes) -&amp;gt; &lt;a href="https://github.com/scharel/harbour-nextcloudnotes"&gt;Nextcloud Notes&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OCReader (Nextcloud RSS) -&amp;gt; &lt;a href="https://github.com/Huessenbergnetz/Fuoten"&gt;Fuoten&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OsmAnd~ (Maps) -&amp;gt; &lt;a href="https://github.com/rinigus/pure-maps"&gt;PureMaps&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Printing (built-in) -&amp;gt; &lt;a href="https://github.com/attah/harbour-seaprint"&gt;SeaPrint&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;QuickDic (dictionary) -&amp;gt; &lt;a href="https://github.com/name924/SailyDIct"&gt;SailyDict&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;RedMoon (screen color temperature) -&amp;gt; &lt;a href="https://github.com/CODeRUS/harbour-tint-overlay"&gt;Tint Overlay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;RedReader (Reddit client) -&amp;gt; &lt;a href="https://github.com/accumulator/Quickddit"&gt;Quickddit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Signal -&amp;gt; &lt;a href="https://gitlab.com/whisperfish/whisperfish"&gt;Whisperfish&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Syncthing (files sync) -&amp;gt; there’s &lt;a href="https://github.com/fuchsmich/sailfish-syncthing-bin"&gt;the binary&lt;/a&gt;, no UI&lt;/li&gt;
&lt;li&gt;Transdroid (Trasmission client) -&amp;gt; &lt;a href="https://github.com/sam-hobbs/harbour-clutch"&gt;Clutch&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Vinyl (music player) -&amp;gt; built-in (Mediaplayer)&lt;/li&gt;
&lt;li&gt;VLC (NFS streaming) -&amp;gt; &lt;a href="https://github.com/llelectronics/videoPlayer"&gt;videoPlayer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;WireGuard (VPN) -&amp;gt; there’s &lt;a href="https://github.com/antranigv/wireguard-sailfish"&gt;the binary&lt;/a&gt;, no UI&lt;/li&gt;
&lt;li&gt;YetAnotherCallBlocker (call blocker) -&amp;gt; &lt;a href="https://github.com/omnight/phonehook"&gt;Phonehook&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, to me it looks like almost everything is there, except:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;a href="https://gemini.circumlunar.space/"&gt;gemini&lt;/a&gt; protocol browser&lt;/li&gt;
&lt;li&gt;a client for &lt;a href="https://gitlab.com"&gt;GitLab&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;a client for &lt;a href="https://dev.lemmy.ml"&gt;Lemmy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;a UI for &lt;a href="https://syncthing.net"&gt;Syncthing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;a UI for &lt;a href="https://www.wireguard.com/"&gt;Wireguard&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ve already started to write a UI for &lt;a href="https://gitlab.com/ilpianista/harbour-syncthing"&gt;Syncthing&lt;/a&gt;, then maybe I could write the browser for the gemini protocol or rather the GitLab client?&lt;/p&gt;

&lt;p&gt;Please consider a donation if you would like to support me (mention your favourite project!).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://liberapay.com/ilpianista/donate"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D0JWHkxh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://liberapay.com/assets/widgets/donate.svg" alt="Liberapay"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many many thanks to Jörg who sent me his Sony Xperia 10 Plus! I hope I don’t disappoint him!&lt;/p&gt;

</description>
      <category>sailfishos</category>
      <category>floss</category>
      <category>jolla</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Sharing your loan details to anyone</title>
      <dc:creator>Andrea Scarpino</dc:creator>
      <pubDate>Mon, 24 May 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/ilpianista/sharing-your-loan-details-to-anyone-2922</link>
      <guid>https://dev.to/ilpianista/sharing-your-loan-details-to-anyone-2922</guid>
      <description>&lt;p&gt;A week ago, I blogged about &lt;a href="https://scarpino.dev/posts/sharing-your-amortisation-schedule-to-anyone.html"&gt;a vulnerability&lt;/a&gt; in a platform that would allow anyone to download users’ amortisation schedules. This was a critical issue, but it wasn’t really exploitable in the wild as it included a part where you had to guess the name of the document to download.&lt;/p&gt;

&lt;p&gt;I no longer trust that platform so I went to their website to remove my loan data from it, but apparently this isn’t possibile via the UI.&lt;/p&gt;

&lt;p&gt;I also opened a ticket on their support platform to request removal and they replied that it isn’t possible.&lt;/p&gt;

&lt;p&gt;So I went to their website with the intention of replacing the data with a fake one… but there was no longer an edit button!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scarpino.dev/images/loans.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DbFyKk4V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/loans_thumb.png" alt="Loans"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m sure it was there before and in fact the code also confirms that it was there:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scarpino.dev/images/loans_code.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NgdPbClK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/loans_code_thumb.png" alt="Loans code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, the platform is based on Magento and so, starting from the current URL, we can easily guess the edit URL, e.g. &lt;code&gt;https://&amp;lt;host&amp;gt;/anagraficamutui/mutuo/edit/id/&amp;lt;n&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s try 1… bingo!&lt;/p&gt;

&lt;p&gt;But wait a minute… this isn’t my loan! Luckily it’s just a demo entry put in by some developer:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scarpino.dev/images/someone_else_loan.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lZNK7DdF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/someone_else_loan_thumb.png" alt="Someone else loan"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even though it’s a dummy page, we can already see the details of the loan such as the (hopefully) fake IBAN, or the loan total and loan number and even the bank contact person name and email address.&lt;/p&gt;

&lt;p&gt;And now take a look at this: if I try to access that page in private mode, then I get the login page. All (almost) well, right?&lt;/p&gt;

&lt;p&gt;Nope. Let’s try the same request via &lt;code&gt;curl&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -s https://&amp;lt;host&amp;gt;/anagraficamutui/edit/id/1 | grep banca

&amp;lt;input type="text" name="istituto_credito" id="istituto_credito" value="banca acme" title="Nome istituto" class="input-text istituto_credito required-entry" /&amp;gt;

$ curl -s https://&amp;lt;host&amp;gt;/anagraficamutui/edit/id/1 | grep NL75

&amp;lt;input type="text" name="iban" id="iban" value="NL75xxxxxxxxx" title="Iban" class="input-text iban required-entry validate-iban validate-length maximum-length-27 validate-alphanum" /&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait a minute, what’s going on?&lt;/p&gt;

&lt;p&gt;Well, it turns out that the page sets the &lt;code&gt;location&lt;/code&gt; header to redirect you to the login page when there’s no cookie, otherwise it prints the HTML page!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -s https://&amp;lt;host&amp;gt;/anagraficamutui/edit/id/1 -I | grep location

location: https://&amp;lt;host&amp;gt;/customer/account/login/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Oh-no!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Data from 5723 loans could have been exposed by accessing a specific URL. Details such as IBAN, loan number, loan total and the bank account contact person could have been used to perform spear phishing attacks.&lt;/p&gt;

&lt;p&gt;I reported this privacy flaw to the &lt;a href="https://csirt.gov.it/"&gt;CSIRT Italia&lt;/a&gt; and the platform’s DPO. The issue has been solved after 2 days, but I still haven’t heard from them.&lt;/p&gt;

</description>
      <category>security</category>
      <category>privacy</category>
      <category>italy</category>
    </item>
    <item>
      <title>Sharing your amortisation schedule to anyone</title>
      <dc:creator>Andrea Scarpino</dc:creator>
      <pubDate>Wed, 19 May 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/ilpianista/sharing-your-amortisation-schedule-to-anyone-82f</link>
      <guid>https://dev.to/ilpianista/sharing-your-amortisation-schedule-to-anyone-82f</guid>
      <description>&lt;p&gt;Last month, my company allowed me to claim some benefits through a dedicated platform. This platform is specifically built for this purpose and allows you to recover these benefits not only in the form of coupons or discount codes, but also as reimbursements for medical visits or interest on mortgage payments.&lt;/p&gt;

&lt;p&gt;I wanted to try the latter.&lt;/p&gt;

&lt;p&gt;I logged on to the platform and then I filled in all the (many) details about the loan that the plaform asks you to fill in, until I had to upload my amortisation schedule which contains &lt;strong&gt;a lot&lt;/strong&gt; of sensitive data. In fact, a strange thing happened at this step: my file was named &lt;code&gt;document.pdf&lt;/code&gt;, but after uploading it was renamed to &lt;code&gt;document_2.pdf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;How do I know? Well, let’s have a look to the UI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scarpino.dev/images/loan_details.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t4iLYkCM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/loan_details_thumb.png" alt="Loan details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scarpino.dev/images/loan_details_hover.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NKv8zT-L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/loan_details_hover_thumb.png" alt="Loan details hover"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It clearly shows the file name and that’s also a hyperlink. Let’s click then.&lt;/p&gt;

&lt;p&gt;The PDF opens in my browser. This is expected, but what happens if we take the URL and try to open it in a private window?? Guess what?&lt;/p&gt;

&lt;p&gt;You guessed it.&lt;/p&gt;

&lt;p&gt;Let’s have a look to the URL again. It’s in the form: &lt;code&gt;https://&amp;lt;host&amp;gt;/media/mutuo/file/d/o/document_2.pdf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That’s tempting, isn’t?&lt;/p&gt;

&lt;p&gt;I wanted to have some fun and I tried the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scarpino.dev/images/loan_curl.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qx1uGGPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://scarpino.dev/images/loan_curl_thumb.png" alt="Loan download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both the &lt;code&gt;curl&lt;/code&gt; output and the checksums are enough to understand that some document has been downloaded there (but discarded since I didn’t download them to my disk…).&lt;/p&gt;

&lt;p&gt;Thus, since the &lt;code&gt;d&lt;/code&gt; and &lt;code&gt;o&lt;/code&gt; parent folders match the two initial letters of my file, I successfully tried with stuff like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/c/o/contratto.pdf&lt;/code&gt;, &lt;code&gt;/c/o/contratto_2.pdf&lt;/code&gt;, …&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/c/o/contract.pdf&lt;/code&gt;, …&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/p/r/prospetto.pdf&lt;/code&gt;, …&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and it does also work with numbers too (to find this out I had to upload a file named &lt;code&gt;1.pdf&lt;/code&gt; 😇), e.g. &lt;code&gt;https://&amp;lt;host&amp;gt;/media/mutuo/file/1/_/1_10.pdf&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you have uploaded your amortisation schedule to this platform, that in its website says it has more than 300k users from 3k different companies, well someone may have downloaded it.&lt;/p&gt;

&lt;p&gt;I reported this privacy flaw to the &lt;a href="https://csirt.gov.it/"&gt;CSIRT Italia&lt;/a&gt; via a PGP encrypted email; the CSIRT is supposed to write to the company that owns the platform to alert them to the problem, but a week later I still hadn’t heard from either of them. So after a week I pinged the CSIRT again, and they replied with a plain text email telling me that they had opened an internal ticket and were nice enough to embed my initial PGP encrypted email.&lt;/p&gt;

&lt;p&gt;Two weeks later (about 21 days since my first mail) the platform fixed the problem (the uploaded file path isn’t deterministic anymore and authentication is in place), but I still haven’t heard from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Addendum
&lt;/h2&gt;

&lt;p&gt;Since &lt;code&gt;&amp;lt;host&amp;gt;&lt;/code&gt; is a third-level domain in my case, I used stuff like &lt;a href="https://github.com/aboul3la/Sublist3r"&gt;&lt;code&gt;Sublist3r&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/OWASP/Amass"&gt;&lt;code&gt;Amass&lt;/code&gt;&lt;/a&gt; to perform DNS enumeration and I found ~50 websites, 30 of which are aliases pointing to the same host. In fact, I could replace &lt;code&gt;&amp;lt;host&amp;gt;&lt;/code&gt; with each of them and I would always download my &lt;code&gt;document_2.pdf&lt;/code&gt; file.&lt;/p&gt;

</description>
      <category>security</category>
      <category>privacy</category>
      <category>italy</category>
    </item>
    <item>
      <title>How my car insurance exposed my position</title>
      <dc:creator>Andrea Scarpino</dc:creator>
      <pubDate>Thu, 11 May 2017 00:00:00 +0000</pubDate>
      <link>https://dev.to/ilpianista/how-my-car-insurance-exposed-my-position-16ko</link>
      <guid>https://dev.to/ilpianista/how-my-car-insurance-exposed-my-position-16ko</guid>
      <description>&lt;p&gt;As many car insurances companies do, my car insurance company provides a satellite device that can be put inside your car to provide its location at any time in any place.&lt;/p&gt;

&lt;p&gt;By installing such device in your car, the car insurance profiles your conduct, of course, but it could also help the police in finding your car if it gets stolen and you will probably get a nice discount over the insurance price (even up to 40%!). Long story short: I got one.&lt;/p&gt;

&lt;p&gt;Often such companies also provide an “App” for smartphones to easily track your car when you are away or to monitor your partner…mine (the company!) does.&lt;/p&gt;

&lt;p&gt;Then I downloaded my company’s application for Android, but unluckily it needs the Google Play Services to run. I am a FLOSS evangelist and, as such, I try to use FLOSS apps only and without gapps.&lt;/p&gt;

&lt;p&gt;Luckily I’m also a developer and, as such, I try to develop the applications I need most; using &lt;a href="https://mitmproxy.org/" rel="noopener noreferrer"&gt;mitmproxy&lt;/a&gt;, I started to analyze the APIs used by the App to write my own client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authentication
&lt;/h2&gt;

&lt;p&gt;As soon as the App starts you need to authenticate yourself to enable the buttons that allow you to track your car. Fair enough.&lt;/p&gt;

&lt;p&gt;The authentication form first asks for your taxpayer’s code; I put mine and under the hood it performs the following request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST -d 'BLUCS§&amp;lt;taxpayers_code&amp;gt;§-1' http://&amp;lt;domain&amp;gt;/BICServices/BICService.svc/restpostcheckpicf&amp;lt;company&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Web service replies with a cell phone number (WTF?):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2§&amp;lt;international_calling_code&amp;gt;§&amp;lt;cell_phone_number&amp;gt;§-1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait. What do we already see here? Yes, besides the ugliest formatting ever and the fact the request uses plain HTTP, it takes only 3 arguments to get a cell phone number? And guess what? The first one and the latter are two constants. In fact, if we put an inexistent taxpayer’s code, by keeping the same values, we get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-1§&amp;lt;international_calling_code&amp;gt;§§-100%

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;…otherwise &lt;strong&gt;we get a cell phone number for the given taxpayer’s code&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;I hit my head and I continued the authentication flow.&lt;/p&gt;

&lt;p&gt;After that, the App asks me to confirm the cell phone number it got is still valid, but it also wants the password I got via mail when subscribing the car insurance; OK let’s proceed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST -d 'BLUCS§&amp;lt;taxpayers_code&amp;gt;§&amp;lt;device_imei&amp;gt;§&amp;lt;android_id&amp;gt;§&amp;lt;device_brand&amp;gt;-&amp;lt;device_model&amp;gt;_unknown-&amp;lt;api_platform&amp;gt;-&amp;lt;os_version&amp;gt;-&amp;lt;device_code&amp;gt;§&amp;lt;cell_phone_number&amp;gt;§2§&amp;lt;password&amp;gt;§§-1' http://&amp;lt;domain&amp;gt;/BICServices/BICService.svc/restpostsmartphoneactivation&amp;lt;company&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Web service responds with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0§&amp;lt;some_code&amp;gt;§&amp;lt;my_full_name&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;em&gt;some_code&lt;/em&gt; parameter changes everytime, so it seems to work as a “registration id”, but after this step the App unlocked the button to track my car.&lt;/p&gt;

&lt;p&gt;I was already astonished at this point: how the authentication will work? Does it need this &lt;em&gt;some_code&lt;/em&gt; in combination with my password at reach request? Or maybe it will ask for my taxpayer code?&lt;/p&gt;

&lt;h2&gt;
  
  
  Car tracking
&lt;/h2&gt;

&lt;p&gt;I start implementing the car tracking feature, which allows to retrieve the last 20 positions of your car, so let’s analyze the request made by the App:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST -d 'ASS_NEW§&amp;lt;car_license&amp;gt;§2§-1' http://&amp;lt;domain&amp;gt;/BICServices/BICService.svc/restpostlastnpositions&amp;lt;company&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Web service responds with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0§20§&amp;lt;another_code&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;§DD/MM/YYYY HH:mm:SS#&amp;lt;latitude&amp;gt;#&amp;lt;longitude&amp;gt;#0#1#1#1-&amp;lt;country&amp;gt;-&amp;lt;state&amp;gt;-&amp;lt;city&amp;gt;-&amp;lt;street&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;WTH?!? No header?!? No cookie?!? No authentication parameters?!?&lt;/p&gt;

&lt;p&gt;Yes, your assumption is right: &lt;strong&gt;you just need a car license and you get its last 20 positions&lt;/strong&gt;. And what’s that &lt;em&gt;another_code&lt;/em&gt;? I just write it down for the moment.&lt;/p&gt;

&lt;p&gt;It couldn’t be real, I first thought (hoped) they stored my IP somewhere so I’m authorized to get this data now, so let’s try from a VPN…oh damn, it worked.&lt;/p&gt;

&lt;p&gt;Then I tried with an inexistent car license and I got:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-2§TARGA NON ASSOCIATA%

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which means: “that car license is not in our database”.&lt;/p&gt;

&lt;p&gt;So what &lt;strong&gt;we could&lt;/strong&gt; get here with the help of &lt;a href="https://sourceforge.net/projects/crunch-wordlist/" rel="noopener noreferrer"&gt;crunch&lt;/a&gt;? Easy enough: &lt;strong&gt;a list of car licenses that are covered by this company&lt;/strong&gt; and &lt;strong&gt;last 20 positions for each one&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I couldn’t stop now.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Web client
&lt;/h2&gt;

&lt;p&gt;This car insurance company also provides a Web client which permits more operations, so I logged into to analyze its requests and while it’s hosted on a different domain, and it also uses a cookie for almost any request, it performs one single request to the domain I previously used. Which isn’t authenticated and got my attention:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://&amp;lt;domain&amp;gt;/&amp;lt;company&amp;gt;/(S(&amp;lt;uuid&amp;gt;))/NewRemoteAuthentication.aspx?RUOLO=CL&amp;amp;ID=&amp;lt;another_code&amp;gt;&amp;amp;TARGA=&amp;lt;car_license&amp;gt;&amp;amp;CONTRATTO=&amp;lt;foo&amp;gt;&amp;amp;VOUCHER=&amp;lt;bar&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one replies with an HTML page that is shown in the Web client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" &amp;gt;
&amp;lt;HTML&amp;gt;
&amp;lt;HEAD&amp;gt;
    &amp;lt;title&amp;gt;NewRemoteAuthentication&amp;lt;/title&amp;gt;
    &amp;lt;meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1" /&amp;gt;
    &amp;lt;meta name="CODE_LANGUAGE" Content="C#" /&amp;gt;
    &amp;lt;meta name="vs_defaultClientScript" content="JavaScript"/&amp;gt;
    &amp;lt;meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie7" /&amp;gt;
        &amp;lt;!--&amp;lt;meta content="IE=EmulateIE10" name="ie_compatibility" http-equiv="X-UA-Compatible" /&amp;gt;--&amp;gt;
        &amp;lt;meta name="ie_compatibility" http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=EmulateIE9, IE=10, IE=11" /&amp;gt;
&amp;lt;/HEAD&amp;gt;
    &amp;lt;body&amp;gt;
    &amp;lt;form name="Form1" method="post" action="/&amp;lt;company&amp;gt;/(S(&amp;lt;uuid&amp;gt;))/NewRemoteAuthentication.aspx?RUOLO=CL&amp;amp;amp;ID=&amp;lt;another_code&amp;gt;&amp;amp;amp;TARGA=&amp;lt;car_license&amp;gt;" id="Form1"&amp;gt;
&amp;lt;input type="hidden" name=" __VIEWSTATE" id="__ VIEWSTATE" value="/wEPDwULLTIwNzEwODIsJFNAgEPKAJDIeBsdSpc2libGVnZGRic5McHC9+DqRx0H+jRt5O+/PLtw==" /&amp;gt;

            &amp;lt;iframe id="frm1" src="NewRicerca.aspx" width="100%" height="100%"&amp;gt;&amp;lt;/iframe&amp;gt;

&amp;lt;SCRIPT language="JavaScript"&amp;gt;
&amp;lt;!--
self.close
// --&amp;gt;
&amp;lt;/SCRIPT&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/HTML&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It includes an iframe (sigh!), but that’s the interesting part!!! Look:&lt;/p&gt;

&lt;p&gt;&lt;a href="/images/car_history.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscarpino.dev%2Fimages%2Fcar_history_thumb.png" alt="Car history"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From that page you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the full name of the person that has subscribed the insurance;&lt;/li&gt;
&lt;li&gt;the car model and brand;&lt;/li&gt;
&lt;li&gt;the total amount of kilometers made by the car;&lt;/li&gt;
&lt;li&gt;the total amount of travels (meant as “car is moving”) made by the car;&lt;/li&gt;
&lt;li&gt;access to months travels details (how many travels);&lt;/li&gt;
&lt;li&gt;access to day travels details (latitude, longitude, date and time);&lt;/li&gt;
&lt;li&gt;access to months statistics (how often you use your car).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="/images/car_month_history.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscarpino.dev%2Fimages%2Fcar_month_history_thumb.png" alt="Car month history"&gt;&lt;/a&gt;&lt;a href="/images/car_day_history.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscarpino.dev%2Fimages%2Fcar_day_history_thumb.png" alt="Car day history"&gt;&lt;/a&gt;&lt;a href="/images/car_month_statistics.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscarpino.dev%2Fimages%2Fcar_month_statistics_thumb.png" alt="Car month_statistics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a lot of informations here and these statistics are available &lt;strong&gt;since the installation of the satellite device&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The request isn’t authenticated so I just have to understand the parameters to fill in. Often not all parameters are required and then I tried by removing someone to find out which are really needed. It turns out that I can simplify that as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://&amp;lt;domain&amp;gt;/&amp;lt;company&amp;gt;/(S(&amp;lt;uuid&amp;gt;))/NewRemoteAuthentication.aspx?RUOLO=CL&amp;amp;ID=&amp;lt;another_code&amp;gt;&amp;amp;TARGA=&amp;lt;car_license&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But there’s still a &lt;em&gt;another_code&lt;/em&gt; there…mmm, wait it looks like the number I took down previously! And yes, it’s!&lt;/p&gt;

&lt;p&gt;So, &lt;code&gt;http://&amp;lt;domain&amp;gt;/&amp;lt;company&amp;gt;/(S(&amp;lt;uuid&amp;gt;))/NewRicerca.aspx&lt;/code&gt; is the page that really shows all the informations, but how do I generate that uuid thing?&lt;/p&gt;

&lt;p&gt;I tried by removing it first and then I got an empty page. Sure, makes sense, how that page will ever know which data I’m looking for?&lt;/p&gt;

&lt;p&gt;Then it must be the &lt;em&gt;NewRemoteAuthentication.aspx&lt;/em&gt; page that does something; I tried again by removing the uuid from that url and to my full surprise it redirected me to the same url, but it also filled the uuid part as path parameter! Now I can finally invoke the &lt;em&gt;NewRicerca.aspx&lt;/em&gt; using that uuid and read all the data!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You just need a car license which is covered by this company to get &lt;strong&gt;all the travels made by that car, the full name of the person owning it and its position in real time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I reported this privacy flaw to the &lt;a href="https://www.certnazionale.it/" rel="noopener noreferrer"&gt;CERT Nazionale&lt;/a&gt;which wrote to the company.&lt;/p&gt;

&lt;p&gt;The company fixed the leak 3 weeks later by providing new Web services endpoints that use authenticated calls. The company mailed its users saying them to update their App as soon as possible. The old Web services have been shutdown after 1 month and half since my first contact with the CERT Nazionale.&lt;/p&gt;

&lt;p&gt;I could be wrong, but I suspect the privacy flaw has been around for 3 years because the first Android version of the App uses the same APIs.&lt;/p&gt;

&lt;p&gt;I got no bounty.&lt;/p&gt;

&lt;p&gt;The company is a leading provider of telematics solutions.&lt;/p&gt;

</description>
      <category>security</category>
      <category>privacy</category>
      <category>italy</category>
    </item>
  </channel>
</rss>
