Can someone help me decipher what these netgear log entries mean? Am I getting hacked?

At first glance, your home network seems to be used for a Denial of Service (DoS) attack. If this is the case, you already have been hacked.
What should I do?

If you want, you may let your ISP know about it --> here. Your ISP might be interested helping you block an attack on a Department of Defense server.

Use Wireshark to monitor the traffic on the devices connected to your router when crawling become slow. The device producing the most traffic is likely the culprit.

Update your question with some .pcap samples when you find the culprit(s).

What should I find with Wireshark, how do I find the culprit(s)?

You want to find ICMP/ping packets bigger than 65,536 bytes. (You need to understand how PoD works.)

If you find those ICMP sessions on a device, save the .pcap, take a screenshot and repeat the process on the remaining devices. You want to know how many devices have been compromised.

If you find some malicious ICMP Session we want to see the details of the layer 2, 3 and 4.

I found those malicious sessions you speak about on my device!(s)
There is/are some malware(s) on your machine(s), find it, and nuke it.
How do I nuke the malware?
There is a lot of antivirus software available. But, from my point of view, the best way would be to totally wipe the compromised device(s).
I found nothing on Wireshark.

Try again. Wireshark might not be easy to use, try to be familiar with the filters. In this case, filter for ICMP or PING traffic.

I really found nothing on Wireshark, tried on all my devices, 5 times.
Then, there is slight chance that your router is compromised. Attackers often attempt to hide their presence, and will attempt to suppress logging.
So what if my router is compromised?

Be sure that your router firmware is up to date

Reset your router to factory default.

Don't use admin as login, set a brand new strong password.

Could these attacks be coming through my WiFi AP?
Yes, this could be performed by an uninvited device that is accessing your Wifi. Check your AP's WiFi DHCP/Static leases to be sure.
Important !
Try to not input passwords, credit card info, or other sensitive data on your devices before being 100% sure that your devices are clean. If malware is on your network doing the DOS, there is a good chance that a keylogger may be present, too.


Possibilities:

You are using a VM with a virtual NAT (Network Address Translation) network adapter. I have experienced profound slowdown under VirtualBox, for instance, when using NAT instead of a bridged network adapter.
You are scanning something that isn't there. The -Pn option means "don't bother trying to find out if anything is listening at this address, just start port scanning it." If the target is not actually there, you'll waste a lot of time sending packets into nowhere.
Your network (or your connection to the target) is slow. What is the latency to the target as measured by nmap -sn or ping? How far away is the target? What kind of network speed do you have? Any of these can impact total scan times.
You are performing a lot of work. The -p- option means to scan 65535 TCP ports. Depending on network conditions and host behavior, this can be a significant amount of traffic.


Could we create a rating system for privacy?

Privacy is far more nuanced than that and the systems involved are extremely complex and layered and constantly changing. A single rating will not work to encapsulate all that. A movie is a closed piece of content that doesn't change.

Privacy regulations include the requirement for systems to describe what information is collected and what is done with it. That Privacy Notice becomes the "rating system" you describe.


If a LUKS encrypted VM is put in saved state, will the master key be in clear on the host?

Yes, the memory image saved on the host will contain the LUKS master key, and if a knowledgeable person were to study the memory image, they could extract the key in a usable form.

Try resuming the VM.  Notice that it picks up where it left off, without asking for a disk encryption password.  Since the system can't read the disk without the key, either the key must have been in the memory image already, or the guest must have recovered the key from somewhere else (maybe the host?).

But typical VM snapshotting doesn't interact with the guest at all: since the host can capture the entire state of the guest, it's simplest and most reliable to just save that state, rather than trying to communicate with an unknown guest OS that may or may not be working properly at the time.  (One good use of virtual machines is debugging operating systems code.)

One easy alternative would be to let the guest make its own saved state.  Tell the guest VM to suspend to disk, and it will forget the key.  Then it will ask for the disk encryption password when it resumes.


What are the hardwares used to protect against a DDoS attack on Network layer

There is no way to prevent a distributed denial of service using a single appliance. The problem with a denial of service is that once the traffic reaches you it's too late.

The only way to mitigate the risk of a DDoS is to use DDoS mitigation services offered by companies like Rackspace,  Akamai  or Cloudfare. They actually scrub the traffic and check it's origin before it reaches you preventing illegitimate traffic from reaching your server. To successfully deploy such a service you need multiple datacenters across different countries to be able to check the legitimacy of the originating traffic using BGP.

This is why a single appliance at the entry point of your network doesn't suffice.


It is driven entirely by US Government demand.

FIPS stands for Federal Information Processing Standards which are US Government standards.

No one else cares about it except them.  Others claim to care about it only because it is widely adopted by the "big boys".  Look around at FIPS 140-2 requirements in other nations.  There are virtually none except for those who wish to sell electronics or software to the North American market.  Other countries do levy cryptographic requirements for localized procurement and the extent of those requirements may borrow heavily from prior work putting FIPS together, but they are different and largely non-interchangeable programs.


Secure wiping of EEPROM and flash memory

EEPROMs work by storing charge in floating-gate transistors. Think of these transistors like tiny capacitors that leak extremely slowly (typically with retention lifetimes of 10+ years), except with the added provision that you can tell whether it's charged or uncharged. Programming one simply involves feeding it a power source and pulling the gate to high or low voltage for a short time. The internal mechanism is called tunnel injection. If you leave the gate "floating" (i.e. neither connected to ground or positive voltage) after disconnecting the power, it remains at the stored value.

Clearing the data on an EEPROM should simply involve setting it all to uncharged. However, tiny ferrous impurities in the die and connectors may have sufficient magnetic susceptibility to remain partially magnetised by the tiny electric field produced by the held charge. By analysing this magnetisation, it may be possible to deduce latent data. As such, writing random data may provide sufficiently overbearing charges to prevent analysis. However, a better option would be to set all cells to 1, then 0, then random. This is because there may be cases where tiny magnetisation deltas are useful to an attacker, which are guaranteed to be destroyed when all cells are charged then discharged.

Flash memory is a different story, and actually uses two different technologies. NAND flash is common, as is NOR. Both types only allow writes in blocks (or "pages"), though typically NAND blocks are much larger than NOR blocks (which are usually a byte).

NAND flash is very similar to EEPROMs in terms of construction, in that they use floating-gate transistors. However, the transistors are arranged in a series chain. This construction means that two options can be performed: setting a single bit to 1, or setting all bits in the cell to 0. NOR flash works in a similar way, but performs hot-electron injection through a charge pump instead. The most important distinction here is that NOR flash requires the charge pump to produce a very high instantaneous voltage, whereas NAND performs writes at a much lower internal voltage.

As such, NAND technology is less likely to promote detectable magnetisation of ferrous impurities than NOR, but holds about equal risk to EEPROM. I would still recommend the 1, 0, random triple-pass for high security, but a single random pass should be more then enough for anyone not worried about attackers that have access to electrostatic force microscopy equipment.

You should also keep in mind that these attacks are very much theoretical, and I don't believe anyone has ever managed to recover fully erased data from an EEPROM.


Using hashed password as secret key for hmac to avoid exchange of secret between server and client

It's not really possible just using the user's password as you can't securely store the passwords in such a way that the client can independantly derive the same key from the password. The reason being that you are required to salt a password while storing it.

The current accepted password hashing algorithms are:

bcrypt
scrypt
PBKDF2


Can you ever be 100% sure you decrypted a message?

For general purposes, you cannot be 100% sure.  If you try the wrong key, you will get a bag of random bits.  Those random bits may look like something valid, but they are still the wrong key.  Monkeys at a typewriter punching out a few lines of Shakespere, and all that.

In theory you could design an encryption algorithm which intentionally lets you know when you get it right.  It would involve adding a block of known content to the message, and verifying that that block is correct when decryption it.  However, you would need to avoid the monkeys at a typewriter problem of random chance happening to decode that block correctly.  You would have to tailor the encryption algorithm and the block of data itself so that you could prove mathematically that no key besides the correct key achieves a match for that block.

Typically this sort of behavior is considered to be a vulnerability in the encryption algorithm, so you don't see it.  It's just too risky to try to add that much provable behavior into your algorithm.  Consider the example of the Enigma, where they found that some output patterns simply couldn't occur due to the layout of the rotors, which was a major factor in the breaking of Enigma.  You would have to intentionally choose an encryption algorithm that has a similar vulnerability.


How can I find my home network's vulnerabilities when opening it for VPN connections

Well, open port does not necessary mean that anyone can enter. If you have an open port on a router/modem with nothing listening behind, then there is nothing to compromise.

Of course, this won't let you work from outside your home either. For this to happen, you have to put the VPN server and make it listen to this open port.

What are the vulnerabilities (most probably not exhaustive) :

a flaw in the router treatment of the IP packets. An intruder sends information with modified content that should have come to the VPN server computer, but instead it got send to a completely different machine (and/or port)
a flaw in the VPN server software. E.g. buffer overflow and such, which could allow someone to send forged packets to execute specific commands, or a failure in the password validation
a human flaw : you wrongfully configured your VPN server so he now accepts anonymous connection instead of rejecting them (for example), or you chose a stupidly-easy password as your credentials (admin/admin, florian/password12)
a flaw in the VPN's protocol, e.g. if poorly designed there could be a way to used wiretapping to recreate an authenticated connection to your VPN.

If you're not a security expert, there are basically no chance that you can find the vulnerabilities by yourself. So what you should do is follow the "best-practices":

use well-known software that uses well-known protocols. If there is a vulnerability, they will most likely be patched quickly and thus minimise the time-frame of your own network vulnerability
use good passwords
do not connect on your home network from computers you can't trust, there could be keyloggers for example
if you are not confident enough to set things up, perhaps you can find someone you trust to do it for you

If you want to test your own security, there are multiple tools dedicated to this (Nessus, metasploit, ...). They are not really "automated" way to assess the security of one's network, you need expertise to define the tests you want them to perform. There might however bundle some "classic" attack patterns.


Potential router malware? Receiving "Access Denied" and other weird blocks from various websites

Each taken on their own, each of these things listed may not be too much to be concerned about. Taken together, it's hard to say.

Southwest.com: I also get a Access Denied at http://www.southwest.com/ (and at https://www.southwest.com/). Their server is misconfigured. Nothing to worry about. Edit: Upon a closer investigation, the http://www.southwest.com/ page loads fine for me when I'm using an IP address in the USA, and gives me an Access Denied with an IP from anywhere in the world (that I've tried — several through Europe, India, Australia). So I'm not honestly sure about his one. They may filter IPs pretty aggressively, and it may be a similar situation to the Schwab.com issue you experienced (and if you've discovered your IP has been blacklisted, that may not be surprising).

Google search: I also get occasional CAPTCHAs when in incognito mode, though this might indicate genuine unusual traffic.

Yelp, Playstation Vue: I'm not a user of these sites and can't offer comment, but your description of these intermittent issues doesn't seem too unusual.

Schwab.com: This could indicate a genuine issue. If I can assume that you are using a normal home internet connection, then with most internet providers your IP address actually changes fairly often. This may mean that you were simply automatically assigned an IP that someone else has used to attack the Schwab website, either intentionally or (more likely) as an unwitting part of a botnet. If you have a dynamic IP (your IP changes regularly), I wouldn't be too concerned about this. If, however, you have a static IP (your IP is always the same), this is a concern, as it means it's something on your home network that's somehow become an unwitting part of a bot-net. Your IPS can tell you which (dynamic or static IP) you have, and may be able to switch you from one to the other if you like.

Godaddy: This is much more likely to indicate that someone is attempting to brute-force your Godaddy password than that there's an infection on your home computer/network/router. This is not that unusual, but there are some important steps to protect your accounts. Firstly, Godaddy supports two factor authentication, which you should enable immediately if you haven't (security professionals recommend enabling 2FA wherever it's supported). Secondly, you should register your email addresses with https://haveibeenpwned.com/, since if your login at a place like Godaddy is being attacked, there's an excellent chance that your credentials have been leaked somewhere, and it's very important to know what's happening with your data.

In short, I don't think you have much reason to worry at this point. Each of those symptoms has a separate, reasonable explanation. You've also taken some good steps so far. However, there are some further steps you can take to protect yourself.

haveibeenpwned.com, as mentioned above.
Always ensure your software (operating system, antivirus, etc) is fully up to date.
If you have any "smart" or "Internet-of-Things" devices (smart lightbulbs, app-enabled dishwashers, security cameras, what have you) be sure that they are also completely updated with their current firmware and software (people often forget these). If they don't need an external connection to the internet for their functionality, then consider blocking them from accessing the internet too. (Sadly, most of these devices need full internet connectivity to work, but still.)
Resetting your router to factory settings won't hurt, and is worth doing. You should also make sure, like with everything else, that the router software is fully up to date. I note in the comments you have separate modem and router; rinse and repeat for the modem.
If you want, you can start looking at your network like an attacker would. Tools like nmap can be used to find things on your network that may not appear (for whatever reason) in your router's interface. Wireshark can be used to investigate traffic, but if you're not able to run it directly on your router, it can take some effort to set up a system whereby your Wireshark can see all the traffic going in and out.

Hope this helps!


openssl: recover key and IV by passphrase

Usage of the openssl enc command-line option is described there. Below, I will answer your question, but don't forget to have a look at the last part of my text, where I take a look at what happens under the hood. It is instructive.

OpenSSL uses a salted key derivation algorithm. The salt is a piece of random bytes generated when encrypting, stored in the file header; upon decryption, the salt is retrieved from the header, and the key and IV are re-computed from the provided password and salt.

At the command-line, you can use the -P option (uppercase P) to print the salt, key and IV, and then exit. You can also use the -p (lowercase P) to print the salt, key and IV, and then proceed with the encryption. First try this:

openssl enc -aes-256-cbc -pass pass:MYPASSWORD -P

If you run this command several times, you will notice each invocation returns different values ! That's because, in the absence of the -d flag, openssl enc does encryption and generates a random salt each time. Since the salt varies, so do the key and IV. Thus, the -P flag is not very useful when encrypting; the -p flag, however, can be used. Let's try again; this time, we have the file foo_clear which we want to encrypt into foo_enc. Let's run this:

openssl enc -aes-256-cbc -pass pass:MYPASSWORD -p -in foo_clear -out foo_enc

This command will encrypt the file (thus creating foo_enc) and print out something like this:

salt=A68D6E406A087F05
key=E7C8836AD32C688444E3928F69F046715F8B33AF2E52A6E67A626B586DE8024E
iv=B9F128D827203729BE52A834CC0890B7

These values are the salt, key and IV actually used to encrypt the file.

If I want to get them back afterwards, I can use the -P flag in conjunction with the -d flag:

openssl enc -aes-256-cbc -pass pass:MYPASSWORD -d -P -in foo_enc

which will print the same salt, key and IV as above, every time. How so? That's because this time we are decrypting, so the header of foo_enc is read, and the salt retrieved. For a given salt value, derivation of the password into key and IV is deterministic.

Moreover, this key-and-IV retrieval is fast, even if the file is very long, because the -P flag prevents actual decryption; it reads the header, but stops there.

Alternatively, you can specify the salt value with the -S flag, or de-activate the salt altogether with -nosalt. Unsalted encryption is not recommended at all because it may allow speeding up password cracking with pre-computed tables (the same password always yields the same key and IV). If you provide the salt value, then you become responsible for generating proper salts, i.e. trying to make them as unique as possible (in practice, you have to produce them randomly). It is preferable to let openssl handle that, since there is ample room for silent failures ("silent" meaning "weak and crackable, but the code still works so you do not detect the problem during your tests").

The encryption format used by OpenSSL is non-standard: it is "what OpenSSL does", and if all versions of OpenSSL tend to agree with each other, there is still no reference document which describes this format except OpenSSL source code. The header format is rather simple:

magic value (8 bytes): the bytes 53 61 6c 74 65 64 5f 5f
salt value (8 bytes)

Hence a fixed 16-byte header, beginning with the ASCII encoding of the string Salted__, followed by the salt itself. That's all! No indication of the encryption algorithm; you are supposed to track that yourself.

The process by which the password and salt are turned into the key and IV is un-documented, but the source code shows that it calls the OpenSSL-specific EVP_BytesToKey() function, which uses a custom key derivation function (KDF) with some repeated hashing. This is a non-standard and not-well vetted construct (!) which relies on the MD5 hash function of dubious reputation (!!); that function can be changed on the command-line with the undocumented -md flag (!!!); the "iteration count" is set by the enc command to 1 and cannot be changed (!!!!). This means that the first 16 bytes of the key will be equal to MD5(password||salt), and that's it.

This is quite weak! Anybody who knows how to write code on a PC can try to crack such a scheme and will be able to "try" several dozens of millions of potential passwords per second (hundreds of millions will be achievable with a GPU). If you use openssl enc, make sure your password has very high entropy! (i.e. higher than usually recommended; aim for 80 bits, at least). Or, preferably, don't use it at all; instead, go for something more robust (GnuPG, when doing symmetric encryption for a password, uses a stronger KDF with many iterations of the underlying hash function).


A 512-bit key has about 154 decimal digits, so that should be the size your facing. This should cost less than $100 to factor.

  The Factoring as a Service project is designed to allow anyone to factor 512-bit integers in as little as four hours using the Amazon EC2 platform for less than $100, with minimal setup.

See Is 512-bit RSA still safe for signature generation? for helpful links including how-tos and readily made scripts for running factoring on AWS.

There is also a good chance that the programmer messed up something, for example by using textbook RSA or providing a decryption oracle (if you have access to a server which can decrypt messages). But I'd only invest time in this if you either have the source code (so you can see which mistakes they made at a glance) or if it's a CTF (where you might be expected to exploit such a mistake).


copy protection (or licensing) mechanism for an android app

Each device has a unique hardware-ID - We will call it HID for readability.

Create an algorithm that takes the HID and generates an unlock-serial-number

Pseudo-code:

Generate_Serial(input = HID)
{
    scramble that HID
    add a secrete value to it
    send the value to costumer
}

Have a sms/phone-calls bot to answer requests coming from your clients devices. Automation of the process is your goal here.

The bot will take the HID and then sends back the unlock-serial-number, which will be used to unlock the app via another on-app algorithm as follow:

Pseudo-code:

Unlock_App(input = unlock-serial-number)
{
    unscramble unlock-serial-number
    remove the HID value
    do you have the secrete value?
    YES : Unlock
    NO : Print Error
}

Think about this as your favorite IM app (WhatsApp, Viber, etc..) verification process.

Note: Be careful storing your secrete value on-app! - you will have to protect it somehow from reverse engineering.

I hope this was helpful!


How password hashing is useful in MITM attack?

Password hashing is used to protect users in the case of a database being compromised. Transmission of the password to the server is a completely different security scenario.

Both of your assertions about traffic sniffing at the start of your question are correct. Transmitting the password in plaintext allows an attacker to sniff the password. Computing the hash on the client side essentially makes the hash the password, so an attacker can just sniff the hash and use that instead.

To answer your questions at the end:

HTTPS uses SSL (or TLS) to provide endpoint-to-endpoint security. This essentially means that an attacker can't sniff out the data, since it's encrypted. He also can't inject data, since authenticity is provided too. When SSL is used, the server has a certificate that contains its public key. The certificate is signed by a CA that your browser trusts, so you can verify that it is correct. Your browser generates a session key and encrypts it using the server's public key. Only the server can decrypt it, because the only the server knows the private key. Once both the server and client know the session key, they can communicate securely.
An ISP or proxy might use a man-in-the-middle attack to present you with a false certificate. If you accept that certificate, they can decrypt the conversation and inject their own data. However, you will be alerted by your browser that the certificate is invalid. Some governments get real certificates issued to them for this purpose - so you won't notice unless you inspect the certificate.
If the attacker knows your WPA2 password, they can connect to the network. This allows them to sniff traffic.

In your situation, send the password over HTTPS, then hash it on the server side with a strong key derivation algorithm such as PBKDF2 or bcrypt.


The term firewall describes a broad category of products for a variety of use cases. There are simple packet filter firewalls using iptables or similar but also so called Next Generation Firewalls which do application level analysis. And there are Intrusion Prevention Systems, Unified Threat Management products, Industry Firewalls ... and also Secure Gateways. Sometimes these names refer to their task, sometimes to a technology and sometimes they are just marketing lingo. But all of these various kinds of network firewalls have in common that they are used for separating networks at various kind of layers: from packet to application layer.

  1) What is the difference between an email security gateway and firewall ? Could an email security gateway be considered as an smtp proxy ?

Mail Gateways or Secure Mail Gateways provide a separation at the Application Layer by analyzing the context of mail delivery and the content of mails transferred through a network boundary. This way they help to protect the inner network against malware, phishing, spam etc but can also help to detect data leakage from inside to outside using emails. While there are standalone Secure Mail Gateways or cloud based solutions the necessary functionality is often included in modern enterprise firewalls too. But, like with firewalls in general the quality of the solutions can vary a lot even between products which claim to have the same general features.

  2) Does an email security gateway run an MTA or a UA?

Secure Mail Gateways are commonly implemented as MTA, i.e. explicitly configured as MX for incoming mail and as the outgoing mail server in the mail clients. But, there are also products which can be used in a transparent way, i.e. which are setup in front of an existing MTA with no additional configuration in DNS or at the clients.

  3) How does it detect spams and phishing emails?

This by itself is a broad question. But, to mention some techniques: there is blacklisting of IP addresses which are known to deliver unwanted or harmful mails (DNS-BL - DNS based blacklists). There is Greylisting to temporarily deny receiving some mail in the hope that spammers will just give up. There is the use of SPF, DKIM and DMARC to detect sender spoofing. There are various content based filters which for example compare received mails with known bad mails received in honeypots or check if they contain links to known spam or phishing sites. And while these are probably the most used and well known techniques this is by far not an exhaustive list of techniques used.


What does "sandboxing" mean for Chrome OS?

Google Chrome OS is a Linux-based operating system on which Chrome is the browser and focuses on  the use of the online applications that belong to Google (Google Drive, Youtube ...). It is the direct competetor with Windows OS of Microsoft.
Centos OS is also  a Linux-based operating system but unlike Chrome OS which runs on mobiles, Centos OS is widely used for servers.
Sandboxing is a concept that you see frequently in  Chrome Os because it is the commercial version of the free and open source project Chromium OS which relies on sandboxing mechanism. Sandboxing, in very simple terms is related to security, especially to prevent from malware effects on the OS. You can for example visit a website with the browser of Chromium OS: if the URL hosts a JavaScript malware (drive-by download attack), there is no chance for the malware to affect your OS given the principle of sandboxing notion which is better explained here:

  The sandbox is a C++ library that allows the creation of sandboxed
  processes — processes that execute within a very restrictive
  environment. The only resources sandboxed processes can freely use are
  CPU cycles and memory. For example, sandboxes processes cannot write
  to disk or display their own windows. What exactly they can do is
  controlled by an explicit policy. Chromium renderers are sandboxed
  processes.

AppArmor and Selinux have the same goals as the sandboxing notion, but the principle of their functionment is different. Mainly sandboxing does not allow its security boundaries to be breached unlike the 2 other Linux softwares.


What is good metric for detecting data exfiltration on covert channel?

DNS and ICMP are not good examples, because in a well configuration, network access is restricted by use of a proxy to thwart DNS and ICMP right from the start.

But there‘s HTTP(S) still available through the proxy.

Usually, websites are not whitelisted in a proxy, so this should work quite well.

As to the content inspection:

You can not do that in general. Even if you have a HTTPS proxy that is doing a MITM, the request payload might still be encrypted within the transport of HTTPS which cannot be scanned for key words.

Additionally, you may not be allowed to MITM for example banking sites for inspection due to normative regulations.

You can however try and find encrypted payload streams in HTTP(S) traffic and analyze them, in the mean time blacklisting the destination hosts.

While volume based exfiltration detection seems like a good plan for DNS and ICMP, for HTTPS it is not as there might be legitimate traffic exceeding your threshold resulting in a big number of false positives and possibly business disruption.

A combined approach would maybe work, maybe with a white list of domains that are safe to upload data to: if you find a significant amount of data is sent through the proxy, you could blacklist the destination if it’s not on the white list and analyze the traffic manually. If the exfiltrated data is small in size, you might still not get it.

All in all: that’s the problem with covert exfiltration: it’s hidden well.


Suspicious "100% guaranteed" web hosting security package

A few things worth noting (expanding on my comment, so I can elaborate a bit more).

He claimed there was a 100% guarantee that no attack could bypass their security.

This claim can never be verified. Aside from the fact that this claim likely came from a sales person with limited (if any) Information Security knowledge, I would say that anybody who ever claims that a system is 100% secure is not to be trusted.

they would ban any IP addresses that are suspected of performing MITM attacks, DDOS attacks

Deploy an SSL / TLS certificate to mitigate any risk of MITM attacks. LetsEncrypt will let you do this for no cost and many hosts support them natively now. Mitigating DDoS attacks is likely not something your host has the capability to do by themselves and will likely just put you on a free CloudFlare plan.

If you're concerned about the security of the application itself then you should be looking for the services of a Penetration Tester. The "security measures" this account representative has presented strictly deal with the protocol level (how traffic gets to your website), and not the security of the website itself. Testing the security, logic flow, etc of the actual application is a task best left to experienced web penetration testers.


Behavior of IPSec when receive window gets full

The anti-replay window is moved, the new upper bound will be the sequence number of the received package (it's always the highest sequence number of any successfully validated package). Packets received later with sequence numbers lower than the new lower bound of the window will be dropped. Refer to RFC 4303, section 3.4.3 for details.


Short answer: It's damn vulnerable.

Why? You are concatenating the values given by POST which come directly from what the user typed. Therefore, it is very simple to manipulate your query. Also, you are using mysql extension which is deprecated. You should be using mysqli or PDO to create prepared statements to protect against injection.

Here's a question from Stackoverflow that explains the matter in depth and how to solve it.

On a side note, you should not be using MD5 to encrypt passwords as it is a broken algorithm. Consider using bcrypt or PBKDF2 as explained here.


How can I find a web application's document root using a path traversal vulnerability?

Use the traversal vulnerability to read

/proc/self/environ

This prints out environment variables among other thread information.

Look for a environment variable called DOCUMENT_ROOT


While essentially, SSL and SSH can use the same algorithms and keys, your life will be a lot simpler if you create your CSR with a tool designed for the job (and you should never use re-use keys for different purposes).

On MS Windows you can do this with certreq, or the MMC snap-in for certificates, but I find the tool bundled with IIS easiest to use. For preference I would use openssl with template conf files.

The private key is stored wherever you tell the software to store the private key.


Recommended Cipher Suites for TLS 1.0, 1.1 and 1.2

NIST maintains "Special Publication SP 800-52" for guidance with regards to TLS usage. On April 2014 was published SP 800-52 Revision 1.

There are a lot of combinations of options, which cannot be readily shortened into an answer; you have to read the document to see what NIST really wants. See sections 3.9 (for servers) and 4.9 (for clients) for summaries of the NIST recommendations. Some highlights:

NIST requires TLS 1.1 support, with TLS 1.2 being warmly recommended. SSL 2.0 and 3.0 are explicitly forbidden. TLS servers for "government-only applications" are required NOT to support TLS 1.0 either (so they really want to force usage of recent versions). Sysadmins are expected to "develop migration plans" for a general support of TLS 1.2 no later than January 1st, 2015 (so NIST is even in kind of a hurry)(I don't believe it will really happen so soon, though).
They drop static Diffie-Hellman (nobody supports that anyway) and they finally embrace RSA. 2048-bit or longer keys, of course. ECDSA is also acceptable, using the P-256 or P-384 standard NIST curves.
They recommend ECDHE cipher suites (and they much prefer ECDHE over DHE).
Encryption shall be 3DES or AES. 3DES support MUST still be maintained (they insist on it, "for interoperability reasons"; one must assume that there still are a lot of deployed systems which do not support AES cipher suites).
When using TLS 1.2, use of AES-GCM is, of course, recommended.
They include an appendix which talks about Certificate Transparency, DANE (DNSSEC), Convergence... but they don't emit specific recommendations.
There is not a single word, good or bad, about SRP. They do talk a bit about PSK cipher suites (and they recommend not using them).


Security breach from contact form in Laravel 5.8.36?

there is lot of possibilities here:

you are on shared hosting ( weak one ) which had another website hacked and that lead to your files.
you have another cms on the same account ( wordpress, magento, ...etc ) that has been hacked and lead to your files.
you have SQL injection vulnerability in your code which lead to your database then your admin access then your files.
you have upload field in any contact form which is not secured and lead to upload a shell.


Are unbranded home security camera secure?

My major concern is how secure are they?

Probably not very secure at all. Why would a cheap no-name wifi-web-cam be secure? The main development time/energy/money probably went into creating the desired functionality with little regard for security.

  Can it be used to hack my wifi or devices on my network?

Sure, it's always a possibility. Whether or not this occurrence is likely depends on what you mean by "hack" as well as the unknown specifics of the camera such as the platform, the os, the applications, the infrastructure, etc.


Clarification on how session fixation attacks works

When the attacker uses an already existing session ID, doesn't the server know that the session id has already been taken by the attacker?

The attacker would send a link with a session ID that is either:

not at all registered at the server - i.e. just a random number on the right format, or
for an actual session that is not logged in, so it is not yet associated with any user.

So the attacker never logs in on the site. It would be foolish by the attacker to send a session ID for a session where she is logged in as herself, since that would give the victim control over the attackers account!

  When the victim logs into the website, what can an attacker do with it? Any examples?

When the victim loggs in, the session ID in question goes from not being associated with any user to being associated with the victim. Since the attacker knows the session ID, she can now use it to impersonate the victim.

This means that she can do anything the victim could do on the site - create and delete content, edit profiles, whatever. Anything that does not require some form of extra authentications such as retyping your password.


is there any solution to manage network forensic, SIEM and intelligence analysis and investigation in a enterprise network?

Have you looked at NetWitness? Also, check out some of the posts and books from TaoSecurity on the topic of network security monitoring. There you'll find some methods that use open source technologies, but of course they'll require more work on your part.


Login on public Wi-Fi networks using HTTPS

Your connection to the email provider is SSL encrypted (starting from your iPad, not the public access point), so this can be considered safe.


I think your approach will depend on what requirements your colleague has for the system's security. The token itself performs a very simple job as part of the authentication architecture. What you'll really be testing is the behavior of the software on the server which, presumably, is provided to you by a vendor. To that end, here are a few tests that must pass, at minimum, for you to know that the system is functioning:

Authentication. Provide the correct credentials for the user
associated with the token, along with the possession factor (the
token's code), and ensure that you are able to access the system.
User-factor pairing. Provide the correct credentials for a different
user, along with the possession factor, and ensure that
authentication fails.
Factor invalidation. Provide the same possession factor twice in
succession, along with valid credentials, and ensure that
authentication fails the second time.
Factor expiration. Provide a sufficiently old possession factor
along with valid credentials and ensure that authentication fails.

Edit: My answer assumes that you are dealing with a disconnected, multi-factor authentication token. Most commonly, these are time-synchronized. Forgive me for not prodding further if you are dealing with a connected token like a smart card.


How does the browser decide to accept a self-signed certificate?

Browsers will only accept an invalid certificate - and self-signed is one form of "invalid" - when the user acknowledges the risk and overrides the browser.  The specific steps for doing so vary from browser to browser, but they're usually onerous by design - they want the decision to bypass security to be hard, not easy.


how to store and retrieve nonce in practice

First of all, As nonce is supposed to be random is not, strictly speaking, true. Nonce in general is only required to be unique.

It is, however, often convenient to generate nonce as (pseudo-)random bytes. In this case and if the nonce is sufficiently big (say, 12+ bytes) there is no need to check against previous nonces as you will never encounter a repeat in your life.


Is it possible?

Yes, in theory, it is possible to define a checksum for the index page of a website. If browser vendors wanted to support such a thing, it could definitely be done. Similar mechanisms for SRI and CSP already exist.

However...

It doesn't make any sense. /index.html pages used to be integral parts of the web, back when it was mostly static. However, most content is generated in a dynamic fashion. For example, if you look at the "index" page generated for this website, you will see that all the dynamic content from the Stack Exchange network, such as your avatar, your username, your reputation and questions currently being asked, are all generated server-side.

That means when you visit https://security.stackexchange.com, you will be delivered a different document than me, or anyone else.

This alone renders your approach completely infeasible. But there is more.

It doesn't make sense

Subresource Integrity solves a particular problem, and you seem to fundamentally misunderstand this problem. You said:

  With subresource integrity, you can specify SHA hashes for URLs, so that you know that you are getting the correct javascript and css files even when they are pulled from a CDN that doesn't use HTTPS.

But the goal isn't to replace HTTPS. The goal is to prevent a bad actor from replacing the legitimate jquery.min.js with a malicious version. If your site specifies how jquery.min.js should look like, then your browser would refuse to execute a malicious version. It was created in a response to the "single point of attack" we created by putting all our JavaScript into one domain.

Furthermore, it doesn't solve any problem at all. You said

  Imagine, a green badge over HTTP!!!

but that isn't even a desirable goal. HTTP is fundamentally insecure and should die. It should have died last decade, for all that security is concerned with. HTTPS solves all the problems HTTPS would need to solve. And with Let's Encrypt, it's literally free and takes five minutes to get a trusted certificate for HTTPS. There is no reason to keep HTTP around even longer.


What makes malware like Stuxnet or Duqu so advanced?

0days are usually fairly expensive. You have to consider the manpower required to find them. Then to find a specific sequence of 0days required to hop into a specific framework is closer to a permutation than a combination.

Figure each 0day is worth around $500k.

To find people that have those specific kinds of 0days or know how to find them, in sequence, then to write and obfuscate the code, have it self replicate only in the target systems along a limited pathway, and target very specific PLCs while leaving as little trace as possible requires a lot of very specialized skills that are perishable, a team is necessary. A team defined by mastery of digital logic and systems.

And the team has to keep their mouths shut.

It goes from being tens of millions of possible coders worldwide, to a few hundred, maybe a few thousand, fairly quickly.

As far as the software itself being really advanced... That's a matter of relativity. It pretty much all boils down to a handful of operations in assembly anyway.


A backdoor is actually quite simple: keep track of the secret key used on the device. Either by generating them randomly and storing them after writing to each device, or by generating them all from a known seed. All of the security of a U2F device is dependent on the device key staying secret.


Is it safe to display version information on a public webpage of your web app?

When in a production environment, the less non-critical information that is handed out the better your security surface will be.

Version information and a product's name can be used to narrow the scope down of attacks that can be used against an application.

Without knowing the in's and out's of the application, it's hard to know if it is in fact deployed as a "production level" application.

I will add that with SVN controlled applications, version information becomes useless to an attacker because the application likely to be rapidly updated.

EDIT: For further clarification, I will also mention that many protocols and pieces of software will pass a version parameter. This is to ensure that the program is talking to a valid version. Imagine an older version of the app talking to a new instance of server software. Things could either go very bad, or just not work at all.


What else can be done for better security against keylogging softwares?

Besides what you've done already to protect yourself you have a few additional options.

Use two factor authentication for your accounts.
Don't use public computers.
Use a live distro that you know is safe (you can sometimes reboot public machines and usb boot)

Adding these into your routine should make you pretty darned secure.


New to security, is php password_hash() good enough?

Using bcrypt is a good start; that's the recommended choice (or at least one of the recommended choices). The documentation seems to indicate that PHP finally does things properly. Make sure that your PHP version is at least 5.5.0. Don't try to fiddle with salts: by default, the function will generate a random salt when needed, and that's the right way to do it, so just let it do its job.

You should try to alter the "cost" option as well. For bcrypt, the cost is a value ranging from 4 to 31; each increment means that the password hashing is twice as expensive, both for your server and for the attacker. In practice, you want to make that value as high as can be tolerated, given your server power, average load, peak load, and maximum user patience: this will give you the best security that you can hope for.

(Note that I said "the best", not "good".)

If you want to understand the underlying concepts for good password hashing, and why bcrypt is a good choice, start here.


How to communicate with a random service after a successful netcat connection?

You would need to communicate with commands that this service can handle. Let's say that you manage to connect to an open SMTP port, you would need to use SMTP commands (HELO, EHLO, MAIL FROM, RCPT TO, etc.) to interact with it. Same thing if you connect to a MySQL port, Redis port, etc.


How can Ettercap act as a client instead of a gateway?

So running a command like

ettercap -T -q -B <iface1> -i <iface2> //

will go into "full duplex" bridge mode where if you broke the link between two machines completely and plugged them into iface 1 and 2 the two machines would be able to talk to eachother just as before.
However there is no mac spoofing so make sure if your using a switch or router it allows promiscuous traffic. You also need to make sure there is no direct connection between the gateway router and the client. from there you can do various things with filters. Though I havn't had much success with filters in bridge mode and wrote a plugin. You can alter any bytes you want and just set

po->flags |= PO_MODIFIED;

and the modified packet will go out the other interface.


The article you linked to clearly stated that it was vulnerable.  However, it's pretty hard to leverage "shell shock" in "BASH" on Windows for git.  You're still restricted to the users permissions, and their git code repository on their file system.

Additionally, there are far fewer attack vectors that exploit shell shock on Windows than on their *nix counterparts.  I'd be gobsmacked if I saw a windows process invoke a bash shell.


Why should relatively-public personal identifying information be kept secret online if at all?

It makes no sense to keep information secret if they are trivially and cheaply obtainable by others anyway.

For everything else somebody has to put some non-trivial effort and/or costs into collecting and associating such information. Due to this it will only be done if the expected return at least matches the efforts and costs needed to obtain such information. And due to limited resources a potential attacker can only target a limited number of victims this way.

By making such previously harder to obtain information easier to get one lowers the costs for obtaining the information. This means less efforts and costs are needed by a potential attacker to get the same return which makes it more likely that it is worth the effort. And due to the lower costs the attacker can also target more victims with the same resources. Both together increase the risk that these information gets misused.


There are strategies to improve the chances of evading a target's AV.  The overall strategy is to try to develop a backdoor that is unique as possible.   Writing your own backdoor from scratch will be the most successful.

A protected,  or "encrypted" envelope around malware is a common strategy.   However,  AV's will sometimes flag the envelope and assume the contents is malware, which sometimes happens with UPX.  As of 2015, Veil-Evasion has become my preferred envelope used to evade signature anti-virus software.


How is Tresorit client-side encryption key stored and managed?

I know this is a late answer, but might still be interesting for others:

The whole process is very well explained in the link below. When you sign in on a device for the first time it downloads your roaming profile from the Tresorit server. It then decrypts you master key from the profile using your password and the master salt (also in your profile, only part not encrypted).

https://support.tresorit.com/hc/en-us/articles/216114377-How-is-your-user-profile-handled-


End to end cryptographic methods/solutions

I'd recommend OpenPGP GNU has a good implementation of that that is GPG or GnuPG that comes with it. Check with gpg --version GNU also has a windows implementation called Gpg4win.

A better place to get these answers that allows for more discussion is IRC. I suggest ##crypto on freenode.

I personally use it with Enigmail(Thunderbird add on) for my email. For more on encryption and digital signatures see this.


Seeing SSL requests in unencrypted form from a remote client

Is it possible to install a certificate on button click, or do you
  have to manually import it?

What do you think "manually importing" is? It's a software (part) that allows the user to select a certificate, and when clicking a button, it adds this certificate to the system. Meaning, of course such a software is possible. (This should be a no-brainer).

While eg. Android had restrictions in the past that third party programs weren't allowed to do so, it's now possible.

  I was wondering how I could be able to see SSL requests in an
  unencrypted form from remote clients

To MITM TLS requests (TLS, forget about SSL), you need not only the certificate part, but access to the data itself too. It's easier to start with that.

A common solution for legitimate purposes is to make a proxy server and to configure your phone to use it. Meaning, if you call a website, your phone won't connect to it directly, but connect to the proxy server, and the proxy server connects to the website. This allows the proxy server to read any transmitted data (but not to decrypt it).

Now, for the decryption part: You might know that, when a TLS connection starts, the server and the client agree on a encryption method and so on, and the client checks (with the local certificate) if the server is the real server for the given address.
If your proxy server wants to decrypt the data, it has to act as client when the connection starts, ie. the TLS connection is between web server and proxy server. The problem is the other direction: After reading what the server sent, it has to be sent to the phone too (otherwise, the phone won't ever get a started TLS connection, and won't ever start to send sensitive data over it).

The key part of TLS now is, the proxy server is not able to re-encrypt the data in a way that the phone thinks it comes from the web server (meaning the phone will reject the connection, because it recognized that the other side is not the web server). The (technial, not legal) solution 1 is to steal the private key of the web server (which is saved on the web server, but hopefully not accessible by the public). If you had that, your proxy server can successfully trick the phone into thinking that it communicates with the web server. It's just, stealing the private key can be a bit hard. The other solution is to add your self-created certificate for the website to the phone, and the private key to the proxy server, to make the phone accept the proxy server as legitimate web server too.

But now, you've still a tiny problem...

  but how would I generate one from the Linux command line that works
  for all websites.

While you could easily look this up, it won't help you, because a certificate for all web sites is not possible. The data format (used by web servers, browsers etc.) just doesn't allow it. Meaning, you would need a custom certificate (on phone and proxy) for each website that exists, if you go that route.

To solve this on the phone side, create a custom CA certificate instead of a single website certificate. Ie. a certificate that can be used to create more certificates, and if your phone has the parent cert, it trusts all children too. And on the proxy side, your proxy software needs to generate website certificates on the fly for each new connection. There's already software that is able to do this.


PyCrypto Possible To Check If File Already AES Encrypted?

As mentioned by Valmiky Arquissandas, encrypted text is generally expected to be computationally indistinguishable from random data. Thus, the only publicly known efficient way to do

something like check if a file is "not already encrypted by AES" is to run a randomness test.

However, your application should use authenticated encryption anyway,

and if it does then it can use the verification procedure to determine with very

high accuracy whether or not the file was already encrypted by the same key.

Additionally, as Valmiky also indicated, it can use a custom wrapper to let it distinguish with

very high accuracy between files it already encrypted and files that are independent of it.

(However, given your program's code, it would be easy to create a

file that registers as the former without having been encrypted by it.)


How to circumvent an isolated domestic internet connection?

It would be impossible to access resources that are not connected to the network. So, saying that direct circumvention would not be possible. Presumably, there would be limited and restricted access to external resources available to specified individuals/groups. Circumventing this restriction would be difficult, legally contentious and likely against the spirit of the question.

If we are talking about accessing external resources from a specific geographic location (which I think this question is more concerned about) than we should look at alternative methods of accessing these resources that do not require a direct physical connection.

Using satellite-based internet (such as that used on airlines) as well as connecting to adjacent regions/countries' cellular network would allow for this.


Have you considered using Splunk?

Very easy to set up, with apps available for *nix platforms and mod_security ready.

Splunk isn't open source, but free to use for up to 500mb of data per day - you can send data via regular syslog, or using their universal forwarder. Their dashboards and charting capabilities are fantastic and easy to use.

You can set up alerts to send emails, trigger actions, run scripts, etc.


Since according to your description all systems in your network are affected and independent from the operating system, the chances are high that your router is compromised and the DNS settings are changed. This way most outgoing traffic can be controlled by the attacker which leads to all these redirects to ads. This type of compromise is not uncommon as you can see from a google search.

What you need to do first is fix your router, that is make a firmware reset and update it to the latest firmware. If the router is out of support, if the model is known to be insecure or if the vendor is known to be unable to make secure devices (this includes most vendors of cheap devices) throw it away and get a better router. For more information see routersecurity.org.

After you've fixed your router you should also make sure that all your systems are clean since compromised routers are not only used to deliver ads but also malware.


I monitored the responses that Hydra was sending over the network with Wireshark and my syntax was working to begin with. The only issue is that the page even when successfully accessed with the username and password stayed on the same page (302 Redirect for a correct combo) I had then edited my success string to look for "302" rather than "log out" or something the user would see. This means my final answer for this issues is as follows:

hydra -l username -P /root/Desktop/Test.txt url.zz.za http-post-form "/portal/xlogin/:ed=^USER^&pw=^PASS^:S=302"


I just discovered that my sysadmin created a loophole that gives me root access. What should I do?

Although it depends on the local policy of your organization, the usual setup is that you should report the issue; actually, make it a must since your sudo call with whoami was logged (sudo keeps logs by default) and this proves that you were aware of the issue. You have crossed the threshold, now you must go to the end of it.

If you consider that the hole is an honest mistake, then you should report to the sysadmin himself. On the other hand, if you have rational reasons to believe that the sysadmin has planted a hole intentionally, then you should report the issue to his manager.

Either way, the sysadmin will hate you for that.


Anonymity of sneakernet: identifiable information on removable storage

Very plausible. Windows stores device information from connected USB devices in the registry, this is commonly used in forensics.

If you attach an iPod/iPhone, it can leave traces on the local system as well and traces of the system you connected to my be left on the device.

Endpoint DLP and antivirus may also scan removable media and leave traces. If a devices is scanned upon being insert files may be indexed, copied, or entered into logs.

CD/DVD media is less likely to include media metadata or serial numbers, but the media name assigned to the disk may be useful.

If Alice cannot control or cannot guarantee the security of Bob's system, she may be better off at least using some fresh media (brand new in package, randomly selected) and not connect the media to a system with any unique data (e.g, boot up in LiveCD then copy from one media to another; or more paranoid, use a new or public PC which cannot easily be linked back to Alice).


Is it safe to generate the longest password possible?

Besides dictionary attacks or other possible techniques (like timing attacks, etc.), an attacker might try bruteforcing all the combinations (if possible), or just try some combinations at random (until they give up because it's not worth continuing).
Suppose you have a 24-char alphanumeric password (allowed characters: a-zA-Z0-9), for example 4LZB7NFjpFW6sjtuIaBel9hZ.

If the attacker knows the length of your password, the possible combinations to try will be 62^24 = 1.04 * 10^43, which is about 143 bits of entropy.
If the attacker does not know the length of your password, the possible combinations will be 62 + 62^2 + ... + 62^23 + 62^24, which is a geometric progression and the result should be ((62^25 -1) / (62 - 1)) - 1 = 1.06 *10^43, still about 143 bits of entropy.
If you make the password 1 character shorter and the attacker knows this length, the possible combinations to try will be 62^23 = 1.7*10^41, which is about 137 bits of entropy.

As you can see, even if the attacker knows the exact length of your password, the advantage they might get is negligible. Also, if your password is already very strong, adding or removing one character won't have a significant impact on your security either (anything above 128 bits of entropy is still considered to be uncrackable, even with an enormous amount of computation power).


Why OpenVPN is using both certificates and DH?

Key pairs are used for two things:

Encrypting a secret value for symmetric encryption
Signing data for validation

Both RSA and DH are based in asymmetric algorithms.  So we have two cases for a secure exchange to occur.

RSA

Alice signs a message to Bob, and encrypts the message with Bob's public key.  Sends message to Bob.  Bob decrypts with his private key.  Verifies the signature to ensure that Alice sent it.  The message is going to be a symmetric encryption key.  This is what's used to secure the connection.

DH

The Diffie Hellman exchange relies on two separate entities generating a secret value.  Through some math magic they're both able to generate a common secret value.  This common secret is what is used as a symmetric key or to derive symmetric keys.  But these secret values that are generated by each side are generated at the time of need.  They don't have an identity associated with them.

That last part is why you might need both.  Using RSA you can have a key pair that will do both encryption and signing.  With DH you only perform the encryption, there is no signing mechanism.  So you need an RSA certificate in order for you to validate the DH data that you're sending.

So why use Diffie Hellman?  Because DH is the basis for Perfect Forward Secrecy.  Which is better explained in this answer.


Most people consider being anonymous to be a state in which who they are could not be determined using reasonable means.

If your site doesn't log where a user comes from and does not ask for an email address or phone number to confirm identity most would consider content posted to be anonymous in the context of the site.

If the system goes a step further and is only accessible by methods which defy normal traceability, such as over TOR, that goes a step further in ensuring anonymity.

The users ability to unmask themselves in their own content does not diminish the systems claim to be anonymous.


Retrieving passcodes through forensic discovery

The specifics of the device are very important here.  Generally speaking, however, (when talking about devices that implement reasonably secure encryption mechanisms) when you encrypt a device with a password, that password is not in fact stored anywhere. The standard process is that when the password, when entered, is run through a key derivation function in order to deterministically create key-encryption-key, which is then used to decrypt the the data-encryption-key, which was randomly generated by the device, and what is actually used to encrypt and decrypt the data on the device.  Without the key-encryption-key, you can't decrypt the data-encryption-key, and can't recover the data.


CVE fields vulnerable_products vs whats in configuration

You have listed an NVD JSON 1.1 snippet, and the answer is in the schema.

The vulnerable field is required as it is the primary product affected.

The configurations field is not required, and as the schema states:

Defines the set of product configurations for a NVD applicability statement.

As you point out, the Opticam products are vulnerable, and the configurations section lists other closely related products/configurations that are similarly affected.

Why are they separated? Since CVEs are product-based, it makes sense not to lump multiple products into the primary key for the CVE, but to add the related products in a child node.


Known security vulnerabilities in JBoss 4.x.x?

There is this JBoss Application Server Remote Exploit (CVE-2010-0738) that was published recently.
The exploit works for JBoss running on both Linux and Windows platforms, when the exploit is successful it will return a command prompt or a shell to the attacker.


Unfortunately, this is not possible in your situation.

When you want the client and the server both to verify each other's identity, this is called "mutual authentication".

Per this MSDN post, NTLM does not support mutual authentication. (It's the third bullet point in the NTLM SessionKey section.)

Kerberos supports mutual authentication, but you must setup a Windows domain to use Kerberos authentication. This requires a Windows Server OS.

After that, the client must be configured to require mutual authentication once both systems are joined to the domain---mutual authentication is not required by default even when it is available.


How can the parallelization in CTR mode be attained?

In counter mode (CTR) no single block of cipher is dependent upon a previously calculated block.  Each block can be calculated independently of every other block.

This could be parallelized by splitting the cipher into chunks for individual threads to encrypt or decrypt.  Say you have a 512 byte block of data you want to encrypt.  Using AES128-CTR there would be 32 blocks of data to encrypt (512/16).  Say you want to use 4 threads.  You would send 8 blocks to each thread with the nonce and counter range you want them to process.

As each thread finishes you need to piece the encrypted data bytes back together.  So you'd have to ensure that you know which thread has finished, and where in the block of encrypted data you need to place it.  Once all threads have returned, and you've pieced the data together you're done.

If this is performed already it would be at the implementation level.  So if OpenSSL for example supports parallelization of CTR then it's possible.  This might need to be configured (server-side) or you might have to feed it a parameter (client-side).


When doing any kind of web based authentication you always want to perform the action over an encrypted channel. So, yes. Get a cert and turn it on. You shouldn't have any problems.

Forbidding access to the server itself, when using machine accounts, is definitely doable but can sometimes be tricky depending on your exact use-cases. First, make sure the user accounts are in neither the Administrators nor Remote Users groups. This will prevent Terminal Services connections.

You will also want to forbid them from logging in locally. I don't have the necessary Windows expertise to explain how, unfortunately.

As an additional step, I would also make sure you firewall rules are appropriately restrictive. If the users can't hit port 3389, then they can't Remote Desktop even if they have an account.


Are buffer overflow applicable only to arrays?

Buffer overflows occur on, no surprise, buffers.

A buffer is a sequence of data. It may or may not have a distinct continuous type. On some systems it may not even consist of bytes. On the assumption that it has a maximum length (or at least an expected one) then there can occur a condition where the size of the data entering the buffer exceeds its maximum length, leading to an overflow (i.e. copy beyond the bounds). This can occur due to the buffer being of fixed length and the copied data being larger than that length, or due to a mistake in the handling of dynamic memory allocation in the case of a variable-length buffer.

Technically the buffer can be of any type. For example, memcpy'ing an int (32-bit) onto a short (16-bit) datatype is a buffer overflow - the buffer was 16 bits in size and we copied 32 bits to it, thus overflowing data onto the following 16 bits after the target buffer.

The reason we usually talk about arrays is that they're the most common data type to see in a buffer overflow context, assuming you consider a string to be a type of array (e.g. char*, which is a pointer to any number of char instances). In most cases you're going to be dealing with such a case, so it makes sense to discuss things in terms of arrays because it's a concrete programming example.


How Does Tor Prevent the Exit Node from Seeing the IP of a Tor Website

Tor hidden services do not operate trough exit nodes. Hidden services picks some nodes as introduction points and builds protected Tor routes to them. Clients connect those services by building own Tor routes to these introduction points.
Only the introduction points know they have route to the hidden service. For the other nodes it looks just like any other encrypted Tor traffic: they cannot distinguish services from each other nor services from clients. It does not matter that the first node sees the IP address, because it has no idea it is the hidden service.
However, it might be possible to deduce a location of a hidden service by its downtimes, if there is just a single instance serving it. Think there are recurring power or Internet outages in your area. If someone can match those with the downtimes of the service, the approximate location or network might be exposed. Furthermore, it would be possible to use e.g. DDoS to delimit it to a single IP address. Having multiple instances to introduce the same service mitigates the threat.


How can I convert my encypted PGP secret key for use performing SSH authentication?

There would be no point in converting a public key if nobody can convert the private key too, meaning this program was created with such a conversion process in mind.  You'll notice the error message reads "We cannot handle encrypted secret keys."

I therefore recommend you remove the private key's password using the passwd command in gpg --edit-key.  You should obviously reencrypt both the old gpg private key and the new ssh private key after conversion.

If you're worried about unencrypted key remaining on the drive, then create either an encrypted partition using encfs, truecrypt, etc., or else create a ramdisk.  You should keep the ramdisk small and short lived to prevent the kernel from swapping it, well unless you find some trick for calling mlock.  Any cryptographic file systems should already mlock their data pages.


How to generate a CSR (certificate signing request) for creating a limited CA (Certificate Authority) using LibreSSL?

You'll need to add the NameConstraints extension to the request using LibreSSL's config file.  The following example is an extract - you'll need to add the various sections to your current config file and tweak the constraints:

[ req ]

# Don't prompt for the DN, use configured values instead
# This saves having to type in your DN each time.

prompt             = no
string_mask        = default
distinguished_name = req_dn

# The size of the keys in bits:
default_bits       = 4096

# The extensions added when generating a CSR
req_extensions     = req_ext

[ req_dn ]

countryName            = GB
stateOrProvinceName    = Somewhere
organizationName       = Example
organizationalUnitName = PKI
commonName             = Example CA

[ req_ext ]

# Extensions added to the request

subjectKeyIdentifier    = hash

basicConstraints            = critical, CA:TRUE
# basicConstraints          = critical, CA:TRUE, pathlen:1

keyUsage = critical, keyCertSign, cRLSign

# Policies and constraints are not recommended for Root CAs
# But could be enforced on subordinate CAs

nameConstraints        = @name_constraints

#policyConstraints = requireExplicitPolicy:1

#inhibitAnyPolicy = 1

#certificatePolicies = @CertPol

[ name_constraints ]
permitted;DNS.1 = example.org
permitted;DNS.2 = example.com
permitted;dirName.1 = style_1
permitted;dirName.2 = style_2

[ style_1 ]
C=gb
ST=somewhere
O=example
1.OU=head office
2.OU=admin

[ style_2 ]
1.DC=org
2.DC=example

[ CertPol ]
policyIdentifier = 1.3.6.1.4.132473
CPS = http://pki.example.org/cps.html

If you're not using the default configuration file you'll need to add -config <config file> to your command line.

Note: I've not tried this on LibreSSL - only on OpenSSL but I believe both use the same syntax.


Unlike PHP, Angular is a frontend framework. All frontend code is visible to the end user.

All network calls are also visible to the end user, even if it's encrypted with HTTPS. Encryption will only protect against man-in-the-middle attacks. An IP whitelist will not.

Although only a whitelisted IP can successfully receive data back from the REST service, any unencrypted data is susceptible to being read and modified by anyone snooping on the network between the client and the server.


Hardening ciphersuites on Windows Server 2012 R2

Yes, it is ok to have CBC ciphersuites in the list as long as SSLv3.0 is disabled.  The issue is not the CBC mode itself, but the SSLv3.0 specification for the padding format.  The padding format in TLSv1.0 is more restrictive, so the malleability required to mount the POODLE attack no longer exists.


Intercepting AJAX request and response using BURP

Are you intercepting all requests or just "in scope" requests? Could it be that the logic in the JavaScript code tries another domain if it does not get a timely response - one you are not intercepting.

Another possibility is that there's a client-side cache of responses that is accessed if a timeout elapses. Maybe Burp Intercept is causing the timeout so the application simply accesses its local storage.

Have a look at the application's client scripts to find out exactly how this works. Also examine the full proxy logs in Burp to check you are not missing any requests.


In most cases no.

The largest torrent communities do not allow any type malicious activities and uploaders are most of the time very trusted members of the community. Any attempts to spread anything are countered very fast.

Of course, a smaller site can have the objective to trap and infect users, but it will be fast to spot and the community will know.

As for the actual cracked software, the main groups that are now mostly veterans in the industry do not add any type of spyware in their releases. The exceptions to this are so few that you can count them by fingers compared to the thousands of releases done by each group.

Note that anti-viruses can detect a group release as dangerous, but that is normal behavior.

Why do the groups do it ? Well, because they can and because it teaches a lesson to the developers. Developers since many years ago focus on anti-piracy instead of the quality of the product. They end up making DRMs so bad that not even legit buyers can properly use the product (see examples like securom). Contrary to that, the ones that invested in product quality instead of copy protection and did not even use a copy protection had larger sales than the over-protected ones. So the DRM-supporting developers defeated themselves because they had no desire to make a good product and they wanted only massive sales instead. The situation is becoming even worse today with the all games going MMO and software going sub-based system. Developers scam the clients out of their money with pre-release packs and then the client ends up with a disaster of a product (see the recent example - Fallout 76 aka Failout 76).

Yes, there is a reputation system between the big groups and practically who releases something first has the biggest rep, but sometimes they can hurry to much and have a bugged result, in which case another group makes a 'proper' release and bashes a little the initial group. Such cases are relatively rare though.

As for the clients, in many cases (and since many years back) it is more convenient to use such a software because it's actually cleaner than the original. All the crapware that could interfere with the functionality of other things is removed and you get what you would actually want: a working game or program that does not break anything else in order to work. Many preferred years back to actually get (buy) the original games but use a cracked version because it actually worked better and did not break anything in the system.

Note GOG (Good Old Games) managed to make deals with the big companies and what they actually sell is copy-protection free. This is a big thing, very helpful for users overall.

So form a security perspective, as example, I can hands down say that a release from a group (or an official GOG one) is safer to use than the original, even today. Today copy protections are less system-damaging overall, but you still usually have to install various game clients or other programs just to make your original games work and in many cases you need constant internet connection which is another inconvenient. Each big company has its game client so you'll end up pretty much with about 10 useless things running in background only for your favorite games to work.


Does keystore has benefits over just encrypted properties?

What is the benefit of using the "proper" JKS keystore over something like AES encryption over just plain property file?

One point is that you would need to manage that encrypted file yourself.

And you cannot make use of other keys and certificate authorities that the user might already have defined.

  Why do keystores exist, which benefits do they provide over encrypted properties?

Keystores abstract different ways of managing keys and certificates. Certificates are not always stored in local files. Sometimes they are accessed over the network and in many cases the certificate store depends on some hardware device (like id card readers).

These hardware keystores often do not allow the extraction of private keys from them, in order to keep them more secure. Instead, they provide a programmatic way of signing and/or ciphering data.

Several devices exist. So the keystore manager in the computer needs to use different protocols and drivers to access these hardware keystores.

For example:

PKCS-11 defines an API to access cryptographic devices.
PKCS-12 provides a standard to store keys and certificates in a file.

The JKS abstracts and allows you to access this whole ecosystem of keystores.


Why is it a good idea that X.509 digital certificates have an expiry date?

The official reason why certificates expire is because of revocation. A certificate is "revoked" when its issuer asserts that the certificate contents are no longer to be trusted, for some reason which needs not me specified. It is like a "cancel" from the CA: the CA signed the certificate, but now regrets it.

A common reason for revocation is when the private key is suspected to have been stolen (e.g. a smart card was lost, so it might be in the wrong hands).

Revocation works by adding the certificate serial number in the Certificate Revocation Lists that the CA publishes regularly. These CRL are signed (usually by the CA) and people who use certificates (e.g. Web browsers, for SSL server certificates) are supposed to automatically download the newest CRL to see whether the certificate they are about to use has been revoked or not.

Without expiration dates, CRL would grow indefinitely, and become too bulky for usage. With expiration, certificates which are expired are removed from the CRL; in that sense, certificate revocation behaves like an hastened expiry. So there you have it: certificates expire to keep CRL small.

(If certificates were very short-lived, and renewed every week or even every day, then we could get away with no revocation support at all, which would be cool, but this would require some sort of automatic renewal, which has its own set of potential issues.)

CRL size is the theoretical reason. The practical reason is that commercial CA really love it when customers have to buy a renewal every year.

An argument can also be made about key sizes and algorithms. Certificate renewal is a good opportunity for enforcing a new algorithm, or a larger key than previously. This is a smoother mechanism than having to revoke old certificates when their key size becomes "too small for comfort" with regards to cryptanalysis advances.


How to defend against a CSRF from the same website?

Well, the CS in CSRF stands for cross site.

But generally, the attack scenario you describe should not be possible for two reasons:

GET requests should not change server-state, so they do not need any CSRF protection.
Requests that do change server-state should be protected via a token. This token should not automatically be added to user-supplied data, and an attacker cannot create a link or form containing this token, so even requests from the same site will be blocked.

If you use a referer-based approach to CSRF protection (or if you automatically add a token to all links or forms), and if GET requests change server-state (or if POST requests can be converted to GET requests, or if you allow the user to post form tags) you should:

Strongly consider your approach in general. You are not following best-practices regarding security or web development.
Not allow users to post excessive HTML. Especially form tags which are needed for POST CSRF should not be permitted, as they allow a number of other attacks (stealing of secret information, phishing, etc).


First of all insure that each OAuth provider actually verifies the users email address.  Google and Facebook do this, but not every site will verify your email address (reddit is an example).  Google and Facebook are on the ball when it comes to security,  and I doubt they will be the weakest link.  However,  defense in depth is admirable quality.

A simple solution to the problem of using the email address as the unique identifier is to email the user and ask them to click on a link which confirms that both OAuth providers should be linked.


Can my software get FIPS 140-2 certified?

My understanding of the FIPS 140-2 standards, unfortunately, aligns with your fear.

As far as I understand, the FIPS 140-2 standards are about proving that you handle private keys in a responsible way. If your software lets Bouncy Castle touch the private keys, then even if you wrote the most secure software in the world, your overall product is only as secure as Bouncy Castle :-(


A good thing about macOS is that applications must be cryptographically signed.  But if you want to launch an application that is not signed, you can add an exception (that's why macOS typically only asks once).  By copying your home directory on a clean install, you don't migrate these exceptions, which means that any exceptions must be added again.

If you try to launch an application and macOS says it can't open it because it isn't signed, you should download it again if you want to be really sure.  If it only asks if it's okay to open it, it's correctly signed and thus not changed from its original.

However, there are two things that could go wrong:  Some programs run scripts, which are not cryptographically signed.  If someone were to change the script but not the binary, you'd never notice.  Also, if you copy the Library folder in your home directory, it may contain services that are started automatically.  I'd recommend not copying the Library folder, but just keeping it around in case you need something.  The same goes for dotfiles in your home directory.

All in all, there are some small risks involved in re-using your home directory, but unless you're really paranoid you can manage to get it relatively safe.  I myself consider it safe enough.


How to crack a password given its hash and its possibilities

Hashcat is used to crack specific hashes such as MD5, SHA-256, bcrypt, and a whole lot more. Hashcat has specific rules it can include if it cannot crack the has with the word directory. Hashcat requires a password directory so it can bruteforce the hash. As an example, I did -1 ?l ?1?1?1?1?1?1 to show the custom character set with -1 (you can have 4 i think) ?l is my charset (all lowers) it also allows ?u ?d ?s ?a for uppercase, numbers, special chars, and all ?1?1?1?1?1?1 is a mask.


Suspected fake torrent peers with "client_test" ID

I think it refers to iknowwhatyoudownload.com

This site made by russians and collects information about what you downloading and publish it. They are most often connecting via DHT and PEX.


Is my client challenge authentication secure?

This challenge response protocol doesn't really authenticate the server. Here a guid is shared with the server but the trust actually depends on the keys of the server and the client. Why not simply use those keys for communication then?
My recommendation would be to have a following mechanism:

The app generates a random GUID and encrypts it with it's private key
The server validates the freshness of the GUID and then creates a session key to be shared with the app. The key and the GUID are sent to the app by encrypting with the client's public key and signed with it's own private key.
The app decrypts the session key and sends the GUID encrypted by the session key to the server.

This way, you have a two way authentication if you have proper replay detection in place. The use of session key mitigates the risk of your key getting exposed.

If you however want to go ahead with your approach, here are a few pointers:

  To prevent any random website to communicate with the app, we have decided to implement the following automatic challenge mechanism, using asymmetric public/private encryption.

The app is totally dependent on the website. If it doesn't trust the website, how can it trust the messages that it is receiving from it?

  The app checks the signature against the token (using the server
  public key), and checks that the decrypted data matches (using its own
  private key). If they both match, the server is authorized to do
  futher operations.

What if someone does an XSS on the trusted website? The script may change the IP address/identifier of the server when it sends the response to the app. This way, an incorrect server is authenticated.

In order to completely answer your question, we would need more information on your implementation.

Do you trust the security of the website that the app is using?
An attacker my use the website as an attack vector to meddle with your communication.
Is the website communicating with the server using TLS?
If it is not over TLS, any party can act as the website to the server and keep it busy with new/repeated guids.


Would a VM such as Virtualbox be my best option for everyday security while working?

By using the same VM for browsing, word documents, and email, you are exposing all of your data to the same level of risk.

Instead of doing all of this activity in the VM, consider doing your browsing and email in the VM, but the contract work and bookkeeping stuff on the host OS. That way if you get phished, the attack is limited to the VM, and can't do really nasty stuff like encrypt your docs and hold them for ransom.


SQL Injection Escaping Challenge Security Shepherd

Short answer: Abuse how their escape works. Try \' OR 1=1; --.

Long answer:

Their escaping function works by replacing every ' with \'. All of them, including ones already preceded by backslashes. That means that if they see \', that'll end up becoming \\' -- an escaped backslash, followed by an unescaped single quote.

After that, it's standard SQL injection. OR 1=1 gets every row in the database, ; terminates the statement, and -- comments the rest out, so that their close quote, end of statement, other conditions, etc. get ignored.


Protecting Passwords Using Short Hash Length

I'm not aware of anyone doing this, currently or historically.

I see what you're getting at -- resistance to password discovery -- but increasing the likelihood of collision as a way to mitigate offline attacks is of dubious value. Any potential benefit of doing so is outweighed by the drawbacks:

If a specific user is targeted, unless there were many collisions, it would be easy for the attacker to try all of the collisions against another site or leak until they got a match ... which would confirm the real password and cancel out any benefit from the collisions.
As the number of collisions goes up, the risk of an online false positive for authenticating (with the original site) goes up.
This also means that the trustworthiness / nonrepudiation of the authentication is reduced. Someone else other than the user could (theoretically) log in as the user, without the user's actual password. Usually, the risk of this is effectively zero in the real world when using a sufficiently collision-resistant hash function. But by deliberately seeking out collisions, it could be argued that you are not following the best practices that ensure nonrepudiation in practice.

Instead, you can get a lot of the benefit you're looking for simply by storing extra private material (an encryption key or a pepper) in an HSM. If implemented properly, this would get you some real resistance to offline attack - without the drawbacks of frequent collisions.


I would like to bring your attention to a malware called Trickbot. This TrendMicro article on Trickbot should bring you up to speed.
I have worked with the malware a couple of times in recent months and you might be interested in one of its capabilities.
It is able to steal email credentials & address-books. The compromised sender email address will then be used to spoof the subsequent mass emails to the potential victims in the address-book.
Essentially by doing this, the chances of this malware infecting another user by clicking it is way higher. The intention is to let the victim's guard down by putting a familiar name to the malicious email. Victims would assume that the sender is legitimate, like a friend or a colleague, and would then click the link and compromised itself and the cycle continues. So let's say an address book of 150 recipients, all it takes is one out of the 150 to keep the chain going.
You might've witnessed this malware first hand, notify your friend through proper channels, and see what is going on.

as it feels like a personal attack.

I can see why you would feel this way, I am not ruling out the personal attack reasoning. But I am just letting you know that there is a way that there are automated/customized personal attacks being crafted where you are just a potential victim of another victim.


How do I verify that my TurboTax software is legitimate

Some download websites show the file hash of the installer on the website ... so then you are supposed to download the file , calculate the downloaded file hash , and compare to see if the hashes match to confirm the download wasn't tampered with.

Similarly if you have a known legit version of the software and a questionable copy of the same version of software you can get the file hash of each of the files and compare to ensure it they are the same and haven't been tampered with.

Note this only works if the 2 pieces of software are the same exact version because file hashed will change version to version.

Here is samples of how to get file hashed on a Mac

https://www.dyclassroom.com/howto-mac/how-to-verify-checksum-on-a-mac-md5-sha1-sha256-etc


How to get top management support for security projects?

Although there are exceptions, generally managers do things for one of two reasons:

Doing it will make them look good
Not doing it will make them look bad

Now apply this to your management to see who the key stakeholders are:

Stakeholder 1: Somebody's allocated money for anti-virus, which ought to make the manager who owns the AV  look good. However, if nobody is using it that will make them look bad if it gets out.
Stakeholder 2: If the company was hacked because AV was not installed someone will look bad.
Stakeholder 3: The company has spent money on AV because the financial benefits of the AV are greater than the financial costs of deployment, which should make someone look good. However as it is not being used properly  therefore the company is incurring the costs without the benefits. This financial drain might make someone look bad

The stakeholders all may be the same person, or it could be separate individuals. Either way these are the people you need to reach. As for how to reach them the first rule in dealing with management is to come to them with a solution, not a problem. If you dump the problem on their lap they will send you on your way telling you to come back when you've figured it out, whereas if you come to them with a solution you are much more likely to get what you need. Remember that managers exist to make work for you, they don't want more work to do themselves, so if you go to them with something that will create work for them they will dump it right back on you. Also, doing the work ahead of time shows you understand the problem and will give you more credibility.

So, make a plan to fix the problem. What's it going to take? Money for extra help? A training program? Figure out how you will fix it and how long it will take. Put it into a powerpoint with 3 simple slides and put it in front of the key stakeholders. Get one of them to "Own the problem", as then they are taking responsibility for it getting fixed.  Start issuing a monthly report showing AV uptake and distribute it to the stakeholders.

Remember what motivates management: it's not about doing the right thing, it's about visibility. Make the problem visible and make them own it.


Password Encryption For PHP 5.3 or Should We Update to 5.5+?

Upgrading to the latest supported stable PHP branch is the recommended route plain and simple.

That being said, you've noted that you're with GoDaddy. Which of their services are you using for the project? If it's their shared hosting line, or any line that offers cPanel, upgrading PHP versions shouldn't add anything to current costs. Any web hosting provider with common sense should be able to easily run EasyApache, cPanel's built-in utility for updating and upgrading Apache, PHP and various other pieces of software.

If you're on a VPS, Cloud Server or Dedicated Server, the above still applies if you're using cPanel. If you're running barebones and someone is managing everything from the CLI (nice!), upgrading is a bit more time consuming, though not by much. They'll need to make sure the correct packages are installed before compiling, or, they could simply use built-in packages offered by upstream.

Even if you rely on certain packages, chances are upstream repositories can cater to your needs. If not, there's always building on to an existing package.

That said, if your boss is dead-set on sticking with dated releases, when it comes to PHP 5.3.7+, I'll reference ircmaxwell and paragonie, both of which are available on GitHub.

password_compat - link

The purpose of this library is to "...provide forward compatibility with the password_ functions that ship with PHP 5.5."

random_compat - link

The purpose of this library is to provide PHP 5.x support for random_bytes() and random_int() (from PHP 7.x). This isn't an alternative to password_compat, it's simply another compatibility layer that will allow you to bring features that you're not going to be able to use (unless you're able to upgrade, of course) down.

Note: If you're going to use random_compat, make sure you're using a stable release instead of the master (as noted by the author).

github.com/paragonie/random_compat/releases/tag/v2.0.2


Is this private network authentication system secure?

If you have done some design work, the best would be now to do some Threat Modelling session, where you could identify all possible flaws. AuthN and AuthZ design is hard and requires experience.

I will not do the Threat Modelling session for you as 1) I do not know all the context and requirements 2) this is not a place for that. But from my experience, I can give you some advice.

First, please remember about the Security in Depth principle which states you should secure your solution on every layer. There is nothing worse than to follow the Security by Obscurity with the private area. You cannot rely on that it is not visible for public users or is not accessible, as this is in private network. If the public application is somehow connected with private backend/API and private app is using the same backend API, you should consider both at the same security level.

Second, try to design a solution where you never send the security token (access or refresh) to the user-agent (browser) as this is mostly considered insecure. Securely storing tokens at the client-side is very hard to achieve. If you design the web app with a PHP backend, stay with the tokens at the backend and use it from there. This is correct for both public and private app.

You have not wrote explicitly that you will be using the OAuth2 and OpenIdConnect so if you consider using access token please remember about those specifications and strictly follow those during implementation. Use certified software for AS and if you have possibility certified client's libraries.
OpenId Certification


How should I approach my security team regarding aggressive group policies (VBA / macro blocking)?

Make sure they understand that you are aware of the Risks of enabling macro's even if its for a select group. Then explain them for who and why enabling marco's would improve [insert your reason] (for example productivity). Then you can always suggest one of the options you listed above, however I would suggest you only come up with these solutions if they responded well to the conversation above.

I always take users way more serious when they explain that they understand the risks, explain why it is needed and suggest possible solutions

probably this reply belongs in the comments, so if someone can move it


ids - How do I match any string in a list of snort contents?

It is correct that it is possible to use pcre. In this example it would look like this

alert tcp any any <> any any (pcre:"/TestA|TestB/"; sid:1000000; msg:"Syntax correct!";)

As of now I do not know any other way of doing it