#coding

california@diaspora.permutationsofchaos.com

If you want to be a hacker try to understand this article in detail ...

In-Depth #Analysis of July 2023 #Exploit Chain Featuring #CVE-2023-36884 and #CVE-2023-36584
https://unit42.paloaltonetworks.com/new-cve-2023-36584-discovered-in-attack-chain-used-by-russian-apt/

Why should you care?
* Get a peek into #malware reverse engeneering
* Learn about weaponizing #attack chaining and other evils of a succesful attack
* Understand #Windows client leaks
* Exposure to #Wireshark, #pcap, #procom, ...
* Relevance for Windows #Security Zones, Mark of the Web (MotW)
* ...


#internet #hacker #hack #education #knowledge #coding #web

prplcdclnw@diasp.eu

Interesting Trick with BASH

Also works with DASH

There is a way to get rid of the last, and only the last, newline in a file, if it exists. xxd, in case you don't use it often, reads stdin and shows you what was read, in hex.

printf "one\ntwo\nthree\n" > test.txt
cat test.txt | xxd
00000000: 6f6e 650a 7477 6f0a 7468 7265 650a       one.two.three.
printf "%s" "$(cat test.txt)" | xxd
00000000: 6f6e 650a 7477 6f0a 7468 7265 65         one.two.three

This won't work with DOS-style newlines (\r\n). The last \r won't be eliminated. That would need a tr -d "\r", but that would eliminate all the \rs.

If you knew for certain that there was a newline at the end, you could measure the length of the file with wc -c and use head -c to eliminate it. But this trick is so simple, I think I'd use it anyway with BASH and DASH.

I don't know if this trick works with any shells other than BASH and DASH. I think printf is always a built-in command, so it would depend on the shell.

BTW, DASH is the variant form of BASH that Debian and Debian derivatives use. With Mint, commands you type from the command line, by default, use BASH, but scripts, by default, use DASH. This matters because echo works slightly different with DASH and BASH. That's why some people use printf "%s\n" "whatever" instead of echo "whatever" in scripts.

#newline #newlines #bash #dash #shell #shell-script #trick #hack #programming #coding

danie10@squeet.me

Revisiting Borland Turbo C/C++, A Great IDE back in the 90s

A DOS based menu options screen with square brackets to select options
“Tough Developer” did this blog recently about looking back at Turbo C and Turbo C++, and also installed an old version to play around with it.

It is a reminder of how far we have come, firstly from the late 1980s and early 1990s, and secondly for those who remember coding with it back then, how advanced it was in its day. Coding before this time was “basically” (yes, I know) standalone text file editing (the days of Emacs and Vim), and you’d debug really from compiler errors.

I’d been programming in Quick Basic for DOS before this, and I only wrote one program in C++ using Borland C++, before I moved on to Visual Basic (with real GUI Windows), and Clipper, Python, etc.

Because there was no Internet yet, nor YouTube, I had to buy paper books to learn from (even though the Borland C++ package came in a massive, cubed foot size box with about 7 or 8 manuals). I still have the three books: Using Borland C++ 3, Tom Swan’s Code Secrets, and The Waite Group’s Turbo C++ Bible.

Maybe I just did not try a hard enough, but the whole C++ syntax never sat well with me. Yes, it wrote really nice tight code, but for some reason I never felt I could just flow with it.

It felt like, back then, that computing was really advancing in leaps and bounds every year or every second year. Graphics cards changed resolution and EGA colour came out, sound went from beeps to real true sound, spreadsheets appeared for the first time, the mouse appeared, graphical interfaces appeared (before Windows even), simulated multitasking appeared, the 640k memory barrier was broken (remember extended RAM and DR DOS?), we progressed from single sided floppy discs to double-sided, stiffy discs, token ring networks (with their T-connectors) appeared and were later replaced by Ethernet, 10MB MFM hard drives, and finally USB ports.

Today, graphics are already so good, storage is so abundant, processors so powerful, so most new innovations are just incremental in nature, and hardly noticed. As I heard on the LTT channel the other day, a user will notice moving from 60Hz refresh rate to a 120Hz monitor, but they will really struggle to notice improvements from 144Hz to 240Hz even though it is double the refresh rate.

Apart from a bit bigger and a bit better, the only big advancement that I remember from the last 15 years or so is SSD drives coming out (super light power, much more robust, and superfast). Even webcams and optical mice had already started to appear 20 to 24 years ago.

See https://www.codeproject.com/Articles/5358258/Revisiting-Borland-Turbo-C-Cplusplus-A-Great-IDE-b
#Blog, #BorlandC++, #coding, #retro, #technology