Earlier quoted context omitted.
termux -> "sudo su" and then ls /sys/module (it gives an output similar to lsmod)
Back in the day, shell coders would receive the "Useless Use Of Cat" award. https://news.ycombinator.com/item?id=23341711 Today it's giving way to "useless use of su" where admins aren't aware of sudo(8) options like "-s" or "-i"
Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
91–100 of 109 posts
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#92Earlier quoted context omitted.
Back in the day, shell coders would receive the "Useless Use Of Cat" award. https://news.ycombinator.com/item?id=23341711 Today it's giving way to "useless use of su" where admins aren't aware of sudo(8) options like "-s" or "-i"
And anyone who points that out still gets to receive the "useless use of code golfing" award.
"syncsyncsyncreboot" became an idiom for various reasons. Then it became "sync; sync; sync; reboot" and deemed equivalent, which was missing the point that physically pressing "enter" introduced some human-length pauses into the process. Then "reboot(8)" incorporated those syncs, and "shutdown(8)" provided more flexibility, but the idiom persisted.
And to this day, the tier-1 support script says to clear your cookies and cache, try a different browser, factory reset your phone, disable firewall, disable AV, reboot your router, bypass your switch and plug in one device directly, wait 15 minutes and try again, and we've abandoned all attempts to understand, diagnose, or find root causes when the underlying systems are too diverse and complex to understand or keep your tech's expertise up-to-date.
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#93IIRC my phone uses a MediaTek chipset. And I vaguely remember the vendor has moved away from MediaTek since because of the ahem quality of those products... No idea how WiFi is done on a phone though. Is there a way to find out whether the phone is affected? I hardly ever use WiFi because I have unlimited cellular data and good coverage, but would still be good to know.
termux -> "sudo su" and then ls /sys/module (it gives an output similar to lsmod)
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#94Earlier quoted context omitted.
> I'm baffled that anyone even thought about using that, given there's such good mt76 support from mainline kernels with hostapd. Not sure if you noticed but the OpenWRT 21.02.x series (based on mainline kernel 5.4 series) is affected, and these guys generally know their game when it comes to wireless on Linux. So much so that I think the mainline kernel mt76 driver is actually maintained by an OpenWRT developer.
Upstream OpenWrt does not use `wappd` so it should not be affected.
https://openwrt.org/advisory/start
Maybe MediaTek has shipped some modified versions of OpenWRT using this "wappd" thing to their B2B customers (as part of the SDK perhaps?) and are now advertising those as vulnerable.
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#95Earlier quoted context omitted.
And anyone who points that out still gets to receive the "useless use of code golfing" award.
Sure, it's annoying and pedantic to nitpick someone's helpful answers and snippets. But sometimes the goal is to foster a better understanding, and reduce superstition and cargo-culting. "sync sync sync reboot " became an idiom for various reasons. Then it became "sync; sync; sync; reboot" and deemed equivalent, which was missing the point that physically pressing "enter" introduced some human-length pauses into the…
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#96Earlier quoted context omitted.
Doesn't "sudo -s" keep the current user's environment variables as opposed to "sudo su"? I admit that in the context of doing "ls /sys/module" it's likely not a huge problem, but I do (in my gut) feel that for running an elevated command, it's cleaner to just drop in as actual root, instead of masquerading as root.
> if you'd only read the manual page and learn its options.
Essentially a "maybe, depending on what your OS policy is", proving that your comments are less than helpful.
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#97Earlier quoted context omitted.
Upstream OpenWrt does not use `wappd` so it should not be affected.
Interesting. The bulletin lists "OpenWrt 19.07, 21.02 (for MT6890)" as vulnerable, but OpenWRT had indeed no security advisory out for this: https://openwrt.org/advisory/start Maybe MediaTek has shipped some modified versions of OpenWRT using this "wappd" thing to their B2B customers (as part of the SDK perhaps?) and are now advertising those as vulnerable.
The OpenWrt folks generally have good enough taste not to ship any drivers or userspace junk from vendor SDKs, though they do have a fair-sized set of backport patches on top of the (somewhat elderly) mainline kernels they do ship.
I'm running up-to-date mainline on my routers, not OpenWrt kernels. The mt76 support in 6.11 (and previously in 6.9 and 6.10) is complete enough that I don't need to carry any patches at all over what's in Linus' tree.
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#98Earlier quoted context omitted.
> if you'd only read the manual page and learn its options.
> Depending on the security policy, the user's PATH environment variable may be modified, replaced, or passed unchanged to the program that sudo executes. Essentially a "maybe, depending on what your OS policy is", proving that your comments are less than helpful.
https://manpages.ubuntu.com/manpages/noble/en/man8/sudo.8.ht...
-E, --preserve-env
--preserve-env=list
-H, --set-home
-i, --login
-s, --shell
The sudoers policy subjects environment variables passed as options to the same restrictions as existing environment variables with one important difference. If the setenv option is set in sudoers, the command to be run has the SETENV tag set or the command matched is ALL, the user may set variables that would otherwise be forbidden.
I am not sure what is meant by "masquerading as root" -- effective UID rather than real UID? "sudo" should set both to the target; there is no masquerading, even if you end up in a root shell with features of the invoking user's environment, those relevant variables should've been adjusted in the process.So what you're proposing to do is to escalate privilege using "sudo"s security model and configuration, which may add, suppress, or alter environment variables, as well as SELinux and resource limits and cgroups or whatever, and then have a second go-round through "su" may alter the environment further, making for an unpredictable interaction. Hopefully it's all harmonized through PAM, but all you wanted is an interactive shell. Why try to justify this copy-paste idiom?
In fact, I could rewrite your original snippet as
sudo ls /sys/module
Why are you even opening an interactive shell to do one simple command? If that's all you want, then learn and use the appropriate idiom for it. "sudo(8)" was originally designed to run one-off commands without invoking that shell. In fact, security experts will tell you not to leave root shells open at any time. If you can run a "sudo command" and return to your user shell, then that is best practice.Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#99Earlier quoted context omitted.
Why is it so much of this hardware/firmware feels so much like deploying a PoC to production? Why can't they hire someone that actually knows what they are doing?
The consumer space is brutally competitive - you're working on tight margins and designs become obsolete very quickly. MediaTek's business is built on selling chips with the latest features at the lowest possible price. Everything has to be done at a breakneck pace that is dictated by the silicon. You start writing firmware as soon as the hardware design is finalised; it needs to be ready as soon as the chips are rea…
This seems like the exact place where open source is a competitive advantage.
Step 1, open source your existing firmware for the previous generation hardware. The people who have the hardware now fix problems you didn't have the resources to fix.
Step 2, fork the public firmware for the previous generation hardware when developing the next generation. It has those bug fixes in it and 90% of the code is going to be the same anyway. Publish the new source code on the day the hardware ships in volume but not before. By then it doesn't matter if competitors can see it because "designs become obsolete very quickly" and it's too late for them to use it for their hardware/firmware in this generation. They don't get to see your next generation code until that generation is already shipping. Firmware tricks that span generations and have significant value can't be kept secret anyway because any significant firmware-based advantage would be reverse engineered by competitors for the next generation regardless of whether they have the source code.
Now your development costs are lower than competitors' because you didn't have to pay to fix any bugs that one of your customers fixed first, and more people buy your hardware because your firmware is less broken than the competition.
Re: Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
#100Earlier quoted context omitted.
Sure, it's annoying and pedantic to nitpick someone's helpful answers and snippets. But sometimes the goal is to foster a better understanding, and reduce superstition and cargo-culting. "sync sync sync reboot " became an idiom for various reasons. Then it became "sync; sync; sync; reboot" and deemed equivalent, which was missing the point that physically pressing "enter" introduced some human-length pauses into the…
Not memorizing all of sudo's flags isn't cargo culting, and neither is using cat to improve clarity.
The options I've memorized over the years are the ones I've used the most often, and this inertia can lead to ignorance, unless I periodically revisit the manual page to see what else can be done.
Every IT/CS instructor will tell you that your source of truth is the vendor's documentation. Don't waste your time Googling Stackexchange when the manual pages are available right on the system, on a website, or however. The manual pages are written by the developers and tech writers to specifically tell you how to use these commands.
You can either "cat for clarity" for the rest of your career, or you can learn new methods like shell redirects, "tee(1)", "exec "When all you have is a hammer, everything looks like a nail."