· 8 years ago · Jan 17, 2018, 09:58 AM
1security/privacy/anonymity notes (computer)
2
3TABLE OF CONTENTS
4•Security/privcy focused OSes with main security features
5•Virus detection software with main security features
6•Domain Name System (DNS) security
7•Browser security/privacy Add-ons
8•Good email providers
9•security/privacy focus Search Engines
10•Anti-keyloggers
11•Firewalls
12•memory protection
13•Linux Kernel Security
14•BSD Kernel security
15•compiler security
16•hardware security
17•802.11 network security
18•Router security
19•vulnerability scanners
20•secure Microkernels
21•security by isolation programs
22•network intrusion prevention system (NIPS) and network intrusion detection system (NIDS)
23•host-based intrusion detection system (HIDS)
24•packet analyzers
25•Packet Filters
26•network security scanner
27•disk encryption
28•security audit tools
29•Network and applications layer authentication and encryption methods
30•Executable space protections
31•server security suite
32•VPNS
33•proxies
34•whistleblower submission system
35•distributing files anonymously
36•scan websites automatically for common vulnerabilities and errors that can de-anonymize the owner or users
37•protection against Metadata
38•proof that bugs can go undetected for atleast 1 year or more!
39•protection against Cross-Site Request Forgery (CSRF)
40•Preventing Remote File Inclusion (RFI) Attacks
41•cross site scripting (XSS) prevention
42•defenses against SQL injections
43•XPath Injection Defenses
44•problems that have not been solved yet
45•General and technical Notes
46
47-------------------------------------------------------------------------------------------------------
48Security/privcy focused OSes with main security features
49
50
51Subgraph OS: security by kernal namespaces isolation, The kernel is patched with an unofficial port of grsecurity/PaX, Tor, Metaproxy is configured to redirect outgoing connections to the Tor network, dm-crypt, noscript, apparmor, Application firewall,MAC spoofing with Macouflage, seccomp-bpf whitelisting and blacklisting as part of Oz,most of subgraph is coded in golang,disguise's a user's IP address,prevent ISP spying,Prevent websites from identifying the user,Prevent malware from identifying the user,Circumvent censorship,Hide Tor use from network observers,uses Xpra to isolate X11. (https://subgraph.com/sgos/)
52
53
54
55
56Qubes OS: security by VM isolation, Qubes relys on Xen to enforce domain isolation rather then a monolithic kernal that has millions of lines of coding,LUKS, Whonix,firewall,DispVM template,Type 1 hypervisor,USB VM, secure copy and paste operations, secure copying and transfer of files, and PDF/image sanitization,Yubikey,each AppVM has it own local isolated dummy X server.The main X server that runs in Dom0 and that handles the real display is never exposed to any of the AppVMs directly,and if used with whonix you are able to:1.disguise's a user's IP address 2.prevent ISP spying 3.Prevent websites from identifying the user 4.Prevent malware from identifying the user, 5.Circumvent censorship,Qubes uses hardware memory
57virtualization (HVM) instead of paravirtualization (PV),the Qubes architecture has been reworked to make it more simple,and to add more features more easily for developers,comes with SaltStack:allows administrators to easily configure their systems. (https://www.qubes-os.org/)
58
59
60
61
62
63OpenBSD: security by correctness, security by reduced code, buffer overflows or integer overflows resistant, has the strlcpy and strlcat functions,firewall, OpenSSH, Reduced attack surface:no loadable modules, relatively few devices, Virtually no compat code, removed entire Bluetooth stack, Significantly less syscalls (e.g. 200+ syscalls less than FBSD) Cut support for some older architectures, Code Quality:int overflows/signedness bugs, as good as gone in most places. (https://www.openbsd.org/)
64
65
66
67
68
69FreeBSD: has the strlcpy and strlcat functions, Sysctl, Secure Level, Jail, Syslog, Mandatory access control (MAC) support is enabled by default, Firewalls: The base system includes IPFW and IPFilter, as well as a modified version of the popular pf with improved SMP performance, OpenSSH. (https://www.freebsd.org/)
70
71
72
73
74
75Whonix: security by VM isolation, Tor ,uses apt-transport-tor for stream isolation,outgoing connections forced to go through Tor otherwise blocked, noscript,firewall, HTTPS everywhere,DNS leaks are impossible,replaces NTP with sdwdate, mechanism to disable Tor stacking,Malware with root privileges cannot discover the user's real IP address,Whonix is divided into two parts: Whonix-Workstation for work activities and Whonix-Gateway or proxy to enforce all Internet traffic routing via the Tor network. This security by isolation configuration averts many threats posed by malware, misbehaving applications, and user error,disguise's a user's IP address,prevent ISP spying,Prevent websites from identifying the user,Prevent malware from identifying the user,Circumvent censorship,Secure data transfer to and from a server with scp,Unobserved administration of servers via SSH,With the Whonix design, it is possible to "torify" applications which are not capable of proxy support by themselves,Hide Tor use from network observers,Hide installed software from network observers. (https://www.whonix.org/)
76
77
78
79
80
81Trusted End Node Security (TENS): security by reduced code, DNScrypt, does not mount a local hard drive, Administrator privileges are not required; nothing is installed,run entirely from the computer's RAM,firewall. (https://www.spi.dod.mil/download.htm) (warning this site appears to not be using https)
82
83
84
85
86
87TinHat: run entirely from the computer's RAM, does not mount any file system, gresecurity/pax,firewall. (http://tinhat.sourceforge.net/) (the site is not using https) (outdated sadly)
88
89
90
91
92
93The Amnesic Incognito Live System (TAILS): Tor,use state-of-the-art cryptographic tools, stream isolation,run entirely from the computer's RAM, LUKS, noscript, outgoing connections forced to go through Tor,firewall,disguise's a user's IP address,prevent ISP spying,Prevent websites from identifying the user,Prevent malware from identifying the user,Circumvent censorship. (https://tails.boum.org/)
94
95
96
97
98Alpine Linux:The kernel is patched with an unofficial port of grsecurity/PaX, and all userland binaries are compiled as Position Independent Executables (PIE) with stack smashing protection,run entirely from the computer's RAM, is built around musl libc and busybox. (https://www.alpinelinux.org/about/)
99
100
101
102
103
104NOTES
105
1061.Tor helps to protects users by bouncing communications around a distributed network of relays run by volunteers all around the world. Without advanced, end-to-end, netflow correlation attacks, anybody watching a user's Internet connection cannot easily determine the sites visited, and those sites cannot learn the user's physical location. (https://www.whonix.org/wiki/About)
107
108
109
110
1112.The public scrutiny of security by design has proven to be superior to security through obscurity.This principle asserts that systems must be secure, even if the adversary knows everything about how they work. (https://www.whonix.org/wiki/Why_Whonix_is_Free_Software)
112
113
114
115
1163.The user is usually the weakess part in security,when it comes to lack of user knowledge in cyber security defenses and what not to do,thats why its important to know as much as you can about cyber security not just installing security software or updating your OS,but knowing how everything works.
117
118
119
1204.In many parts of the globe, direct connections to the Tor network are censored. It is simple for censors to use technology to block connections, because it only requires maintenance of a real-time blacklist of all publicly known Tor (guard) relays and directory authorities.
121
122In order to try and solve this problem, the Tor project came up with the idea of making a proportion of Tor guard relays only available via relatively private channels. However, since these alternative guard relays ("vanilla bridges") use the same protocol to communicate with the Tor clients as normal guard relays, a censor can simply identify the Tor signature of the network connection and then block it.
123
124Tor developers have recognized that security by obscurity has failed many bridge users, because most are still blocked in repressive environments. This has led to the development of Pluggable Transports (PTs), which help to circumvent censorship by transforming the Tor traffic flow between the Tor client and the bridge so it appears to be "innocent" network traffic, instead of the actual Tor traffic.
125
126Unfortunately, traditional obfusticated bridges - obfs2, obfs3, obfs4 - still depend on censors being unaware of bridge information (like the IP address), which is still a security by obscurity approach. This allows aggressive censors to gradually block known obfusticated bridges by requesting the same information from the Tor Project BridgeDB, as any normal user would do.
127
128potential solution:Unlike traditional bridges, meek_lite utilizes the concept of collateral freedom.meek_lite has recently proven to perform better in circumventing censorship than other methods. For example, during the 19th National Congress of the Communist Party of China held last month, meek was one of the few effective tools to bypass strengthened Internet censorship. (https://www.whonix.org/blog/meek_lite-whonix-14)
129
130
131
132
1335.Because the OpenBSD project is based in Canada, no United States export restrictions on cryptography apply, allowing the distribution to make full use of modern algorithms for encryption. Encryption can be found almost everywhere in the operating system, from file transfers to file systems to networking. Pseudo-random number generators are also included in OpenBSD, which ensures that random numbers cannot be predicted based on the system state. Other features include cryptographic hash functions, cryptographic transform libraries, and cryptographic hardware support. (https://www.ibm.com/developerworks/aix/library/au-openbsd.html)
134
135
136
137
138
1396.Zero-day exploits are computer vulnerabilities, which have not yet been discovered.
140
141
142
143
144
145--------------------------------------------------------------------------------------
146Virus detection software with main security features
147
148
149
150
151Malwarebytes Endpoint Security: Detects and removes zero-hour and known Trojans, worms, adware,spyware, and other malware,employs delete-on-reboot to remove persistent or deeply embedded malware,removes PUP (Potentially Unwanted Program),anti-ransomware technology,malicious website blocking,Real-time protection,Anti-rootkit,Maintains productivity by preserving system uptime and reducing the need for reimaging. Reduces the burden on the IT department,Identifies vulnerable endpoints and aggregates endpoint reporting. Includes XML logging in machine- and human-readable formats for robust analysis,Linking Engine:Signature-less technology that identifies and thoroughly removes all threat artifacts linked with the primary threat payload,Small system footprint. (https://www.malwarebytes.com/business/endpointsecurity/) (https://www.itcadence.net/services/cloud-security/)
152
153
154
155
156
157
158avast! Free: Provides on-access protection from viruses and other malware,Includes a "heuristics engine" to detect previously unknown threats,Includes real-time protection of files, email, web surfing, P2P transfers, instant messages, and even suspicious behavior (https://www.thebalance.com/avast-free-antivirus-2016-review-1356598)
159(https://www.avast.com/en-us/free-antivirus-download)
160
161
162
163
164
165webroot secure anywhere: Can recover files encrypted by ransomware. Uses tiny amount of disk space. Very fast scan. Handles unknown malware. Includes firewall.Webroot's cloud-based servers maintain a giant database of known programs, good and bad.When Webroot encounters an unknown program, it sends detailed telemetry to HQ for analysis, and starts monitoring that program. Every action by the suspect gets journaled for possible rollback. Of course, some events can't be rolled back. Transmitting data to an outside source is one example. Webroot doesn't let an unknown program perform that sort of action,that means a valid unknown program might not be fully functional for a while. (https://webrootsupports.weebly.com/)
166
167
168
169
170
171RKhunter (Rootkit Hunter): is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. It does this by comparing SHA-1 hashes of important files with known good ones in online databases, searching for default directories (of rootkits), wrong permissions, hidden files, suspicious strings in kernel modules, and special tests for Linux and FreeBSD. (http://rkhunter.sourceforge.net/) (https://en.wikipedia.org/wiki/Rkhunter)
172
173
174
175
176
177chkrootkit: locally checks for signs of a rootkit (http://www.chkrootkit.org/)
178
179
180
181
182
183Rogue killer TKZY: is an anti-malware able to detect and remove generic malware and advanced threats like rootkits, rogues, worms.It also detects controversial programs (PUPs) as well as possible bad system modifications/corruptions (PUMs). (https://www.adlice.com/download/roguekiller/)
184
185
186
187
188
189
190virustotal: Analyze suspicious files and URLs to detect types of malware including viruses, worms, and trojans. File URL Search. (https://www.virustotal.com/#/home/upload)
191
192
193
194
195
196urlscan.io: allows you to scan a website and analyze the resources it requests and the domains it contacts. Understand what your website is doing. (https://urlscan.io/)
197
198
199
200UrlQuery.net: is a free online service for testing and analyzing URLs, helping with identification of malicious content on websites. The main focus of urlquery.net is to find and detect suspicious and malicious content on webpages, to help improve the security industry and make the internet a safer place. (https://urlquery.net/about)
201
202
203
204
205NOTES
2061.Antivirus tools are actually worse than useless. In the case of sophisticated and targeted attacks, the antivirus software can serve as a pathway to exploiting a system's kernel, since they almost always run with administration level privileges.Polymorphic code and kernel rootkits or hardware rootkits essentially render antivirus products helpless. (https://www.whonix.org/wiki/Malware)
207
208
209
2102.payloads can be completely obfuscated from antivirus detection, but the stub portion remains. The stub is a more difficult portion to obfuscate, because it must remain executable in order to properly perform its job of decrypting and running the original executable. Since the payload changes for each instance, antivirus signatures have to match on the stub portion in order to be able to match more than a single individual piece of malware.In order to obfuscate the stub program, a unique stub generator (USG) can be used. The generator might insert random data in certain unused locations of the stub. It might insert randomized executable operations that have no effect. It might substitute or reorder certain portions of the code. The USG attempts to create a stub that is both unique and that contains as small of an unchanging portion of code as possible to make signature creation more difficult.It is expected that a FUD product will have a relatively short useful lifespan before antivirus companies can reliably detect executables that have been created by it.
211
212
213the next step in detecting malware is behavior- and reputation-based technologies not depending on signatures. If effective, tricks such as FUD cryptors may be made obsolete by improvements to behavior- and reputation-based detection.
214(https://www.symantec.com/connect/blogs/fully-undetectable-cryptors-and-antivirus-detection-arms-race)
215
216
217
2183.cloud AVs https://www.blackhat.com/docs/us-17/thursday/us-17-Kotler-The-Adventures-Of-Av-And-The-Leaky-Sandbox.pdf
219
220
221
2224.reporting phishing websites tip:
223
224Right-click the link in the phishing email, and copy the hyperlink. Do not click the link, which is less useful to security companies.
225(https://decentsecurity.com/#/malware-web-and-phishing-investigation/)
226--------------------------------------------------------------------------------------------
227Domain Name System (DNS) security
228
229
230quad9: blocks against known malicious domains, preventing your computers and IoT devices from connecting malware or phishing sites. Whenever a Quad9 user clicks on a website link or types in an address into a web browser, Quad9 will check the site against the IBM X-Force threat intelligence database of over 40 billion analyzed web pages and images. Quad9 also taps feeds from 18 additional threat intelligence partners to block a large portion of the threats that present risk to end users and businesses alike. (https://www.quad9.net/#/about)
231
232
233
234
235Tenta DNS: is a modern, secure DNS alternative that supports both ICANN and OpenNIC roots, DNS over TLS and DNSSEC (DNS Security Extensions).Tenta is also written in written in Golang! (https://tenta.com/blog/post/2017/11/introducing-tenta-dns)
236
237
238
239OpenDNS
240
241
242
243
244DNScrypt
245
246
247
248DNSSEC
249
250
251
252
253DNS over TLS (https://tools.ietf.org/html/rfc7858)
254
255
256
257
258NOTES
2591.onion services don't use the insecure Domain Name System (DNS), which means there is no organization like ICANN to oversee a single root registry of onion addresses or to handle ownership dispute resolution of onion addresses. Instead, onion services get strong authentication from using self-authenticating addresses: the address itself is a cryptographic proof of the identity of the onion service. When a client visits an onion service, Tor verifies its identity by using the address as ground truth. (always use onion addresses on tor)
260
261
262
2632.DNSCrypt provides a panacea to the woes plaguing DNS. It encrypts both the question and answer, making them invisible to snoopers. It also effectively signs the message, so you know that the server you contacted really sent the answer and not an impostor. It's as if someone blocked out the messages on your postcard and the postcard you receive back includes a signature.
264
265Although DNSCrypt provides a significant security advantage, it comes with other disadvantages:
266
267Not completely encrypted: Even though the domain requested (question) and IP address (answer) is hidden, the complete process is not obfuscated. The total number of questions, their relative size and more remain available. Furthermore, it remains trivial to identify that you are, in fact, performing DNS resolution.
268
269Complex and not well supported: In the world of encryption, it's always safer to go with standardized protocols that have gone through a rigorous review process. Unfortunately DNSCrypt has not been standardized yet, and some of the ways it uses cryptography are unusual.
270
271Hard to use: Because DNSCrypt isn't standardized, very few programs natively support it, requiring users to download and configure helper applications, significantly increasing the difficulty of use and risk of misconfiguration.
272
273
274
2753.DNS over TLS takes a completely different approach, establishing a fully encrypted tunnel between your computer and the DNS server. Rather than sending requests in the clear, with just the critical data encrypted, the whole connection is encrypted. Furthermore, since TLS is the encryption protocol used to secure almost all other internet services, the technology is well understood and constantly improved.
276
277--------------------------------------------------------------------------------------------------------
278Browser security/privacy Add-ons
279
280
281HTTPS everywhere
282
283
284Noscript
285
286
287WOT
288
289
290Ghostery
291
292
293Ublock origin
294
295
296Privacy Badger
297
298
299User Agent Switcher
300--------------------------------------------------------------------------------------------------------
301Good email providers
302
303
304Riseup.net:collective dedicated to providing private and secure hosting, listing and mail services for individuals and organisations who are committed to political and social justice.Their services are free and Riseup does not monitor your activity,RiseUp operates exclusively over the Secure Sockets Layer (SSL),leaving Alternate email field empty will provide better privacy, but will not let you reset your password for this account in case you forget it.Riseup is currently using Roundcube, a free and open source web mail interface. Roundcube require JavaScript. If you prefer not to use it, Riseup also lets you access your email with SquirrelMail (see below). Riseup web mail also need your browser to accept cookies If you are using a public or shared computer (for example in an Internet café, community centre or library), you can enter your password by using the virtual keyboard. It offers your email account another layer of protection from key-logger programs.
305
306
307
308Protonmail:requires two passwords, which provides an added layer of protection.The login password gets sent to the server, and that’s how you prove that your username is actually yours. And the second is the mailbox password, which never gets sent to ProtonMail’s server. The second password runs in your browser and decrypts your messages there.stores your email encrypted to disk which means the emails would be undecipherable without your password if a government agency compelled the company to hand over your communications.
309
310
311
312Icedove (you should add these two add-ons Enigmail and TorBirdy.)
313
314
315
316I2P-Bote (has automatic encryption and signing without relying on third-party software such as PGP/GnuPG)
317
318
319
320BitMessage
321
322
323
324
325
326
327NOTES
3281.Use split-GPG for email to reduce the risk of key theft used for encryption / decryption and signing.
329
330
3312.Create an AppVM that is exclusively used for email and change the VM's firewall settings to only allow network connections to the email server and nothing else ("Deny network access except...").
332
333
3343.Only open untrusted email attachments in a DisposableVM to prevent possible infection.
335
336
3374.Although RiseUp is a secure email service managed by trustworthy advocates of Internet privacy and security, an unusual email service may attract unwarranted attention. It might make more sense in some situations, to blend in by using a popular email service in your country.
338
339
3405.One of the big issues is that it isn't easy to know whether a message sent to another ProtonMail user is being encrypted to the recipient’s correct public key, which is stored on ProtonMail’s keyserver. For example, if Alice sends Bob a message encrypted to his public key, it's harder for anyone else to read the message. But since ProtonMail distributes the encryption keys to users, it has the technical ability to give Alice its own keys in addition to Bob’s, thus encrypting the messages in a way that would allow it to eavesdrop.This problem is not unique to ProtonMail, says Joseph Bonneau, a technology fellow at the Electronic Frontier Foundation. Apple's iMessage and the now-encrypted WhatsApp have the same flaw. (Services like TextSecure, Silent Circle, and Threema, on the other hand, allow users to verify fingerprints to assure that they have the proper keys for one another, thus mitigating that threat.)Thats why its recommanded to use split-GPG with Protonmail.
341
342
343
3446.Email identities were really easy to spoof back in the 90s and early 2000s. Changing the “From†header field was enough to make friends believe an email came from their mother, significant other, or even the FBI. There were websites specially made for this purpose.However, those tricks no longer work thanks to anti-spoofing protections such as DMARC (DKIM / SPF) and anti-spam filters. Today, emails with a spoofed “From†field either go to the spam folder or are completely rejected by the server.Email usage is higher than ever and email is used for everything – from tracking parcels to sharing sensitive data. Unfortunately email is already not a very secure way to communicate.We’ve seen a lot of malware spreading via emails, relying on social engineering techniques to convince users to open unsafe attachments, or click on phishing links. The rise of ransomware distributed over email clearly demonstrates the effectivity of those mechanisms.
345
346
347
3487.list of email providers vulnerable to mailsploit https://docs.google.com/spreadsheets/d/1jkb_ZybbAoUA43K902lL-sB7c1HMQ78-fhQ8nowJCQk/edit#gid=0
349--------------------------------------------------------------------------------------------------------
350security/privacy focus Search Engines
351
352
353
354DuckDuckgo
355
356
357Startpage
358
359
360Disconnect
361
362--------------------------------------------------------------------------------------------------------
363Anti-keyloggers
364
365
366Zemana AntiLogger
367
368KeyScrambler
369
370
371
372NOTES
3731.Using a virtual keyboard can help protect against keyloggers.Key-logger programs are designed to monitor user's physical key strokes to record passwords, usernames and other vital information. Virtual keyboard allow users to circumvent this security vulnerability, by letting the user enter their password using the mouse.
374
375--------------------------------------------------------------------------------------------------------
376Firewalls
377
378
379Next Generation Firewall check point
380
381Barracuda NextGen Firewall (NGF)
382
383ipfire
384
385smoothwall express
386
387
388
389NOTES
3901.If your firewall works by blocking ports, then you can tell Tor to only use the ports when you start your Tor Browser. Or you can add the ports that your firewall permits by adding "FascistFirewall 1" to your torrc configuration file. By default, when you set this Tor assumes that your firewall allows only port 80 and port 443 (HTTP and HTTPS respectively). You can select a different set of ports with the FirewallPorts torrc option.
391
392
3932.In complete and utter disregard for the IETF, unused network ports should provide no response even via ICMP. ICMP should be disabled as far as possible.
394 (https://www.quora.com/What-desktop-OS-kernel-is-the-most-hardened-the-most-unhackable)
395
396
397--------------------------------------------------------------------------------------------------------
398memory protection (memory corruption,userland memory protection,direct memory access (DMA),Return Oriented Programming (ROP),heap protection,etc.)
399
400
401
402ptmalloc2: was forked from dlmalloc.During early days of linux, dlmalloc was used as the default memory allocator. But later due to ptmalloc2’s threading support, it became the default memory allocator for linux. has undergone several recent changes as of version 2.3.4 it contains numerous security enhancements,increasing the difficulty of exploiting heap corruption vulnerabilities. The glibc heap now contains safe unlinking, and a bunch of other features that raise the bar of exploitation significantly, however, these changes are still relatively minor - and are quite different from the fundamental changes that OpenBSD is making.
403
404
405
406phkmalloc:if you're running one of the BSDs, you're probably running phkmalloc.In practice, phkmalloc has been a little bit more difficult to exploit, though I don't think that this was so much an intentional feature as much as a side effect of the algorithm. It will suffice to say that the two algorithms are distinct and different.
407
408
409
410phkmalloc vs ptmalloc2:Fundamentally, they're both trying to solve the same problems, and both of them are quite effective - I certainly don't want to downplay the effects of the recent changes to ptmalloc2. Perhaps the only fundamental difference between the two, from the perspective of an end-user, is that the OpenBSD implementation will do a better job of preventing heap exploitation through heap data corruption (as opposed to heap management data corruption - sorry if the difference between the two isn't obvious), and the OpenBSD implementation will complain loudly (crash) almost every time there is a problem.
411
412
413
414PartitionAlloc:PartitionAlloc, part of the Google Chrome web browser. It has an out-of-line metadata design such that heap metadata is partitioned or guard paged off from the calling program's buffers. The notable exception, shared with tcmalloc, is freelist pointers, which occupy the freed slots. In PartitionAlloc, freelist pointers are transformed so that dereferencing them faults, and partial pointer overwrites are thwarted.While writing PartitionAlloc, strictly protected heap metadata was a goal. After all, if the metadata is naturally guarded with guard pages then there's less need for code defenses which are trying to detect and stop bad side effects from metadata corruption. Simplicity wins.However, there's an interesting interaction with single byte overflows that provides pause for thought and philosophizing.With an out-of-line metadata design, a single byte overflow off the end of a chunk will hit the first byte of some other chunk. Depending on the different object types that could be in the adjacent chunk, that's potentially a lot of possibilities for the attacker to explore.
415
416
417
418
419
420Address space layout randomization (ASLR):Attackers are able to a priori pick the right code pieces because parts of the code image of the vulnerable application remain static across different installations. Address space layout randomization (ASLR) is meant to prevent this kind of code reuse by randomizing the locations of the executable segments of a running
421process. However, in both Linux and Windows, parts of the address space do not change due to executables
422with fixed load addresses, or shared libraries incompatible with ASLR. Furthermore, in some
423exploits, the base address of a DLL can be either calculated dynamically through a leaked pointer,
424or brute-forced.
425
426
427
428
429Selfrando:randomizes Tor browser code to ensure that an attacker doesn't know where the code is on your computer. This makes it much harder for someone to construct a reliable attack--and harder for them to use a flaw in your Tor Browser to de-anonymize you.Software written in C and C++ is exposed to exploitation of memory corruption. Compilers and operating systems include various exploit mitigation mechanisms that prevent certain offensive techniques. Unfortunately, standard mitigations lag behind the offensive techniques used in exploits against browsers, servers, and other frequently targeted software and do not stop a well-resourced adversary.selfrando can be used to harden your software beyond what is possible with current mitigations. Inspired by biodiversity in nature and existing randomizing defenses, selfrando varies the attack surface, i.e., the code layout, by randomizing each function separately. This makes exploit writing harder and increases resilience to information leakage relative to traditional address space layout randomization (ASLR) techniques.
430
431
432
433
434
435RELRO:Hardens ELF programs against loader memory area overwrites by having the loader mark any areas of the relocation table as read-only for any symbols resolved at load-time ("read-only relocations"). This reduces the area of possible GOT-overwrite-style memory corruption attacks. (included in gresecurity)
436
437
438
439
440PAX_USERCOPY:kills heap overflow bug when the memory copy occurs between userspace and kernel space in either direction. The 1st version developed by Spender in 2009 and added into PaX later. HARDENED_USERCOPY is part of PAX_USERCOPY being ported to linux kernel in v4.8.
441
442
443
444
445
446KERNEXEC (included in gresecurity): prevents the kernel from executing data that is writable (including userland data). So modifying the IDT would be mitigated as well.
447(http://blog.siphos.be/2013/05/looking-at-the-local-linux-kernel-privilege-escalation/)
448
449
450
451
452
453UDEREF stronger than Supervisor Mode Access Prevention (SMAP) (included in gresecurity): The kernel will not de-reference userland pointers in contexts where it expects only kernel pointers. This feature cannot be disabled while the kernel is running.
454(https://wiki.gentoo.org/wiki/Hardened/PaX_Quickstart)
455
456
457
458
459KERNSEAL (included in gresecurity)
460
461
462
463
464STRUCTGUARD (included in gresecurity)
465
466
467
468
469
470Reuse Attack Protector (RAP):RAP is the state of the art in CFI defense and is a ROP mitigation technique,RAP's tags don't depend on the secrecy of the tag values themselves,neither kbouncer nor code randomization can do anything about function pointer hijacking -- RAP ensures that a function pointer can only be used to call a real function, not a gadget, and only a function whose type matches the type hash identified during compile time,and thanks to RAP,Stack Smashing Protector (SSP) is no longer needed.(included in gresecurity)
471
472
473
474
475
476kBouncer:an efficient and fully transparent ROP mitigation technique that does not requires source code or debug symbols. kBouncer is based on runtime detection of abnormal control transfers using hardware features found on commodity processors. Issues:kbouncer applies its checks using the expensive LBR stack. It's thus only able to apply the checks to the system API level (and then generally only to a subset of those functions, as done in the kbouncer implementation in EMET) to maintain adequate performance. The LBR stack is also limited in size, limiting the call depth that kbouncer can reasonably validate.
477
478
479
480
481In-place code Randomization:ROP mitigation technique,does not require symbolic debugging information,It is applied directly in third party executables,Does not introduce any runtime overhead,Experimentally proved to be effective against windows 7 ROP attacks,It can also be combined with existing security techniques to further increase the randomization
482entropy,but code randomization techniques are vulnerable to arbitrary read vulnerabilities.While RAP is designed to work in the presence of arbitrary reads and arbitrary writes at arbitrary times.
483
484
485
486
487
488Heap corruption mitigations:heap integrity checks, guard pages, and allocation order randomization
489
490
491
492
493
494IOMMU:Thanks to IOMMU,PCI cards are more resisant to Direct Memory Access (DMA) based attacks.
495
496
497
498
499
500You can go to the extreme and turn DMA completely off,losing a huge performance gain from DMA of course.
501
502
503
504
505
506Refuse access to DMA access memory by external devices until after the Windows OS is in control to parse DMA requests.
507
508
509
510
511
512Ensure unnecessary ports that allow attackers to perform a DMA attack (such as FireWire, Thunderbolt, ExpressCard, PC Card or any other PCI/PCIe Hardware interfaces) are disabled in the Operating Environment, and that normal users are prevented from altering such settings.
513
514
515
516
517
518Ensure devices are always secured with the use of some form of power up authentication either thru a BIOS power on password or Pre-Boot Authentication (PBA) from a full disk encryption (FDE) product.
519
520
521
522
523
524If devices are deemed to operating in an unsecure environment, be sure to require the use of hibernation mode and power off when not in use to prevent DMA attacks.
525
526
527
528
529
530
531No-eXecute (NX) is a processor feature that allows marking of memory pages as non-executable. The feature allows the CPU to help guard the system from attacks by malicious software. When the NX feature is enabled on a system, it prevents malicious software code from being placed in accessible regions of memory to be executed when control reaches that memory location.This was originally invented by AMD.
532
533
534
535
536
537XD is the acronym for eXecute Disable, which is an Intel specific implementation of NX. It refers to the same feature but Intel chose to call it by a different name.
538
539
540
541
542XN is the ARM equivalent of the same feature and is the acronym for eXecute Never.
543
544
545
546
547Essentially, both NX, XD and XN are the same and are different names for the same feature in AMD, Intel and ARM respectively.
548
549
550
551
552
553
554 NOTES
5551.Let’s discuss using FDE as a mitigation as the implementation can be tricky: With most encryption products that provide Data-At-Rest (DAR) security, once a legitimate user has successfully authenticated at Pre-Boot, the drive is thereafter “unlocked†and its contents are readable by the operating system and/or any other processes. If the threat of DMA attacks is considered a major risk, then the primary protection against this is to use interactive Pre-Boot Authentication.
556
557Some FDE solutions allow for unattended Pre-Boot Authentication (for example BitLocker with TPM protection). Thus even if the device is powered off when stolen, the attacker can power on the device and it will boot to the OS; similar issues apply to power modes such as Sleep. Thus, the use of unattended PBA is not recommended to ensure an attacker is prevented from launching such an attack. (Note: There are circumstances, depending on the risk profile, where unattended PBA via pre-boot networking with a management server acting as the external authenticator mitigates the risk. Another possible mitigation is to utilize Intel Enterprise Digital Fence.
558
559A DMA-based attack on software encryption is to gain access to the software Encryption Key as well as all sensitive data that is currently in memory. The primary mitigation against such an attack is to use Pre-Boot Authentication with single or multi-factor strong credentials.
560
561A DMA-based attack on a hardware-encrypted drive (SED) such as an Opal drive is an attempt to gain access to the PIN in memory (if it’s stored) that unlocks the SED returning from Sleep mode. The primary mitigation against this attack is also the use of Pre-Boot Authentication coupled with disabling support of Sleep for the system. The use of Sleep mode for Self-Encrypting Drives should be strongly cautioned.
562
563
564
565
566
5672.Due to how modern computing works, basically everything that you have done during a session is stored in the RAM. If an attacker has physical access to your computer when you are running Whonix, it may enable her to recover everything that have been achieved during the session - even if you are using Full Disk Encryption. From typed texts to saved files, including passwords and encryption keys. The more recent the activity, the more likely it is that it is still in the RAM.
568
569Furthermore, it has been shown that the data present in the RAM might be recoverable for seconds or even minutes after the computer is powered off using a cold boot attack.
570
571Wipe RAM on shutdown (e.g. using a kexec script) - or do not leave the computer unattended immediately after shutdown. Unfortunately there is not yet an upstream script, to implement wiping the RAM on shutdown. We can not provide a solution for this attack, this is solved nowhere but partially in Tails and Liberte Linux (not checked), waiting for upstream solution.
572
573
574
575
576
5773.Heap corruption vulnerabilities are one of the most common types of vulnerability that Microsoft addresses through security updates today. These vulnerabilities typically occur as a result of programming mistakes that make it possible to write beyond the bounds of a heap buffer (a spatial issue) or to place a heap allocated object in an unexpected state such as by using the object after it has been freed (a temporal issue).
578
579
580
581
5824.Return-oriented programming (ROP) has become the primary exploitation technique for
583system compromise in the presence of non-executable page protections. ROP exploits are
584facilitated mainly by the lack of complete address space randomization coverage or the presence
585of memory disclosure vulnerabilities, necessitating additional ROP-specific mitigations.
586Existing defenses against ROP exploits either require source code or symbolic debugging
587information, or impose a significant runtime overhead, which limits their applicability for
588the protection of third-party applications.
589
590
591
592
5935.Other defenses against code-reuse attacks complementary to ASLR include compiler extensions,
594code randomization, control-flow integrity, and runtime solutions. In practice,
595though, most of these approaches are almost never applied for the protection of the COTS software currently
596targeted by ROP attacks, either due to the lack of source code or debugging information, or due to their
597increased overhead.
598
599
600
601
602
6036.As code-reuse attacks require precise knowledge of the structure and location of the code to
604be reused, diversifying the execution environment or even the program code itself is a core
605concept in preventing code-reuse exploits.
606
607
608
609
610
611
6127.Address space layout randomization is probably one of the most widely deployed countermeasures against code-reuse attacks. However, its effectiveness is hindered by code segments left in static locations,while, depending on the randomization entropy, it might be possible to circumvent it using brute-force guessing. Even if all the code segments of a process are fully randomized, vulnerabilities that allow the leakage of memory contents can enable the calculation of the base address of a DLL at runtime.
613
614
615
616
617
618
6198.Intra-DLL randomization at the function, basic block, or instruction level can provide protection for executables
620that do not support ASLR, or against de-randomization attacks through memory leaks.
621
622
623
624
625
626
6279.JOP is similar to ROP, but it uses indirect jump instructions instead of returns to transfer
628control from gadget to gadget. Clearly, constructing JOP programs is far more difficult than ROP because
629the attacker has to maintain a memory region with the payload and manually advance the pointer to the
630next gadget and transfer control to it. The same functionality is conveniently achieved by a single return
631instruction in ROP.
632
633
634
635
63610.Stack/heap protectioned provided by linux kernel has only one single page( 4KB by default in i386) due to some compatibility issues. PaX's implementation doesn't have this problem and its gap is 64KB by default. You can set the number at runtime via "sysctl vm.heap_stack_gap"( We have another auditing item for the hardening solution. Thanks to the full disclosure).
637--------------------------------------------------------------------------------------------------------
638Linux Kernel Security
639
640
641Gresecurity: is a set of patches for the Linux kernel which emphasize security enhancements,such as 1.Preventing direct userland access by kernel. 2.Bounds checks on kernel copies to/from userland. 3.ASLR. 4.Prevents userland code execution by kernel. 5.Prevents kernel stack overflows on x64. 6.Hardened userland memory permissions. 7.Random padding between thread stacks. 8.Hardened BPF JIT against spray attacks. 9.Automatically responds to exploit bruteforcing. 10.Chroot hardening. 11.Prevents users from tricking Apache into accessing other users' files. 12.Provides Trusted Path Execution. 13.role-based access control (RBAC).Just to name a few features.
642
643
644
645
646
647PaX:A major component bundled with grsecurity is PaX. Among other features, the patch flags data memory, the stack, for example, as non-executable and program memory as non-writable. The aim is to prevent memory from being overwritten, which can help to prevent many types of security vulnerabilities, such as buffer overflows. PaX also provides address space layout randomization (ASLR), which randomizes important memory addresses to reduce the probability of attacks that rely on easily predicted memory addresses.
648
649
650
651
652
653secure computing mode (Seccomp) (merged into the Linux kernel mainline in kernel version 2.6.12):is a computer security facility in the Linux kernel,seccomp allows a process to make a one-way transition into a "secure" state where it cannot make any system calls except exit(), sigreturn(), read() and write() to already-open file descriptors. Should it attempt any other system calls, the kernel will terminate the process with SIGKILL. In this sense, it does not virtualize the system's resources but isolates the process from them entirely.
654
655
656
657
658cgroups:is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes.
659
660
661
662
663STACKLEAK:-reducing the information that can be revealed through kernel stack leak bugs
664 - blocking some uninitialized stack variable attacks
665 - introducing some runtime checks for kernel stack overflow detection
666
667
668
669
670
671KernelAddressSanitizer (KASAN) (included in the Linux kernel 4.0):Detects OOB for both writes and reads,provides strong UAF detection (based on delayed memory reuse),Does prompt detection of bad memory accesses,Prints informative reports.
672
673
674
675
676
677/dev/mem protection:Some applications (Xorg) need direct access to the physical memory from user-space. The special file /dev/mem exists to provide this access. In the past, it was possible to view and change kernel memory from this file if an attacker had root access. The CONFIG_STRICT_DEVMEM kernel option was introduced to block non-device memory access (originally named CONFIG_NONPROMISC_DEVMEM). (included in the Linux kernel 2.6.25)
678
679
680
681
682
683
684
685/proc/$pid/maps protection:With ASLR, a process's memory space layout suddenly becomes valuable to attackers. The "maps" file is made read-only except to the process itself or the owner of the process. Went into mainline kernel with sysctl toggle in 2.6.22. The toggle was made non-optional in 2.6.27, forcing the privacy to be enabled regardless of sysctl settings (this is a good thing). (Becames non-optional in Linux kernel 2.6.27)
686
687
688
689
690
691
692
693runtime memory allocation validation:Detect double-frees in kernel space.
694
695
696
697
698
699
700Restricting access to kernel logs:The kernel logs contain useful information for an attacker trying to exploit kernel vulnerabilities, such as sensitive memory addresses. The kernel.dmesg_restrict flag was to forbid access to the logs without the CAP_SYS_ADMIN capability (which only processes running as root have by default).
701
702
703
704
705
706
707Restricting access to kernel pointers in the proc filesystem:Enabling kernel.kptr_restrict will hide kernel symbol addresses in /proc/kallsyms from regular users without CAP_SYSLOG, making it more difficult for kernel exploits to resolve addresses/symbols dynamically. This will not help that much on a pre-compiled Arch Linux kernel, since a determined attacker could just download the kernel package and get the symbols manually from there, but if you're compiling your own kernel, this can help mitigating local root exploits. This will break some perf commands when used by non-root users (but many perf features require root access anyway).
708
709
710
711
712Keep BPF JIT compiler disabled:The Linux kernel includes the ability to compile BPF/Seccomp rule sets to native code as a performance optimization. The net.core.bpf_jit_enable flag should be left at 0 for a maximum level of security.
713This can be helpful in specific domains, but is not usually useful. A JIT compiler opens up the possibility for an attacker to perform a heap spraying attack, where they fill the kernel's heap with malicious code. This code can then potentially be executed via another exploit, like an incorrect function pointer dereference. (gresecurity's GRKERNSEC_BPF_HARDEN solves this)
714
715
716
717
718ptrace scope:Arch enables the Yama LSM by default, providing a kernel.yama.ptrace_scope flag. This flag is enabled by default and prevents processes from performing a ptrace call on other processes outside of their scope without CAP_SYS_PTRACE. While many debugging tools require this for some of their functionality, it is a significant improvement in security. Without this feature, there is essentially no separation between processes running as the same user without applying extra layers like namespaces. The ability to attach a debugger to an existing process is a demonstration of this weakness.
719
720
721
722
723
724hidepid:The kernel has the ability to hide other users' processes, normally accessible via /proc, from unprivileged users by mounting the proc filesystem with the hidepid= and gid=,this greatly complicates an intruder's task of gathering information about running processes, whether some daemon runs with elevated privileges, whether other user runs some sensitive program, whether other users run any program at all, makes it impossible to learn whether any user runs a specific program (given the program doesn't reveal itself by its behaviour), and, as an additional bonus, poorly written programs passing sensitive information via program arguments are now protected against local eavesdroppers.
725
726
727
728
729dmesg restrictions:When attackers try to develop "run anywhere" exploits for vulnerabilties, they frequently will use dmesg output. By treating dmesg output as sensitive information, this output is not available to the attacker. Starting with Ubuntu 12.04 LTS, /proc/sys/kernel/dmesg_restrict can be set to "1" to treat dmesg output as sensitive. Ubuntu Touch kernels have this enabled by default.
730
731
732
733
734Block kexec:Starting with Ubuntu 14.04 LTS, it is now possible to disable kexec via sysctl. CONFIG_KEXEC is enabled in Ubuntu so end users are able to use kexec as desired and the new sysctl allows administrators to disable kexec_load. This is desired in environments where CONFIG_STRICT_DEVMEM and modules_disabled are set, for example.
735
736
737
738
739Kernel Address Display Restriction:When attackers try to develop "run anywhere" exploits for kernel vulnerabilities, they frequently need to know the location of internal kernel structures. By treating kernel addresses as sensitive information, those locations are not visible to regular local users. Starting with Ubuntu 11.04, /proc/sys/kernel/kptr_restrict is set to "1" to block the reporting of known kernel address leaks. Additionally, various files and directories were made readable only by the root user: /boot/vmlinuz*, /boot/System.map*, /sys/kernel/debug/, /proc/slabinfo
740
741
742
743
7440-address protection:Since the kernel and userspace share virtual memory addresses, the "NULL" memory space needs to be protected so that userspace mmap'd memory cannot start at address 0, stopping "NULL dereference" kernel attacks. This is possible with 2.6.22 kernels, and was implemented with the "mmap_min_addr" sysctl setting. Since Ubuntu 9.04, the mmap_min_addr setting is built into the kernel. (64k for x86, 32k for ARM.)
745
746
747
748PAX_REFCOUNT:Reference counter overflow bug can be exploited in scenario where UAF( Use-After-Free) comes into game. PAX_REFCOUNT killed this kind of bug class.It can protects the kernel against integer overflows.
749
750
751
752PAX_MEMORY_SANITIZE:does poisoning/sanitization the memory on free to reduces the attack surface.
753
754
755
756
757SL*B freelist randomization:randomizes the SLAB freelist. The list is randomized during initialization of a new set of pages. The order on different freelist sizes is pre-computed at boot for performance. Each kmem_cache has its own randomized freelist. Before pre-computed lists are available freelists are generated dynamically. This security feature reduces the predictability of the kernel SLAB allocator against heap overflows rendering attacks much less stable.
758
759
760
761
762GRKERNSEC_BRUTE:If you say Y here, attempts to bruteforce exploits against forking daemons such as apache or sshd will be deterred. When a child of a forking daemon is killed by PaX or crashes due to an illegal instruction, the parent process will be delayed 30 seconds upon every subsequent fork until the administrator is able to assess the situation and restart the daemon. It is recommended that you also enable signal logging in the auditing section so that logs are generated when a process performs an illegal instruction.
763(https://xorl.wordpress.com/2010/11/09/grkernsec_brute-exploit-bruteforcing-protection/)
764
765
766
767NOTES
7681.Using sysctl is a good way to harden the Linux kernel.
769
770
771
772
7732.Add link restrictions
774Symlinks:
775
776A long-standing class of security issues is the symlink-based
777time-of-check-time-of-use race, most commonly seen in world-writable
778directories like /tmp. The common method of exploitation of this flaw
779is to cross privilege boundaries when following a given symlink (i.e. a
780root process follows a symlink belonging to another user).
781
782The solution is to permit symlinks to only be followed when outside
783a sticky world-writable directory, or when the uid of the symlink and
784follower match, or when the directory owner matches the symlink's owner.
785
786Applications should just use mkstemp() or O_CREATE|O_EXCL.
787- True, but applications are not perfect, and new software is written
788all the time that makes these mistakes; blocking this flaw at the
789kernel is a single solution to the entire class of vulnerability.
790
791In Linux 3.6,link restrictions are enabled by default.
792
793
794
795
7963.kernel process stack overflow are rare and one of the most dangerous vulnerabilities in the kernel (gresecurity solves this with STACKLEAK and with the removal of thread_info from the kernel and GRKERNSEC_BRUTE helps PaX/Grsecurity also restricted SUID program's RLIMIT_STACK up to 8MB and the environment arg/strings up to 512KB.)
797(https://github.com/hardenedlinux/grsecurity-101-tutorials/blob/master/notes/stack_clash.md)
798
799
800
801
8024.use-after-free is a very popular bug class in kernel and it can be exploited by the adversary to gain information or priviledges. (gresecurity solves this with PAX_REFCOUNT and PAX_MEMORY_SANITIZE also helps)
803
804
805
8065.Return-to-user (ret2usr): redirects corrupted kernel pointers to data residing in user space. (gresecurity solves this with KERNEXEC,and OpenBSD's X^W also solves this )
807(https://hardenedlinux.github.io/system-security/2016/12/13/kernel_mitigation_checklist.html)
808
809
810
8116.Grsecurity kernels also disables user namespaces by default.
812
813
8147.An important technique for hardening the system is kernel address-space layout randomization (KASLR), which randomizes the placement of the kernel in the virtual address space at boot time.
815(https://lwn.net/Articles/738975/)
816
817
818
8198.Daniel Gruss's paper cites a number of hardware-based attacks on KASLR. They use techniques like exploiting timing differences in fault handling, observing the behavior of prefetch instructions, or forcing faults using the Intel TSX (transactional memory) instructions. There are rumors circulating that other such channels exist but have not yet been disclosed. In all of these cases, the processor responds differently to a memory access attempt depending on whether the target address is mapped in the page tables, regardless of whether the running process can actually access that location. These differences can be used to find where the kernel has been placed — without making the kernel aware that an attack is underway.
820
821Solution: Fixing information leaks in the hardware is difficult and, in any case, deployed systems are likely to remain vulnerable. But there is a viable defense against these information leaks: making the kernel's page tables entirely inaccessible to user space. In other words, it would seem that the practice of mapping the kernel into user space needs to end in the interest of hardening the system.
822(https://lwn.net/Articles/738975/) (https://gruss.cc/files/kaiser.pdf)
823
824
825
826
827
8289.GRKERNSEC_BRUTE disabled: 200 hrs to gain control of EIP, then ~1500 yrs to brute force the PaX's ASLR to getting root shell
829
830 GRKERNSEC_BRUTE enabled: ~1365 days to gain control of EIP, then...you don't wanna know-_-
831 (https://github.com/hardenedlinux/grsecurity-101-tutorials/blob/master/notes/stack_clash.md)
832
833
834
835
836
83710.PaX's ASLR can defeat offset2lib easily since...2001?
838(https://github.com/hardenedlinux/grsecurity-101-tutorials/blob/master/notes/stack_clash.md)
839
840
841
84211.W & X memory is the cruial condition to physmap spraying.
843(https://hardenedlinux.github.io/system-security/2016/12/13/kernel_mitigation_checklist.html)
844
845
846
84712.No unwanted driver should be compiled. No unwanted code of any kind should be compiled. All code that can reference kernel-level objects outside the kernel should be disabled.
848(https://www.quora.com/What-desktop-OS-kernel-is-the-most-hardened-the-most-unhackable)
849--------------------------------------------------------------------------------------------------------
850OpenBSD Kernel security
851
852Trapsleds: a new mitigation that significantly reduces the amount of nops in the instruction stream, replacing them with trap instructions or jump-over-trap sequences, thereby requiring greater accuracy for targetting potential gadgets. (http://undeadly.org/cgi?action=article&sid=20170622065629)
853
854
855
856Kernel Address Randomized Link (KARL): a new "link-kit" allows the .o files of the kernel to be relinked in a random order, creating a unique kernel for each boot. /bsd is now non-readable to users, to try to keep the secret.The idea is to randomise how the kernel loads, so that kernel loading gets the same benefits as applies to (for example) application memory in ASLR (address space layout randomisation) – so an attacker can't rely on predictable memory allocations to identify where a buffer overrun might land.
857(https://www.theregister.co.uk/2017/06/19/thats_random_openbsd_adds_more_kernel_security/)
858
859
860
861accton: Process accounting is a security method in which an administrator may keep track of system resources used and their allocation among users, provide for system monitoring, and minimally track a user's commands.Process accounting has both positive and negative points. One of the positives is that an intrusion may be narrowed down to the point of entry. A negative is the amount of logs generated by process accounting, and the disk space they may require. (https://www.freebsd.org/doc/handbook/security-accounting.html) (https://man.openbsd.org/accton.8)
862
863
864
865ifstated: daemon runs commands in response to network state changes, which it determines by monitoring interface link state or running external tests. (https://man.openbsd.org/ifstated.8)
866
867
868
869pledge: restrict system operations,current process is forced into a restricted-service operating mode. A few subsets are available, roughly described as computation, memory management, read-write operations on file descriptors, opening of files, networking. In general, these modes were selected by studying the operation of many programs using libc and other such interfaces, and setting promises or execpromises. (https://man.openbsd.org/pledge.2)
870
871
872
873
874
875
876
877
878---------------------------------------------------------------------------------------------------------
879compiler security
880
881
882libc pointer encryption
883
884
885
886RANDSTRUCT:is a Grsecurity feature randomize the number of sensitive kernel structures at compile time and ported it to the mainline and merged in v4.12.
887
888
889
890
891timeless:This will cause warnings when the __TIME__, __DATE__ and __TIMESTAMP__ macros are used.
892
893
894
895-Wformat -Wformat-security:A gcc security feature while not all programs correctly implement the printf hints (like glib's G_GNUC_PRINTF macro), adding this will at least call out simple printf format string vulnerabilities. Any programs whose builds become "noisy" as a result, should be fixed anyway.
896
897
898
899-D_FORTIFY_SOURCE=2 -O1:A gcc security feature that compile-time protection against static sized buffer overflows. No known regressions or performance loss. This should be enabled system-wide.
900
901
902
903relro:During program load, several ELF memory sections need to be written to by the linker. This flags the loader to turn these sections read-only before turning over control to the program. Most notably this prevents GOT overwrite attacks.
904
905
906
907fstack-protector-strong:This is a stronger variant of stackprotector, but without significant performance penalties.This adds safety checks against stack overwrites. This renders many potential code injection attacks into aborting situations. In the best case this turns code injection vulnerabilities into denial of service or into non-issues (depending on the application).Stack Smashing Protector (SSP) *merely detects stack buffer overruns, they are not prevented.*
908
909
910
911Position Independent Executables (PIE):Position Independent Executable are needed to take advantage of Address Space Layout Randomization, supported by some kernel versions. While ASLR can already be enforced for data areas in the stack and heap (brk and mmap), the code areas must be compiled as position-independent. Shared libraries already do this (-fPIC), so they gain ASLR automatically, but binary .text regions need to be build PIE to gain ASLR. When this happens, ROP (Return Oriented Programming) attacks are
912much harder since there are no static locations to bounce off of during a memory corruption attack.
913
914
915reproducible builds:Most aspects of software verification are done on source code, as that is what humans can reasonably understand. But most of the time, computers require software to be first built into a long string of numbers to be used. With reproducible builds, multiple parties can redo this process independently and ensure they all get exactly the same result.
916
917
918SANCOV:The sancov gcc plugin inserts a __sanitizer_cov_trace_pc() call at the start of basic blocks.This plugin is a helper plugin for the kcov feature. It supports all gcc versions with plugin support (from gcc-4.5 on).It is based on the gcc commit "Add fuzzing coverage support" by Dmitry Vyukov.
919
920
921
922cyclomatic_complexity:Compute cyclomatic complexity of functions based on the gcc internal representation.The cyclomatic complexity of a section of source code is the number of linearly independent paths within it. For instance, if the source code contained no control flow statements (conditionals or decision points), the complexity would be 1, since there would be only a single path through the code. If the code had one single-condition IF statement, there would be two paths through the code: one where the IF statement evaluates to TRUE and another one where it evaluates to FALSE, so the complexity would be 2. Two nested single-condition IFs, or one IF with two conditions, would produce a complexity of 3.
923
924
925
926PAX_LATENT_ENTROPY:Providing enough randomness, especially at early boot, has been a constant struggle for Linux. While on the Intel platform, Ivy Bridge and newer processor models that support RDRAND generally eliminate the problem of entropy starvation at early boot and runtime, older processors and those of other architectures continue to be plagued by this problem. The demonstrable effects of this include weak private keys on embedded systems, weak randomness on VM guests, predictable stack canaries, and more. PaX's latent entropy plugin included in grsecurity addresses the lack of randomness by modifying the instruction streams of functions called only during boot as well as some specific functions at runtime that perform some unpredictable computations from the perspective of an attacker. These functions are modified to produce a nondeterministic value based on the flow of execution. At several points in the boot process and at runtime, this pseudorandom value is mixed in to the entropy pool. Further, a kernel compiled with this plugin will have the various random pools in the kernel initialized at compile-time to random contents.(Now it’s called “latent_entropy†plugin merged in v4.9.)
927
928
929
930NOTES
9311.Issues with Stack Smashing Protector (SSP): The SSP implementation in gcc-3.x is not perfect, and can cause problems. In particular C++ code can be built incorrectly when SSP is enabled, although the exact details are not clear at the moment.The SSP implementation in gcc-4.x is completely different, even so far as changing the semantics of the compiler switches. At the time of writing, we have little experience in the SSP implementation in gcc-4.x.
932
933
9342.Issues with PIEs:Ideally, when building a static executable, a shared library, or building without the standard gcc system files, PIE would not be automatically enabled. Unfortunately, the options -static, -shared, -nostdlib and -nostartfiles are link options, so are usually only supplied to the link command of an executable and not to the compilation commands for individual objects. In these cases, -fPIE will be added to the compilation commands when in fact it shouldn't be. This is an unavoidable limitation, since it is impossible to know from a compilation command for an object exactly what the link command is going to be. Indeed in some cases more than one link command can happen using the same objects. Such cases have to be handled by the relevant ebuild on a case-by-case basis. The -nostdlib and -nostartfiles options occur rarely. The -shared option is usually used when the compilation commands have been performed with -fPIC, so the majority of such cases are not a problem.
935
936
9373.Compiler is the bridge between source code and machine code.
938
939
9404.The userland heap is a very significant part of an operating system, and it's not something that gets swapped out from a major operating system distribution at a whim.For those of you who don't have a programming background, let me attempt a brief and non-technical explanation of what a heap is. Basically, it's just a management facility for most of the memory that applications use. When an application (such as Mozilla, your command shell, word processor, and so on) needs some memory, it will typically take this memory from the heap. The heap is responsible for handling these requests, which involve handing out chunks of memory when requested, and freeing the chunks when the application is finished with them.
941
942
9435.malloc internally invokes either brk or mmap syscall.
944
945--------------------------------------------------------------------------------------------------------
946hardware security
947
948Trusted Platform Module (TPM)
949
950Intel Trusted Execution Technology (TXT)
951
952Intel Boot Guard technology
953
954secure boot
955
956trusted boot
957
958coreboot
959
960Libreboot
961
962
963
964
965
966
967NOTES:
9681.Purchase hardware from manufacturers who support GNU/Linux.
969
970
971
972
9732.Purchase hardware which supports coreboot/libreboot as a proprietary BIOS replacement.
974
975
976
977
9783.Purchase hardware without the need for proprietary drivers or firmware: hdnode.org
979
980
981
982
9834.Avoid using wireless devices, since they are insecure.
984
985
986
987
9885.Preferably disable or remove Bluetooth hardware modules.
989
990
991
992
993
9946.Hardware-specific issues can really only be fixed at the hardware level. At best, software interventions can only provide workarounds.
995
996The problem is no hardware exists that consists of entirely Libre firmware. It is very difficult to: analyze the firmware of hardware, wipe potentially compromised versions, or overwrite firmware with a most-likely-clean version. If the firmware being used was Libre Software, it would make verification easier but wouldn't stop infection. Disassembling hardware components (BIOS, disk controllers, CPU, Intel AMT etc.) and flashing them with clean versions offline is so difficult, that it is just cheaper and more convenient to buy new hardware.
997
998
999
1000
1001
1002
10037.Users should also avoid or disable the commonly deployed PXE boot and Wake-on-Lan (WoL) "features". PXE is implemented either as a Network Interface Card (NIC) BIOS extension or as UEFI code in modern devices (where it can be easily disabled).On most systems, WoL hardware functionality is usually blocked by default and explicitly needs to be enabled using the system BIOS or UEFI.
1004
1005--------------------------------------------------------------------------------------------------------
1006802.11 network security
1007
1008WPA2
1009
1010
1011
1012
1013NOTES
10141.protects the data messages by generating perpacket keys. Although no security solution can claim to be “bullet-proof,†WPA represents a quantum leap forward in Wi-Fi security.Although recently, Mathy Vanhoef of imec-DistriNet, KU Leuven, discovered a serious weakness in WPA2 known as the Key Reinstallation AttaCK (or KRACK) attack. Their overview, Key Reinstallation Attacks: Breaking WPA2 by forcing nonce reuse, and research paper (Key Reinstallation Attacks: Forcing Nonce Reuse in WPA2, co-authored by Frank Piessens) have created quite a stir in our industry because the press touts that it “breaks Wi-Fiâ€.
1015
10162.Disable Wi-Fi Protected Setup (WPS) because it allows any device to connect to the network with the relevant eight-digit PIN.
1017
10183.Do not bother disabling SSID broadcasting since it is trivial to guess.
1019
10204.Do not rely on the WEP and WPA standards which are cryptographically weak and have known security weaknesses. Use the WPA2 standard so only authorized users can use the network.
1021
10225.Use routers that exclusively use WPA2, preferably with the AES standard (CCMP) and not TKIP which is less secure.
1023
10246.Enable the "Block WAN Requests" option to conceal the network from other Internet users.
1025
10267.Limit the number of Dynamic Host Configuration Protocol (DHCP) leases (connects) to the Wi-Fi network to match the number of personal devices owned.
1027
10288.If you must allow use of the Wi-Fi network to visitors, set up a guest network that turns itself off after a set period.
1029
10309.Use the 5-GHz band for Wi-Fi instead of the standard 2.4GHz band (if possible), since the 5 GHz band does not travel as far.
1031
103210.If possible, schedule Wi-Fi networks to turn off at night, and then turn on in the morning.
1033
103411.If possible, use a dedicated network connection (LAN, WiFi etc.) that is not shared with other potentially compromised computers.
1035
103612.If using a shared network via a common cable modem/router or ADSL router, configure a de-militarized zone (perimeter network) to restrict Whonix-Gateway accessibility to/from other nodes on the network e.g. printers, phones and laptops.
1037
103813.A novel approach to counter the replay and fake CTS frame injection DoS attacks caused by not securing the 802.11 control frames is proposed. The solution to improve the current 802.11 control frame protection by generating a unique message authentication code using IAPP framework for key distribution and key management is proposed. SHA-2 or 3, the cryptographic hash function which is used to generate MAC for the control frames is supported by most of the current wireless station adapters which in turn makes this approach very cost effective.
1039
1040
1041--------------------------------------------------------------------------------------------------------
1042Router security
1043
1044Openwrt
1045
1046pfsense
1047
1048
1049
1050
1051NOTES
10521.Users should consider upgrading to a commercial-grade router that is normally intended for small businesses as a sensible investment in security. Further, it is safer to have a personally owned routing device that connects to an ISP-provided modem/router in order to maximize administrative control over routing and wireless features of the home network.
1053
10542.Change the default router username and password to something suitably long and random.
1055
10563.Turn off Universal Plug and Play (UPnP), which can allow applications to open ports to external computers.
1057
10584.Disable NAT-PMP, since it has similar functionality to UPnP.
1059
10605.Disable the Home Network Administrative Protocol since it allows remote management of network devices.
1061
10626.Port forwarding (if desired by the user) should be limited to a source IP address and/or source IP address subnet.
1063
10647.Keep router firmware up-to-date at all times for better security. Set the self-updating firmware option if it is available.
1065
10668.Do not bind services to the external interface.
1067
10689.Reconfigure the router firewall rules to drop all relevant incoming packets.
1069
107010.Disable the HTTP interface and enable the HTTPS interface instead, preferably on a non-standard port. For example: https://192.168.1.1:82 instead of http://192.168.1.1
1071
107211.Use the browser's incognito or private mode when accessing the administrative interface so the URL is not saved in the browser history.
1073
107412.Change the Service Set ID (SSID) which often leaks router information. Do not use personally identifying information like the apartment number you live in.
1075
107613.Disable cloud-based router management (if offered) because trust is shifted to another person between the user and the router.
1077
107814.Do not use mesh router systems that do not permit local administrative access.
1079
108015.Disable remote administrative access and administrative access over Wi-Fi. Set administrator access only via wired ethernet connections (not possible with mesh routers).
1081
108216.Disable all other remote-access protocols like PING, Telnet and SSH.
1083
108417.Firewall ports should be set to "stealth" rather than "closed" so no response is given to unsolicited external communications from attackers probing the network.
1085
108618.Set logging to on, if the feature is available. This allows for a record of unsolicited incoming connection attempts, attempted logins and so on.
1087
108819.Avoid administrating the router with a smartphone application.
1089
109020.Use Gibson Research Corp.'s Shields Up port-scanning service to test the router for hundreds of common vulnerabilities, most of which can be mitigated by the router's administrator.
1091
109221.If possible, use a dedicated network connection (LAN, WiFi etc.) that is not shared with other potentially compromised computers.
1093
109422.If using a shared network via a common cable modem/router or ADSL router, configure a de-militarized zone (perimeter network) to restrict Whonix-Gateway accessibility to/from other nodes on the network e.g. printers, phones and laptops.
1095
109623.WiFi users should default to the WPA2-AES standard which provides the safest protocol and strongest encryption currently.
1097
109824.Do not rely on WiFi Protected Set-up (WPS), which has major security flaws.
1099--------------------------------------------------------------------------------------------------------
1100vulnerability scanners
1101
1102OpenVAS : created by Greenbone Networks,framework of several services and tools offering a comprehensive and powerful vulnerability scanning and vulnerability management solution.
1103
1104
1105Vega: created by subgraph,security scanner and web security testing platform to test the security of web applications.
1106
1107
1108Qualys FreeScan (network vulnerablity scanner):
1109--------------------------------------------------------------------------------------------------------
1110secure Microkernels
1111
1112
1113SeL4
1114
1115
1116
1117
1118--------------------------------------------------------------------------------------------------------
1119security by isolation programs
1120
1121Oz:Uses kernal namespaces for isolation.
1122
1123
1124
1125
1126
1127Firejail (SUID program) : Firejail is an easy to use and simple tool for sandboxing applications and servers alike. Firejail is suggested for browsers and internet facing applications, as well as any servers you may be running. Firejail is further enhanced when used with Grsecurity.
1128
1129
1130
1131
1132
1133XEN : Is a type 1 hypervisor,use more full virtualization options such as Xen can also improve security in the event you plan on running risky applications or browsing dangerous websites,can be used for VM isolation.
1134
1135
1136
1137
1138
1139virtualbox : Type 2 Hypervisor,can be used for VM isolation.
1140
1141
1142
1143
1144sandboxie
1145
1146
1147
1148
1149chroots: Manual chroot jails can also be constructed.
1150
1151
1152
1153
1154bubblewrap:is a setuid sandbox application developed from Flatpak with an even smaller resource footprint than Firejail. While it lacks certain features such as file path whitelisting, bubblewrap does offer bind mounts as well as the creation of user/IPC/PID/network/cgroup namespaces and can support both simple and complex sandboxes.
1155
1156-------------------------------------------------------------------------------------------------------
1157network intrusion prevention system (NIPS) and network intrusion detection system (NIDS)
1158
1159
1160Bro IDS: Bro comes with analyzers for many protocols, enabling high-level semantic analysis at the application layer.Bro-IDS is a bit different than Snort.In a way Bro is both a signature and anomaly-based IDS. Its analysis engine will convert traffic captured into a series of events. An event could be a user logon to FTP, a connection to a website or practically anything. The power of the system is what comes after the event engine and that's the Policy Script Interpreter. This policy engine has it's own language ( Bro-Script ) and it can do some very powerful and versatile tasks.If you're an analyst and you've wondered "How can I automate some of my work?" then this is the tool you've been looking for.
1161
1162
1163
1164Snort: de-facto standard for IDS and eventually IPS (thanks to community effort!)
1165
1166
1167
1168AlienVault OSSIM (Open Source Security Information Management): integrating a selection of tools designed to aid network administrators in computer security, intrusion detection and prevention.Intended to give security analysts and administrators a view of all the security-related aspects of their system, by combining log management and asset management and discovery with information from dedicated information security controls and detection systems.OSSIM performs these functions using other well-known open-source software security components, unifying them under a single browser-based user interface. OSSIM comes with PRADS,OpenVAS,Snort,Suricata,Tcptrack,Nagios,OSSEC,Munin,NFSen/NFDump,FProbe,OSSIM also includes self developed tools, the most important being a generic correlation engine with logical directive support and logs integration with plugins.Note: Suricata and Snort cannot be used at the same time. Snort is currently being phased out in favor of Suricata. (https://en.wikipedia.org/wiki/OSSIM)
1169
1170
1171
1172
1173
1174NOTES
1175There are a number of techniques which attackers are using, the following are considered 'simple' measures which can be taken to evade IDS:
1176
1177
11781.Fragmentation: by sending fragmented packets, the attacker will be under the radar and can easily bypass the detection system's ability to detect the attack signature.
1179
1180
11812.Avoiding defaults: The TCP port utilised by a protocol does not always provide an indication to the protocol which is being transported. For example, an IDS may expect to detect a trojan on port 12345. If an attacker had reconfigured it to use a different port the IDS may not be able to detect the presence of the trojan.
1182
1183
11843.Coordinated, low-bandwidth attacks: coordinating a scan among numerous attackers (or agents) and allocating different ports or hosts to different attackers makes it difficult for the IDS to correlate the captured packets and deduce that a network scan is in progress.
1185
1186
11874.Address spoofing/proxying: attackers can increase the difficulty of the ability of Security Administrators to determine the source of the attack by using poorly secured or incorrectly configured proxy servers to bounce an attack. If the source is spoofed and bounced by a server then it makes it very difficult for IDS to detect the origin of the attack.
1188
1189
11905.Pattern change evasion: IDSs generally rely on 'pattern matching' to detect an attack. By changing the data used in the attack slightly, it may be possible to evade detection. For example, an Internet Message Access Protocol (IMAP) server may be vulnerable to a buffer overflow, and an IDS is able to detect the attack signature of 10 common attack tools. By modifying the payload sent by the tool, so that it does not resemble the data that the IDS expects, it may be possible to evade detection.
1191--------------------------------------------------------------------------------------------------------
1192host-based intrusion detection system (HIDS)
1193
1194OSSEC
1195--------------------------------------------------------------------------------------------------------
1196packet analyzers
1197
1198
1199packet total (PacketTotal is a free, online PCAP analyzer designed to visualize network traffic, detect malware, and provide analytics for the traffic contained within.) ( https://packettotal.com/ )
1200
1201
1202
1203tcpdump: a powerful command-line packet analyzer. (http://www.tcpdump.org/)
1204
1205-------------------------------------------------------------------------------------------------------
1206Packet Filters
1207
1208
1209Berkeley Packet Filter (BPF) (BPF supports filtering packets, allowing a userspace process to supply a filter program that specifies which packets it wants to receive.) (https://en.wikipedia.org/wiki/Berkeley_Packet_Filter)
1210
1211
1212
1213NOTES
12141.Network intrusion detection systems rely on one, or more means of traffic analysis in order to determine whether or not a given stream of network traffic is suspicious. Network analysts, and system administrators can make use of stateless traffic filters to help them understand what is going on inside of their network(s), where such filters can be used for traffic inspection, filtering, and shaping.
1215
1216Packets can be filtered based on physical characteristics of the packet header (i.e. the signature) or based on one or more heuristics which would flag the packet as anomalous. (http://tylerfisher.org/bpf/)
1217
1218-------------------------------------------------------------------------------------------------------
1219network analysis scanners
1220
1221
1222Wireshark: is network protocol analyzer,it lets you see what’s happening on your network at a microscopic level and is the de facto (and often de jure) standard across many commercial and non-profit enterprises, government agencies, and educational institutions.(https://www.wireshark.org/)
1223
1224
1225Nmap: utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. (https://nmap.org/)
1226
1227-------------------------------------------------------------------------------------------------------
1228disk encryption
1229
1230
1231Linux Unified Key Setup (LUKS): encrypts storage media volumes.
1232(http://www.forensicswiki.org/wiki/Linux_Unified_Key_Setup_(LUKS) )
1233
1234
1235
1236notes
1237
1238
12391.Question:If I stick to standard operations, and I do not require any of the features from LUKS, what risks am I as a non-expert taking?
1240
1241LUKS partitions have a header that ensures such a partition won't be seen as ext2, vfat, etc. A plain dm-crypt partition may coincidentally end up looking like a unencrypted filesystem, and has a chance of being written to accidentally, destroying your data.
1242
1243LUKS checks if you entered the correct passphrase. If you put in the wrong passphrase, plain dm-crypt won't pick up on this; instead, it will happily give you garbled crypto-mapping which may also coincidentally look like an unencrypted filesystem, and has a chance of being written to accidentally, destroying your data.
1244
1245LUKS stores the type of encryption used, while dm-crypt requires you to supply the same options each time. If, after a period of not using your encrypted device, you find there are a few gaps in your recollection of what the password was, and it turns out you forgot the encryption options as well, you are doubly hosed (this happened to me personally before LUKS existed; the encrypted data wasn't so important so I just reformatted after unsuccessfully trying to get in for an hour or so).
1246(https://security.stackexchange.com/questions/90468/why-is-plain-dm-crypt-only-recommended-for-experts)
1247
1248-------------------------------------------------------------------------------------------------------
1249security audit tools
1250
1251
1252Lynis: Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. (https://cisofy.com/lynis/)
1253
1254
1255
1256TIGER: The Unix security audit and host intrusion detection tool. (http://www.nongnu.org/tiger/)
1257
1258
1259
1260Scout2: Security auditing tool for AWS environments. (https://nccgroup.github.io/Scout2/)
1261
1262
1263
1264prowler: Tool for AWS security assessment, auditing and hardening. It follows guidelines of the CIS Amazon Web Services Foundations Benchmark. (https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf)
1265
1266
1267
1268lunar: A UNIX security auditing tool based on several security frameworks. (https://github.com/lateralblast/lunar)
1269
1270-------------------------------------------------------------------------------------------------------
1271Network and applications layer authentication and encryption methods (some may support combinations of authentication, integrity, access control, and confidentiality).
1272
1273Quantum cryptography
1274
1275
1276
1277SHA3-512 (based off Secure Hash Algorithm 3)
1278
1279
1280
1281Elliptic curve cryptography (ECC) (using:Ed25519 and Curve25519)
1282
1283
1284
1285Kerberos
1286
1287
1288
1289IP Security Protocol (IPSec)
1290
1291
1292
1293AES-256 (with PKCS7 padding)
1294
1295
1296
1297RSA (using 4096 bit)
1298
1299
1300
1301GNU Privacy Guard (GPG) (based off PGP)
1302
1303
1304
1305Secure Shell (SSH)
1306
1307
1308
1309Transport Layer Security (TLS)
1310
1311
1312
1313
1314NOTES
13151.IPsec is an end-to-end security scheme operating in the Internet Layer of the Internet Protocol Suite, while some other Internet security systems in widespread use, such as Transport Layer Security (TLS) and Secure Shell (SSH), operate in the upper layers at the Transport Layer (TLS) and the Application layer (SSH). Hence, only IPsec protects all application traffic over an IP network. IPsec can automatically secure applications at the IP layer.
1316
1317
1318
13192.IPSec controls whether a user can connect to the computer at the IP layer, not the application layer.
1320
1321
1322
13233.For confidentiality, PGP encrypts messages with an efficient single-key or conventional encryption algorithm known as IDEA. It then uses RSA to encrypt, with the receiver's public key, the IDEA key used to encrypt the message. The receiver can use RSA to recover the IDEA key and use that key to recover the message.
1324
1325
1326
1327
13284.What do Digital Signatures Prove and What They DO NOT Prove:
1329
1330Digital Signatures show that someone who had access to the private key has made a signature. It is an indication, that its contents have not been tampered (so, integrity is preserved) and can indicate, that a given file is authentic.Digital Signatures do not prove any other property, e.g. that the file is not malicious. In fact there is nothing that could stop people from signing a malicious program.
1331
1332The point is, of course, that people need to choose to trust some people, e.g. Linus Torvalds, Microsoft, etc. and assume that if a file(s) was indeed signed by those individuals, then indeed it should not be malicious and buggy in some horrible way. But the decision of whether to trust certain people is beyond the scope of digital signatures.
1333
1334
1335
1336
13375.IP Security Protocol (IPSec), which the operating systems uses rather than relying on the inherently insecure TCP/IP Version 4 (IPV4). (IPV4 chooses to trust just about everybody and everything.) IPSec encrypts and validates packets to protect the privacy of data and to ensure that no changes are made to packets during the delivery process. IPSec became an integral piece of the standard Internet Protocol with the introduction of TCP/IP Version 6 (IPV6), making the future of the Internet more secure by default.
1338
1339
13406.SSL should be done using LibreSSL or a trusted independent version.
1341(https://www.quora.com/What-desktop-OS-kernel-is-the-most-hardened-the-most-unhackable)
1342
1343-------------------------------------------------------------------------------------------------------
1344Executable space protections
1345
1346Data Execution Prevention (DEP)
1347
1348W^X
1349
1350
1351
1352notes
1353
13541.Bypassing DEP and NX requires a cool trick called Return-Oriented Programming.
1355
1356-------------------------------------------------------------------------------------------------------
1357server security suite
1358
1359Atomic Secured Linux
1360
1361
1362
1363-------------------------------------------------------------------------------------------------------
1364VPNS
1365
1366
1367ipvanish (No Logs, Best For Tor, DNS Leak Protection, Unlimited Bandwidth)
1368
1369
1370
1371ExpressVPN (AES-256 cipher with RSA-4096 handshake and SHA-512 HMAC, Elliptic Curve Diffie–Hellman, fast, DNS leak protection, kill switch, no logs)
1372
1373
1374Torguard (Blocks WebRTC/DNS/IPv6 Leaks, 3000+ Servers in 50+ Countries, AES-256, TLS, IPsec, Advertisement and Malware Blocking, DPI Bypass, OpenVPN, IKev2, AnyConnect & OpenConnect SSL based VPN, Unlimited Bandwidth, no logs)
1375
1376
1377Riseup VPN (bitmask)
1378
1379
1380iVPN (Unlimited Bandwidth, Multihop Technology, no logs , kill switch, firewall-based DNS leak protection, WebRTC leak, fast, Servers in 12 countries, Up to three simultaneous connections,more available on request, OpenVPN and L2TP/IPsec VPN protocols, Obfsproxy, AES-256 cipher with RSA-4096 handshake and HMAC SHA-1 hash authentication, Diffie-Hellman exchange (DHE) introduces perfect forward secrecy PFS), with a new encryption key generated every hour)
1381
1382
1383OpenVPN (DPI Bypass,AES-256,based on open source software,Challenge/Response authentication,possible to execute scripts in the context of the
1384desktop user instead of the root context of the OpenVPN daemon, Web-free VPN,Local subnet blocking)
1385
1386
1387
1388NOTES
13891.You -> VPN -> Tor
1390
1391You can very well decrease your anonymity by using VPN/SSH in addition to Tor.If you know what you are doing you can increase anonymity, security and privacy.
1392
1393Most VPN/SSH provider log, there is a money trail, if you can't pay really anonymously. (An adversary is always going to probe the weakest link first...). A VPN/SSH acts either as a permanent entry or as a permanent exit node. This can introduce new risks while solving others.
1394
1395Who's your adversary? Against a global adversary with unlimited resources more hops make passive attacks (slightly) harder but active attacks easier as you are providing more attack surface and send out more data that can be used. Against colluding Tor nodes you are safer, against blackhat hackers who target Tor client code you are safer (especially if Tor and VPN run on two different systems). If the VPN/SSH server is adversary controlled you weaken the protection provided by Tor. If the server is trustworthy you can increase the anonymity and/or privacy (depending on set up) provided by Tor.
1396
1397VPN/SSH can also be used to circumvent Tor censorship (on your end by the ISP or on the service end by blocking known tor exits).
1398
1399
1400
1401
14022.Do not use a VPN as an anonymity solution. If you're looking for a trusted entry into the Tor network, or if you want to obscure the fact that you're using Tor, setting up a private server as a bridge works quite well.
1403
1404VPNs encrypt the traffic between the user and the VPN provider, and they can act as a proxy between a user and an online destination. However, VPNs have a single point of failure: the VPN provider. A technically proficient attacker or a number of employees could retrieve the full identity information associated with a VPN user. It is also possible to use coercion or other means to convince a VPN provider to reveal their users' identities.
1405
1406
1407
14083.Is it possible to completely disable logging?The command «log/dev/null» on Linux completely removes all the logs of OpenVPN service. Owing to the settings, you can completely disable the logging of any connections to the OpenVPN server.
1409
1410
1411
14124.Multihop Technology:This basically allows you to “chain†VPN servers, so that your data is routed between two VPN servers as it travels between you and the internet.
1413
1414
1415--------------------------------------------------------------------------------------------------------
1416proxies
1417
14181.Privoxy: is a proxy server that (pay attention here) uses application-layer filtering. HTTP traffic passed through Privoxy will have certain privacy-oriented rules applied to them. For example, Privoxy will block ads, detect and disable click-tracking scripts, disabling pop-ups, etc.
1419
1420
1421--------------------------------------------------------------------------------------------------------
1422whistleblower submission system
1423
1424secure drop
1425--------------------------------------------------------------------------------------------------------
1426distributing files anonymously
1427
1428OnionShare
1429--------------------------------------------------------------------------------------------------------
1430scan websites automatically for common vulnerabilities and errors that can de-anonymize the owner or users
1431
1432OnionScan
1433--------------------------------------------------------------------------------------------------------
1434protection against Metadata
1435
1436MAT - Metadata Anonymisation Toolkit
1437
1438Why MAT is not the ultimate solution?
1439Mat only removes metadata from your files, it does not anonymise their content, nor handle watermarking, steganography, or any overly customized metadata field/system. Also please not that MAT does its best to scrub as much metadata as possible, it's not really efficient at scrubbing embedded media inside complex formats. For examples, images embedded inside PDF may not be cleaned.
1440
1441NOTES
14421.Use POP3 and SMTP settings, as IMAP leaks more metadata.
1443
1444
14452.Since onion services are part of the Tor network, the services and the people connecting to them get more security and privacy; their traffic doesn't even leave the network,the onion services are relied on for metadata-free chat and file sharing.
1446--------------------------------------------------------------------------------------------------------
1447proof that bugs can go undetected for atleast 1 year or more!
1448
1449
14501.Orpheus' Lyre:In 2017 Two implementations of the Kerberos authentication protocol received patches this week against a vulnerability that allowed a threat actor to bypass authentication procedures.The vulnerability was discovered by a team of three researchers, who dubbed it "Orpheus' Lyre." Researchers tracked down the flaw to Kerberos versions released in 1996.Orpheus' Lyre exploits a part of the Kerberos protocol named "tickets." These are messages exchanged between network nodes, and are used to authenticate services and users.Not all parts of a ticket are encrypted when sent through the network. Kerberos implementations usually rely on checking the encrypted parts of a Kerberos message to authenticate users and services.Researchers said they found a way to force the Kerberos protocol to use the plaintext and non-encrypted part for authentication procedures.
1451
1452
14532.Dirty COW:is a computer security vulnerability for the Linux kernel that affects all Linux-based operating systems It is a local privilege escalation bug that exploits a race condition in the implementation of the copy-on-write mechanism in the kernel's memory-management subsystem.Because of the race condition, with the right timing, a local attacker can exploit the copy-on-write mechanism to turn a read-only mapping of a file into a writable mapping. Although it is a local privilege escalation, remote attackers can use it in conjunction with other exploits that allow remote execution of non-privileged code to achieve remote root access on a computer.The attack itself does not leave traces in the system log! The vulnerability has existed in the Linux kernel since version 2.6.22 released in September 2007, and there is information about it being actively exploited at least since October 2016.
1454
1455
14563.Heartbleed:is a security bug in the OpenSSL cryptography library, which is a widely used implementation of the Transport Layer Security (TLS) protocol. It was introduced into the software in 2012 and publicly disclosed in April 2014. Heartbleed may be exploited regardless of whether the vulnerable OpenSSL instance is running as a TLS server or client. It results from improper input validation (due to a missing bounds check) in the implementation of the TLS heartbeat extension, thus the bug's name derives from heartbeat. The vulnerability is classified as a buffer over-read, a situation where more data can be read than should be allowed.
1457
1458
14594.POODLE:which stands for "Padding Oracle On Downgraded Legacy Encryption",is a man-in-the-middle exploit which takes advantage of Internet and security software clients' fallback to SSL 3.0.If attackers successfully exploit this vulnerability, on average, they only need to make 256 SSL 3.0 requests to reveal one byte of encrypted messages.POODLE exemplifies a vulnerability that succeeds thanks to a mechanism designed for reducing security for the sake of interoperability. When designing systems in domains with high levels of fragmentation, then, extra care is appropriate. In such domains graceful security degradation may become common. (SSL version 3.0 was released in 1996,so potentially this bug can be as old as 1996!)
1460
1461
14625.Shellshock:also known as Bashdoor,is a family of security bugs in the widely used Unix Bash shell, the first of which was disclosed on 24 September 2014. Many Internet-facing services, such as some web server deployments, use Bash to process certain requests, allowing an attacker to cause vulnerable versions of Bash to execute arbitrary commands. This can allow an attacker to gain unauthorized access to a computer system.The first bug causes Bash to unintentionally execute commands when the commands are concatenated to the end of function definitions stored in the values of environment variables.Within days of the publication of this, intense scrutiny of the underlying design flaws discovered a variety of related vulnerabilities (CVE-2014-6277, CVE-2014-6278, CVE-2014-7169, CVE-2014-7186, and CVE-2014-7187); which Ramey addressed with a series of further patches.Analysis of the source code history of Bash shows the bugs had existed since Bash version 1.03 released in September 1989!
1463
1464
14656.VENOM(Virtualized Environment Neglected Operations Manipulation ): is a security vulnerability in the virtual floppy drive code used by many computer virtualization platforms. This vulnerability may allow an attacker to escape from the confines of an affected virtual machine (VM) guest and potentially obtain code-execution access to the host. Absent mitigation, this VM escape could open access to the host system and all other VMs running on that host, potentially giving adversaries significant elevated access to the host’s local network and adjacent systems.The VENOM bug has existed since 2004, though it has reportedly not been exploited in the wild yet.
1466
1467
1468
1469
14707.Meltdown: breaks the most fundamental isolation between user applications and the operating system. This attack allows a program to access the memory, and thus also the secrets, of other programs and the operating system.If your computer has a vulnerable processor and runs an unpatched operating system, it is not safe to work with sensitive information without the chance of leaking the information. This applies both to personal computers as well as cloud infrastructure.There are patches against Meltdown for Linux, Windows, and OS X.Meltdown has potentially existed since 1995.
1471(https://meltdownattack.com/) (https://lwn.net/Articles/738975/)
1472
1473
1474
1475
14768.Spectre: breaks the isolation between different applications. It allows an attacker to trick error-free programs, which follow best practices, into leaking their secrets. In fact, the safety checks of said best practices actually increase the attack surface and may make applications more susceptible to Spectre.Spectre is harder to exploit than Meltdown, but it is also harder to mitigate.However, it is possible to prevent specific known exploits based on Spectre through software patches.Spectre has potentially existed since 1995.
1477(https://meltdownattack.com/) (http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180101/513630.html)
1478
1479
1480
1481
1482
1483--------------------------------------------------------------------------------------------------------
1484protection against Cross-Site Request Forgery (CSRF)
1485
1486We recommend two separate checks as your standard CSRF defense that does not require user intervention. This discussion ignores for the moment deliberately allowed cross origin requests (e.g., CORS). Your defenses will have to adjust for that if that is allowed.
1487
1488
14891.Check standard headers to verify the request is same origin
1490
14912.AND Check CSRF token
1492
1493(for a full explanation go here: https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet )
1494
1495
1496
1497--------------------------------------------------------------------------------------------------------
1498Preventing Remote File Inclusion (RFI) Attacks
1499
1500
15011.Never use arbitrary input data in a literal file include request.
1502
1503
15042.Use a filter to thoroughly scrub input parameters against possible file inclusions.
1505
1506
15073.Build a dynamic whitelist.
1508
1509
1510NOTES
15111.The RFI is a cousin to the nefarious XSS cross-site scripting attack. Both are forms of code injection, although the RFI is less sophisticated. As such, it is also more easily prevented.
1512
1513
15142.Like all code injection attacks, RFI is a result of allowing unsecure data into a secure context. The best way to prevent an RFI attack is to never use arbitrary input data in a literal file include request.
1515
1516
1517(for a full explanation go here: http://www.esecurityplanet.com/browser-security/how-to-prevent-remote-file-inclusion-rfi-attacks.html )
1518--------------------------------------------------------------------------------------------------------
1519cross site scripting (XSS) prevention
1520
15211.HTML Escape Before Inserting Untrusted Data into HTML Element Content
1522
1523
1524
15252.Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes
1526
1527
1528
15293.JavaScript Escape Before Inserting Untrusted Data into JavaScript Data Values
1530
1531
1532
15334.HTML escape JSON values in an HTML context and read the data with JSON.parse
1534
1535
1536
15375.CSS Escape And Strictly Validate Before Inserting Untrusted Data into HTML Style Property Values
1538
1539
1540
15416.URL Escape Before Inserting Untrusted Data into HTML URL Parameter Values
1542
1543
1544
1545
15467.Prevent DOM-based XSS
1547
1548
1549
1550
15518.Use HTTPOnly cookie flag
1552
1553Preventing all XSS flaws in an application is hard, as you can see. To help mitigate the impact of an XSS flaw on your site, OWASP also recommends you set the HTTPOnly flag on your session cookie and any custom cookies you have that are not accessed by any Javascript you wrote. This cookie flag is typically on by default in .NET apps, but in other languages you have to set it manually.
1554
1555
1556
1557
15589.Implement Content Security Policy
1559
1560There is another good complex solution to mitigate the impact of an XSS flaw called Content Security Policy. It's a browser side mechanism which allows you to create source whitelists for client side resources of your web application, e.g. JavaScript, CSS, images, etc. CSP via special HTTP header instructs the browser to only execute or render resources from those sources.
1561
1562
1563
156410.Use an Auto-Escaping Template System
1565
1566Many web application frameworks provide automatic contextual escaping functionality such as AngularJS strict contextual escaping and Go Templates. Use these technologies when you can.
1567
1568
1569
157011.Use the X-XSS-Protection Response Header
1571
1572This HTTP response header enables the Cross-site scripting (XSS) filter built into some modern web browsers. This header is usually enabled by default anyway, so the role of this header is to re-enable the filter for this particular website if it was disabled by the user.
1573
1574
1575(for a full explanation go here: https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet )
1576--------------------------------------------------------------------------------------------------------
1577defenses against SQL injections
1578
1579Defense Option 1: Prepared Statements (with Parameterized Queries)
1580
1581The use of prepared statements with variable binding (aka parameterized queries) is how all developers should first be taught how to write database queries. They are simple to write, and easier to understand than dynamic queries. Parameterized queries force the developer to first define all the SQL code, and then pass in each parameter to the query later. This coding style allows the database to distinguish between code and data, regardless of what user input is supplied.
1582
1583Prepared statements ensure that an attacker is not able to change the intent of a query, even if SQL commands are inserted by an attacker. In the safe example below, if an attacker were to enter the userID of tom' or '1'='1, the parameterized query would not be vulnerable and would instead look for a username which literally matched the entire string tom' or '1'='1.
1584
1585
1586
1587
1588
1589
1590
1591
1592Defense Option 2: Stored Procedures
1593
1594Stored procedures are not always safe from SQL injection. However, certain standard stored procedure programming constructs have the same effect as the use of parameterized queries when implemented safely* which is the norm for most stored procedure languages. They require the developer to just build SQL statements with parameters which are automatically parameterized unless the developer does something largely out of the norm. The difference between prepared statements and stored procedures is that the SQL code for a stored procedure is defined and stored in the database itself, and then called from the application. Both of these techniques have the same effectiveness in preventing SQL injection so your organization should choose which approach makes the most sense for you.
1595
1596
1597
1598
1599
1600
1601Defense Option 3: White List Input Validation
1602
1603Various parts of SQL queries aren't legal locations for the use of bind variables, such as the names of tables or columns, and the sort order indicator (ASC or DESC). In such situations, input validation or query redesign is the most appropriate defense. For the names of tables or columns, ideally those values come from the code, and not from user parameters. But if user parameter values are used to make different for table names and column names, then the parameter values should be mapped to the legal/expected table or column names to make sure unvalidated user input doesn't end up in the query. Please note, this is a symptom of poor design and a full re-write should be considered if time allows.
1604
1605
1606
1607
1608
1609
1610
1611Defense Option 4: Escaping All User Supplied Input
1612
1613This technique should only be used as a last resort, when none of the above are feasible. Input validation is probably a better choice as this methodology is frail compared to other defenses and we cannot guarantee it will prevent all SQL Injection in all situations.
1614
1615This technique is to escape user input before putting it in a query. It is very database specific in its implementation. Its usually only recommended to retrofit legacy code when implementing input validation isn't cost effective. Applications built from scratch, or applications requiring low risk tolerance should be built or re-written using parameterized queries, stored procedures, or some kind of Object Relational Mapper (ORM) that builds your queries for you.
1616
1617This technique works like this. Each DBMS supports one or more character escaping schemes specific to certain kinds of queries. If you then escape all user supplied input using the proper escaping scheme for the database you are using, the DBMS will not confuse that input with SQL code written by the developer, thus avoiding any possible SQL injection vulnerabilities.
1618
1619
1620
1621Additional Defenses
1622
1623To minimize the potential damage of a successful SQL injection attack, you should minimize the privileges assigned to every database account in your environment. Do not assign DBA or admin type access rights to your application accounts. We understand that this is easy, and everything just ‘works’ when you do it this way, but it is very dangerous. Start from the ground up to determine what access rights your application accounts require, rather than trying to figure out what access rights you need to take away. Make sure that accounts that only need read access are only granted read access to the tables they need access to. If an account only needs access to portions of a table, consider creating a view that limits access to that portion of the data and assigning the account access to the view instead, rather than the underlying table. Rarely, if ever, grant create or delete access to database accounts.
1624
1625If you adopt a policy where you use stored procedures everywhere, and don’t allow application accounts to directly execute their own queries, then restrict those accounts to only be able to execute the stored procedures they need. Don’t grant them any rights directly to the tables in the database.
1626
1627SQL injection is not the only threat to your database data. Attackers can simply change the parameter values from one of the legal values they are presented with, to a value that is unauthorized for them, but the application itself might be authorized to access. As such, minimizing the privileges granted to your application will reduce the likelihood of such unauthorized access attempts, even when an attacker is not trying to use SQL injection as part of their exploit.
1628
1629While you are at it, you should minimize the privileges of the operating system account that the DBMS runs under. Don't run your DBMS as root or system! Most DBMSs run out of the box with a very powerful system account. For example, MySQL runs as system on Windows by default! Change the DBMS's OS account to something more appropriate, with restricted privileges.
1630
1631
1632
1633(for a full explanation go here: https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet )
1634--------------------------------------------------------------------------------------------------------
1635XPath Injection Defenses
1636
16371.Just like the techniques to avoid SQL injection, you need to use a parameterized XPath interface if one is available, or escape the user input to make it safe to include in a dynamically constructed query. If you are using quotes to terminate untrusted input in a dynamically constructed XPath query, then you need to escape that quote in the untrusted input to ensure the untrusted data can't try to break out of that quoted context.
1638
16392.Another better mitigation option is to use a precompiled XPath query. Precompiled XPath queries are already preset before the program executes, rather than created on the fly after the user's input has been added to the string. This is a better route because you don't have to worry about missing a character that should have been escaped.
1640
1641
1642
1643--------------------------------------------------------------------------------------------------------
1644problems that have not been solved yet
1645
16461.there has been no solution proposed to protect the network from DoS attacks caused by an attacker using CTS-to-Self.
1647
1648(CTS=Clear To Send)
1649
1650
1651
1652
1653
1654
1655
16562.Tor is vulnerable to statistical "traffic confirmation" attacks, where the adversary watches traffic at both ends of a circuit and confirms his guess that they're communicating. It would be really nice if we could use cover traffic to confuse this attack. But there are three problems here:
1657
1658.Cover traffic is really expensive. And *every* user needs to be doing it. This adds up to a lot of extra bandwidth cost for our volunteer operators, and they're already pushed to the limit.
1659
1660.You'd need to always be sending traffic, meaning you'd need to always be online. Otherwise, you'd need to be sending end-to-end cover traffic -- not just to the first hop, but all the way to your final destination -- to prevent the adversary from correlating presence of traffic at the destination to times when you're online. What does it mean to send cover traffic to -- and from -- a web server? That is not supported in most protocols.
1661
1662.Even if you *could* send full end-to-end padding between all users and all destinations all the time, you're *still* vulnerable to active attacks that block the padding for a short time at one end and look for patterns later in the path.
1663
1664
1665
1666
1667
1668
16693.We’ve been losing software freedom because ME, which is the most powerful demon from Ring -3 world. Since it’s more likely an invincible enemy even Intel haven’t disable SPI by adding a similar feature into the same physical package of processor( because it’d be harmful to OEM’s interest?)
1670
1671Intel ME can’t be 100% disabled but we can restrict the power of Intel ME by minizing its functions.
1672
1673(UPDATE:It might Now be Possible To Disable & Strip Down Intel's ME https://phoronix.com/scan.php?page=news_item&px=Intel-ME-Cleaning Via an open-source, third-party tool called me_cleaner )
1674
1675
1676
1677
1678
16794.It seems that there will always be bugs,or exploits,in the coding of programs,OSes,etc. and that there will never be error-free/bug free coding of programs,thats why theres a constant need for updating,your hardware,software,program, etc. even when patches or fixes are implemented that just brings more coding involved,and potentially create more bugs due to that one fix you created for that 1 bug.The best we can do is reduce the amount of coding,and make sure our very own patches don't create more bugs or exploits.
1680
1681
1682
1683
1684
16855.Trust is an issue,at some point you have to trust,that someone at the manufactory of your computer that you bought did not put a backdoor or any malware,on your new computer,other examples include but are not limited to your internet service provider (ISP),server operator,Tor developers etc.
1686
1687
1688
1689
16906.The host system clock synchronization mechanism still uses unauthenticated NTP from a single source. This is not optimal, but there is no real solution to this problem.A potential attack vector is created by this NTP behavior; the ISP and/or time server could either inadvertently or maliciously introduce a significant clock skew, or the host clock could simply malfunction.
1691
1692
1693
16947.Unfortunately, it is not yet possible to set a random clock offset for Qubes-Whonix VMs to prevent clock correlation attacks since it is unsupported by Xen. A related issue is denying Qubes-Whonix access to "clocksource=xen", which may not be possible without Linux kernel and/or Xen patches.
1695
1696
1697
1698--------------------------------------------------------------------------------------------------------
1699General and technical Notes
1700
17011.In linux use sudo instead of su.
1702
1703
1704
1705
1706
17072.It is possible to tighten the security so much as to make your system unusable,do it without over doing it.
1708
1709
1710
1711
1712
17133.Avoid using secure shell without requiring SSH keys,this prevents brute force attacks.
1714
1715
1716
1717
17184.when using SSH, implementing Fail2ban so only key authentication is allowed.
1719
1720
1721
1722
1723
17245.download over TLS and even better to verify the gpg signatures,and even better then those two is to obtain the software or item you want by creating by source code.
1725
1726
1727
1728
1729
17306. Intel Software Guard Extensions (SGX) supposedly has the ability to create a secure enclave within a potentially compromised OS. (update:here are some known weaknesses of SGX https://github.com/jovanbulck/sgx-pte )
1731
1732
1733
1734
1735
17367.TCP timestamps are disabled by default in Qubes R3.1 and above.
1737
1738
1739
1740
1741
17428.Constantly check for updates of outdated hardware and software programs.
1743
1744
1745
1746
1747
1748
1749
17509.Apply a BIOS password for BIOS set up and boot.
1751
1752
1753
1754
1755
175610.In Qubes always open attachments in DispVM.
1757
1758
1759
1760
176111.Most .bat's that you will see online will be malicious. Some are good though.Always open .bat files with caution.
1762
1763
1764
1765
1766
176712.Be weary of vulnerable apt-get downloads through untrusted Tor exit relays.
1768
1769
1770
1771
1772
177313.Users should understand that the system clock inside Whonix is set to UTC to prevent against time zone leaks. This means it may be a few hours ahead or behind the user's host system clock. It is strongly recommended not to change this setting.
1774
1775
1776
1777
1778
177914.The Whonix-Gateway state should not be suspended or saved. It is far better to power off the Whonix-Gateway if it is no longer needed.
1780
1781
1782
1783
1784
1785
178615.Similarly, if users suspend or save the Whonix-Workstation state, the clock will again lag behind the correct value.This can be manually fixed inside Whonix-Workstation by running: Start Menu -> Applications -> System -> Whonix Timesync.
1787
1788
1789
1790
1791
1792
179316.If the host clock value is grossly inaccurate - more than one hour in the past or more than 3 hours in future - Tor cannot connect to the Tor network.This is easily solved by manually fixing the clock on the host, then powering the Whonix-Gateway off and on again.
1794
1795
1796
1797
1798
179917.Another side effect of a significantly inaccurate host clock concerns operating system (OS) updates and cryptographic verification on the host. Until the host clock is manually fixed, it may no longer be possible to download updates or verify SSL certificates with the host browser.
1800
1801
1802
1803
1804
1805
180618.Users should always check whether a host clock defect relates to an empty battery before assuming the ISP is tampering with NTP.
1807
1808
1809
1810
1811
1812
181319.Spoofing the initial virtual hardware clock offset is useful to prevent Clock Correlation Attacks.
1814
1815
1816
1817
1818
1819
182020.For greater security, higher performance and a lower resource footprint, consider using an experimental MirageOS-based unikernel firewall that can run as a QubesOS ProxyVM.
1821
1822
1823
1824
1825
1826
182721.Store encrypted back-ups on a separate back-up disk that is already encrypted with LUKS or dm-crypt.
1828
1829
1830
1831
1832
1833
183422.Two things that have not been name spaced as of yet are time and kernel keystrings
1835
1836
1837
1838
1839
184023.Deactivate TransPort Test for better Stream Isolation.
1841
1842
1843
1844
1845
184624.Run all instances of Tor Browser in a DisposableVM which is preferably uncustomized to resist fingerprinting.
1847
1848
1849
1850
1851
1852
1853
185425.Selfrando provides a significant security improvement over standard address space layout randomization (ASLR) present in Tor Browser and other browsers.
1855
1856
1857
1858
1859
1860
186126.TCP Initial Sequence Numbers mitigation.
1862
1863
1864
1865
1866
1867
186827.set RELRO to "Full RELRO" instead of "Partial RELRO".
1869
1870
1871
1872
1873
187428.always use HTML5 instead of adobe flash.
1875
1876
1877
1878
1879
1880
188129.From time to time a user asks which incoming/outgoing ports are required by Whonix-Gateway. The answer is:
1882
1883Incoming: none.
1884Outgoing: all.
1885
1886An alternative technique for controlling ports might be corridor (a Tor traffic whitelisting gateway), since it can act as a firewall.
1887
1888
1889
1890
189130.JSONP (JSON with Padding) is a method commonly used to bypass the cross-domain policies in web browsers. (You are not allowed to make AJAX requests to a web page perceived to be on a different server by the browser.) Solution:should look to use Cross-Origin Resource Sharing (CORS) where possible.A taste of what this attack can do:https://www.nytimes.com/2015/06/13/technology/chinese-hackers-circumvent-popular-web-privacy-tools.html
1892
1893
1894
1895
189631.Mainframes:are notoriously difficult to get access to, making security testing difficult, if not impossible.Ayoub Elaassal, a security auditor at consulting firm Wavestone, was one of the lucky few who were able to access a mainframe for an audit.It didn't take him too long to find a vulnerability that, if exploited, could have given him root access to a mainframe and its vital, sensitive data."We could potentially compromise the whole system, and to whatever we want -- like intercepting transactions and issuing wire transfers,"
1897
1898
1899
1900
190132.NTP is a buggy and ancient protocol. Flaws in NTP clients can be remotely exploited to give an attacker control over the system,uninstall NTP clients on the host operating system and disable systemd's timdatectl NTP synchronization feature,this prevents time-related attack vectors which rely on leakage of the host time,and add sdwdate (Secure Distributed Web Date).
1902
1903
1904
1905
1906
1907
190833.Block incoming ICMP messages (and any traffic in general) with iptables or any of its frontends.Disable ICMP timestamps and TCP timestamps on the host operating system to prevent leakage of: system information, host time, system uptime, and fingerprinting of devices behind a router.
1909
1910
1911
1912
1913
191434.If a Trusted Platform Module (TPM) is available, use AEM protection to attest that only desired (trusted) components are loaded and executed during the system boot. Unauthorized modifications to BIOS or the boot partition will be notified.
1915
1916
1917
1918
1919
1920
1921
192235.Avoid dual booting,even if you are using encryption on your Qubes installation, /boot is still unprotected and could be maliciously modified by the other OS possibly leading to Qubes itself being maliciously modified.
1923
1924
1925
1926
192736.Open-source hardware is also not perfectly secure, since it is not "stateless", that is, lacking any persistent storage.
1928
1929
1930
1931
193240.CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE = increased security if turned off
1933
193441.CONFIG_GRKERNSEC_TPE = Cool feature that can prevent things from executing everywhere, no performance hit.
1935
193642.CONFIG_GRKERNSEC_SYSFS_RESTRICT = Might not work with Wayland and/or systemd ?
1937
193843.CONFIG_GRKERNSEC_NO_RBAC = If RBAC isn't going to be used it's better to turn this on to prevent any abuse, no performance hit.
1939
194044.CONFIG_GRKERNSEC_IO = No performance hit.
1941
194245.CONFIG_PAX_MEMORY_UDEREF = Some virtualisations solutions can take a huge performance hit with this security setting.
1943
194446.CONFIG_PAX_MEMORY_SANITIZE = 3% performance hit on single CPU system.
1945
194647.CONFIG_PAX_MEMORY_STACKLEAK = 1% performance hit on single CPU system.
1947
194848.CONFIG_PAX_MEMORY_STRUCTLEAK = Even less performance hit than STACKLEAK.
1949
195049.GRKERNSEC_CONFIG_PRIORITY_SECURITY = Choose this option if security is of highest priority for this deployment of
1951 grsecurity. UDEREF, kernel stack clearing, clearing of structures intended
1952 for userland, and freed memory sanitizing will be enabled for this kernel.
1953 In a worst-case scenario, these features can introduce a 20% performance hit
1954 (UDEREF on x64 contributing half of this hit).
1955
1956
1957
1958
195950.People who built computers in the early 2000's will tell you BIOS updates are risky, and they were, but not anymore.
1960
1961
1962
1963
196451.Good programming lanuages for security might be golang,D,Rust, and Ada.
1965
1966
1967
1968
1969
197052.Most programming languages higher level than C are much more secure when it comes to programming errors like Heartbleed's. Examples that primarily compile to machine code include D, Rust and Ada.
1971
1972
1973
1974
1975
197653.Whonix-Workstation Security:In Qubes-Whonix the best practice is to use DisposableVMs for all your internet activity. Alternatively, periodically delete your Whonix-Workstation AppVM(s) and create fresh instances from the Whonix-Workstation TemplateVM.
1977
1978
1979
1980
198154.Use a Yubikey to enhance the security of Qubes user authentication, mitigate the risk of password snooping, and to improve USB keyboard security.The Qubes Yubikey provides an easy way to integrate the Yubikey into your existing Qubes user authentication in order to mitigate the risk of having someone or something snooping on your keyboard while you type your password.
1982
1983It has been designed to be used with a USB AppVM to protect against USB based attacks.
1984
1985
1986
1987
198855.For greater security, advanced users should consider configuring the OS to avoid making core dumps. If possible, preventing access to process memory is also advisable, along with secure storage of the file system.Although core dumps are typically readable only by root,but may contain sensitive data (such as passwords or cryptographic keys), which are written to disk following a crash.
1989
1990
1991
199257.websites can easily determine whether you have allowed JavaScript for them, and if you disable JavaScript by default but then allow a few websites to run scripts (the way most people use NoScript), then your choice of whitelisted websites acts as a sort of cookie that makes you recognizable (and distinguishable), thus harming your anonymity.
1993
1994
1995
1996
1997
199858.SQL Injection flaws are introduced when software developers create dynamic database queries that include user supplied input. To avoid SQL injection flaws is simple. Developers need to either: a) stop writing dynamic queries; and/or b) prevent user supplied input which contains malicious SQL from affecting the logic of the executed query.
1999
2000
2001
2002
2003
200459.Configure sys-whonix to use corridor as a filtering gateway to ensure only connections to Tor relays pass through. This provides an additional fail-safe to protect from accidental clearnet leaks that might arise from hypothetical Whonix bugs
2005
2006
2007
2008
2009
201061.Anonymity is compromised if another NAT network adapter is added to the Whonix-Workstation. If this advice is disregarded, then your identity is leaked if/when infection occurs. Therefore, it is strongly recommended to always update over the Tor network. Although Tor updating is slow by comparison, it prevents inadvertent leaks.
2011
2012
2013
2014
201562.Avoid using wireless keyboards and mice because most send data unencrypted. Even if this wasn't the case, there is no way to verify the robustness of the cryptography involved in proprietary products. A local adversary (up to 100 meters away) can sniff keystrokes and inject their own, allowing them to take over the machine.
2016
2017
2018
2019
2020
2021
202264.Torrify apt-get traffic on the host to prevent fingerprinting and leakage of sensitive security information.Apt-transport-tor is a package that allows host operating systems or non-Whonix-Workstation VMs that are not behind a torifying gateway (like Whonix-Gateway) to torify their apt-get traffic for individual repositories.
2023
2024Strictly speaking, there is no need to use apt-transport-tor inside Whonix VMs since all traffic is already routed over Tor. apt-get is stream isolated using a preconfigured uwt wrapper. In other words, apt-get in Whonix is already talking to a Tor SocksPort. Nevertheless, apt-transport-tor will be the default in Whonix 14 because it provides better error handling and stream isolation
2025
2026
2027
2028
2029
2030
203165.TCP timestamps provide protection against wrapped sequence numbers,but the downside of TCP timestamps is adversaries can remotely calculate the system uptime (and boot time) of the machine and the host's clock down to millisecond precision. These calculated uptimes (and boot times) can also help to detect hidden network-enabled operating systems, as well as link spoofed IP and MAC addresses together and more.
2032To prevent this information being available to an adversary, it is recommended that TCP timestamps are disabled on any operating systems being used. The less information available to attackers, the greater the security.Disable TCP Timestamps via kernel sysctl. Note this boolean disables it for both IPv4 and IPv6 - both are controlled by the same sysctl option.
2033
2034
2035
2036
2037
2038
203966.Ada language is designed to prevent common programming errors as much as possible and is used in critical systems where a system bug might have catastrophic consequences.Many issues can be mitigated through proper coding style, code review, unit tests, etc. but having them done at the language level means that you get it for free.It is also worth adding that despite the fact that a language designed for security such as Ada removes many classes of bugs, there is still nothing stopping you from introducing business logic bugs that the language doesn't know anything about.
2040
2041
2042
2043
2044
2045
204667.Do not use C (and C++)
2047
2048Technically, it is possible to write an implementation of C which would be "safe" and still formally conforms to the C standard, but at a steep price (for instance, you have to make free() a no-operation, so allocated memory is allocated "forever"). Nobody does that.
2049
2050problem:The big problem with "don't use C" is interoperability with other languages. Pretty much any language supports writing a wrapper for C libraries.
2051
2052
2053
2054
2055
205668.Metrics Portal:provides analytics for the Tor network, including graphs of its available bandwidth and estimated userbase;
2057
2058 Atlas:is a web application to learn about currently running Tor relays; and
2059
2060 ExoneraTor:answers the question of whether there was a Tor relay running on a given IP address on a given date.
2061
2062
2063
2064
2065
2066
2067
206869.USBKill is an anti-forensics script written in the aftermath of the SilkRoad trial. Its purpose is to trigger protection events that prevents adversaries from siphoning files/installing malware/running a mouse jiggler. It creates a USB white-list of allowed devices of which anything else plugged into the machine causes it to erase the computer's RAM and immediately shutdown. This can be adjusted to exclude all devices. It can also be used in reverse, with a white-listed flash drive in the USB port attached to the user's wrist via a lanyard serving as a key. In this instance, if the flash drive is forcibly removed, the program will initiate the desired routines.
2069
2070
2071
2072
207370.The MAC address is normally not traceable because it is not passively sent to computers beyond the local router.However, other computers on the local network can potentially log it.Also,due to weaknesses in current spoofing methods it is likely the MAC address can be enumerated via the physical characteristics of the Wi-Fi card.If users intend to use an untrusted, public network then MAC spoofing should be considered.Spoofing is only necessary if you expect to travel with your laptop or PC. It is not required for home PCs that do not change locations.
2074
2075
2076
2077
2078
207971.If the user's home network has a cable modem internet connection, the ISP either provides the cable modem device as part of the service or requires pre-registration of the MAC address of the self-provided cable modem in order to setup the service.
2080
2081If a user manages to hack or change the MAC address of the modem, the service would immediately cease functioning because the IP address assignment is apportioned for, and bound to, that specific MAC address. As a result, when connecting from behind a cable modem/NAT router, MAC address spoofing of the computer's ethernet adapter may be pointless. If a user is traced, the trackable endpoint will be the MAC address of the cable modem device.
2082
2083
2084
2085
2086
2087
2088
208975.In the case of flash based storage like SSDs and USBs, never storing data unencrypted in the first place is the only solution to protecting data.
2090
2091Unlike HDDs overwriting data on SSDs is no longer effective in wiping the disk.The most important consequence of this is that old passwords may still be around, potentially for a very long time because fast erase by overwriting the header and key-slot area is insecure.Example: You change your password because you notice it was exposed to shoulder-surfing or CCTV recording. On a SSD the old password is still retrievable and can be used to decrypt the master key and your data because secure overwriting no longer works as with magnetic disks.
2092
2093Also wear-leveling mechanisms like TRIM leak information about the filesystem that can aid forensics.You must keep TRIM disabled (the default) during Linux LUKS-encrypted installs.
2094
2095
2096
2097
209876.Cache-based side-channel attacks are a serious problem in multi-tenant environments, for example, modern cloud data centers. We address this problem with Cloak, a new technique that uses hardware transactional memory to prevent adversarial observation of cache misses on sensitive code and data. We show that Cloak provides strong protection against all known cache-based side-channel attacks with low performance overhead.
2099We demonstrate the efficacy of our approach by retrofitting vulnerable code with Cloak and experimentally confirming immunity against state-of-the-art attacks. We also show that by applying Cloak to code running inside Intel SGX enclaves we can effectively block information leakage through cache side channels from enclaves, thus addressing one of the main weaknesses of SGX. https://www.microsoft.com/en-us/research/publication/strong-efficient-cache-side-channel-protection-using-hardware-transactional-memory/
2100
2101
2102
2103
210477.Here is a list of additional programming language features that (I think) make it much harder to write unsafe code. The first five features expand the compiler's capabilities in reasoning about your code, so you, a human being prone to error making, don't have to*. In addition, these features also should make it easier for a fellow human being, an auditor, to reason about your code. OpenSSL's source code is often described as a mess and a language stricter than C could have helped to make it easier to reason about. The last two features are about context issues that affect security as well.
2105
21061.A strict type system: Makes it easier to reason about program correctness. Eliminates certain input attacks.
2107
21082.Immutable by default: having immutable values as the primary data container means it is much easier to reason about the state of your program.
2109
21103.Disabled or restricted unsafety: Don't allow scary things such as pointer arithmetic (e.g. Go), or, at least only allow it if wrapped in big fat warnings (Rust). Note that a language lacking in pointer arithmetic completely is excluded for use in a huge number of applications that require low level access.
2111
21124.Compile time taint checking: expand the type system to allow identifying tainted values: values that depend in some way based on input. The compiler could then (conditionally) forbid operations with a tainted value that leak information to outside observers, such as branching on such a value. This could prevent or at least migitate certain classes of timing attacks. As far as I know, these are only available in static code analysis tools, and not in compilers themselves?
2113
21145.Dependent types: dependent types are a means to tell the compiler that "here is an Int whose values are between 2 and 87" or "here is a String of maximum length 12 containing only alphanumeric characters". Failure to meet these requirements results in compilation failure, and not a runtime failure with likely unsecure results. This feature is available in Idris and some theorem prover languages.
2115
21166.Absence of garbage collection: Garbage collection is a big problem for language safety - it creates garbage collection pauses in your program. These pauses leak information about the state of your program and allow timing attacks to happen. When the garbage collector is invoked is impossible (or at best incredibly hard) to predict as a developer, however, and subject to huge changes for even the smallest amount of code changes.
2117
21187.Performance, portability & interopability: It may be fine if you have need for a secure and slow program that only runs on the PowerPC platform, but don't expect anyone else to use it for a cross-platform TLS library. OpenSSL is popular precisely because it's fast and runs everywhere from obscure MIPS-based routers to massively parrallel SPARC servers and everything in between. Furthermore any program or runtime in the world can interface with OpenSSL as a library because it uses C calling conventions.
2119From my limited knowledge of languages, no language does all of these. Rust is an example of a language that covers many - it is strict, immutable by default, has restricted unsafety, does not require garbage collection and is quite performant and portable. Compile time taint checking and dependent types presently appear to be exotic features that require either additional static code analysis tools or new languages, unfortunately.
2120
2121
2122
2123
2124
2125
2126
212778.We study the effectiveness of countermeasures for trafï¬c analysis attacks within our proposed framework. Two basic countermeasure strategies are (a) to pad the trafï¬c with constant interarrival times of packets (CIT) or (b) to pad the
2128trafï¬c with variable interarrival times (VIT). Our experiments show that CIT countermeasures fail when the adversary uses sample variance or sample entropy of packet interarrival times for statistical analysis. On the other hand,
2129VIT countermeasures are effective regardless of which sample statistics are used by the adversary. These observations
2130are validated by analysis of detection rates based on sample
2131distributions of packet interarrival times.
2132Key Words - packet interarrival times, trafï¬c analysis attacks, statistical analysis, statistical pattern recognition
2133
2134
2135
2136
2137
213879.Security researchers have successfully broken one of the most secure encryption algorithms, 4096-bit RSA, by listening — yes, with a microphone — to a computer as it decrypts some encrypted data. The attack is fairly simple and can be carried out with rudimentary hardware.
2139
2140Acoustic cryptanalysis, carried out by Daniel Genkin, Adi Shamir (who co-invented RSA), and Eran Tromer, uses what’s known as a side channel attack. A side channel is an attack vector that is non-direct and unconventional, and thus hasn’t been properly secured. For example, your pass code prevents me from directly attacking your phone — but if I could work out your pass code by looking at the greasy smudges on your screen, that would be a side channel attack. In this case, the security researchers listen to the high-pitched (10 to 150 KHz) sounds produced by your computer as it decrypts data.
2141
2142Acoustic cryptanalysis is actually surprisingly dangerous. Imagine if you were decrypting some files in a library, coffee shop, or other public space — someone could obtain your decryption key just by placing their phone near your computer. Alternatively, an attacker could use spear phishing to put malware on your phone that listens for the decryption key. With HTML5 and Flash able to access the microphone, it would be possible to build a website that listens for encryption keys too. The researchers propose one particularly nefarious scenario: Put a microphone into a co-located server, slot it into a rack in a data center, and then scoop up the encryption keys from hundreds of nearby servers.
2143
2144If you want to keep your data secure, you only really have two viable options: Heavy-duty encryption, physical security, and ideally both at the same time. If an attacker can’t get physically close to your data, it instantly becomes much harder to steal it. As far as mitigating acoustic cryptanalysis attacks, you either implement physical security — keep your laptop in a sound-tight box, or never let anyone near your computer when you’re decrypting data — or you need to use a “sufficiently strong wide-band noise source.†Something like a swooping, large-orchestra classical concerto would probably do it.
2145
2146
2147
2148
2149
2150
2151
215281.Normally the dial-up or broadband provider knows your name, postal address and non-anonymous payment method. If Tor or Whonix is compromised, then an adversary only needs to pressure the service provider to confirm your identity. This is not the case if using an anonymous WiFi adapter plugged or integrated into the Whonix-Gateway.
2153
2154For safer use, it is recommended to:
2155
21561.Buy the WiFi adapter anonymously in a store, second-hand or on the street.
21572.Never provide personal data during a purchase.
21583.Do not use the adapter for prior, non-anonymous activity. Some providers or hotspots log MAC addresses and the username (if paid).
21594.If possible, only use free hotspots or pay for them anonymously. Otherwise abstain from paid hotspots.
21605.For greater security, always use a new, distant, random, non-circular hotspot location.
2161
2162
2163
2164
2165
2166
216782.Onionizing Repositories
2168
2169When Whonix, Debian and Qubes packages are installed or updated, default settings point to repositories with a http:// URL.However, experimental Tor hidden services are already available for the Whonix, Debian and Qubes packages.
2170
2171There are several security and privacy benefits of using Tor hidden services:
2172
21731.The user cannot be uniquely targeted for malicious updates (attackers are forced to attack everyone requesting the update).
21742.The package repository, or observers watching it, can't track what programs are installed.
21753.The ISP cannot easily learn what packages are fetched.
21764.End-to-end authentication and encryption provides protection against man-in-the-middle attacks e.g. version downgrade attacks.
2177
2178
2179
2180
2181
218284.Attention must also be given to changing the usual Tor entry guards used for connections.Entry guard changes are necessary for every Tor instance on the user's machine host (apt-transport-tor) and guest.An authentication technique can fingerprint devices - and also track user devices as a side-effect - by observing inter-packet timings on a LAN's wire-segment. The timing effects are the result of how various components in a machine create packets.Fortunately, this technique cannot be used to identify devices across the internet.This technique can be defeated by inducing random delays in a machine's packet stream. Since there is no concern about impersonating other devices on the LAN, it doesn't matter that such an authentication system will view such machines as "unknown".
2183
2184
2185
2186
2187
218885.not related to security but still helpful https://gyazo.com/c73be243e9508b7f82f0a15fea607930
2189
2190
2191
2192
2193
2194
219586.Locking down your web site (in Apache)
2196
2197If you are the owner of a web site and have SSL security on it, you can “lock it down†so that the only cipher that your web site supports is “256-bit AESâ€. This takes the choice out of the end user’s hands — either they use AES or they don’t connect securely. This is a good thing to do for very sensitive sites. However, the “danger†is that some of your users may be using web browsers that do not support AES (like old versions Internet Explorer), and thus will not have any access to your site unless they change browsers.
2198
2199To lock your site down to support 128-bit and 256-bit AES only (to get AES but not require 256-bit, so that some browsers like iPhone and such will work), you would add to your Apache httpd.conf file:
2200
2201SSLCipherSuite AES256-SHA:AES128-SHA
2202
2203This can be added globally, in a virtual host, or even in your .htaccess file. It will ensure that any successful connection to your site will use one of these ciphers. Just be sure to add it to the secure settings for your site and not just the insecure site area!
2204
2205In general, for a high security configuration for Apache, you will want to support only TLS v1.0+ and only NIST-recommended cipher suites.
2206
2207
2208
2209
2210
221187.offline APT package manager
2212
2213apt-offline is an Offline APT Package Manager.
2214
2215apt-offline can fully update and upgrade an APT based distribution without connecting to the network, all of it transparent to APT.
2216
2217apt-offline can be used to generate a signature on a machine (with no network). This signature contains all download information required for the APT database system. This signature file can be used on another machine connected to the internet (which need not be a Debian box and can even be running windows) to download the updates. The downloaded data will contain all updates in a format understood by APT and this data can be used by apt-offline to update the non-networked machine.
2218
2219apt-offline can also fetch bug reports and make them available offline.
2220
2221
2222
2223
2224
222588.VM images that are built with frozen sources rather than current sources (including Whonix)
2226is that latest stable releases sometimes contain vulnerable, remotely exploitable applications that are very likely to be used over untrusted networks that are in a position to run man-in-the-middle attacks. One example of this is [CVE-2014-6273] in apt-get.Self-created builds from source code using current sources would solve this.Although using Current Sources comes with its own issues.
2227
2228
2229
2230
2231
2232
2233
223490.Cleaning a Compromised System
2235So, you didn’t patch the system and it got hacked. What to do? Well, let’s see:
2236
2237
2238
2239You can’t clean a compromised system by patching it. Patching only removes the vulnerability. Upon getting into your system, the attacker probably ensured that there were several other ways to get back in.
2240
2241
2242
2243You can’t clean a compromised system by removing the back doors. You can never guarantee that you found all the back doors the attacker put in. The fact that you can’t find any more may only mean you don’t know where to look, or that the system is so compromised that what you are seeing is not actually what is there.
2244
2245
2246
2247You can’t clean a compromised system by using some “vulnerability remover.†Let’s say you had a system hit by Blaster. A number of vendors (including Microsoft) published vulnerability removers for Blaster. Can you trust a system that had Blaster after the tool is run? I wouldn’t. If the system was vulnerable to Blaster, it was also vulnerable to a number of other attacks. Can you guarantee that none of those have been run against it? I didn’t think so.
2248
2249
2250
2251You can’t clean a compromised system by using a virus scanner. To tell you the truth, a fully compromised system can’t be trusted. Even virus scanners must at some level rely on the system to not lie to them. If they ask whether a particular file is present, the attacker may simply have a tool in place that lies about it. Note that if you can guarantee that the only thing that compromised the system was a particular virus or worm and you know that this virus has no back doors associated with it, and the vulnerability used by the virus was not available remotely, then a virus scanner can be used to clean the system. For example, the vast majority of e-mail worms rely on a user opening an attachment. In this particular case, it is possible that the only infection on the system is the one that came from the attachment containing the worm. However, if the vulnerability used by the worm was available remotely without user action, then you can’t guarantee that the worm was the only thing that used that vulnerability. It is entirely possible that something else used the same vulnerability. In this case, you can’t just patch the system.
2252
2253
2254
2255You can’t clean a compromised system by reinstalling the operating system over the existing installation. Again, the attacker may very well have tools in place that tell the installer lies. If that happens, the installer may not actually remove the compromised files. In addition, the attacker may also have put back doors in non-operating system components.
2256
2257
2258
2259You can’t trust any data copied from a compromised system. Once an attacker gets into a system, all the data on it may be modified. In the best-case scenario, copying data off a compromised system and putting it on a clean system will give you potentially untrustworthy data. In the worst-case scenario, you may actually have copied a back door hidden in the data.
2260
2261
2262
2263You can’t trust the event logs on a compromised system. Upon gaining full access to a system, it is simple for an attacker to modify the event logs on that system to cover any tracks. If you rely on the event logs to tell you what has been done to your system, you may just be reading what the attacker wants you to read.
2264
2265
2266
2267You may not be able to trust your latest backup. How can you tell when the original attack took place? The event logs cannot be trusted to tell you. Without that knowledge, your latest backup is useless. It may be a backup that includes all the back doors currently on the system.
2268
2269
2270
2271The only way to clean a compromised system is to flatten and rebuild. That’s right. If you have a system that has been completely compromised, the only thing you can do is to flatten the system (reformat the system disk) and rebuild it from scratch (reinstall Windows and your applications).