Posting from HTTPS without specifying protocol - secure?

A relative URL as used here will inherit the method  and domain and part of the path of the base URL. The base URL is typically the URL you'll see in the browsers URL bar but it might also be changed using the base tag. Thus, if the base URL uses https then the relative URL will too.

Note that the base tag might actually specify a different method than the URL actually loaded (and which is shown in the URL bar). In the following example the form will be submitted over plain HTTP even if the page was originally loaded using HTTPS and is shown as such in the URL bar:

<!doctype html>
<base href=http://example.com/> <!-- plain HTTP in base URL -->
<form action=submit.php> <!-- will be submitted with plain HTTP -->
...
</form>

This means just looking at the particular part of the source code and to the URL in the URL bar is not sufficient to determine which method will actually be used to submit a form.


Why don't antivirus definition files get detected as malware

That's a good question, and the answer is they do, or at least they did.
It used to be a common problem and was one of the reasons it was recommended not to install multiple virus scanners, because they would trigger on the other vendors signatures.
Currently nearly all signature files are encoded or packaged in some way that alleviates cross scans of signature files. For example the open source virus scanner ClamScan provides signatures as zip files although their extension is not ".zip". Uncompressing one of these signature files shows content like the following:
e6fec7dc14a74ded93fb9bc50f408e1c:101888:Win.Trojan.Mybot-3069
2fdfa9f7b22e209b4e4aee51109767c1:56320:Win.Trojan.SdBot-599
005d1d1c578316d70c1e0e4f56b61f5f:65341:Win.Trojan.SdBot-600
4ca8616bdd7a9e1d6c60b1d6793dee8a:182272:Win.Trojan.Startpage-295
e83beca0b22cb86b40e77230a41cb827:86493:Win.Trojan.Wootbot-88
8074bd1c4b28bf4296a7a5b85074769f:92672:Win.Trojan.Wootbot-89
90b59c2621ffa8c966f4209073808db9:151552:Win.Trojan.Wootbot-90
dc09af7adcb2f9d1acda2ab9dce0bcc5:104960:Win.Trojan.C-198

The scanner is looking for the binary patterns represented by each of these entries, however these entries are ASCII HEX representations of the binary string, not the actual binary string.
In order for the virus scanners to look for a match, the signature and the scanned files must be in a matching format before comparison. This could be ascii hex or a hash, or anything else but doing so to all of the files is a much higher overhead than simply converting the signatures to raw binary for comparison.
Converted to native binary signatures, they are now in a state that could easily trigger another virus scanner but generally this is now done in-memory only, and not written back out to a file.
For another virus scanner to key on the now native binary signature, it would have to be scanning simultaneously and scanning other in-memory processes. While less common now, this does happen!


Authenticated vs Unauthenticated network scans

I assume you are talking about web applications. If not, edit your question as my answer will not make much sense.

  What are the differences between authenticated and unauthenticated scans?

Authenticated scan is when you have a valid account on the application. Unauthenticated is when you do not have any.

  Do they show the same results?

No, they show different results. Unauthenticated scan will show every resource that anyone on the internet can access, without having an account. Authenticated will show only resources accessible to valid users.

  In which scenario should both be used?

If the application don't have account controls, a simple unauthenticated scan is the only option, as you cannot use an account if no accounts are available.

If there are accounts involved, use both. Why?

If you have credentials, login on your account and scan everything you can. Map every resource, every available backend, everything. Log out, and try to access the protected resources with the unauthenticated session. If you can access secured resources without an account, you found an authentication bypass vulnerability.


Infection I can't shut down, disguises process as scvhost.exe

If you are able to see the process and even terminate it, it's not protecting itself too well. Even if the only way to be sure you're eradicated the virus is a clean reinstall, chances are that the infection isn't technically very advanced and may be eliminated with "reasonable" certainty.

I assume you already tried with System Restore and had no luck. If you didn't try, verify whether you can revert the system to a state preceding the infection. If you could, that would be something you might want to try (but see at bottom for a caveat).

Otherwise, start by grabbing a tool like Process Explorer and display the process tree after a clean (well, dirty...) reboot. You will be able to see the scvhost process and its parent. Usually this 'restart' trick is managed either through the service interface, or by two different programs that "look after" each other, restarting their companion as soon as they see it down.

So first you check the scvhost object.

If its parent is an "unknown" binary, not part of the Windows system, you can "suspend" both parent and child. Neither will react, since you killed neither (yet). If the parent is "services.exe" (and it's the real services.exe), then your infection has disguised itself as a service, and you need to suspend the child only.

In the service scenario, open the Services console, set it to "Do not restart if terminated", and disable the service so it doesn't run at boot. Then kill the child process (having been suspended, it shouldn't be able to notice the settings being changed and change them back), and try rebooting. See the note at bottom for a caveat first, though.

If it wasn't a service, look on the disk for the parent process (Process Explorer usually tells you where the process started from). In these setups, the parent has the only tasks of launching the child and overwatching, and trying not to attract attention. You might not find the child executable (might not even be a file on its own), but you should be able to remove the parent. Look for its name in the usual places in the Registry (or you might want to also try Autoruns).

Before doing this, verify you do have a current backup of your data files. It is conceivable that the infection might have either rendered the system unstable, or purposely booby-trapped it, and this rather brutal removal might trigger something unpleasant.


All of my most important information was hacked from Equifax. Now what?

how can I possibly prevent fraudulent use of my personal info?

Apply to all three of the credit bureaus to put a security freeze on your credit report (not a fraud alert, they are two different things-- the latter is temporary). It will cost you $10 or so for each one and be painfully inconvenient when you need to do anything involving credit (applying for job, buying a cell phone, etc.).

Keep an eye on Credit Karma. Be mindful of inquiries you didn't initiate; it's an indication someone is hammering your credit for new lines.

Dispute anything fraudulent as soon as it shows up, before the thief has an opportunity to max out your accounts and bust out. Not that the stolen money is your problem, but the banks and credit bureaus will certainly act like it. Mitigate this damage.

Alternately you can sign up for one of the credit monitoring rackets to protect you against the very threat they created.

  What are the hackers likely to target?

As to what they'll target, it's all the same stuff they always have:

Tax returns. File early, before fraudsters do.
Employment records, including modification of direct deposit accounts.
Health savings accounts.
Existing credit lines. Your card issuers will likely be sending out new cards in the next few weeks, but you can pre-empt this and claim all your cards were stolen and have them re-numbered.
Opening new lines of credit. Everything from credit cards to HELOCs. They have everything they need to impersonate you.

If you have money stored anywhere other than your mattress, assume it's open for the taking unless it's secured by credible 2FA.


Is using decrypt_derived more secure than a keyfile?

decrypt_derived is slightly better than the keyfile approach for these reasons:

You could accidentally store the keyfile with the incorrect permissions and thereby leak the contents to non-root users on the system, whereas the master key for a LUKS permission can only be accessed by root.
You could accidentally delete the keyfile, whereas the master key can't be accidentally changed or removed.
If the root filesystem gets corrupted you could lose the contents of the keyfile, whereas the master key would not be affected by this.

Basically, I would use decrypt_derived if it is available (i.e. I'm using Debian/Ubuntu), but wouldn't go to the effort of installing it manually if it's not. In either case I would still add an additional passphrase key to the home partition in case the root partition gets corrupted and the master key is lost.

I certainly wouldn't use the third method you suggested, since it is more work and you want to avoid storing the passphrase anywhere.


Is the hosting OS safe to sql injection hackers by hiding admin ID?

There's a general maxim that trying to hide information within your code base (or table structure in this case) isn't actually helping to secure your software. It's referred to as security through obscurity and is not considered good practice.

I have sympathy for your situation because I have certainly wandered into some code spaghetti in my time, but really your best bet here is to continue to refactor the code and reduce attack vectors.

When you say "crack the admin password" do you mean that someone has already gotten in and stolen the password hashes? If this is a major concern of yours, you should absolutely salt your passwords if not already doing so -- this will help make it much more difficult for attackers to steal passwords.

In terms of developing a triage and working on your refactor, I would highly recommend The 2018 Guide To Building Secure PHP Software.


What is the safest way to deal with loads of incoming PDF files, some of which could potentially be malicious?

I think the safest option for you would be to use Qubes OS with its built in DisposableVMs functionality, and its “Convert to Trusted PDF” tool.

What is Qubes OS?

Qubes is an operating system where it's all based on virtual machines. You can think of it as if you had different isolated ‘computers’ inside yours. So that way you can compartmentalize your digital life into different domains, so that you can have a ‘computer’ where you only do work related stuff, another ‘computer’ that is offline and where you store your password database and your PGP keys, and another ‘computer’ that is specifically dedicated for untrusted browsing... The possibilities are countless, and the only limit is your RAM and basically how much different ‘computers’ can be loaded at once. To insure that all these ‘computers’ are properly isolated from each other, and that they can't break to your host (called ‘dom0’ for domain 0) and thereby control all of your machine, Qubes uses the Xen hypervisor,[1] which is the same piece of software that is relied upon by many major hosting providers to isolate websites and services from each other such as Amazon EC2, IBM, Linode...
Another cool thing is that each one of your ‘computers’ has a special color that is reflected in the windows' borders. So you can choose red for the untrusted ‘computer’, and blue for your work ‘computer’ (see for example picture below). Thus in practice it becomes really easy to see which domain you're working at. So let's say now that some nasty malware gets into your untrusted virtual machine, then it can't break and infect other virtual machines that may contain sensitive information unless it has an exploit that can use a vulnerability in Xen to break into dom0 (which is very rare), something that significantly raises the bar of security (before one would only need to deploy malware to your machine before controlling everything), and it will protect you from most attackers except the most resourced and sophisticated ones.

What are DisposableVMs?

The other answer mentioned that you can use a burner laptop. A Disposable Virtual Machine is kind of the same except that you're not bound by physical constraints: you have infinitely many disposable VMs at your wish. All it takes to create one is a click, and after you're done the virtual machine is destroyed. Pretty cool, huh? Qubes comes with a Thunderbird extension that lets you open file attachments in DisposableVMs, so that can be pretty useful for your needs.[2]

(Credits: Micah Lee)

What's that “Convert to Trusted PDF” you were talking about?

Let's say you found an interesting document, and let's say that you had an offline virtual machine specifically dedicated for storing and opening documents. Of course, you can directly send that document to that VM, but there could still be a chance that this document is malicious and may try for instance to delete all of your files (a behavior that you wouldn't notice in the short-lived DisposableVM). But you can also convert it into what's called a ‘Trusted PDF’. You send the file to a different VM, then you open the file manager, navigate to the directory of the file, right-click and choose “Convert to Trusted PDF”, and then send the file back to the VM where you collect your documents. But what does it exactly do? The “Convert to Trusted PDF” tool creates a new DisposableVM, puts the file there, and then transform it via a parser (that runs in the DisposableVM) that basically takes the RGB value of each pixel and leaves anything else. It's a bit like opening the PDF in an isolated environment and then ‘screenshoting it’ if you will. The file obviously gets much bigger, if I recall it transformed when I tested a 10Mb PDF into a 400Mb one. You can get much more details on that in this blogpost by security researcher and Qubes OS creator Joanna Rutkowska.

[1] : The Qubes OS team are working on making it possible to support other hypervisors (such as KVM) so that you can not only choose different systems to run on your VMs, but also the very hypervisor that runs these virtual machines.
[2] : You also additionaly need to configure an option so that the DisposableVM-that is generated once you click on “Open in DispVM”-will be offline, so that they can't get your IP address. To do that:  "By default, if a DisposableVM is created (by Open in DispVM or Run in DispVM) from within a VM that is not connected to the Tor gateway, the new DisposableVM may route its traffic over clearnet. This is because DisposableVMs inherit their NetVMs from the calling VM (or the calling VM's dispvm_netvm setting if different). The dispvm_netvm setting can be configured per VM by: dom0 → Qubes VM Manager → VM Settings → Advanced → NetVM for DispVM." You'll need to set it to none so that it isn't connected to any network VM and wont have any Internet access.
[3] : Edit: This answer mentions Subgraph OS, hopefully when a Subgraph template VM is created for Qubes you could use it with Qubes, making thus exploits much harder, and thanks to the integrated sandbox it would require another sandbox escape exploit as well as a Xen exploit to compromise your entire machine.


Can OnionDuke malware actually spread to new systems through an image?

Does this information about OnionDuke mean that it attempts to infect new systems by embedding itself inside an image that is executed when viewed by a user, or is that image for upgrading systems that are already infected?

From my understanding the payload needs to be extracted from the image by an existing instance of the malware or by a dropper. Other part of the report make this more clear in that they write (The Dukes Whitepaper, page 14):

  Screenshot of a tweet intended for
  OnionDuke, with a link pointing
  to an image file that embeds an
  updated version of OnionDuke

Thus Twitter is part of the Command & Control structure and the malware will load the instructions from the tweet, i.e. where the update can be found. Embedding the malware inside the image is used to make it look innocent, so that firewalls or breach detection systems don't consider the data suspicious. And such an image can be easily placed on lots of trusted sites so that chances are high that the URL for the image will not be blacklisted.

The image itself is not used as an exploit vector, that is viewing the image inside the browser is harmless. It is only used as a container.


In theory, can a restricted-use ToR network be created with "Verifiable Encryption"? How should I approach learning it?

It sounds like what you really are looking for is a zero knowledge proof (or several zkps).

You want to prove that (1) data belongs to a given class (general contents) and (2) that the data is within some limits (upper/lower bounds).

Since you also want to transmit the data through the system, you'll need to bind the proof to the data in such a way that the proof is valid only for the ciphertext being transmitted through the system.

One possible way to do this is to have both the sender and the recipient conduct zero knowledge proofs.

In general this is a very hard problem, but if you can limit the scope of the problem it should be solvable.

I'd recommend starting with learning about zero knowledge proofs, and then looking at some real world examples. One particular example that comes to mind is the use of zero knowledge proofs in the context of nuclear weapon verification.


Yes

You must do the following to get a network map view of the environment.

Setup a 'log analytics workspace'
In 'Storage Accounts Blade' goto diagnostic settings and point the diagnostic logs to the new 'log analytics workstpace'
Upgrade your ASC 'Azure Security Center' subscription to Standard.

Select the new log analytics workspace you configured as the logging solution.

Agent Automatic Install - in ASC, enable the default ASC Policy, this will force installation of agents to any VM's you have.
Wait an hour

After an hour or so your log analytics workspace will have some logs in it and have a map of your environment.

Goto Azure Security Center > Resource Security Hygiene > Networking.  Under Network Map click 'See Topology'

You will get something like this.

Azure SQL Remediation.  If you want to remediate the pub IP in your SQL instance, do the following.

Configure Virtual Switch  - you will want to configure a virtual switch with a /16 subnet network address.  Once provisioned, add a /24 subnet under the 'subnets' blade.  Your adding the /16 so you can provision multiple subnets within your switch.  There are multiple ways to do this, I'm simply suggesting one method to quickly remediate your SQL public access.  You can always implement something with better networking efficacy later.

Advertise your SQL.   Add the SQL to the private network space of one of the subnets your configured to your private virtual switch earlier.
Add a Firewall.
Add a firewall to the switch and configure a public IP to the front of it.  You can now add your standard ruleset to the pub IP.  Don't forget the last rule, DENY ALL.

That's the basics.

The network map will give you insight to ALL your public resources, the switch and FW will secure your SQL instance.

*remember, every 'storage account' is public and http by default.  Goto the firewall blade within each storage account and select the radio button 'force https' AND create a rule that the storage account is available only to your virtual networks.  If you require access from a public IP with a local instance of 'Storage Explorer' you can add your public IP to the ruleset in that blade by simply clicking 'add'.  That will secure your storage accounts from public access, except from your Pub IP.  Cheers, hope this is helpful.


How do I protect my Windows computer against the IPV6 flood attack shown in this video

1- The speaker does a pretty good job of explaining what is happening. To sum up, a Linux machine on the same local network as a windows machine sends out thousands of "router advertisements" (RA). These advertisements are usually sent out by routing devices to tell other devices on the network what network prefix to use, and where to route external IPv6 requests. Every time a machine receives an RA, it refreshes its entries for that network prefix (they time out otherwise), or adds new addresses if the network prefix is different. The demo is showing a windows box adding a new IPv6 address for every RA it receives, causing it to spike the CPU load to 100%.

The speaker says he contacted Microsoft about the issue, and they said they had no plans to fix it. I think that the behaviour shown here is technically up to RFC 1256 [1] spec, which is why there is no plan for a fix. Granted, the OS could allow for the configuration of a maximum number of addresses to configure (Linux and BSD do allow this configuration).

Also, note that the windows machine CPU is pegged at 100%, but still somewhat responsive. The OS has not crashed, and I expect that if left for a few minutes (once the IPv6 addresses time out), it would return to normal CPU utilization. I wouldn't go as far as calling it a "kill every machine that receives the packets" attack (as the speaker in the video claims).

2- How to prevent this from happening to you? The most obvious answer is to turn off IPv6 in the network adapter settings. If you need IPv6, then the solution is to monitor who is on your local network. This attack won't work over the Internet (RA packets can't be routed across the Internet), so your adversary must be local. If you're on a network you don't control (e.g., Starbuck), I really doubt someone would be doing this attack. There are so many other attacks you can do when you're local that making someone's computer hit 100% CPU utilization is just silly.

[1] http://www.networksorcery.com/enp/rfc/rfc1256.txt


How to route internet traffic through Google

You might want to look into domain fronting. Unfortunately, it seems that Google has disabled support for this just last month (April of 2018), preventing Tor's meek pluggable transport from using it to evade authoritarian censorship. If there are any other web services which you are able to use for domain fronting, you may want to use them instead. If that doesn't work at all, you can visit arbitrary web pages by using Google Cache or Google Translate as a make-shift web proxy.

As Steffen Ullrich mentioned in a comment, you can also run a proxy or VPN on Google Cloud, assuming the IP addresses associated with it are not blocked. There are also a number of free, public CGI web proxies scattered around the internet that run on a Google service.


How does someone check for malware in his machine's firmware?

You either need to compare the binary stored in the device with a known safe copy (either by checking a signature or comparing for byte equality with a copy provided by the vendor) or look for symptoms. Both of these are easier said than done.

If comparing a binary how do you get a copy from the device? If by requesting it via some kind of API the firmware offers how do you know the firmware is actually returning itself? Some devices will offer hardware mechanisms to dump rom contents - although attaching a JTAG isn't exactly convenient / easy to perform on a regular basis.

Symptom detection is similar to normal software based malware. Unusual behavior, network traffic etc. The difficulty of this depends on the malware itself.

In theory something well written enough on devices where the firmware controls all IO mechanisms could be impossible to identify until it decides to be malicious - and for all you know this could be triggered remotely.


How exactly does the NVIDIA Tegra Fusée Gelée exploit work?

On 2018-04-23, the ReSwitched team publicly released their exploit. The FAQ you linked has not been updated since (as of the writing of this post). A summary of the exploit is available in the vulnerability disclosure report:

  The USB software stack provided inside the boot instruction rom (IROM/bootROM) contains a copy
  operation whose length can be controlled by an attacker. By carefully constructing a USB control
  request, an attacker can leverage this vulnerability to copy the contents of an attacker-controlled
  buffer over the active execution stack, gaining control of the Boot and Power Management processor
  (BPMP) before any lock-outs or privilege reductions occur. This execution can then be used to
  exfiltrate secrets and to load arbitrary code onto the main CPU Complex (CCPLEX) "application
  processors" at the highest possible level of privilege (typically as the TrustZone Secure Monitor at
  PL3/EL3).

The report also contains specific details of the exploit. As the report states, it has been known by multiple entities for some time. More details relevant for end users are availailable in the Q&É.


is OSSEC effective in protecting a Drupal installation?

OSSEC is a host intrusion detection system and if you are running just a web server, then is not the best solution.

In my opinion you need a WAF (web application firewall). mod security with OWASP ruleset is a good choice. Of course you need to invest time to configure it, but is less complicated than OSSEC. Also have hundreds of rules for all kind of CMS / blogs etc.

OSSEC is a good choice, if you give access to others to manage the system and you don't have a strict access control for ssh/ftp/sftp/etc.

If you take in consideration to use a WAF, I suggest you to also install fail2ban (fail2ban integration with Drupal: https://www.drupal.org/project/fail2ban).


Code signing certificate validation by Java

If a jar is correctly signed, the verifier (often but not necessarily a network client) needs only the root, and if you use a public CA that root will usually already be there.

Specifically, a KeyStore privateKeyEntry is supposed to contain the full cert chain (although if the cert is self-signed the chain is only that one cert). When jarsigner signs using that privatekey (by alias) it creates a PKCS#7 SignedData detached signature, which includes the cert chain. For the case where the keystore can't provide the chain, jarsigner since Java7 has -certchain option to add them, see http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html .

To verify a jar signature (or any signature containing a cert chain) Java actually can use any cert in the chain found in the local truststore. Since roots exist for the purpose of concentrating trust for all chains under them, it's conventional and easiest to have only roots in the local truststore. And JRE includes a default cacerts containing nearly 100 roots for "well-known" public CAs like Verisign and GoDaddy.

jarsigner -verify -verbose -certs [-keystore if_not_default] test.jar will show you the cert chain used, and mark the cert(s?) found in the truststore with its alias in parentheses at the right.


What are the security implications of enabling anonymous root/sudo access with sshd on a local guest VM?

The answer to that depends. Is your VM connected in a host only network? or a virtual subnet that is not connected to the internet? or is the vm also allowed to access the internet (i.e. bridged or nat)?

Having root access to a machine on your network with no password is a huge security risk. If it got exploited somehow, it would give an attacker carte blanche to download all kinds of penetration testing tools and network assessment software (think apt-get install nmap, mysql-client, etc...) and basically roam around your network as if they were sitting right next to you connected to your wifi.

If the vm is connected in host only or is in an isolated subnet then it basically is about as secure as your host os, given you haven't made some ridiculous misconfiguration somewhere. Since, the host would have to be exploited first. But personally, I wouldn't feel safe in this situation either. But then again, I'm the paranoid sort.

Setting up ssh keys isn't that much of a pain. It might take all of 5-10 minutes to accomplish. There are many guides on how to do it easily, like this one from Digital Ocean and, although I highly recommend against it, you can even make keypairs that require no password if you absolutely must. At least that way someone would require the ssh key to connect making it more difficult than just logging in.

But to answer your title question bluntly, if your development vm is connected to the internet with root access, no password and is available a good percentage of the time, the security implications are potentially complete and total compromise of your internal network. I'd really recommend against it.


What Man-made Physical Threat Could Pose Severe Danger to a Server Farm?

Most things of importance placed in a data center have a sister installation in a physically separate data center, and if there was a reason to "fail over" from the live to the backup site, it's completely plausible that things like data shipping will occur as part of it.  It also will result in a flurry of manual and semi-automatic administrative activity, which could plausibly allow someone to exploit a toehold in the environment and expand it.

It's a standard trope that response plans and disaster recovery plans can be exploited as they cause predictable actions on the part of the victim.  Consider Star Trek Into Darkness, where the villain bombs an installation for the sole purpose of triggering an executive meeting.  The children who pulled a fire alarm in order to flush their classmates out of the school to be shot at (Tennessee?  Georgia? Arkansas (see Michael A's comment below)  A dozen years ago or so).  Appleseed Ex Machina where the villian replaces the programming on the backup computer, then orchestrates an event which will cause failover to that computer.

If you can find interesting incident response plans, read them and see what predictable behaviors can be used by an attacker.


3000 new contacts being added to gmail after receiving an email

It seems to me that, as a hacker wouldn't, to my knowledge, benefit from this at all (unless it is some kind of attack meant to overload a process??? seems unlikely...) this is almost certainly just a glitch. By default, Google usually adds anyone you respond to to your contacts; in all likelihood it just had a minor glitch. If the hacker thought you would not know how to remove contacts en masse he might have thought to exasperate you and make you decide just to leave the contacts there after a few hundred deletes. I think e-mail from contacts goes to your inbox automatically, even if it does not pass spam filters, so it might have simply been phase one of a spamming scheme? Maybe check your spam periodically to see if there is anything in there from this address - just out of interest.


Bypassing Windows Defender VBA custom code

You need to Obfuscate the VBA Script in order to make it FUD (Fully UnDetectable)

You can use the ChrW() function, which allows you to type ASCII characters instead of the actual characters themselves.

If you could share your code maybe we could try to assist you with this ("use of unsafe function"). I advise you to dive into someone else's code in github and try to check out their steps in order to verify your code, you'll be able to notice a difference.


How secure is changing or adding a single character in your passphrase?

is there evidence of attempts to further crack these passphrases or is it more likely that your typical hacker will move on to the next account in his list?

This depends. If the attacker can guess that your password changing schema is simply to replace a single character (maybe because he got access to your two last passwords or knows how you think) than he will probably try first to change only single characters.

And if your account looks more valuable than other accounts the attacker will try harder to crack your password. It depends just on whatever the best return of investment is.

And as for the "typical hacker": The typical hacker will adapt. There are lots of password leaks out there and these are used to find out which kind of passwords are mostly used and which kind of variations are done. These information then will be used to making the cracking attempts smarter and faster. If new leaks show a change of behavior the algorithms for cracking will be adapted again.

  ... if we were to change a password from supersecret11 to s.upersecret11, doesn't this effectively accomplish the same thing as changing the entire passphrase?

Whatever the schema is you use to derive your next password from the previous one it will always be weaker than just choosing a random new password. This is especially true if the attacker somehow knows the schema you are using (maybe derived from knowing your last passwords) because then he can easily create and check the few variants of the new password.


If you can't disable java from chrome://plugins, you can use the -disable-java startup switch. Example:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -disable-java

Navigating to http://java.com/en/download/help/testvm.xml after a restart of the browser should give the message:

  No working Java was detected on your system. Install Java by clicking
  the button below.

You can read about other switches in The Power User’s Guide to Google Chrome.

To improve security for the future, not just react to public exploits, you might also want to go to chrome://chrome/settings/content and check Click to play on the Plug-ins:

This will wait for your click in order to run the plug-in therefore limiting your exposure.

And this should protect you from more than just Java vulnerabilities:

Secunia PSI/VIM for notification of updates, vulnerabilities and automatic updates
Microsoft EMET for preventing stack overflows and similar
BufferZone for protection from drive-by installers
iCore Virtual Accounts for times when you need to walk the dark side of the net on a production machine


MITM attack with HSTS implemented websites

Question 1:  Yes, this is possible.  The fact that the site is on the HSTS preload list only tells the browser that it should always connect to the site by https and not http.  The HSTS preload list does not contain any information about the certificate itself.
Question 2:  No, because of the answer to question 1.


Is an RSA public key needed to crack an RSA private key?

No, knowing the public is not required to crack an RSA private key. Given an encrypted message, the attacker only needs to know something which allows him to distinguish a success in decrypting your message from a failure. This something can be anything, commonly it is some knowledge about the data content as for instance the knowledge of a challenge in its clear form, the presence of certain tags, of the data structure, of data statistics as for instance a presence of large number of correct english words or the presence of a checksum.

While not bad in its essence, your idea of keeping the public key private just reduces your public key cryptography to a situation which would most likely be solvable using symmetric cryptography.

One of the big issue with symmetric cryptography was that the sender and receiver had to find a way to exchange a pair of secret keys securely while there is no secure communication channel already established and no way to check each other identity. The main solution for this was to use out-of-band key exchange.

Asymmetric encryption, to which RSA encryption belongs, solved this by proposing a system where the sender and receiver can publish their public keys in a common directory, those public keys being optionally signed by a third-party entity trusted by both parties. This allows to remove the burden of having to exchange keys using out-of-band methods.

Nevertheless, if you like, you can still use out-of-band methods to exchange the public key. It is not necessary, depending on what you intend to do it may be more complex and harder to maintain over time, it will not increase your security in any noticeable way but it will not decrease your security either.

To go (a bit) in your direction, note that all public keys are necessarily made really public. A good example of this is user's SSH authentication keys. While stored in clear form, the user's public is usually not published (as opposed to the server's public key). However this so as long as there no advantage in doing so. As soon as it becomes more practical to store public keys in a trustable directory (an internal company directory for instance), there is usually no issue in doing so.


Monitoring Kerberos Authentication Traffic

So when may I see the Kerberos v5 protocol in monitoring tool?

Take a closer look at the GSSAPI traffic.

GSSAPI provides an interface to Generic Security Services.  Kerberos v5 is one of the Security Services supported by GSSAPI.  While it is possible to write code that directly exchanges Kerberos v5 traffic, it is common for systems that use "Kerberos v5" to implement it via GSSAPI.

This is in agreement with the Kerberos documentation, which says (in the Developing with GSSAPI chapter):
"We recommend using the GSSAPI [...] for secure network communication over using the libkrb5 API directly."

Summary: we can't be 100% sure without seeing your traffic, but probably the GSSAPI traffic you see is handling the Kerberos 5 mechanism.


Is it more secure to set a DNS CAA record to a non-existing CA?

In short, no.

And here it is why.

1. Do not use made up names

Whatever you do on the Internet, when you really need fake/obfuscated name, do not just invent some and hope that it will be fine in the future for everyone. By that reasoning, .MAIL has become a TLD that will never exist because it has been abused by so many documentations.

RFC 2606 provides you with a set of correct values for such a case, basically, example.com, example.net and .example TLD.

2. Empty CAA records

But using "fake" names is not even necessary for CAA records.
The RFC 6844 gives this example:

  For example, the following CAA record set requests that no
  certificates be issued for the domain 'nocerts.example.com' by any
  certificate issuer.

nocerts.example.com       CAA 0 issue ";"

So just do that, do not invent a fake name.

3. DNSSEC?

Is your domain DNSSEC-enabled?

If not, CAA records can be spoofed or dropped

4. Use of CAA records: issuance time vs use time

  "this is not verified or enforced by browsers."

They do not need to. Per CAB Forum requirements (section 3.2.2.8 of https://cabforum.org/wp-content/uploads/CA-Browser-Forum-BR-1.6.2.pdf), nowadays all CAs are required to check for CAA records at certificate issuance time.

This is when it matters because the certificate will be valid for let us say 1 year; and during this timeframe the DNS CAA record can be changed to many things, so at use (connect) time the browser may get a completely different answer than the one at certificate issuance time.

And Crypt32 said it in the comment, as written in the requirements: "This stipulation does not prevent the CA from checking CAA records at any other time."

But feature wise, you are probably more thinking about DANE and its TLSA records, see RFC 6698 and 7671.

They would provide to clients the insurance, at connect time, for any given service, that the server indeed should be using either the certificate or public key exposed in the TLSA records or a certificate signed by a specific authority whose certificate is in a TLSA record.

Of course:

you need a DNSSEC enabled zone for them to be useful, otherwise trivial downgrade attacks are possible, and
clients need to use these records, otherwise they can not enforce the rules you put in place; unfortunately for now for browsers it is at most an add-on and certainly not a base feature.


Why is still so easy to send phishing emails?

Yes DKIM and SPF as you say do go some way in helping fight against spoofing. It's not the clients that tend to ignore the likes of DKIM it's the receiving email server that does not bother to check the result, or fails to adequately act on the result.

I suspect many large email providers would rather accept more spam over loss of legitimate traffic or complicated user configurations. The likes of hotmail I suspect commercially would rather accept the spam.

On the other hand the likes of Apple.com not having suitable DKIM etc is probably because the implementation costs to get this correctly deployed across their infrastructure is too costly and complicated. There is a strong argument that companies should feel morally compelled to ensure their domains, such as Apple, make use of email security controls. But costs will normally outweigh security benefits.


How do I protect an application from malformed packets?

How can I filter the packets so that they are conformant to some format I define (eg. a formal grammar)?

As far as I know there is no general purpose filter software you could use to normalize the traffic based on a formal grammar.  For specific protocols like HTTP you might try to use IPS (or inline IDS) like Snort, Suricata, Bro or commercial firewalls but in my experience they are very tolerant to protocol errors. For HTTP you might also application level gateways (i.e. reverse proxy) which in my experience are a bit more strict and at least normalize the traffic, i.e. implicitly remove some malformed data. A special type of these HTTP gateways are web application firewalls (WAF) which are usually more strict than normal HTTP proxies.

But none of this solutions filters everything, i.e. your application should be robust enough so that malformed data will not cause security problems. If this is not the case I would not make the application accessible from the internet.


Is android keystore still vulnerable if root access is received?

An application with root access has full control over the system and can do whatever it wants to do because it can override all (DAC type *) security restrictions. So the short answer is "yes".

(*) A root user confined via SeLinux (MAC) might  be prevented from doing certain things, but that really depends on the situation. Better not rely on this.


Public registry (database or API) for known security vulnerabilities in open source software?

There are multiple sites that track "CVEs" (Common Vulnerabilities and Exposures), though I believe MITRE maintains the canonical list. You can also look up the National Vulnerability Database from NIST (part of the US government), which contains all CVEs (and possibly other findings too?) which has feeds for new vulnerabilities.
These databases include open-source software, and also proprietary software that uses open-source components, but also any assigned vulns in fully proprietary software. I've never tried to use an API from either of them, but it's probably possible (the web UI supports various kinds of searching and filtering, so if nothing else you should be able to screen-scrape). Note however that these are definitely not comprehensive lists; most security bugs (especially if they are low impact or unlikely to affect many users, due to being in niche software and/or patched immediately with minimal exposure) never get assigned a CVE or similar.


How can an embedded system support HTTPS and also keep an SSL key safe

Yes, they can likely manage to extract your private key from the device. Even if you encrypt the key and don't keep the decryption key on the device (eg: you must enter a password to decrypt the key when you boot), there are techniques for extracting the key (eg: cold boot attacks). And, depending on the deployment scenario, you may not even be able to force a password to be entered on boot. In the end, there's no security without physical security.

In answer to your question:

  What stops them from sniffing your network traffic, and decrypting everything you send to the server?

The ability to sniff TLS traffic in the face of a disclosed private key can be prevented by using TLS ciphers that support perfect forward secrecy. In these ciphers, the private key is only used for authentication and not encryption.

  What stops them from pretending to be the device (MITM attack)?

Nothing (unless you have physical and virtual network infrastructure that ensures that an MiTM can't occur - this likely requires a secure network).


Is encryption an efficient way to protect digital media?

Ultimately DRM for multimedia ends up being security through obscurity by necessity. You HAVE to give the person all the information to display the information so they can consume it which means they have all the information they need to save it/copy it/etc. There is ultimately no way to get around that.

The only possible way to get around this is by using things like TPM and secure boot that are built into the hardware and supported by the OS. This can then theoretically limit what you are able to do and protect the video but that isn't something you can throw together itself and is still only as secure as all the combined components are (TPM, Secure boot, OS, Video card driver etc).


How can I find the default KDF for my version of GPG?

GnuPG uses an algorithm called S2K (String-to-Key). This isn't unique to GnuPG, and is actually part of the official OpenPGP standard, specifically RFC 4880 § 3.7. The strongest version of this KDF, version 3, works by repeating the key and the salt many times and hashing the whole result.

The specific hash algorithm used is specified with --s2k-digest-algo.


Is a 'dumbphone' mobile more secure for basic phone calls than a smartphone?

Has the security of the basic phone call changed much, in the last 10 years ?
So, do smartphones utilise anything new [purely in] the initiation and connection of just the phone call itself ?

Yes. There are new technologies used to establish phone calls in cellular networks. Those new technologies mitigate some attacks which were possible due to flaws in the older ones. So if you use a "dumbphone" that runs on the older technologies you are subject to those attacks (i.e. the inverse is true, the smartphone is in this respect more secure).
The technologies used in the cellular networks basically evolved over time like this: 1st generation (analogue), 2nd generation (GSM etc.), 3rd generation (UMTS etc.), 4th generation (LTE etc.).
If you use a device running for example the GSM technology, an attacker might intercept your calls with hardware costs of only about $30 USD. Intercepting calls made with the newer technologies is harder up to a point where only nation state attackers can perform them.


No, it's not possible to inject serverside code just via echoing CGI parameters. But as you say, it allows for a reflected XSS attack.

On the other hand, it's possible there may be other vulnerabilities in the code you did not include in your question.


A data diode is used to transfer data in one direction only and make sure that no data can travel in the other direction. HTTP works by the client sending a request to the server and the server sending a response back to the client. Since a diode would allow data to pass in one direction only it would mean that either the request gets passed to the server but not the response back or that the response gets passed to the client but not the request to the server. This means simple HTTP pass through would not be possible.

But, it would be possible to emulate the servers behavior on the client side of the diode the following way: the client transfers the request to the diode which transfers the request to the server and then sends an emulated response to the client. Of course this emulated response can at most signal failure or success since the original response from the server is unknown at the client side. Thus such emulation might be useful for HTTP uploads only and can not be used to retrieve information from the server.

It would also be possible to use the diode in the other direction, i.e. to only pass the servers response to the client but not the clients request to the server. In this case the server side of the diode would need to emulate the clients request which means that only a single preconfigured request would be possible. Thus this scenario might be useful for polling a specific fixed URL only.

I'm not aware of any product which implements such functionality for HTTP. But I know a product which does similar emulations for FTP and SMTP (mail).

But at the end the strict one-way-only design of a diode can make it unusable in many use cases where highly restricted but still bi-directional communication is needed. In such cases task-specific application level gateways might be the way to go which can severely restrict which kind of requests the client can send and which kind of responses the server can send back.


Difference between DNS spoofing and phishing

Phishing is mostly a social attack, i.e. you might setup up a site which looks like a trusted one (i.e. copy of Paypal), give it a hostname which might fool the user (e.g. https-paypal.encrypted.whatever) so that the URL and links look trustable, put it together with some story ("detected hacking attempt, needs verification..") in a mail and wait for gullible users. You might use it to get credentials, infect the user with malware etc.

DNS spoofing instead is a technical attack, where the attacker tries to respond to a DNS query ("get me the IP address for paypal.com") with their own (wrong) answer and thus direct the user to the attackers site instead of the requested site.

Since DNS spoofing is a technical attack you can protect against it with technical solutions, like DNSSec. Using https also protects against DNS spoofing since the attacker does not has the certificate for the requested name. None of these things help against pishing, since this attack is not against a technical based trust system but against a social trust system. Against phishing, only awareness helps, and if you are lucky the phishing attack was not targeted against you, but against lots of users. In which case browsers often have the relevant sites in a blacklist already.


Web Application Vulnerability Scan- False Positives-Recognizing and Eliminating

I personally see a lot of false positives with Cross Site Request Forgery.

This may not be the answer you're looking for, but you need to verify them to the best of your ability.

If you find something is beyond your ability you have a couple options:

learn how to do it - this of course takes time and experience, a luxury we don't always have
lean on a knowledgeable sysadmin
lean on a knowledgeable developer
lean on the vendor (if this is a 3rd party app) to confirm/deny the vulnerability

Vulnerability scans results can cover a wide range of technologies and platforms. You can't be expected to be an expert in all of them.


Base64 or HEX encoded?

Hex.  Base64 would show upper and lower characters as well as +, /, and =.  This simply shows numbers and a single case of characters (implying case doesn't matter).

Assuming it's hex, you can decode it down to a binary data file using xxd:

$ xxd -r -p < encoded.txt > encoded.raw

And once you've done that you can use 'file' to guess at what it is:

$ file encoded.raw
encoded.raw: zlib compressed data

So, yes, compressed with zlib.  You can try to unzip it, only to fail:

$ gzip -d < encoded.raw

gzip: stdin: not in gzip format

Fortunately, U&L Stack Exchange provides this answer:

$ printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - encoded.raw |gzip -dc
<XML>

  <PAGINA NUMERO="0">
    <COPIA NUMERO="1">
      <LINEA NUMERO="1">
....


Is authentication through proxy sites safer?

In terms of increased risks from using proxies, yes there could be.  If you browse a site which sends things like a session token in clear-text, it would be possible for the proxy to see/use that token.  so to an extent you need to trust the proxy server operator not to do that.

If you are using a proxy I'd be especially aware of any SSL errors that might indicate that your session is being intercepted as well.

In terms of whether it's possible for the end-point sites to track you down that depends on a number of factors.

This kind of question has been discussed elsewhere on the site, so I'd take a look at some of the answers like this, and a good list of posts here


No, adding such side information does not really help to strengthen the resistance to collisions, for a cryptographically secure hash function such as SHA-256 already takes into account the length (through explicit inclusion in the padding, see §5.1.1, page 13 of the FIPS 180-3 standard) as well as every single bit of the input data to compute the digest. There is no known collision for SHA-256 nor is there any publicly known promising method to find one.


Is Taking advantage of the IsNumeric() Function In VB.Net Through SQL Injection Possible?

I'm gonna say that it depends on what you do later with the ID variable.  If your code later converts the hex to a string and then builds queries with it, then the answer becomes 'yes'

Example:

I build an e-commerce website that looks looks up your purchase history based on your customer ID...  Being a noob, I came up with a clever idea of using your email address to generate your ID by simply converting it to hexadecimal.

my email = customer@example.com
my ID would then be =
637573746f6d6572406578616d706c652e636f6d

That looks like a "pretty secure" and unique ID, so I feel really good about what I've done.

Now the injection:

Someone figures out that the user ID is simply the hex equivalent of the email address and guesses that I may be converting it back into text and using that result in a query

http://mysite.com/orderhistory?userid=637573746f6d6572406578616d706c652e636f6d

injected ID = 31272064726f70207461626c652075736572733b202d2d
ascii equivalent = 1' drop table users; --

If I, the developer, check to make sure the ID is numeric... then hex-to-text the ID... then use it in a query....  I've just allowed a sql injection

References:

Here's a similar question regarding SQL injections using only alpha-numeric characters: https://stackoverflow.com/questions/8086906/keeping-clear-of-sql-injections

Here's another thread discussing sql injection via hex:  http://arstechnica.com/civis/viewtopic.php?f=20&t=107657

... Of course the right solution is to use 'real' prevention mechanisms such as parameterized queries, but this is certainly an interesting question.


Access protected (from export) private key in windows certificate store

You can try using Mimikat'z crypto module. Most A/Vs flag Mimikatz as a "threat",  add appropriate exclusion.


What's the best encryption strategy to go with when everybody needs to be able to write data but only a select people can view it?

It sounds like systems design for email encryption would give you the security properties you're looking for. The two big email encryption systems are PGP and S/MIME. The details differ a bit between them, but in both systems you create a public key and private key pair; usually you associate the public key with an email address, but you don't necessarily need to; they are just formats for encrypting files and don't need to be used with email.
Given that both PGP and S/MIME are so common, I'm sure you can easily find open source implementations that you can integrate into your Android and Web clients. I have no idea if that is something supported by Firebase, or if you'll need to build a custom add-on, that part of your question is a bit out of scope for this site.
The idea would be to create an encryption keypair and distribute the public key to all the clients (for example, maybe you embed the public key in the mobile app) and the client encrypts the content for that public key using PGP or S/MIME file format, and send the encrypted data to the server. Store them on the server encrypted. Employees who are authorized to view the tickets can be given a copy of the private key.
Counter-arguments against this suggestion:
There is some devil-in-the-details to think about here, like you need to be careful not store the decryption private key on the same server as the encrypted data or else an attacker could steal both at the same time and defeat the whole purpose. You also want to think about how to revoke access to an administrator if you need to, which will be a bit hard to do with this design.


Strange flood of requests to my web server

I found this article, which seems to explain what's going on: https://wiki.apache.org/httpd/ProxyAbuse

I have modified the default host config to return http 444 now. Hopefully the culprits will realise that this is not an open proxy and just go away at some point.

E.g.:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
                return 444;
        }
}

Seems to work. 10 minutes after I inserted this, the traffic dropped considerably. I assume that the fact that nginx was responding with http 200 to the proxy requests, meant that the culprit thought it worked as a proxy (Even though it was just serving the default server page). Responding with an error must have tipped them off.


Ongoing DDoS: What is the next step after being able to handle it?

Reporting the IP addresses will yield little, moreover, nothing. In many cases, the addresses DoS'ing you are likely compromised or infected with malware. Your goal should be to focus your time, resources on minimizing, or getting rid of the capabilities of being DoS'd, this is time better spent. The question becomes, how do you stop/minimize DoS attacks.

My suggestions: Familiarize yourself with RFC 4732. What kind of DoS are you suffering from? Resource exhaustion on the network side? Application side (e.g. someone requesting hundreds of thousands of webpages)? Then focus on fixing that side of the equation.

From the networking side, you could work with your provider to implement BCP38 (RFC 2827), and have your ISP work with your upstream provider to have them too implement some changes however, this is out of your control (the actual change) and you're at the mercy of your provider, and their provider to actually get anything done.

From the application side (say your HTTP server is getting hammered), you could move HTTP over to something like Cloudflare but if THEY go done, so too then you. There are many different approaches to tackling this issue, e.g. load balancing using different Amazon AWS instances, CDN providers, it all depends on how much time, and resources you put into it. As for reporting IPs, it's akin to calling NOT the local authorities, but a local random security guard company, and saying: "I just saw 1,000 suspicious cars driving." I can assure you little will be done.


Server never receives plain text, which is very easy to verify. Log int to your protonmail and observe all communication which browser does with server.
at some stage you will see message like that

{
   "Message":{
      "ToList":[ ...],
      "CCList":[ ...],
      "BCCList":[...],
      "Subject":"test",
      "Unread":0,
      "MIMEType":"text/html",
      "Flags":0,
      "Sender":{...  },
      "AddressID":"pzS3cXCi2Aky0EgfL89rRoI6W2t1RyhlMiIP6_4lVQCtRA4f2yj6ULUB7bJ9KAvoW6Ql1plW1sBtgf1XKZryXQ==",
      "Body":"-----BEGIN PGP MESSAGE-----\r\nVersion: OpenPGP.js v4.6.2\r\nComment: https://openpgpjs.org\r\n\r\nwcBMA+jYaqQbPJMUAQf+PsXHCJBAW44WqhzMWXjH0iwgDoCIstEmlm66OLZX\r\nCBHNtnLRR1lKxUiXyJNu3lHg3Z6XonawnHbM8vlDG7F6h/Iam7VujbeXjh3d\r\ndr9IdpRzE0ONA9vET04+qDCR+49ESG3tXI94qFYqh36BHi81+ro426JVz8Z4\r\nPoxu6PRpZWMvtYikDOayM25fQooDVH9AOu6qxncMY2DSKMjsS/RxLzB7iYSC\r\nCOPgdjbGWXQWcOW4UKwn24btRadyQc+7JzF93wn1aH3YFN5fVD1hQzSiYNnZ\r\n4T2+aV4RxM1cv8Rbvc3JpYNfzg+zbgQoI82mfQuyLLU3A82ap2T9YefXi/T0\r\nvdLpAVWTcy3DJOlSKNpOE6Xp711wUcey7Uaaw1b9sXaiwhLLR8LdRoE9HIsw\r\nas/z7Gh8gzH1RawavsIOBntN5H72FpddNtxLo18/B0dna38NeDLaM4zMmXj5\r\nytR5yqHZopbftDaWXxG8p1aP7CnEQyEusU9/yUH4Ah1mxlYDDEJDGZhl0ECv\r\n8ipBYzo4iewygpA7yLCf6fEXh0PgbXq3I0TD7Lr6WRodHGRO8b2X0RyawY94\r\n8h2kaxw0awXf1DqR4CIqS99wOmQIUGugrOfEHTaXxHKdFmxJL3z6NbgEbMvs\r\nq9ZJfeOgnxhcpg79CvetohnRW91z9XospN4IwJfUcHQZk3TPqzTVJy13Vs+P\r\n0Cw+OHK6Vej/FkiubRAVguJmmF4STy5z/0AecR1ZPsxFrjX/InvbOPaMdsCw\r\nezcCD8tHvkc1oTpGTZ6ktCDOhR17w5qru5xWtBPJFtdWi3Sk5Ux94yYR3rpU\r\nx+dAU9v9+LK0PumzMQqrWmpnbZyw4yp4jTB0VmQ4YtQGmXEr/t5iI3BnNhV9\r\nwZuqK7zA1EKJGe+76URE1OGsJwkldfL4Q/0u5FJbpGnfSZsMlwbHJOj5VkVe\r\nFPtJOCsOxBtpk/aKP+jm0OmZDNyDuYtfGHU9X3hPJDTom5lcL4B0ml433lvS\r\nZJ4jnnZxKPo+hT9DzpxeIbnPeJQjRsRDfowRsPb2KGIFQxeyHagmDNcVBK1L\r\n4A0KdpvKh2Yo16E=\r\n=he+D\r\n-----END PGP MESSAGE-----\r\n"
   },
   "id":"harAqr3eDuzKm0qAFFI3fDrbtU4F_kvPxKRzPfEHTJfl5duG6e8huhP7VyhopXX-gHZx1nclEP6RXMzT4oDbRA==",
   "AttachmentKeyPackets":{}
}

If you look at section Body you will noticed it is encrypted using PGP before send to server.

Yes, if you have keys, then you could decrypt this message on your own.

Using Gmail instead proton mail will not give you key benefit which proton mail does. This message is passed to back end encrypted which indicates, it will be stored in drafts as encrypted, which won't necessary happened in case of Gmail.


I work with a company and another developer posted this and wanted us all to run it. i'm noob with things like this

The openssl req command creates a self-signed certificate, then the sudo security add-trusted-cert command adds the newly created self-signed certificate to your local store of trusted certificates.

Are you running a local web server on the host that your doing this on, and using this host to develop and/or test an application with the local web server?  If so, this would explain why your coworker is asking you to do this.


Diameter was designed to supersede RADIUS. There is no doubt Diameter provides superior functionality. Unfortunately, upgrading old RADIUS environments can be tricky.

  “There is a large RADIUS deployment base out there and unless a proper migration plan that includes deployment of translation agents and co-existence of RADIUS and Diameter, migration to Diameter will not be simple.” [1]

The “translation agents” mentioned above are software or devices acting as adapters between new Diameter servers and legacy hardware that only supports RADIUS. Translation agents could relieve the effort required to upgrade, but they bring their own problems too.

  “... there can be many variants and implementations of translation agents in proprietary non-IETF manners. Also due to the simultaneous standardizations of RADIUS and Diameter, various RADIUS messages may be handled differently by different translation agents along the process, while none of those translation agents can be assumed to have access to complete and accurate session state information.” [1]

That sounds hard. So RADIUS extensions have proven to be the easier option.

  “… The uptake of Diameter has been very slow though, and RADIUS still remains the de facto standard for the foreseeable future. A major reason for this is probably the fact that the many enhancements that Diameter was supposed to bring are already covered by the various RADIUS extensions. There is, for instance, the RadSec protocol that transports RADIUS over TCP and TLS.” [2]

Of course, there are limitations to RADIUS extensions. Diameter can provide far superior support for 4G LT-Advanced mobile networks, for which RADIUS would be a very poor choice [3].

TACACS+ is also available, but

  “TACACS+ overall function is similar to that of RADIUS but RADIUS has enjoyed a more widespread use since it is not a proprietary (sic) of Cisco.“ [3]

Some also argue that TACACS+ is more suited to network administration than general network access for a large user base (e.g. ISP, Telco) [4].

I appreciate that some of my references are old and my be out of date. Although, I have recently seen new, small-scale network deployments choose RADIUS over Diameter/TACACS+. In these cases, the staff know RADIUS; extensions provide required security; and RADIUS has no ties to Cisco.

I think it's matter of time before Diameter overtakes RADIUS, but it's very hard to tell just how much time.

[1] Nakhjiri, M. & M., AAA and Network Security for Mobile Access: Radius, Diameter, EAP, PKI and IP Mobility, Section 7.4, John Wiley & Sons, 2005

[2] van der Walt, D., FreeRADIUS Beginner's Guide, Packt Publishing, 2011

[3] Håkan, V., Diameter: Next generations AAA protocol, Institutionen för systemteknik, 2001

[4] Woland, A., RADIUS vs TACACS+, retrieved from http://www.networkworld.com/article/2838882/radius-versus-tacacs.html


How can I guarantee non-modification of data with signatures?

Use trusted timestamps
Have one more trusted external company timestamp and sign a hash of your content for you. There are several companies that do this for money.

See: Trusted Timestamping (wiki page)
Globalsign has a nice diagram (and they also sell that service)

You can then create a chain. Where each link of the chain links to its predecessor and each link is also signed.


Would the authorities in my college be able to see what websites I accessed through tunneling(SSH)?

Depends on the way you use SSH. If you just do it the usual way of using the -D option to provide a SOCKS server and use this as the proxy at the browser, they will not see that you are accessing these sites but they might deduce the use of such sites from tracking DNS queries. ssh -D provides only a SOCKS4 server and for SOCKS4 the resolving of host names to IP addresses must be done outside the SOCKS4 tunnel, because SOCKS4 can only handle connections to IP addresses.

Edit: thanks to dr jimbob for pointing out, that SOCKS5 is available in ssh since 2003, but that have to make sure to use this version. With Firefox you have to explicitly choose the SOCKS version and you need also to explicitly enable RemoteDNS to make the DNS lookups through the SOCKS5 proxy.


What cookie attacks are possible between computers in related DNS domains (*.example.com)?

Summary. Yes, this is possible.  It's not a browser bug.  It is part of the as-designed functionality of cookies.  There is no browser that is safe from this.  Cookies are ancient technology and their security model is only loosely-integrated with the rest of the web.  The details are messy and ugly.

The gory details

The site blog.example.com can set cookies with scope blog.example.com or with scope example.com.  Cookies with the latter scope will be sent back to secure.example.com, if the user visits secure.example.com.

If the site secure.example.com sets a cookie with scope example.com, then the site blog.example.com can overwrite that cookie arbitrarily.  Whenever browsers see a cookie with the same name and scope as one that's already in the cookie jar, they discard the old cookie value and overwrite it with the new cookie.  Thus, blog.example.com can overwrite any cookie whose scope is example.com.

Worse still, one cookie can shadow a cookie with another scope.  Suppose secure.example.com sets a cookie with scope secure.example.com and name SESSIONID.  Next suppose blog.example.com sets a cookie with scope example.com and the same name.  Finally, suppose the user visits the site secure.example.com.  What happens?   It is ugly: the browser sends both cookies, in some undefined order, and the server has no reliable way to tell which cookie value came from which site.  So, the server can detect that it is in a confusing situation, but has no good way to unconfuse itself.  Worse, some web application frameworks may conceal the confusion from application code, using one of the cookie values and silently ignoring the other.  This can lead to something that behaves effectively like blog.example.com overwrote the cookie from secure.example.com, in a situation where no one would reasonably expect that it might be able to.

(As a side note, the secure flag does not prevent a cookie from being overwritten.  In fact, a HTTP site can overwrite a cookie with a secure flag, as long as the domain names are related appropriately.  The secure flag provides confidentiality protection but not integrity protection.)

Finally, there is one other way to delete cookies: a malicious site can set lots of cookies, overflowing the fixed limit on the number of cookies that the browser will store.  The result is that the browser "forgets" older cookies from other sites.  This allows blog.example.com to delete all of the cookies set by secure.example.com (regardless of their scope), and then set a new cookie with scope example.com that will be sent back to secure.example.com -- which has much the same effect as overwriting an existing cookie.  This may be what you were thinking of when you mentioned "cookie jar overflow".

Discussion

It's messy.  Sad to say, this is just how cookies work on the Internet.  If you want to avoid it, the simplest defense is to use a new second-level domain for untrusted sites.  There's probably a better defense that doesn't restrict the naming of your sites, but I don't know what it is.

As a general note, for questions like these about how the web works, I highly recommend the browser security handbook.  It is packed with nuggets.  In this case, you might want to read its material on the same-origin policy for cookies.


Received an email about an "Etsy" Password Reset due to the "Linkedin Breach...." is this a phishing attempt?

The email is referring to a breach of the LinkedIn password database that happened back in 2012. This was one of several HUGE breaches that was discovered around the end of May 2016, all of which actually happened earlier.

Although we knew about the LinkedIn breach a few years ago, we thought it was only a case of "some passwords were stolen". 6 million account owners were apparently notified at the time.

Then somebody put the full dataset for sale on the darkweb in 2016. And we learned the true scope was "all the passwords got stolen".

After these breaches, there are now over 600 million valid username/password combinations for sale, for a few very popular sites including LinkedIn, MySpace, and Tumblr.

Knowing that the majority of Internet users re-use passwords, smart criminals bought up those stolen credentials and started trying to log into various other online services, including github, Twitter, Pinterest, Instagram, TeamViewer, GoToMyPC, and almost certainly others. So no, I doubt very much "you can use a LinkedIn account to access Etsy", however if you (like most people on the Internet) used the same password on Etsy as you used on LinkedIn, somebody probably used the password they stole from LinkedIn to try logging into your Etsy.

So: if you've EVER had a LinkedIn account, or a MySpace account, it's probably a good idea to change your password there. If you ever re-used that password anywhere else, change it there too. To be safest, you're right not to follow the link in the email. Go directly to each site, and change it there through the normal means, rather than following the email link.

While you're at it, consider getting a password manager like KeePass, 1Password, DashLane, LastPass, or similar; this will allow you to come up with a unique and strong password everywhere, without needing to remember all of them. Then when something like this inevitably happens again, you only need to change the one password that got breached.

If you're curious (or want to have a warning next time), take a minute to search for and/or register your email address over at Troy Hunt's haveibeenpwned service, which can tell you if your credentials were leaked in any of the fairly large collection of breaches he had access to.


How does Dumpper program get default WPS without bruteforcing them?

WPS does not seem to be a well implemented technology. If you reverse engineer the firmware, you may find that the algorithm is MAC based, etc (such as in the case of some D-Link Routers or Belkin).

It also looks like in many cases that implementation weaknesses also permit brute forcing (also see CERT VU#723755) to be done easily.

This is supposedly open source software, so you can examine it to see what is going on exactly, but the code doesn't seem to actually be upon on SF.


The Error Code 400 means that the request was malformed. This means the request sent by the client(you, using burpsuite) to the server didn't fit the 'rules' of http.

In the case of a REST API with a JSON payload, 400's are typically used to indicate that the JSON is invalid in some way according to the API specification for the service. Which you didn't supply in your question. Maybe if you give some more information, i can answer more detailed. Meanwhile i suppose that the 400 is correct behavior indicating that this request is malformed in some unspecific way. I think 400 is the intended response for a nonexistent email in this JSON-request.


One of ISO 27001 requirements is management of access control to company's IT resources.

If you just install Ubuntu on your laptop, all the access control will be managed by you directly, instead of your company. So when, for example, your manager will want to fire you, then your IT department won't be able to block your local laptop account in a convenient moment.

Of course Linux can be connected to central authentication systems (AD, IPA, CAS etc.), but first your IT department needs to build required competences (a single employee knowing how to do that is not enough since all ISO standards require written, repeatable and verifiable processes).

On the other hand, knowledge on how to connect Windows to AD, and deploy a central authentication, is more or less common in IT, so probably your company already has ISO processes for it. Therefore, they allow you to use only Windows.


Why don't more websites implement Perfect Forward Secrecy?

Actually most Web sites do implement forward secrecy, i.e. at least one of the "DHE" (or "ECDHE") cipher suites. Most SSL implementations support them out of the box, and most SSL server certificates are adequate (with a DHE cipher suite, the server's key is used for a signature; but almost everybody uses RSA and almost all RSA certificates allow the key usage for signatures).

However, most SSL implementations are also courteous, in that the server follows the client preferences. This means that, in the list of cipher suites announced as supported by the client (in the ClientHello message), the server will usually select the first one which is also supported on the server side. Since most clients tend to put the non-DHE cipher suites first, DHE suites remain unused.

The extra cost incurred by DHE cipher suites is slight, and almost always negligible:

The computational cost for the handshake is about doubled. This means that a basic server may do "only" 1000 full handshakes per second instead of 3000, based on its available CPU. Since servers don't usually boast 1000 new clients per second, on a single PC, this limitation is never a true limitation in practice.
The extra bandwidth is small: less than 1 kilobyte of overhead induced by the use of a DHE cipher suite. There again, this overhead is only for a full handshake, i.e. the very first connection between a client and a server; subsequent connections will use the "abbreviated handshake", which is more efficient, and completely unimpacted by the actual cipher suite.

So, to sum up, forward secrecy is already there and it is underused only because of the traditional behaviour of clients and servers (preference order) which remains as it is for no good technical reason, only inertia. In some cases, developers or sysadmins deactivate DHE support based on some unsubstantiated rumour about how DHE is "very expensive" and "might heavily impact performance", but these myths are easily dispelled with some actual benchmarks, and are still rare. Browsers and servers choose non-DHE cipher suites mostly because that is the default behaviour and nobody feels motivated enough to do anything about it.

To be complete, there is an extra effect: when the BEAST attack was published, people semi-panicked, and the common mantra was: "use RC4, it is immune". SSL has no DHE cipher suite with RC4 (there is no incompatibility between DH and RC4, but it just happens that no such standard cipher suite has been defined). So this resulted in clients and servers preferring RC4 cipher suites, which indirectly implies not using the DHE cipher suites.


Resources for physical security questions

Check out The Core Group http://enterthecore.net/

They offer training sessions at the Black Hat conference (and other conferences):
"PHYSICAL PENETRATION TESTING"
https://www.blackhat.com/html/bh-us-11/training/core-pentest-intro.html
https://www.blackhat.com/html/bh-us-11/training/core-pentest-advanced.html

  Those who attend this session will leave with a full awareness of how to best protect buildings and grounds from unauthorized access, as well as how to compromise most existing physical security in order to gain access themselves. Attendees will not only learn how to distinguish good locks and access control from poor ones, but will also become well-versed in picking and bypassing many of the most common locks used in North America in order to assess their own company's security posture or to augment their career as a penetration tester

Videos by Deviant Ollam:  http://deviating.net/lockpicking/videos.html
(and his book: http://www.amazon.com/Practical-Lock-Picking-Physical-Penetration/dp/1597496111/)


Do I need my own server for signing certificates?

You are probably asking about Public Key Infrastructure. Or some similar design.

PKI works in the way you generate a certificate signing request on your device then you sign it with your private key to make sure that you are the person / device who is requesting the certificate. Once you have this CSR generated you send it to the server. In automatic mode, the server validates the CSR, basically, it takes a look to the signing request, what purposes you are requesting certificates for (it can be a server certificate, client certificate, certificate for signing emails, whatever) then it checks if the certificate signing request is signed by somebody who owns the certificate allowing him to send signing requests to server (the csr contains the certificate including public key of the private key used to sign the CSR). If everything is valid the certificate is issued to you and signed by server. In non-autonomous mode there is usually person who takes a look on the CSR and validates that you (requestor) are you (i.e. by mail, phone, by checking your ID card, whatever standard identity checking method). Thats in short. Take a look on www.google.com/search?q=PKI, it includes a lot of standards and formats.

I have no clue what the application you are hacking is trying to achieve. It seems to me it is trying to do exactly what I've described but who knows what it collects for CSR in the device and what is included into payload. From my perspective it should be doable as the private key used to sign the payload must be stored in the device itself if it is used at all. But ofcourse, if it is protected with any kind of password which you don't know you are lost.

Its hard to help you without closer information about the application and the server you are trying to connect to. I wouldn't rather ask what it is.

Furthermore, I would also recommend you to don't ask such hacking questions here as it seems you are trying to achieve something bad, something what was not intention of the software authors.


I have some doubts about integrating syslog-ng with ELK. Is that
  really necessary?

Of course not, syslog-ng is a "log management infrastructure." If you deploy ELK as a SIEM you can manage all your logs there.
You just need to install an agent on each server you want logs from. You can use the official logstash client or any other tool that parses your syslog to JSON and pass it to the Elastic Search server.

  I assume that the input to the ELK platform will be all syslogs and system events. All correlation, rules and processing happens within the ELK environment. Am I correct?

You can pass anything you want, but yes you are correct.

  Is DB a better way to integrate with Elasticsearch?

I don't think so; Elastic gets all the data and stores it by itself, so to interact with any other DB you will have to deploy some agent that reads the DB and sends JSON to the Elastic server.

You can follow this guide to start playing with the full ELK: here

I'm not sure it is up to date (for example, Kibana doesn't need nginx anymore for reverse proxy, it comes with built-in nodejs) but it can save you a lot of time.


What does the message mean and is it not safe to pay online at this website?

It's hard to offer anything other than "theories" without analyzing the actual code, but this appears likely:

It is a page delivered over https.
Some of it loads over http. Something with href= "http://..."
This is enough for Opera to a) block the content +and+ show "content blocked" message.
As long as the http content is blocked, the rest of the rendered page is safe - hence you don't see an "insecure content" warning. BTW, most browsers do render (without blocking, but with/without warning) what they consider "passive content" despite being http (e.g. images).
When you enable the insecure content, then Opera goes ballistic and gives out "insecure content" warnings.

What could go wrong:
Some of the active insecure content on the page has access to the DOM - i.e., every bit of information you entered - including your credit card details. This is bad news because unless you dig deeper, you won't know whether that access is abused. So in general, you assume the worst (even if it is just a dumb oversight by a programmer) and don't risk your info. Of course, if you feel confident about your analytical skills, you could analyze the insecure content - make sure it isn't loading more code at runtime and then decide whether its safe. For most peeps, that's a bit too much when all they want is to buy some fidget spinners. :)

P.S. What I can't reconcile here is your "I can see that the page is not https". That doesn't reconcile with the screenshot too (where you do see a cert), so I'm guessing that you meant that the page is not "100% https".


Two-factor authentication methods: password + SMS/voice message vs. password + app-generated code?

A well-designed app on your phone is more secure.

There are a large set of vulnerabilities in the delivery of either phone calls or text messages.  They include messing with telephone routing tables, and systems such as  which can collect text messages and route them as email.

If your phone is running an app, then these delivery and routing issues don't matter.   If it's insecure, either because it's stolen or taken over by an attacker, then you're out of luck in either scenario.


Are stack buffer overflows even possible in this instance?

It depends.

DEP blocks you from just doing a jump to esp and executing code there. ASLR is your major important thing to bypass here.

There are a number of ways that you might be able to do this:

Modules loaded into the process which don't have ASLR enabled. There are a bunch of ways this might happen:

DLLs that are a part of your application which were compiled without the ASLR flag.
Injected as part of the AppInit DLLs.
Injected by 3rd party applications, e.g. anti-virus or something like xfire / Fraps.
Shell handlers loaded alongside shdoclc.dll when you use the standard file dialogs.

Fixed-address allocations (e.g. VirtualAlloc with the lpAddress parameter set)
Secondary vulnerabilities that allow for memory disclosure or pointer disclosure may be useful in building up an idea of where things are in memory.
Corrupting the stack in some way that triggers a secondary issue, e.g. heap corruption. This could then open up other exploitation avenues, using tricks such as heap spraying, heap feng-shui, JIT spraying, etc.


No. For it to be steganography, the message must be hidden in something (an image, a file, etc). When someone looks at that something, they should not be able to suspect that it contains a hidden message.

This isn't the case for morse code at all. There is no carrier that hides a message, there is just the message itself.


Yes, it's a violation of PCI-DSS Requirements, specifically requirement 3.4:

Render PAN unreadable anywhere it is stored (including on portable digital media, backup media, and in logs) by using any of the following approaches:

One-way hashes based on strong cryptography (hash must be of the entire PAN)
Truncation (hashing cannot be used to replace the truncated segment of PAN)
Index tokens and pads (pads must be securely stored)
Strong cryptography with associated key-management processes and procedures


Does ARP spoofing works in case the target ARP cache has the gateway

The assumption, "ARP poisoning attacks only work when the gateway's MAC address is not in the victim's ARP cache", is false.
A type of ARP request or reply exists known as a "gratuitous ARP"; from the Wireshark Wiki:

Gratuitous in this case means a request/reply that is not normally
needed according to the ARP specification (RFC 826)
A gratuitous ARP reply is a reply to which no request has been made.

The wiki page also has some information about legitimate use of gratuitous ARP replies. However, they can also be used maliciously, and they are the driving force behind most ARP poisoning attacks.
Let's look at an example network setup:
Gateway:
IP address: 192.168.1.1
MAC address: 11:11:11:11:11:11

Victim:
IP address: 192.168.1.100
MAC address: 22:22:22:22:22:22

Victim's ARP cache:
192.168.1.1 is at 11:11:11:11:11:11

Attacker:
IP address: 192.168.1.200
MAC address: 33:33:33:33:33:33

In this case, the gateway's MAC address is already cached by the victim, and the attacker wants to convince the victim that they are the gateway. The attacker can send a gratuitous ARP reply to the victim:
192.168.1.1 is at 33:33:33:33:33:33

Even though the victim did not request this information, it will happily update its ARP table:
Victim's ARP cache:
192.168.1.1 is at 33:33:33:33:33:33

Now the victim's traffic will go to the attacker instead of the gateway.
So, the takeaway is that gratuitous ARP replies can be used to update existing, legitimate entries in favor of malicious ones. The victim doesn't have a way of knowing whether or not the gratuitous ARP is malicious; what if the machine was just reconfigured or had a NIC swap? There is not really a way to tell.

I would like to understand which ARP reply should he save and which he should discard

As somewhat indicated above, the most recently received ARP reply is used to update the cache, regardless of whether is was gratuitous or not.


To answer your first (and easy) question: Yes, they use Signal's protocol.

The second question is a tough one. (But since they do use Signal's protocol, you might as well use Signal, don't you think?) They're not completely open source, btw. Only the app is, the server software is not. To my knowledge, there's no security audit. I'm not sure how they handle metadata, which is a huge deal (to me, at least) and the reason why I personally use Threema. The guys behind Wire are Skype developers, which doesn't exactly inspire confidence since Sykpe is/was one of the least secure messengers around. Also, how do they generate money? The app is free. There are no ads. That should raise suspicion, if you ask me.


Why would a goal of DLP solution implementation include "loss of mitigation"?

This was probably a typo. Data Loss mitigation is obviously a goal of DLP. Elasticity, as you said, is not a goal of DLP.


ZAP supports HTTP basic authentication natively, so you wont need to use Zest in this case. If you know that an app uses basic auth then you can set that up via the API. However I recommend that you start by using the ZAP desktop as this is much easier to use when debugging issues. For specific help with this its probably quicker to ask on the ZAP User Group: https://groups.google.com/group/zaproxy-users


Are there any decent web app security scanners that can integrate with a build server?

Maybe you should give a try to Netsparker: http://www.mavitunasecurity.com/netsparker/. It has automated scans, report generation, logging. Provides CLI.


Can IP phones be eavesdropped upon if administrator access is available?

Yes it is very easy if you know the current sip or voip platform use (and you must know because you can access the admin page of the phone)  and you know how to create a sip or voip relay with asterisk or anyother VOIP gateway.

You could then reconfigure phone so they use your voip gateway and send the packet to the IPBX of your university.

This would be like a man in the middle, the problem you can have here is finding which is the user connection credential to the university VOIP gateway, if there's one.


LVM operates below the filesystem, so whatever it does, it does so at the disk level. So yes, indeed, when LVM implements encryption this is "full-disk encryption" (or, more accurately, "full-partition encryption").

Applying encryption is fast when it is done upon creation: since the initial contents of the partition are ignored, they are not encrypted; only new data will be encrypted as it is written. However, when applying encryption on an existing volume (as is typical of TrueCrypt) requires reading, encrypting and writing back all used data sectors; this includes sectors which were previously in use, even if they are not in use right now, because they may contain excerpts of some files which were later on copied around. So that kind of after-the-fact application of encryption requires reading and rewriting the whole volume. A mechanical harddisk will run at about 100 MB/s, so a 1 TB volume will need 6 hours (3 for reading, 3 for writing).

The encryption itself needs not be slow, at least if it has been properly implemented. A basic PC will be able to encrypt data at more than 100 MB/s, with AES, using a single core (my underpowered laptop achieves 120 MB/s); with recent x86 cores offering the AES-NI instructions, 1 GB/s is reachable. Thus, the CPU can keep pace with the disk, and, most of the time, the user will not notice any slowdown.

Of course, if you do "something crazy" like cascading algorithms, well, you've done something crazy and you will have to pay for it. Cascading three algorithms means having to compute all three whenever you read or write data. AES is fast; Serpent not so (about twice slower). In any case, cascading encryption algorithms is not a very rational idea. By default, "encrypted LVM volume" in Linux will rely on dm-crypt, which is configurable (several algorithms are supported) but does not indulge into voodooistic cascades, and that's a blessing.

(This does show one of the little paradoxes of security: if it is too transparent and efficient, then people get nervous. For the same reason, medicine pills must taste foul.)


For which content types is it recommended to set X-XSS-Protection header?

If you decide to use X-XSS-Protection, you should set it for any page capable of running active script content. Non-executable formats like CSS or images are not affected by the header.

Note that SVG images, despite being able to run script code, apparently don't respect the header in Chrome which suggests that it is only applied to HTML documents. Proof of concept:

<?php
header('X-XSS-Protection: 1; mode=block');
header('Content-type: image/svg+xml');
?>
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
<?php echo $_GET['foo']; ?>
</svg>

Run it in your browser like this:http://localhost/xss.php?foo=<script>alert(1)</script>

In my tests, the reflected JS from the parameter is executed although the XSS filter is active. But if you change the content-type to text/html, the JS will be properly filtered.

(Also note that the use of the X-XSS-Protection header is controversial and can result in new vulnerabilities which is why Facebook even decided to deactivate the XSS auditor entirely. And be aware that setting the header doesn't replace proper output escaping.)


Can a file get accidentally corrupted while downloading?

It is possible but uncommon with HTTP that the actual bytes are corrupt. But it is not uncommon that the download simple breaks in-between and that the browser does not notice. This is especially true if no length information are sent with the content (i.e. ends with TCP close) but even if a length is sent or chunked encoding is used browsers often ignore such errors.

With FTP it is even worth because there is no real way to indicate the length of the content, that is the content always ends with connection close. Apart from that corruption can happen if you use the wrong transfer mode ASCII instead of BINARY.


Websockets are not inherently less secure then "normal" web traffic. What you describe as possible attacks against the websocket server can also be used as attacks against your websockets gateway. And while you can check an authentication cookie early in the webserver and abandon the request if necessary you could also check some authentication information early in the websockets connection and quickly close the websocket if needed.

Still, if you already have a webserver which acts both as gateway or server for the web application and for the server and which has already implemented checks for authentication it makes sense to use the same authentication for both web application and websockets instead of implementing  another one specific to the websockets backend.


Did somebody connect to my facebook account?

If i'm not wrong,

At FAcebook -> settings -> security ->  Active Sessions

There is a history of devices  connected to your account by date , with some useful info IP and city browser

SO you can switch to a difference browser, and if some one else log in will report with a browser that you don't use.

You can also disconnect them (unlink) from that panel too


What kind of hashing to use for storing REST API tokens in the database?

TLDR; SHA256 is good enough

To answer this we need to look at why we salt, hash, and use multiple iterations of the hash, in the first place;

Why do we salt? To protect users that have weak password entropy from having their password cracked (e.g. rainbow tables or two users with the same password). This is not an issue because UUID4 will have 122 bits of entropy1.

If we wanted to create a rainbow table of all UUIDv4 values that have been SHA256 hashed and we could do 1 trillion hashes a second2. It would take 168.6 quadrillion years to make the rainbow table. So we don't need to worry about that.
Why do we hash? To prevent clear text copies of the password from being stored. This seems like a good idea. You don't want someone who can read your database3 to be able to impersonate users.
Why do we use multiple iterations? To slow down brute force attacks. As mentioned before UUID4 will have 122 bits of entropy. Cracking these hashes is infeasible even at high speed.

[1] 128 bits - 6 bits that are predetermined

[2] The current fastest hashing rates are chaining all the time so I won't bother trying to find the most current speed it will be out of date in a few months.

[3] This could be SQL Injection, or a leaked copy from a backup, or an insider, or whatever.


Rembering password on client (not database)

Is there a secure way for my program to store this? Preferably cross platform as well.

Secure against what kind of attack?

Against a remote attacker with no access to the machine: probably simply saving it as a file will do it, although in practice you will probably do it less obvious (see next point).
Against an attacker with access to the machine: There is no 100% secure way, because if your program can access the secret the attacker (with at least the same permissions) can do the same. You could only make it harder by saving the file at non-obvious places, hiding it within innocent content (like with steganography), obfuscating the information, encrypting it (although the secret must be accessible by the application and thus will also be accessible by a determined attacker).


Vulnerability in Composer/MeekroDB WhereClauseTest.php?

Take a look at what that PHP script does:

https://github.com/SergeyTsalkov/meekrodb/blob/master/simpletest/WhereClauseTest.php

It's a way to open the door to the DB by adding known usernames and passwords.


Is it possible to take an image of the firmware of HDD and SSD?

There is a standard to write firmware, the ATA DOWNLOAD_MICROCODE command and the segmented version (transfer protocol 3), but there is no standard for reading the firmware back. As another answer says, some manufacturers may add their own vendor-specific techniques to do so.
There is another reliable way to access firmware, but it cannot be done from software. Opening the drive to see the controller will expose the firmware chip (flash or EEPROM) which can be read directly using specialized hardware designed to interface with the chip, such as a SPI reader. Sometimes, the controller chip has internal flash, meaning there is no external chip to read, which would mean attaching a JTAG probe to the chip is the likely solution to obtaining the firmware.
There are two excellent resources showing what it takes to read the firmware so it can be modified and replaced which I know of. Specifically, an incomplete (?) write-up on HDD firmware-based MBR rootkits from Malwaretech and the classic Linux port to an HDD by SpritesMods. An image from the latter showing the flash chip which you'd need to directly interface with to read is below.


Certificate SHA1 Thumbprint reported as a vulnerability

Is it a security concern if a certificate's thumbprint is calculated using the SHA1 algorithm?

This depends on how the thumbprint is used later.
If the thumbprint is used in an application as the only way to verify a specific certificate then the signature on the certificate does not matter at all, because it is not verified. Instead in this case the security of the certificate is reduced to the security of the SHA-1 thumbprint and therefore weak.


What is the recommended file extension for GnuPG-encrypted files?

.asc is appropriate for all ASCII-armored output, even if the input file was in a binary format.  Traditionally the original filename will be maintained so that the recipient knows what to expect once they've decrypted the file, e.g., file.tar.gz.asc.