· 8 years ago · Nov 28, 2017, 10:18 AM
1security notes (computer)
2
3TABLE OF CONTENTS
4•Security/privcy focused OSes with main security features
5•Virus detection
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•general system hardening
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•security information and event management system
25•packet analyzers
26•network security scanner
27•disk encryption
28•security audit tools
29•Network and applications layer authentication and encryption software
30•best cryptographic to date
31•Executable space protections
32•server security suite
33•VPNS
34•proxies
35•whistleblower submission system
36•distributing files anonymously
37•scan websites automatically for common vulnerabilities and errors that can de-anonymize the owner or users
38•protection against Metadata
39•proof that bugs can go undetected for atleast 1 year or more!
40•protection against Cross-Site Request Forgery (CSRF)
41•Preventing Remote File Inclusion (RFI) Attacks
42•cross site scripting (XSS) prevention
43•defenses against SQL injections
44•XPath Injection Defenses
45•problems that have not been solved yet
46•General and technical Notes
47
48-------------------------------------------------------------------------------------------------------
49Security/privcy focused OSes with main security features
50
51
52Subgraph OS (security by kernal namespaces isolation, gresecurity/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,)
53
54
55
56Qubes OS (security by VM isolation, Qubes relys on Xen to enforce domain isolation rather then a monolithic kernalthat 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)
57
58
59
60OpenBSD (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)
61
62
63
64FreeBSD (has the strlcpy and strlcat functions, Sysctl, Secure Level, Jail, Syslog, Mandatory access control (MAC) support is enabled by default, firewall, OpenSSH)
65
66
67
68Whonix (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)
69
70
71
72Lightweight Portable Security (security by reduced code, DNScrypt, does not mount a local hard drive, Administrator privileges are not required; nothing is installed,firewall )
73
74
75
76TinHat (lives on Ram, does not mount any file system, gresecurity/pax,firewall )
77
78
79
80The Amnesic Incognito Live System (TAILS) (Tor,use state-of-the-art cryptographic tools, stream isolation, 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)
81
82
83
84
85
86NOTES
87
881.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.
89
90
91
92
932.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.
94
95
96
97
983.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.
99
100
101
1024.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.
103
104In 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.
105
106Tor 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.
107
108Unfortunately, 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.
109
110potential 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.
111
112
113
114
115
116--------------------------------------------------------------------------------------------------------
117Virus detection
118
119
120Malwarebytes 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)
121
122
123
124Avast Anti-virus
125
126
127
128webroot 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)
129
130
131
132RKhunter
133
134
135
136chkrootkit
137
138
139
140OTL (by oldtimer)
141
142
143
144Rogue killer TKZY
145
146
147
148virustotal
149
150
151NOTES
1521.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.
153
154
155
1562.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.
157
158the 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.
159
160
161
1623.cloud AVs https://www.blackhat.com/docs/us-17/thursday/us-17-Kotler-The-Adventures-Of-Av-And-The-Leaky-Sandbox.pdf
163--------------------------------------------------------------------------------------------------------
164Domain Name System (DNS) security
165
166DNScrypt
167
168DNSSEC
169
170OpenDNS
171
172
173NOTES
1741.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)
175
176--------------------------------------------------------------------------------------------------------
177Browser security/privacy Add-ons
178
179
180HTTPS everywhere
181
182Noscript
183
184WOT
185
186Ghostery
187
188Ublock origin
189
190Privacy Badger
191
192User Agent Switcher
193--------------------------------------------------------------------------------------------------------
194Good email providers
195
196
197Riseup.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.)
198
199
200
201Protonmail (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.)
202
203
204
205Icedove (you should add these two add-ons Enigmail and TorBirdy.)
206
207
208
209I2P-Bote (has automatic encryption and signing without relying on third-party software such as PGP/GnuPG)
210
211
212
213BitMessage
214
215
216
217
218
219
220NOTES
2211.Use split-GPG for email to reduce the risk of key theft used for encryption / decryption and signing.
222
223
2242.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...").
225
226
2273.Only open untrusted email attachments in a DisposableVM to prevent possible infection.
228
229
2304.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.
231
232
2335.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.
234--------------------------------------------------------------------------------------------------------
235security/privacy focus Search Engines
236
237
238
239DuckDuckgo
240
241
242Startpage
243
244
245Disconnect
246
247--------------------------------------------------------------------------------------------------------
248Anti-keyloggers
249
250
251Zemana AntiLogger
252
253KeyScrambler
254
255
256
257NOTES
2581.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.
259
260--------------------------------------------------------------------------------------------------------
261Firewalls
262
263
264Advanced Policy Firewall R-fx Networks
265
266Next Generation Firewall check point
267
268Barracuda
269
270ipfire
271
272smoothwall express
273
274
275
276NOTES
2771.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.
278--------------------------------------------------------------------------------------------------------
279memory protection (memory corruption,userland memory protection,direct memory access (DMA),Return Oriented Programming (ROP),etc.)
280
281
282
283hardened malloc
284
285
286
287
288
289Address 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
290process. However, in both Linux and Windows, parts of the address space do not change due to executables
291with fixed load addresses, or shared libraries incompatible with ASLR. Furthermore, in some
292exploits, the base address of a DLL can be either calculated dynamically through a leaked pointer,
293or brute-forced.
294
295
296
297
298
299RELRO (included in gresecurity)
300
301
302
303
304
305KERNEXEC (included in gresecurity)
306
307
308
309
310
311UDEREF (included in gresecurity)
312
313
314
315
316
317KERNSEAL (included in gresecurity) (defenses against data-only attacks)
318
319
320
321
322STRUCTGUARD (included in gresecurity)
323
324
325
326
327
328Reuse Attack Protector (RAP):RAP is the state of the art in CFI defense,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,perhaps the successor of Stack Smashing Protector (SSP) is a ROP mitigation technique (included in gresecurity)
329
330
331
332
333
334kBouncer: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.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.
335
336
337
338
339In-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
340entropy,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.
341
342
343
344
345
346Supervisor Mode Access Prevention (SMAP) (included in gresecurity)
347
348
349
350
351
352
353Heap corruption mitigations:heap integrity checks, guard pages, and allocation order randomization
354
355
356
357
358
359IOMMU:Thanks to IOMMU,PCI cards are more resisant to Direct Memory Access (DMA) based attacks.
360
361
362
363
364
365You can go to the extreme and turn DMA completely off,losing a huge performance gain from DMA of course.
366
367
368
369
370
371Refuse access to DMA access memory by external devices until after the Windows OS is in control to parse DMA requests.
372
373
374
375
376
377Ensure 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.
378
379
380
381
382
383Ensure 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.
384
385
386
387
388
389If 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.
390
391
392
393
394
395
396No-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.
397
398
399
400
401
402XD 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.
403
404
405
406
407XN is the ARM equivalent of the same feature and is the acronym for eXecute Never.
408
409
410
411
412Essentially, both NX, XD and XN are the same and are different names for the same feature in AMD, Intel and ARM respectively.
413
414
415
416
417
418
419 NOTES
4201.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.
421
422Some 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.
423
424A 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.
425
426A 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.
427
428
429
430
431
4322.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.
433
434Furthermore, 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.
435
436Wipe 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.
437
438
439
440
441
4423.Heap corruption vulnerabilities are the most common type 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).
443
444
445
446
4474.Return-oriented programming (ROP) has become the primary exploitation technique for
448system compromise in the presence of non-executable page protections. ROP exploits are
449facilitated mainly by the lack of complete address space randomization coverage or the presence
450of memory disclosure vulnerabilities, necessitating additional ROP-specific mitigations.
451Existing defenses against ROP exploits either require source code or symbolic debugging
452information, or impose a significant runtime overhead, which limits their applicability for
453the protection of third-party applications.
454
455
456
457
4585.Other defenses against code-reuse attacks complementary to ASLR include compiler extensions,
459code randomization, control-flow integrity, and runtime solutions. In practice,
460though, most of these approaches are almost never applied for the protection of the COTS software currently
461targeted by ROP attacks, either due to the lack of source code or debugging information, or due to their
462increased overhead.
463
464
465
466
467
4686.As code-reuse attacks require precise knowledge of the structure and location of the code to
469be reused, diversifying the execution environment or even the program code itself is a core
470concept in preventing code-reuse exploits.
471
472
473
474
475
476
4777.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.
478
479
480
481
482
483
4848.Intra-DLL randomization at the function, basic block, or instruction level can provide protection for executables
485that do not support ASLR, or against de-randomization attacks through memory leaks.
486
487
488
489
490
491
4929.JOP is similar to ROP, but it uses indirect jump instructions instead of returns to transfer
493control from gadget to gadget. Clearly, constructing JOP programs is far more difficult than ROP because
494the attacker has to maintain a memory region with the payload and manually advance the pointer to the
495next gadget and transfer control to it. The same functionality is conveniently achieved by a single return
496instruction in ROP.
497--------------------------------------------------------------------------------------------------------
498Linux Kernel Security
499
500
501Gresecurity: 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.
502
503
504
505
506
507PaX: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.
508
509
510
511
512
513secure 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.
514
515
516
517
518cgroups: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.
519
520
521
522
523STACKLEAK:-reducing the information that can be revealed through kernel stack leak bugs
524 - blocking some uninitialized stack variable attacks
525 - introducing some runtime checks for kernel stack overflow detection
526
527
528
529
530
531KernelAddressSanitizer (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.
532
533
534
535
536
537/dev/mem protection (included in the Linux kernel 2.6.25)
538
539
540
541
542
543
544
545/proc/$pid/maps protection (Becames non-optional in Linux kernel 2.6.27)
546
547
548
549
550
551
552
553runtime memory allocation validation:Detect double-frees in kernel space.
554
555
556
557
558
559
560Restricting 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).
561
562-
563
564
565
566
567Restricting 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).
568
569
570
571
572Keep 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.
573This 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.
574
575
576
577
578ptrace 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.
579
580
581
582
583
584hidepid: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.
585
586
587
588
589NOTES
5901.Using sysctl keys is a good way to harden the Linux kernel.
591
592
593
594
5952.Add link restrictions
596Symlinks:
597
598A long-standing class of security issues is the symlink-based
599time-of-check-time-of-use race, most commonly seen in world-writable
600directories like /tmp. The common method of exploitation of this flaw
601is to cross privilege boundaries when following a given symlink (i.e. a
602root process follows a symlink belonging to another user).
603
604The solution is to permit symlinks to only be followed when outside
605a sticky world-writable directory, or when the uid of the symlink and
606follower match, or when the directory owner matches the symlink's owner.
607
608Applications should just use mkstemp() or O_CREATE|O_EXCL.
609- True, but applications are not perfect, and new software is written
610all the time that makes these mistakes; blocking this flaw at the
611kernel is a single solution to the entire class of vulnerability.
612
613In Linux 3.6,link restrictions are enabled by default.
614
615
616
617
618
6193.Information leaks of kernel stack data are the most common type of leaks in the kernel and potentially the most dangerous.(gresecurity solves this with STACKLEAK)
620
621
622
623
624
6254.Integer overflows are a common bug class in the kernel. (gresecurity solves this)
626
627
628
629
6305.Grsecurity kernels also disables user namespaces by default.
631
632
633--------------------------------------------------------------------------------------------------------
634general system hardening
635
636bastille unix
637--------------------------------------------------------------------------------------------------------
638compiler security
639
640
641
642heap protection
643
644
645
646libc pointer encryption
647
648
649
650RANDSTRUCT (GCC plugin)
651
652
653
654STACKLEAK (GCC plugin)
655
656
657
658timeless:This will cause warnings when the __TIME__, __DATE__ and __TIMESTAMP__ macros are used.
659
660
661
662-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.
663
664
665
666-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.
667
668
669
670relro: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.
671
672
673
674fstack-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.*
675
676
677
678Position 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
679much harder since there are no static locations to bounce off of during a memory corruption attack.
680
681
682reproducible 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.
683
684
685
686NOTES
6871.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.
688
689
6902.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.
691
692
6933.Compiler is the bridge between source code and machine code.
694
695--------------------------------------------------------------------------------------------------------
696hardware security
697
698Trusted Platform Module (TPM)
699
700Intel Trusted Execution Technology (TXT)
701
702Intel Boot Guard technology
703
704secure boot
705
706trusted boot
707
708coreboot
709
710Libreboot
711
712
713
714
715
716
717NOTES:
7181.Purchase hardware from manufacturers who support GNU/Linux.
719
720
721
722
7232.Purchase hardware which supports coreboot/libreboot as a proprietary BIOS replacement.
724
725
726
727
7283.Purchase hardware without the need for proprietary drivers or firmware: hdnode.org
729
730
731
732
7334.Avoid using wireless devices, since they are insecure.
734
735
736
737
7385.Preferably disable or remove Bluetooth hardware modules.
739
740
741
742
743
7446.Hardware-specific issues can really only be fixed at the hardware level. At best, software interventions can only provide workarounds.
745
746The 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.
747
748
749
750
751
752
7537.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.
754
755--------------------------------------------------------------------------------------------------------
756802.11 network security
757
758WPA2
759
760
761
762
763NOTES
7641.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â€.
765
7662.Disable Wi-Fi Protected Setup (WPS) because it allows any device to connect to the network with the relevant eight-digit PIN.
767
7683.Do not bother disabling SSID broadcasting since it is trivial to guess.
769
7704.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.
771
7725.Use routers that exclusively use WPA2, preferably with the AES standard (CCMP) and not TKIP which is less secure.
773
7746.Enable the "Block WAN Requests" option to conceal the network from other Internet users.
775
7767.Limit the number of Dynamic Host Configuration Protocol (DHCP) leases (connects) to the Wi-Fi network to match the number of personal devices owned.
777
7788.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.
779
7809.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.
781
78210.If possible, schedule Wi-Fi networks to turn off at night, and then turn on in the morning.
783
78411.If possible, use a dedicated network connection (LAN, WiFi etc.) that is not shared with other potentially compromised computers.
785
78612.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.
787
78813.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.
789
790
791--------------------------------------------------------------------------------------------------------
792Router security
793
794Openwrt
795
796pfsense
797
798
799
800
801NOTES
8021.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.
803
8042.Change the default router username and password to something suitably long and random.
805
8063.Turn off Universal Plug and Play (UPnP), which can allow applications to open ports to external computers.
807
8084.Disable NAT-PMP, since it has similar functionality to UPnP.
809
8105.Disable the Home Network Administrative Protocol since it allows remote management of network devices.
811
8126.Port forwarding (if desired by the user) should be limited to a source IP address and/or source IP address subnet.
813
8147.Keep router firmware up-to-date at all times for better security. Set the self-updating firmware option if it is available.
815
8168.Do not bind services to the external interface.
817
8189.Reconfigure the router firewall rules to drop all relevant incoming packets.
819
82010.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
821
82211.Use the browser's incognito or private mode when accessing the administrative interface so the URL is not saved in the browser history.
823
82412.Change the Service Set ID (SSID) which often leaks router information. Do not use personally identifying information like the apartment number you live in.
825
82613.Disable cloud-based router management (if offered) because trust is shifted to another person between the user and the router.
827
82814.Do not use mesh router systems that do not permit local administrative access.
829
83015.Disable remote administrative access and administrative access over Wi-Fi. Set administrator access only via wired ethernet connections (not possible with mesh routers).
831
83216.Disable all other remote-access protocols like PING, Telnet and SSH.
833
83417.Firewall ports should be set to "stealth" rather than "closed" so no response is given to unsolicited external communications from attackers probing the network.
835
83618.Set logging to on, if the feature is available. This allows for a record of unsolicited incoming connection attempts, attempted logins and so on.
837
83819.Avoid administrating the router with a smartphone application.
839
84020.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.
841
84221.If possible, use a dedicated network connection (LAN, WiFi etc.) that is not shared with other potentially compromised computers.
843
84422.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.
845
84623.WiFi users should default to the WPA2-AES standard which provides the safest protocol and strongest encryption currently.
847
84824.Do not rely on WiFi Protected Set-up (WPS), which has major security flaws.
849--------------------------------------------------------------------------------------------------------
850vulnerability scanners
851
852OpenVAS (created by Greenbone Networks,framework of several services and tools offering a comprehensive and powerful vulnerability scanning and vulnerability management solution)
853
854
855Vega (created by subgraph,security scanner and web security testing platform to test the security of web applications)
856
857
858Qualys FreeScan (network vulnerablity scanner)
859--------------------------------------------------------------------------------------------------------
860secure Microkernels
861
862
863SeL4
864
865
866
867
868--------------------------------------------------------------------------------------------------------
869security by isolation programs
870
871Oz
872Uses kernal namespaces for isolation.
873
874
875
876
877
878Firejail (SUID program)
879Firejail 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.
880
881
882
883
884
885XEN
886Is 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.
887
888
889
890
891
892virtualbox
893Type 2 Hypervisor,can be used for VM isolation.
894
895
896
897
898sandboxie
899
900
901
902
903chroots
904Manual chroot jails can also be constructed.
905
906
907
908
909bubblewrap: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.
910
911-------------------------------------------------------------------------------------------------------
912network intrusion prevention system (NIPS) and network intrusion detection system (NIDS)
913
914
915Bro 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.)
916
917
918
919Snort (de-facto standard for IDS and eventually IPS (thanks to community effort!)
920
921
922
923
924
925NOTES
926There are a number of techniques which attackers are using, the following are considered 'simple' measures which can be taken to evade IDS:
927
928
9291.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.
930
931
9322.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.
933
934
9353.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.
936
937
9384.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.
939
940
9415.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.
942--------------------------------------------------------------------------------------------------------
943host-based intrusion detection system (HIDS)
944
945OSSEC
946--------------------------------------------------------------------------------------------------------
947security information and event management system
948
949AlienVault OSSIM (Open Source Security Information Management)
950
951--------------------------------------------------------------------------------------------------------
952packet analyzers
953
954
955Wireshark
956
957packet total ( https://packettotal.com/ )
958
959-------------------------------------------------------------------------------------------------------
960network security scanner
961
962
963Nmap
964
965-------------------------------------------------------------------------------------------------------
966disk encryption
967
968
969dm-crypt
970
971Linux Unified Key Setup (LUKS)
972
973-------------------------------------------------------------------------------------------------------
974security audit tools
975
976
977Lynis
978
979TIGER
980
981-------------------------------------------------------------------------------------------------------
982Network and applications layer authentication and encryption software (some may support combinations of authentication, integrity, access control, and confidentiality).
983
984Kerberos
985
986
987IPSec
988
989
990AES-256 (with PKCS7 padding)
991
992
993RSA (using 4096 bit)
994
995
996GNU Privacy Guard (GPG) (based off PGP)
997
998
999Secure Shell (SSH)
1000
1001
1002Transport Layer Security (TLS)
1003
1004
1005
1006
1007NOTES
10081.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.
1009
1010
1011
10122.IPSec controls whether a user can connect to the computer at the IP layer, not the application layer.
1013
1014
1015
10163.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.
1017
1018
1019
1020
10214.What do Digital Signatures Prove and What They DO NOT Prove:
1022
1023Digital 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.
1024
1025The 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.
1026
1027-------------------------------------------------------------------------------------------------------
1028best cryptographic to date
1029
1030Quantum cryptography
1031
1032
1033SHA3-512 (based off Secure Hash Algorithm 3)
1034
1035
1036Elliptic curve cryptography (ECC) (using:Ed25519 and Curve25519)
1037-------------------------------------------------------------------------------------------------------
1038Executable space protections
1039
1040Data Execution Prevention (DEP)
1041
1042W^X
1043
1044
1045
1046notes
1047
10481.Bypassing DEP and NX requires a cool trick called Return-Oriented Programming.
1049
1050-------------------------------------------------------------------------------------------------------
1051server security suite
1052
1053Atomic Secured Linux
1054
1055
1056
1057-------------------------------------------------------------------------------------------------------
1058VPNS
1059
1060
1061ipvanish (No Logs, Best For Tor, DNS Leak Protection, Unlimited Bandwidth)
1062
1063
1064
1065ExpressVPN (AES-256 cipher with RSA-4096 handshake and SHA-512 HMAC, Elliptic Curve Diffie–Hellman, fast, DNS leak protection, kill switch, no logs)
1066
1067
1068Torguard (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)
1069
1070
1071Riseup VPN (bitmask)
1072
1073
1074iVPN (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)
1075
1076
1077OpenVPN (DPI Bypass,AES-256,based on open source software,Challenge/Response authentication,possible to execute scripts in the context of the
1078desktop user instead of the root context of the OpenVPN daemon, Web-free VPN,Local subnet blocking)
1079
1080
1081
1082NOTES
10831.You -> VPN -> Tor
1084
1085You 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.
1086
1087Most 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.
1088
1089Who'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.
1090
1091VPN/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).
1092
1093
1094
1095
10962.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.
1097
1098VPNs 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.
1099
1100
1101
11023.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.
1103
1104
1105
11064.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.
1107
1108
1109--------------------------------------------------------------------------------------------------------
1110proxies
1111
11121.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.
1113
1114
1115--------------------------------------------------------------------------------------------------------
1116whistleblower submission system
1117
1118secure drop
1119--------------------------------------------------------------------------------------------------------
1120distributing files anonymously
1121
1122OnionShare
1123--------------------------------------------------------------------------------------------------------
1124scan websites automatically for common vulnerabilities and errors that can de-anonymize the owner or users
1125
1126OnionScan
1127--------------------------------------------------------------------------------------------------------
1128protection against Metadata
1129
1130MAT - Metadata Anonymisation Toolkit
1131
1132Why MAT is not the ultimate solution?
1133Mat 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.
1134
1135NOTES
11361.Use POP3 and SMTP settings, as IMAP leaks more metadata.
1137
1138
11392.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.
1140--------------------------------------------------------------------------------------------------------
1141proof that bugs can go undetected for atleast 1 year or more!
1142
1143
11441.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.
1145
1146
11472.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.
1148
1149
11503.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.
1151
1152
11534.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!)
1154
1155
11565.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!
1157
1158
11596.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.
1160
1161
1162
1163
1164
1165--------------------------------------------------------------------------------------------------------
1166protection against Cross-Site Request Forgery (CSRF)
1167
1168We 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.
1169
1170
11711.Check standard headers to verify the request is same origin
1172
11732.AND Check CSRF token
1174
1175(for a full explanation go here: https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet )
1176
1177
1178
1179--------------------------------------------------------------------------------------------------------
1180Preventing Remote File Inclusion (RFI) Attacks
1181
1182
11831.Never use arbitrary input data in a literal file include request.
1184
1185
11862.Use a filter to thoroughly scrub input parameters against possible file inclusions.
1187
1188
11893.Build a dynamic whitelist.
1190
1191
1192NOTES
11931.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.
1194
1195
11962.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.
1197
1198
1199(for a full explanation go here: http://www.esecurityplanet.com/browser-security/how-to-prevent-remote-file-inclusion-rfi-attacks.html )
1200--------------------------------------------------------------------------------------------------------
1201cross site scripting (XSS) prevention
1202
12031.HTML Escape Before Inserting Untrusted Data into HTML Element Content
1204
1205
1206
12072.Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes
1208
1209
1210
12113.JavaScript Escape Before Inserting Untrusted Data into JavaScript Data Values
1212
1213
1214
12154.HTML escape JSON values in an HTML context and read the data with JSON.parse
1216
1217
1218
12195.CSS Escape And Strictly Validate Before Inserting Untrusted Data into HTML Style Property Values
1220
1221
1222
12236.URL Escape Before Inserting Untrusted Data into HTML URL Parameter Values
1224
1225
1226
1227
12287.Prevent DOM-based XSS
1229
1230
1231
1232
12338.Use HTTPOnly cookie flag
1234
1235Preventing 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.
1236
1237
1238
1239
12409.Implement Content Security Policy
1241
1242There 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.
1243
1244
1245
124610.Use an Auto-Escaping Template System
1247
1248Many web application frameworks provide automatic contextual escaping functionality such as AngularJS strict contextual escaping and Go Templates. Use these technologies when you can.
1249
1250
1251
125211.Use the X-XSS-Protection Response Header
1253
1254This 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.
1255
1256
1257(for a full explanation go here: https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet )
1258--------------------------------------------------------------------------------------------------------
1259defenses against SQL injections
1260
1261Defense Option 1: Prepared Statements (with Parameterized Queries)
1262
1263The 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.
1264
1265Prepared 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.
1266
1267
1268
1269
1270
1271
1272
1273
1274Defense Option 2: Stored Procedures
1275
1276Stored 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.
1277
1278
1279
1280
1281
1282
1283Defense Option 3: White List Input Validation
1284
1285Various 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.
1286
1287
1288
1289
1290
1291
1292
1293Defense Option 4: Escaping All User Supplied Input
1294
1295This 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.
1296
1297This 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.
1298
1299This 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.
1300
1301
1302
1303Additional Defenses
1304
1305To 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.
1306
1307If 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.
1308
1309SQL 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.
1310
1311While 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.
1312
1313
1314
1315(for a full explanation go here: https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet )
1316--------------------------------------------------------------------------------------------------------
1317XPath Injection Defenses
1318
13191.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.
1320
13212.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.
1322
1323
1324
1325--------------------------------------------------------------------------------------------------------
1326problems that have not been solved yet
1327
13281.there has been no solution proposed to protect the network from DoS attacks caused by an attacker using CTS-to-Self.
1329
1330(CTS=Clear To Send)
1331
1332
1333
1334
1335
1336
1337
13382.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:
1339
1340.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.
1341
1342.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.
1343
1344.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.
1345
1346
1347
1348
1349
1350
13513.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?)
1352
1353Intel ME can’t be 100% disabled but we can restrict the power of Intel ME by minizing its functions.
1354
1355(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 )
1356
1357
1358
1359
1360
13614.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.
1362
1363
1364
1365
1366
13675.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.
1368
1369
1370
1371
13726.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.
1373
1374
1375
13767.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.
1377
1378
1379
1380--------------------------------------------------------------------------------------------------------
1381General and technical Notes
1382
13831.In linux use sudo instead of su.
1384
1385
1386
1387
1388
13892.It is possible to tighten the security so much as to make your system unusable,do it without over doing it.
1390
1391
1392
1393
1394
13953.Avoid using secure shell without requiring SSH keys,this prevents brute force attacks.
1396
1397
1398
1399
14004.when using SSH, implementing Fail2ban so only key authentication is allowed.
1401
1402
1403
1404
1405
14065.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.
1407
1408
1409
1410
1411
14126. 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 )
1413
1414
1415
1416
1417
14187.TCP timestamps are disabled by default in Qubes R3.1 and above.
1419
1420
1421
1422
1423
14248.Constantly check for updates of outdated hardware and software programs.
1425
1426
1427
1428
1429
1430
1431
14329.Apply a BIOS password for BIOS set up and boot.
1433
1434
1435
1436
1437
143810.In Qubes always open attachments in DispVM.
1439
1440
1441
1442
144311.Most .bat's that you will see online will be malicious. Some are good though.Always open .bat files with caution.
1444
1445
1446
1447
1448
144912.Be weary of vulnerable apt-get downloads through untrusted Tor exit relays.
1450
1451
1452
1453
1454
145513.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.
1456
1457
1458
1459
1460
146114.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.
1462
1463
1464
1465
1466
1467
146815.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.
1469
1470
1471
1472
1473
1474
147516.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.
1476
1477
1478
1479
1480
148117.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.
1482
1483
1484
1485
1486
1487
148818.Users should always check whether a host clock defect relates to an empty battery before assuming the ISP is tampering with NTP.
1489
1490
1491
1492
1493
1494
149519.Spoofing the initial virtual hardware clock offset is useful to prevent Clock Correlation Attacks.
1496
1497
1498
1499
1500
1501
150220.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.
1503
1504
1505
1506
1507
1508
150921.Store encrypted back-ups on a separate back-up disk that is already encrypted with LUKS or dm-crypt.
1510
1511
1512
1513
1514
1515
151622.Two things that have not been name spaced as of yet are time and kernel keystrings
1517
1518
1519
1520
1521
152223.Deactivate TransPort Test for better Stream Isolation.
1523
1524
1525
1526
1527
152824.Run all instances of Tor Browser in a DisposableVM which is preferably uncustomized to resist fingerprinting.
1529
1530
1531
1532
1533
1534
1535
153625.Selfrando provides a significant security improvement over standard address space layout randomization (ASLR) present in Tor Browser and other browsers.
1537
1538
1539
1540
1541
1542
154326.TCP Initial Sequence Numbers mitigation.
1544
1545
1546
1547
1548
1549
155027.set RELRO to "Full RELRO" instead of "Partial RELRO".
1551
1552
1553
1554
1555
155628.always use HTML5 instead of adobe flash.
1557
1558
1559
1560
1561
1562
156329.From time to time a user asks which incoming/outgoing ports are required by Whonix-Gateway. The answer is:
1564
1565Incoming: none.
1566Outgoing: all.
1567
1568An alternative technique for controlling ports might be corridor (a Tor traffic whitelisting gateway), since it can act as a firewall.
1569
1570
1571
1572
157330.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
1574
1575
1576
1577
157831.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,"
1579
1580
1581
1582
158332.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).
1584
1585
1586
1587
1588
1589
159033.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.
1591
1592
1593
1594
1595
159634.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.
1597
1598
1599
1600
1601
1602
1603
160435.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.
1605
1606
1607
1608
160936.Open-source hardware is also not perfectly secure, since it is not "stateless", that is, lacking any persistent storage.
1610
1611
1612
1613
161440.CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE = increased security if turned off
1615
161641.CONFIG_GRKERNSEC_TPE = Cool feature that can prevent things from executing everywhere, no performance hit.
1617
161842.CONFIG_GRKERNSEC_SYSFS_RESTRICT = Might not work with Wayland and/or systemd ?
1619
162043.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.
1621
162244.CONFIG_GRKERNSEC_IO = No performance hit.
1623
162445.CONFIG_PAX_MEMORY_UDEREF = Some virtualisations solutions can take a huge performance hit with this security setting.
1625
162646.CONFIG_PAX_MEMORY_SANITIZE = 3% performance hit on single CPU system.
1627
162847.CONFIG_PAX_MEMORY_STACKLEAK = 1% performance hit on single CPU system.
1629
163048.CONFIG_PAX_MEMORY_STRUCTLEAK = Even less performance hit than STACKLEAK.
1631
163249.GRKERNSEC_CONFIG_PRIORITY_SECURITY = Choose this option if security is of highest priority for this deployment of
1633 grsecurity. UDEREF, kernel stack clearing, clearing of structures intended
1634 for userland, and freed memory sanitizing will be enabled for this kernel.
1635 In a worst-case scenario, these features can introduce a 20% performance hit
1636 (UDEREF on x64 contributing half of this hit).
1637
1638
1639
1640
164150.People who built computers in the early 2000's will tell you BIOS updates are risky, and they were, but not anymore.
1642
1643
1644
1645
164651.Good programming lanuages for security might be golang,D,Rust, and Ada.
1647
1648
1649
1650
1651
165252.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.
1653
1654
1655
1656
1657
165853.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.
1659
1660
1661
1662
166354.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.
1664
1665It has been designed to be used with a USB AppVM to protect against USB based attacks.
1666
1667
1668
1669
167055.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.
1671
1672
1673
167457.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.
1675
1676
1677
1678
1679
168058.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.
1681
1682
1683
1684
1685
168659.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
1687
1688
1689
1690
1691
169261.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.
1693
1694
1695
1696
169762.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.
1698
1699
1700
1701
1702
1703
170464.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.
1705
1706Strictly 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
1707
1708
1709
1710
1711
1712
171365.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.
1714To 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.
1715
1716
1717
1718
1719
1720
172166.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.
1722
1723
1724
1725
1726
1727
172867.Do not use C (and C++)
1729
1730Technically, 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.
1731
1732problem:The big problem with "don't use C" is interoperability with other languages. Pretty much any language supports writing a wrapper for C libraries.
1733
1734
1735
1736
1737
173868.Metrics Portal:provides analytics for the Tor network, including graphs of its available bandwidth and estimated userbase;
1739
1740 Atlas:is a web application to learn about currently running Tor relays; and
1741
1742 ExoneraTor:answers the question of whether there was a Tor relay running on a given IP address on a given date.
1743
1744
1745
1746
1747
1748
1749
175069.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.
1751
1752
1753
1754
175570.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.
1756
1757
1758
1759
1760
176171.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.
1762
1763If 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.
1764
1765
1766
1767
1768
1769
1770
177175.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.
1772
1773Unlike 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.
1774
1775Also 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.
1776
1777
1778
1779
178076.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.
1781We 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/
1782
1783
1784
1785
178677.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.
1787
17881.A strict type system: Makes it easier to reason about program correctness. Eliminates certain input attacks.
1789
17902.Immutable by default: having immutable values as the primary data container means it is much easier to reason about the state of your program.
1791
17923.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.
1793
17944.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?
1795
17965.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.
1797
17986.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.
1799
18007.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.
1801From 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.
1802
1803
1804
1805
1806
1807
1808
180978.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
1810trafï¬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,
1811VIT countermeasures are effective regardless of which sample statistics are used by the adversary. These observations
1812are validated by analysis of detection rates based on sample
1813distributions of packet interarrival times.
1814Key Words - packet interarrival times, trafï¬c analysis attacks, statistical analysis, statistical pattern recognition
1815
1816
1817
1818
1819
182079.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.
1821
1822Acoustic 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.
1823
1824Acoustic 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.
1825
1826If 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.
1827
1828
1829
1830
1831
1832
1833
183481.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.
1835
1836For safer use, it is recommended to:
1837
18381.Buy the WiFi adapter anonymously in a store, second-hand or on the street.
18392.Never provide personal data during a purchase.
18403.Do not use the adapter for prior, non-anonymous activity. Some providers or hotspots log MAC addresses and the username (if paid).
18414.If possible, only use free hotspots or pay for them anonymously. Otherwise abstain from paid hotspots.
18425.For greater security, always use a new, distant, random, non-circular hotspot location.
1843
1844
1845
1846
1847
1848
184982.Onionizing Repositories
1850
1851When 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.
1852
1853There are several security and privacy benefits of using Tor hidden services:
1854
18551.The user cannot be uniquely targeted for malicious updates (attackers are forced to attack everyone requesting the update).
18562.The package repository, or observers watching it, can't track what programs are installed.
18573.The ISP cannot easily learn what packages are fetched.
18584.End-to-end authentication and encryption provides protection against man-in-the-middle attacks e.g. version downgrade attacks.
1859
1860
1861
1862
1863
186484.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".
1865
1866
1867
1868
1869
187085.not related to security but still helpful https://gyazo.com/c73be243e9508b7f82f0a15fea607930
1871
1872
1873
1874
1875
1876
187786.Locking down your web site (in Apache)
1878
1879If 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.
1880
1881To 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:
1882
1883SSLCipherSuite AES256-SHA:AES128-SHA
1884
1885This 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!
1886
1887In general, for a high security configuration for Apache, you will want to support only TLS v1.0+ and only NIST-recommended cipher suites.
1888
1889
1890
1891
1892
189387.offline APT package manager
1894
1895apt-offline is an Offline APT Package Manager.
1896
1897apt-offline can fully update and upgrade an APT based distribution without connecting to the network, all of it transparent to APT.
1898
1899apt-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.
1900
1901apt-offline can also fetch bug reports and make them available offline.
1902
1903
1904
1905
1906
190788.VM images that are built with frozen sources rather than current sources (including Whonix)
1908is 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.
1909
1910
1911
1912
1913
1914
1915
191690.Cleaning a Compromised System
1917So, you didn’t patch the system and it got hacked. What to do? Well, let’s see:
1918
1919
1920
1921You 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.
1922
1923
1924
1925You 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.
1926
1927
1928
1929You 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.
1930
1931
1932
1933You 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.
1934
1935
1936
1937You 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.
1938
1939
1940
1941You 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.
1942
1943
1944
1945You 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.
1946
1947
1948
1949You 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.
1950
1951
1952
1953The 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).