Hacker Newsnew | past | comments | ask | show | jobs | submit | matan-h's commentslogin

oh I only checked for very popular sites (here is the list: https://github.com/matan-h/falling-history/blob/main/docs/to...). Also news.ycombinator.com is in the list, so I expected at least that to be in the browser history.


Noted.


aka /sdcard on most phones


Apart from the length, what advantages does `[-z $VAR ] && VAR=x` over `if [ ! $VAR ]; then VAR=x fi` ?

Btw, The color script is cool. This makes ANSI sensible.


I don't think there are any functional or performance differences between these forms:

  [ -n "$var" ] || var=X
  [ -z "$var" ] && var=X
  if [ ! "$var" ]; then var=X; fi
It's a question of [your] style and taste, I think.

There are a lot more ANSI sequences that I could work into that block, but it is quite thorough for the space it occupies.

BONUS:

Here is my script to extract all of the stored WiFi networks and passwords when run as root:

  #!/bin/sh

  find /data \
      -name WifiConfigStore.xml \
      -print0 |
  xargs -0 awk '

    /"SSID/ { s = 1 }
    /PreShared/ { p = 1 }

    s || p {
      gsub(/[<][^>]+[>]/, "")
      sub(/^[&]quot;/, "")
      sub(/[&]quot;$/, "")
      gsub(/[&]quot;/, "\"")
      gsub(/[&]amp;/, "\\&")
      gsub(/[&]lt;/, "<")
      gsub(/[&]gt;/, ">")
    }

    s { s = 0; printf "%-32.32s ", $0 }
    p { p = 0; print }

  ' | sort -f


I use this to copy programs from termux.

in termux (you need lld [pkg i lld]):

   mkdir /sdcard/.adb
   cp `which bash` /sdcard/.adb
   cp $(ldd `which bash`|cut -d ">" -f2) /sdcard/.adb
in adb shell:

   cd /data/local/tmp
   cp /sdcard/.adb/bash
   cp /sdcard/.adb/*.so
   LD_LIBRARY_PATH=.
   ./bash


I've tried it. nushell works for me only with the "-c" option, otherwise I get "Error: I/O error: Function not implemented (os error 38)". Probably the prompt function


yes. (It's not really the 'root' user, but it trusts blindly and can do things such as installing apps without user confirmation.). In my other blog post about gms, the JS bridges would be running in the privileged scope.

You agreed to this in Google's privacy policy when installing Android.


Thanks you for fixing it I`ve updated the blog. now my simple rust script is not that helpful :)


Gitleaks regexes are fairly accurate. For example, the regex to find a GitHub PAT is "ghp_[0-9a-zA-Z]{36}" which mean it has a specific number (36+4) of characters from specific group (alphabet+number). And I try to filter out the obvious non-secrets (like 'abcd','xxxx' and '1234'). However, as I stated in the article, most of the data is not actionable: most people just revoke the token, use an old one, change some random letters, etc.


I think the real take-away is that StackOverflow does not have key detection like GitHub does.


I see real-looking keys posted to SO at least a couple of times per week (stuff like Twilio and Stripe keys are the most obvious as they’re tagged-strings; followed by GMail SMTP creds; I edit them out and flag the posts for the mods, as one does). Granted, most of the time it’s just some kid who doesn’t appreciate what secrets are worth keeping, or wasn’t paying attention when copying+pasting into their post, but every so-often I see secrets in a post from what looks like an outsourced worker assigned to a “real” business, with very real things to lose - and I get depressed from wondering how modern society even holds itself together given the scale of incompetence I witness first-hand…

(Fun-fact: the next SMS text-message you get from a major chain informing you on an upcoming appointment was likely sent to you via Twilio from a desktop client with a hardcoded AccountSID and AuthSecret strings shared by all 20,000 (multitenant) users; Don’t ask how I know, but it’s depressing; I do report these things (anonymously) to the vendors but then receive a reply from a non-technical manager accusing me of “hacking”. I haven’t yet reported them to e.g. Twilio directly because I don’t want Twilio to revoke their creds and cause potentially hundreds of thousands of people to not-receive essential comms from those tenants. Le sigh…


There was another thread a few years ago where someone suggested reporting to US-CERT or another CERT. It has some advantages like "they know what a credential leak is", "they know that people reporting security issues aren't necessarily malicious", and "they sound official when they try to get it fixed". And "your name will no longer be on the report".

I haven't had occasion to try this myself, but it sounded like good advice!


Has GitHub open sourced their key detection?


No, Microsoft is keeping all of that stuff under the wraps. They have a "secret scanning partner program" where they allow companies to have a endpoint GitHub can use for figuring out if something is a secret or not, so it's not just a library with a bunch of regex, seems like a service in itself and Microsoft doesn't really open source stuff like that.



You are correct. Though, speaking of regex, they work with partners to create the most accurate regexes possible using non-public information like expected entropy or checksums.


That's surprising (to me), because the enterprise custom scanning feature only supports hyperscan-flavoured regex.


Sorry, I should clarify that some of those things are _in addition_ to regex. You are correct that it uses Hyperscan to find initial matches, then their first-party patterns go through some additional local processing magic.

(This is my understanding based on conversations with people working on the secret scanning feature at GitHub, I don't have firsthand knowledge.)


But... But... I thought Microsoft ♥ open source?


I agree. I asked for a feature that warn users before they post secrets: https://meta.stackexchange.com/questions/394710/feature-requ...


I have an addition to this story:

Me: here's a bug in Google Play Services.

Google: Not a bug, working as expected, closing issue.

Me: posted the bug on my blog, and it's get extensive media coverage.

Google: It seems we were wrong! It is indeed a bug. We will return to you in a few weeks.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: