Brisket! Sourdough!

15.5 pound brisket, $3.78 per pound, Sam’s in Idaho Falls, 4 Tbsp salt, 4 Tbsp pepper, 2 Tbsp garlic powder. Gonna put them on at 225℉ to start.

1810, 9 Nov: brisket on the smoker.

1830: sourdough is fermenting.

2200: flat is at 160℉, point at 142℉.

0210, 10 Nov: flat is 166℉, point 164℉. Crutched it!

0730: flat is 186℉, point 187℉. Turned temperature up to 250℉.

0845: put the rest of the ingredients in the bread. I’ve continued doing the 1 tsp regular yeast along with the sourdough starter, and doubling sourdough starter over the Josie Baker recommendation.

0930: flat is 201℉, point 200℉. Almost there!

1000: both are at 202℉. Just one degree more!

1045: sourdough starting bulk rise.

1110: brisket at 203℉. Taking it off.

Cleaned up, sliced up, gotta cool a bit…

1400: sourdough in the pan for final rise.

1712: sourdough in the oven.

Now brisket sandwiches will be almost from scratch… Everything except cheese and BBQ sauce

CybatiWorks PI – Running on QEMU

CybatiWorks is an educational and research tool for learning about Industrial Control System cyber components. I haven’t used it much, but it looks like it’ll simulate a PLC controlling a process, and it’ll do it on a Raspberry PI, GPIO-connected hardware, and a controlling HMI (Human-Machine Interface) desktop. You can buy the hardware pre-setup, then use it in a course.

The person who runs the company is Matthew Luallen, and he’s quite responsive over email. I’ve been trying to look into the system a bit, and CybatiWorks offers the RasPI image for free through their “Community” program. Unfortunately that’s run by Google+, and is now a broken link. Emailing the responsive founder, however, will get you a link to the necessary image.

Now that I had the RasPI image though, I needed to run it, and didn’t have a PI handy. It was time for QEMU. This gentleman had a great start, and following his instructions allowed me to investigate the system partially, but that methodology gets you only 256MB RAM total. I needed more to start up all the services in the image, so I could see them work together.

QEMU’s documentation had a way forward – use the “virt” machine instead of versatile.., but this necessitated building a new kernel. Something I learned during this process – kernels built for one ARM machine don’t seem to work well on others. I’m not 100% why, I’ve definitely seen lots of binaries work interoperably, but kernels seem to be very specific (at least with QEMU).

The RasPI image comes with a kernel, f3n3s7ra’s page recommended a kernel… Unfortunately the QEMU documentation recommends installing a Debian image to get the kernel and initrd. That took several hours – now that I extracted them I’ve got them available for download via the links in the previous sentence (these came from the Debian project on 1 Nov 2019).

Once you’ve got initrd, vmlinuz, and CybatiWorksPI.img extracted from the email Matthew can send you, the command below will startup QEMU with a working network stack and kick you to a shell as root. You may have to switch the window view over to “serial0”.

sudo qemu-system-arm -M virt -m 1024 -kernel vmlinuz-3.16.0-6-armmp-lpae -initrd initrd.img-3.16.0-6-armmp-lpae -drive if=none,file=CybatiWorksPI.img,format=raw,id=hd -device virtio-blk-device,drive=hd -netdev tap,id=ethdev -device virtio-net-device,netdev=ethdev -no-reboot -append "root=/dev/vda2 rootfstype=ext4 rw init=/bin/bash"

You won’t get the typical startup sequence via systemd, and I haven’t been able to get that working yet, but you can do something similar with the command below (from the QEMU command line). This’ll kick off runlevel 3 startup scripts.

cd /etc/rc3.d
for i in S*; do ./$i restart; done

Now an ifconfig should reveal that eth0 is up and at 172.16.192.30/24. Back on your host computer “sudo ip add add 172.16.192.10/24 dev tap0” will configure tap0 to communicate with the QEMU box. You should now be able to ping 172.16.192.30 from your host.

The default services now should be:
TCP 22 – SSH
TCP 80 – lighttpd
TCP 2812 – monit
TCP 7777 – RexWSTCP
TCP 8000 – WebIOPi
TCP 43981 – RexCore

If you want to run the HMI VM Matthew will send you, don’t set your host to 172.16.192.30, so the VM can take that address. After starting the VM up, you may have to configure subnets more intelligently, and IP forwarding on your host (so the different network devices in your host can communicate).

Blockchain Use in Software Code Signing & Malware C2

I’ve done some small research about blockchain recently, and just want to put my thoughts down on paperblog so I can stop thinking them. Most of this is rehashing information I’ve read, but the “signed code verification” piece towards the end is an idea of mine that I’ve not read about elsewhere.

Blockchain is a hot term these days. It’s a popular management buzzword, and as such it can get thrown about as a cure for just about all that ails you. All businesses need to store data, and blockchain is known as a data-store, so everyone wants to make sure you’ve considered their (probably expensive) blockchain solution for data storage…

Blockchain is good at solving a couple problems though.

  • It can provide a publicly-verifiable record of data’s existence at a point in time. At any point in the future, anybody with access to the blockchain can prove that a certain piece of data existed at the point it was stored on the blockchain. If you’ve got a document that has been digitally signed, you can store the hash of that document on the blockchain. Later blockchain links will all chain back to your document hash, and their presence will prove that your document predated their transactions. Because blockchain additions (is most implementations) occur on fixed schedules, it will be possible to reconstruct exactly when your document must have been added to the chain.
  • Publicly-verifiable records of data’s existence can prove transactions have occurred, or contracts have been signed. This is how a blockchain can act as a ledger. Transactions on the blockchain can represent physical-world transactions, if the participants assign them that meaning, enabling tracking of the transfer of real-world entities between blockchain participants. On a public blockchain these transfers are transparent to everyone involved at all points in the future. They cannot be reverted by any individual except by a future transaction.
  • Transparency means that no trusted third-party needs to exist. Transactions can occur more easily between non-trusting parties without an escrow.
  • Public blockchains get stored by many parties, each having an economic incentive to participate. That means any data stored on them is stored in many places, providing data replication and the potential for access from disparate parts of the world. To store a small amount of data, little economic incentive is required. To store larger amounts of data, much greater incentive is required.

These solutions are enabled by some prerequisites.

  • Blockchains require lots of computational power. Specifically, they require more than your adversaries. To prove data’s existence at a point in time, links must be added to the chain periodically. When adding links to the chain, the other participants in the blockchain must agree on their addition. If there are malicious participants in the blockchain, they may decide to disagree about a set of new links, and instead agree on a different set of links. If the malicious participants form a majority, other participants in the chain will be influenced to believe the new malicious links are legitimate and ignore the others. Participants make decisions based upon cryptographic data that’s passed around, and computing that cryptographic data requires computational power. Therefore, to prevent a malicious takeover of a blockchain, you must have more computational power than any malicious adversaries can muster. In a public blockchain, you get the benefit of all the disparate participants’ computational power. Your adversaries must then overpower the public, instead of just you.
  • Blockchains require a computer network connecting participants. When designing a blockchain for use in low-Internet access areas you really restrict your ability to use existing public blockchains. To add data to a blockchain you must submit your transaction to the other participants, and enough of them must get it for your data to have any chance of being added. If you stop using public blockchains, or use small ones, perhaps because you’re in a remote area, you open yourself up to attacks based on computational power.
  • Public blockchains require economic incentive. Computational power costs money – for hardware, network access, and electricity. Participants in a blockchain require computational power. Thus, participants need a monetary incentive to participate. You pay for data additions to Bitcoin’s blockchain by supplying a small amount of bitcoin that is automatically paid to the individual who adds your data to the blockchain. The amount of data added by each transaction is small, so larger chunks of data require multiple transactions and more bitcoin.

Lots of proposed uses for blockchain have limited applicability due to these requirements.

Potential Use Case: Malware Command and Control (C2)

Malware C2 is an interesting use for blockchain, though. Malware running on end-points often needs to reach out to its creators for further instruction. “Steal files”, “learn about the local network”, “propagate to a nearby computer”, “record keystrokes”, or “delete yourself” are all things malware might want to do, but only when commanded by a remote attacker. Often malware reaches out to one destination for these commands. This is the simplest C2 implementation, where one or a few hard-coded server name or IP address provide the C2 to the malware.

Network defenders can try to detect and block this behavior by redirecting those C2 servers to alternate locations, pretending to be those C2 servers, or by taking over the C2 servers with the permission of law enforcement or the server’s rightful owner.

Blockchain’s distributed nature makes this much more difficult. Given a good-enough implementation, it could be difficult or impossible for defenders to block access to a copy of the blockchain. Because there’s no central server it’s not possible for a defender to take over the blockchain, either. Once a C2 command is added to the blockchain, it is impractical to remove it, too.

We’ve seen a few uses of it this method already. Omer Zohar built and demonstrated this use-case in early 2018. He used Ethereum and its “smart contracts” system to implement encrypted C2 of a nearly unlimited number of malware endpoints. The result was a system that is extremely difficult to block or subvert. As Ethereum increases in popularity the system will be increasingly hard to block. His major limitation was operational cost. Each message to and from an endpoint cost a small amount of Ether, translating to (at the time) about $39 per year per malware instance.

Anonymity is a major benefit of such a system. Many consider blockchain participation to be completely anonymous, however participation often requires money, and that money must enter the system from some point. That money typically comes from a traceable source, however malware authors also steal or “mine” cryptocurrency. Such activity would provide a less-traceable source, and make the system nearly entirely anonymous.

Potential Use Case: Code Signing Transparency

Another potential use for blockchain is in software signature verification. Microsoft’s Windows and Apple’s OS X use software signatures to verify that software was produced by an entity (a company or individual). Software producers compile their code into binaries, then digitally sign them before sending those binaries out into the wild.

This provides end users the assurance that a specific company made the binary. An example is if someone emails you a version of Microsoft’s Notepad. Before executing it you would want to make sure it was actually from Microsoft, otherwise a malicious actor could have modified Notepad to include malicious software. If Microsoft has signed this copy of Notepad, you can verify that signature and prove that Microsoft created it. You would know then that the version of Notepad was safe to execute. Windows and OS X now make it more difficult to execute software that’s not digitally signed by some vendor.

Stuxnet is a piece of malware that abused software signatures. It included components that were signed by legitimate, trusted software vendors. This made those components more likely to be trusted and less likely to be detected. Other malware has abused software signatures, but none has been as high-profile as Stuxnet.

Blockchain’s distributed, transparent, nearly-immutable nature can help solve this problem.

Software signatures can currently be verified by a client who trusts a root certificate, and can the follow that root certificate trust through a set of other certificates to the software signature in question. One certificate signs the next, which signs the next… Good verification requires checking a revocation list too, so when invalid signatures are found in-the-wild they can be cancelled.

If an additional step for verification required signatures to be found in a public database of software signatures, all malicious code signers would have to publish their signatures to this public database too. Companies could check the database to determine if someone is signing code on their behalf.

In the event of Stuxnet, JMicron Technology and Realtek Semiconductor would have been able to check the public database regularly. They would have seen a software signature they did not issue, and they could have placed it on the revocation list immediately. They could have then taken action to prevent further signatures in their name.

A blockchain can act as this public database. The result would be widely distributed, and it would be practically impossible to modify or remove signature entries after they were added. As an added benefit, it would become more obvious to observers when a company holds compromised certificates that should no-longer be trusted, and that company’s security practices could become (rightly) suspect. Because blockchain provides an irrefutable timestamp when data is added, signature attack timelines will also become more transparent to security researchers.

Every valid software signature would incur a small cost to be added to the blockchain. Additionally, the signature verification process would become more complex and require Internet access. However, software and hardware vendors could implement API endpoints that handle the blockchain portion of verification, simplifying lookup code for the endpoints they sell. The result would still provide transparency for all signature creators and verifiers.

I haven’t seen this solution proposed elsewhere, however Kim, Kwon and Dumitras recommend that code signing tools log all transactions they complete [Kim, 2017]. Tools like “signtool.exe” in Windows would log “the hash value of program code and the certificates” to Microsoft, then third parties could “periodically audit the log and identify code signing abuse”. This is great, however it doesn’t require software to verify that signatures are present in that log during signature verification. Without that, any attacker that subverts the signature reporting process, by preventing reporting to Microsoft, gets their software signed without reporting it.

References:

Some discussion of blockchain benefits and requirements: https://blog.todotnet.com/2019/03/solving-real-world-problems-with-distributed-ledger-technology/

Paper about blockchain potential in the military: https://www.jcs.mil/Portals/36/Documents/Doctrine/Education/jpme_papers/barnas_n.pdf?ver=2017-12-29-142140-393

Doowon Kim, Bum Jun Kwon, and Tudor Dumitraş. 2017. Certified Malware: Measuring Breaches of Trust in the Windows Code-Signing PKI. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security (CCS ’17). ACM, New York, NY, USA, 1435-1448. DOI: https://doi.org/10.1145/3133956.3133958. URL: http://users.umiacs.umd.edu/~tdumitra/papers/CCS-2017.pdf

Sir Sour

Time to make sourdough again! The starter has been going for a couple weeks, but during that time it never adopted the stinkiness I associated with the early starter stages last time. It does seem to grow after feeding, it produces some alcohol on top… It’s probably doing it’s thing enough to make some bread, so it’s time to try that out.

I was trying to diagnose the difference between the starter this time and last, and the best I can come up with is that the whole wheat flour is pretty old this time. It’s only a couple months away from it’s best-by date, so it has been sitting on the shelf for almost a year. I think in that time the natural yeasts and bacteria in the flour maybe mostly died. This, the harder time starting out. If this loaf is sour and good, perhaps this is really the better situation. Maybe the yeast just went into suspension, and the bacteria died, for instance, letting me skip the “stinky gym socks” state of starter. I don’t know.

Anyway, I started the fermentation last night and things smelled great (a little stinky a little yeasty) this morning, so it seems like the dough is on track. I did my cheater, adding 1 tsp regular yeast in with the other dough ingredients this morning.

The bulk rise finished around 1300 today, and the loaf is quite large. Bread is very forgiving! This will almost certainly be delicious awesome bread regardless of the specifics. Now – will it be the perfect tasting sourdough loaves I was making before? Who knows. It helps that I am pretty easy to please I guess.

Starting final rise

Looking good @1600! The cheater yeast really increases volume.

Final rise complete, about to go in the oven

It’s pretty good! Sour enough… I guess the starter works.

Smoking Salmon in Idaho

Well, we’re still unpacking things, but we’ve been here for a bit. One of the things I was most excited to have arrive is the smoker – not gonna lie, that was a top priority. I’ve been looking forward to having some smoked Salmon again, and Sarah has mentioned it a couple times too.

There’s a Sam’s Club more convenient these days, so I picked up some salmon there. They had Sockeye for about $12 a pound, and “Atlantic” for about $9. I went with the Atlantic to see how it’d go. This looks like the same fish I was buying back at Costco in MD. I’ve heard the Sockeye is amazing – maybe next time. At that price though, I’ll probably smoke some other fish to see how it goes. Trout? This time I picked up two fillets totaling about 5.5 lbs.

0800: The fish swam in the typical brine all night at the bottom of the fridge. I put it in the fridge to dry at this time. We haven’t found our typical wide flat glass brownie baking dishes, or cooling racks, so to get things drying I had to use a couple cake pans with a smoker rack sitting on top of each.

1230: Starting up the smoker – 120℉. I’m a little distracted by a project I’m working on. I should’ve started it up around 1130… Should be fine though, the fish just gets a little more time drying.

1310: Fish is on the smoker. Two hours at 120℉, one at 140℉, then 175℉ until the internal temp is over 135℉. Baste it with maple syrup every hour.

1710: it’s done and it’s fantastic as usual. No problem. The fish has the same quality as what I was buying in MD.