Remove less secure ciphers from WHM by decrpyting different convoluted references to the same ciphers I have previously removed less secure ciphers from WHM (Web Host Manager) however it has been a while and I want to learn how to fish, not be handed a fish.
The trouble seems to stem from the fact that there is little-to-no consistency in how ciphers are referenced or even where they are defined.
WHM Cipher Definitions
Ciphers seem to be listed in two places: Exim Configuration Manager and Apache Configuration ⇨ Exim Configuration Manager.

The Apache Configuration has a field "SSL/TLS Protocols" which is currently defined as ALL:!ADH:!AECDH:!EDH:!RC4:+HIGH:+MEDIUM:-LOW:-EXP.
The Exim Configuration Manager currently has a field "SSL/TLS Cipher Suite List" which is set to ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256.

Definition of Weak Ciphers
Here is the SSL Labs test for my domain. I have everything except TLS 1.2 and TLS 1.3 disabled and many less secure ciphers disabled. The test lists the following ciphers as being weak:
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) ECDH x25519 (eq. 3072 bits RSA) FS WEAK 128
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) ECDH x25519 (eq. 3072 bits RSA) FS WEAK 256
TLS_RSA_WITH_AES_128_GCM_SHA256 (0x9c) WEAK 128
TLS_RSA_WITH_AES_256_GCM_SHA384 (0x9d) WEAK 256
TLS_RSA_WITH_AES_128_CBC_SHA (0x2f) WEAK 128
TLS_RSA_WITH_AES_256_CBC_SHA (0x35) WEAK 256

I attempted to "translate" though after updating the values in both sections and running cPanel's AutoSSL I still got the same results on the test.
Translating Cipher References
I attempted to reference the TLS 1.2 standard as well as some documentation from OpenSSL. I made numerous other search queries and spent hours reading through documentation, standards and forums without luck.
Here is my attempt to make the lists look more similar to each other:
From the Exim Configuration Manager:

ECDHE_ECDSA_CHACHA20_POLY1305
ECDHE_RSA_AES128_GCM_SHA256
ECDHE_RSA_AES256_GCM_SHA384
ECDHE_RSA_AES128_SHA256
ECDHE_RSA_AES256_SHA384
ECDHE_RSA_CHACHA20_POLY1305

From the SSL Labs Test to be removed:

ECDHE_RSA_WITH_AES_128_CBC_SHA
ECDHE_RSA_WITH_AES_256_CBC_SHA
RSA_WITH_AES_128_GCM_SHA256
RSA_WITH_AES_256_GCM_SHA384
RSA_WITH_AES_128_CBC_SHA
RSA_WITH_AES_256_CBC_SHA

The list says to remove two ECDHE and the rest don't have ECDHE. In that example how do I remove something not defined? Secondly it suggests removing CBC though that is not defined in the first list.
Desirable Answer Format
Learning is the detection of patterns so I'm really looking for an answer with a table where column A lists the ciphers from the SSL Labs test and column B references how they are referenced (to be defined (for stronger ciphers) and disabled for weaker ciphers). Just enough that I can detect the pattern of how the test references the same ciphers as Apache (or whichever software directly handles all of this). A good reference URL with such a table (and where on the page if it's more than just a few paragraphs) would be very helpful.
It would also be incredibly useful to know how to have the server define a preferred cipher and to know which is considered the strongest if possible please.

For now, you probably would be best and most quickly served by relying on others who have studied cryptography and network security, and who offer their recommendations freely as a service.  Sites like Mozilla's SSL Configuration Generator are a great way to obtain a clear list of ciphers that best meet your security needs.

Once you have solved your immediate problem and have your services configured securely based on the recommendations of experts in the field, you can consider spending more time digging deeper into this topic. But it's a deep field; you'll end up needing to understand the different families and types of cryptographic algorithms, key sizes, protocols, weaknesses, attacks, public key infrastructure, TLS, and network security.

The problem with cryptography is that it's hard for someone outside of the field to know how to compare the strengths of the various algorithms and key sizes, or which protocols or algorithms are known to have weaknesses.


Does content-type header having a blank value in the response body, cause any security problem? I have one HTTP request which is responding with no content value (No response body).
Is it necessary to have a content-type header specified for these kinds of responses?

A Content-Type header is applicable to a response with a body per RFC 2616:

When an entity-body is included with a message, the data type of that
body is determined via the header fields Content-Type and Content-
Encoding.

By extension, it's not necessary if there is no response body, as you're describing.
It is a SHOULD and not a MUST, so it is RFC-compliant to not include that header even if there is a response body:

Any HTTP/1.1 message containing an entity-body SHOULD include a
Content-Type header field defining the media type of that body.

As @Elhitch says, when the client has to guess what the Content-Type is, it's possible it will guess wrong with negative implications.  But that doesn't apply to your use case of 'No content value (No response body)'.


Checksum Calculation for Source Code tar balls downloads Http sites like OpenSSL provide checksum for each source code tarball available for download
HTTPS sites like GitHub usually do not provide checksum with 'download zip' option.
Some sites although HTTPS do provide checksum.

So if one has HTTPS, is checksum not necessary for file downloads?

Please help me with some explanation.

Checksums are there just to inform you that nothing has been damaged during download process. You must know that checksums have nothing to do with security features such as encryption. They are there just to be sure with a certain degree that what you got is what you expected. A more secure and better solution is to check the PGP signature as when you try to download a Kali Linux ISO image file.

As for HTTPS, there is the famous MITM attack performed practically for example using the notion of SSL striping developed by Moxie Marlinspike.

What I want to say is that when it comes to security you can never be safe 100%, but in your case it is better to download something from a website that combines reliability (checksums) and trust/security (HTTPS)


Associate API key with user I am creating a public API that will require API key authentication. When a user wants to register a new API key, they send a request to one of our endpoints with a list of permissions they want. We generate a unique key (uuid4) and send it back to them encrypted by TLS.
I am planning to hash the key that was created and store it as the primary key of a database. On each user request we can rehash the key they send in the headers and index the database to check if it is indeed one of the keys we've created. We'll also have their list of permissions stored in a column which we can use to authorize them for certain routes.
Question: My concern is how we're going to associate an API key to a user. Say a user wants to see a list of API keys they've generated. Is it now impossible for us to produce this list? Also say that a user loses their API key. How would we identify which API key has been lost, so we can at least delete that record in the database? I'm wondering how this stuff is usually handled.

If you hash the keys, it would not be possible to show the keys to the user ever again. Hashing can not be reversed. You can only check if a given key is linked to the user.
What is oftenly done for APIs is to create a key consisting of a public and private/secret part. The public part can then be stored in your DB, whilst the secret part follows your current flow of storing/hashing. You can then list the public keys for the user (which he can then delete if lost).
Upon authentication the user would need to provide both parts which you can check in your DB. Another option would be to request a temporary token with the public/private keypair, this token can then be used for further API calls. Note that the token should have a limited lifetime and of course must be unique among all users.


compare cipher suites between different OpenSSL Versions How to find cipher suite changes within different OpenSSL versions ? Let's assume that  the  OpenSSL package was update to  openssl-0.9.8e-36.0.1.el5_11 and I'm able to find from release notes what was it's version prior to the upgrade. Thanks to "Steffen Ullrich I know how to run a command to list the cipher suites for the current version but is there any repository that would allow my compare both OpenSSL versions in terms of cipher suite changs?

thank you

Cipher suites can be enabled or disabled at compile-time, which is why you'd want to be able to run the same command against both versions of OpenSSL: so you can see what was actually compiled into the package. Someone could also have backported certain suites into (or out of) the code before compiling and releasing the packages you have. Given that long version string, you seem to have received OpenSSL from some third-party vendor (CentOS?) who is not providing vanilla OpenSSL, so the official OpenSSL changelogs won't tell you what other changes have been made: you will probably need to contact your vendor for their changelogs.

As a starting point, or if you just care about what could have been compiled in assuming the code was taken directly from OpenSSL without any changes, OpenSSL provides their changelogs by version so you can see a technical list of what was changed in each version (for example, 0.9.8c removed 3 ciphersuites and added 1).


Explain to non tech savvy person how to check that your connection to mybank.com is safe? I was reading the security advice given by the Swedish Bankers' Association. They included these two pieces of advice (my translation), that I assume is to teach the user to check for SSL/TLS and protect from SSL-strip:

  Check that it is the address of your bank in the address bar of your browser before you log on to your internet bank.
  The web address on the log on page should start with https:// and a padlock symbol should be visible in the browser.

This is a fairly important topic, since some Swedish banks serve their main page (where the link to the internet bank is) over HTTP, and none of them have implemented HSTS. However, I see a number of problems with the advice given:

How do I check that it is the adress of my bank? An ordinary user would probably go scanning the URL for the name of the bank, and be satisfied when they find it. So armed only with this advice you would easily fall for mybank.com.evil.com/mybank.com. (Unfortunately the URL for logon pages are often not very clean, so customers would expect a messy URL.)
"So I remember there was something with an h and a couple of p or t or something I should look for. http://? Yeah, that was probably it. Must be safe."
Look for the padlock in the browser? Seriously? You can just include it in the page, don't even need to use the old favicon trick to fool someone reading this advice.

Naturally I started to think about what some actual good advice would be to give on this subject, but I found it surprisingly hard. The advice should be (A) short, (B) easy to remember and understand even for a user with little technical knowledge, and (C) apply to all fairly modern browsers. Imagine you have 30 seconds to explain this to a not very-tech savvy relative.

Any suggestions?

Why security indicators fail vs. phishing

There is no action that can be taken that is economically viable. Put another way, it's too effortful to defend against phishing attacks. See 'So long and no thanks for the externalities' for an example on the US economy and information workers.

You are correct that checking for URL correctness is error-prone, and HTTPS passive security indicators are a big joke. They go unnoticed, they have for years been meaningless (what does it mean if the keypad is blue or green or grey!?), and were they to be more prominent / active, people would get habituated to see them and attacks could simply buy a certificate for a rogue URL so that the name checks out.

The solution to this issue must be architectural, rather than rely on wasting the time of humans and on said humans to not make mistakes. Why is it that Web browsers don't have a centralised, trusted repository from which to verify the URLs of banks and reputable payment/transfer websites, so that unique security indicators can be used for such sites?

Solution: make users rely on a secure interaction rather than make them deal with the limitations of indicators

I would tell people to go onto the website once, make sure the URL is correct once (you can help them), and save it in their favourites. And use exclusively the favourites button so they know they are on the right website. I would tell them (without details) that you never know where you'll land when clicking a link or searching for a website but the favourites button always takes you to the right place. How? Doesn't matter.

At this stage, users are guaranteed to land on the correct URL. If an active MITM attack is occurring, they will get the scary certificate warning, which they normally don't have for their banking website. Warning habituation is a very real thing, and figures are missing to determine whether users would pay attention to it in the context of a previously trusted banking website. Improving on this warning (e.g. making it scarier for bank sites) would also require knowledge of what is and isn't a bank's website.


How to set up firewall on Mac and/or iOS? I think it is called firewall. I am basically trying to set up something that tells the Mac to not connect to internet without active VPN on. So all internet has to connect via VPN. How do I do this?

I want to know it especially for the Mac, but if you know about it for ios, too, it would be helpful, too, so either one, thanks.

Mac OS X comes with two firewalls installed by default. One visible is System Preferences is the application firewall and won't be of any help in this case.

The other is a packet filtering firewall called pf, however it does not offer a GUI.

Basically you need to block all outgoing connections on your regular network interface except the one to the VPN server and pass all traffic on the VPN interface.

The configuration of the firewall is in the /etc/pf.conf file. You need to add at least the following rules (the following assumes your regular interface is en0 and VPN's tun0).

block out on en0 from any to any
pass out on en0 from any to <vpn_server_IP>
pass out on tun0 from any to any

Remember that the last rule "wins".

After modifying the contain file run to load the rules:

pfctl -e
pfctl -f /etc/pf.conf

To disable the firewall run:

pfctl -d

The rules above are minimal ones for the purpose you specified, you might also need to add a rule to access your local network through the regular interface. Also they block DNS, so you'd need to specify the IP of the VPN server not its DNS name when connecting.


Is there any smarter way to crack wpa-2 handshake? I was testing on my own router that how secure is my password. First I set a random 9 digit number as a password but the aircrack-ng was unable to crack it even in 45 minutes and tried other tools like pyrit, crunch but they also didn't work very well. So, what I was wondering is that the password cracking tools are unable to crack a mere 9 digit no. then how can they crack a strong password (combination of upper, lowercase, numbers, special characters) however it may crack the password but it can take days or even years. And the other way is phishing which doesn't work always.

How does password cracking work in the real world?

WPA2 is indeed a slow hash.  But in the real world, performance is better than you might suspect:

An attacker can leverage multiple GPUs. With hashcat, six GTX 1080s can exhaust ?d?d?d?d?d?d?d?d?d in about eight minutes (and equivalent capacity  - for basic attacks - can be rented on AWS for relatively little money).
Simple brute force and simple dictionaries are just the beginning - other techniques include using rules, masks, combinator attacks, hybrid attacks, and using larger, higher-quality dictionaries made from actual leaked passwords. These attacks are faster than brute force (often dramatically so).
Since most passwords are human-selected and not random, analyzing the context and psychology of the target is often useful - and may be necessary to make any real progress against a non-poor (but non-random) password stored with a slow hash like WPA2.

But if that WPA2 password is truly random, and draws from all four character sets .. six 1080s would take 92 years to fully exhaust the keyspace.


Can my employer track my computer use at home if they pay for my internet access? I work at home, and my company has supplied me with a computer and pays the local cable company for internet service and rental of a modem.  There is no router.  Company policy allows us to go online during breaks. However, as the company computer has a VPN, smart card and is loaded with tracking software I would rather do that on my own computer.

Can they track me if I connect my own computer to the internet service they pay for?  And would it make a difference if I bought my own router so both computers could be online at the same time?

Your company could potentially see everything your ISP (i.e. "the local cable company") can see. Since they are the ones who pays the bill, they could call up the ISP and ask to see the logs. Depending on the company and the jurisdiction, they might not let your employer see the logs, and there might not even be any useful logs. But if we focus on the technical aspects, the answer is that whatever your ISP knows, they could potentially tell your employer.

So what does your ISP know? Check out this old answer of mine. In this case your ISP are the ones that own the network.

I don't see how a router would make any difference here.


Brute force a hard drive when most of the password is known I need to access a hard drive that is encrypted with LUKS. The password provided is incorrect, however it is only incorrect by a character or so.
The password itself is very strong and above 30 characters in length. How would one go about brute forcing their way into the hard drive with this information in mind to access the data or should the data loss simply be accepted?

John the Ripper Jumbo has LUKS format available.  Use luks2john first, and then use JtR normally, walking through the characters one at a time to see which is wrong.


Cant access most websites using a fake AP created by aircrack-ng suite The question , Setting up a fake AP - problem with iptables and DNS server , I posted before was answered and fixed, to not confuse people looking for the same problem in the future I wanted to post a new question that follows the problem I had but doesnt really have anything to do with it,since the former question was about my iptables and led to using a DNS server, this question is only about DNS and my hosts configuration or so I suspect, and the topic of this question is actually quite different.

I'm having some difficulty accessing websites using a bridged AP i made with aircrack-ng suite.

I cant access websites such as : yahoo, hotmail, google, CNN etc.. . But I can access several websites like facebook,youtube and addresss bar search with google engine works fine.
I have set my etc/dhcp/dhcpd.conf and my routing & IP tables entry as follows;
running iptables configuration and at0 routing rules(bash file):

#!/bin/sh
ifconfig at0 up
ifconfig at0 10.0.0.1 netmask 255.255.255.0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -P FORWARD ACCEPT
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

running DHCP server : /etc/init.d/isc-dhcp-server start

/etc/dhcp/dhcpd.conf file:

authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 10.0.0.0 netmask 255.255.255.0
{
    option subnet-mask 255.255.255.0;
    option domain-name "freewifi";
    option routers 10.0.0.1;
    option domain-name-servers 194.90.0.1;
    range 10.0.0.10 10.0.0.20;
}

The DNS server im using is the best offered DNS server using NameBench.py.

I'm getting this message on google for example, and its the same for many more websites:

I can ping, but I cant apt-get or use wget, meaning I dont really have access to the internet(?)

Using Kali Linux, MTU is 1500 , my speed is 5Mb/s using wireless connection.
What is the problem here?

UPDATE
I am able to connect directly to websites that I couldnt before if I type in the address bar:  https://www.yahoo.com but if its without https it says unable to connect.

I read somewhere that mozila only allows HTTPS connections or it could be the Kali forcing HTTPS to make it secure. On WireShark I see many TCP DUP ACK'S and RST'S.

After some comments, you are on the road... now you must locate exactly your problem. To launch sslstrip I can recommend you this nomenclature:

sslstrip -f -p -k -l 10000

-l to listen on port. so 10000 is default, you can avoid this or change port.
-k this kills possible previous sslstrip sessions in progress, recommended.
-f this change the favicon to a lock similar to used in https pages. It rocks if the victim uses old internet explorer versions, useless on chrome and firefox.
-p log only ssls POSTs

Of course if you launch this, you must activate the rule: iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000 as we said in previous comments.

I think you are doing good the commands... but sslstrip is a technique on which it depends not only on your side. If the "victim" use good built links like https://whatever.com you have nothing to do. He/she is going to ask directly always for an encrypted page.

So many people say "HSTS is the solution to sslstrip". And this is NOT TRUE. I did sslstrip a lot of times testing access to pages with HSTS and it works... they key as I said is the victim must do the http (without "s") initial request.

Another decisive factor is that not everypage can be sslstripped if you use common browsers on last versions since some years ago... I mean, if you use modern Chrome, Firefox or Internet Explorer for example... these browsers have an internal list of known ssl sites. That sites (like twitter or facebook for example) will never be sslstripped because the browser knows that ALWAYS must look for them using https even if the user did the "bad way request" putting facebook.com without specifying the https:// before. I guess these sites pay to the browser's companies to be in that list.

There are more advanced techniques to do sslstrip even to pages in that lists... like Delorean attack, or using sslstrip+ also called sslstrip2 which requires dns and proxy etc... but are more complicated.

I suggest to you try against not very known ssl pages because in that way there are less possibilities to crash in your tests against a site which is in that browser internal lists.

Good luck!


When should a DNS entry be cached? What conditions should not be? How do I determine the TTL? I'm writing a DNS resolver and am building a spreadsheet of when a DNS record should be cached, and not be cached... but it's harder than it first looks (to me at least).

Is there consolidated test cases for DNS caching that I can refer to?  All the RFCs seem to have many revisions, and the requirements on caching are inconsistent at best.  This is further complicated by the re-definitions of the SOA record.

An improperly cached DNS record can mean that I'm poisoning the cache with invalid records.

The most relevant example I can think of is where a fake referral is generated for an NS, A, or MX.

When should validation of that referral be done?
How is that referral validated?
Should I traverse from the root servers again?

See http://en.wikipedia.org/wiki/DNS_cache_poisoning and the many entries linked from there.

A short answer would be that you should only cache the answer when it comes from a server that you would normally trust for the the relevant domain.


Is it possible to spoof a GPS satellite? If it is possible? Any devices that can be bought to do so.
If not, how are GPS satellites are designed to be spoof-free.

Yes, it's possible — even easy. No, GPS satellites are not designed to be spoof-free.

GPS wasn't designed against satellite spoofing, probably because back then they didn't even dream of someone doing that. Even back in 2008, this wasn't something easy and affordable. From Wired: Researchers Demonstrate How to Spoof GPS Devices:

  Researchers at Virginia Tech and Cornell University spent more than a
  year building equipment that can transmit fake GPS signals capable of
  fooling receivers.

Since then, this has become easier. All you need is a radio signal transmitter and some open-source software. See e.g. GPS Spoofing w/ BladeRF from Crazy Danish Hacker.

Kaspersky's article on Is it possible to guard against GPS attacks? explains how this is not something that could be easily fixed:

  Although the problem has been known for some time, there is a major
  obstacle to developing protection measures — the key equipment is in
  space and will not be replaced right away. GPS satellites emit what
  they emit, and no one can add standard protection tools, such as
  encryption and certificates, to the signals. Security measures so far
  have been more experimental in nature and not for large-scale
  application.


Moving Infected Files to Trash versus Quarantining them When you run an AntiVirus, typically they give you the option of quarantining the infected files. I remember when I was a kid I would move them to the trash bin instead. My question is, which method - quarantining infected files or moving to trash - is most secure? If so, why?

It's my understanding that when we 'quarantine' files the AntiVirus just moves them to another location. What makes this location secure? Can an infected file be dangerous even after being moved to the trash can?

A quarantine is a place for you to review files that caused alerts. It's not about security, but convenience.


Is there any definitive way to tell if an email is a phishing attempt? Is there any definitive way to tell if an email is a phishing attempt? What cues should the "average computer" user employ to detect a phishing email?

There are a number of both technical and non-technical ways that someone can identify a phishing attempt.

Communicate out of Band. The easiest reliable way is to communicate with the proposed sender out-of-band. Call them, send them a what's app if applicable, signal, whatever. If an organization or an individual didn't send you an email they can tell you over the phone. Just remember to use a phone number that is not included in the email.

Proofreading - Much of the spam, even a lot of spear phishing, is very poorly written. Poorly constructed sentences and spelling errors are pretty good indicators of Spam.

Hovering over links - Phishing links will typically be "obfuscated" to look like they link to a login page. For instance the text may be https://login.facebook.com however when you hover over the link you notice it's some long verbose domain name. Tell-tale phishing.
EDIT : As Mehrdad and Bacon Brad have pointed out this method may provide mixed results. Links can be used in a variety of attacks such as CSRF / XSS attacks, and the link provided may also lead to an authorized third party.

Email Headers - Perhaps one of the more tech-savvy way of telling whether or not an email is legitimate is by looking at the E-mail Headers. E-mails contain metadata that states where emails originated from. You can usually tell by looking at the email header if an email originated from an authenticated source with these headers. Note that this is not foolproof as many organizations may outsource mail campaigns, but email coming from a private IP address could indicate a phishing email.

Macros - Does the word doc you've just been sent state you need to enable macros in order to see the document? Don't you go doing that.

Social Engineering - Many phishing email tactics will play off human emotions and employ many well known Social Engineering techniques. Statements like "You must click on this link and re-activate your bank account within 24 hours or your account will be closed" are meant to make the receiver panic. When we panic we make illogical decisions. If you feel an email is playing off your emotions you might be getting phished.

Is this normal behaviour? - Institutions are well versed in the ways of phishing and as such they are not going to ask you to click on embedded links in an email to "reset your password" or "confirm your account". If your spidey sense is tingling, probably phishing.

In my experience there is no one silver bullet in dealing with phishing. During penetration tests spear phishing always works. The above information will help you spot attempts to phish you, but the easiest and most efficient way to confirm or deny a phishing attempt is to call the "sender" to confirm if it's legitimate.


Is it safe to use unencrypted rsync when my backup is encrypted? I've configured something usually advised against, but so far I have evaluated it seems perfectly safe to me. I'd like some opinions since playing with non-encrypted connections for my very sensitive data can be disastrous.

Here's my configuration:

I've set up an rsyncd daemon on my backup server and defined a single backup target in /etc/rsyncd.conf; I don't want to use rsync over SSH since the backup server disallows SSH password logins
The destination for the backup module is /home//.directory used exclusively for this purpose
I've setup a /etc/rsyncd.secrets with plaintext username:password pair used exclusively for this purpose and not matching any local username; Owner: root, permissions 600
I've opened up the configured non-standard rsyncd port with iptables but with a source (-s) restriction of just my NAS

The way I'm using this is:

In my Synology NAS, I've defined an unencrypted remote rsync target in my the Hyper Backup service to connect to the respective remote rsyncd port
I've enabled "client-side encryption" when defining the backup details. As far as I've read up on the way it works, it means the .hbk file it creates and transfers can only be unlocked either using the password, or the private key of specifically the Synology NAS that created it.
I've used a very strong passphrase when defining that backup's encryption
Since I'm using a daily local backup as another Hyper Backup task, I've configured this to happen just once per week as an off-site reassurance

Can you please consider the above and let me know if I'm right in my thoughts that it's safe to use this non-encrypted connection in this manner?

I have so far enabled it for just a small portion of my data, but I'm planning to extend it to all my sensitive personal data as soon as I get your advice :-) Thanks in advance.

Assuming all data to be transferred is encrypted client-side, it should be completely safe in terms of data privacy to use the regular, unencrypted rsync:// protocol. If the credentials used for authentication are also sent in the clear, then an attacker on the wire may be able to use them to modify or delete existing encrypted files. While proper client-side encryption will detect that files have been modified, files that get deleted by a malicious user will be gone.


Cloning external harddrive encrypted by bitlocker using dd Hi I want to know if I use dd to clone an external hard drive encrypted by bitlocker to another external drive, can the clone always be opened using the same password or there are exceptions?

DD is a bit for bit copy, barring disk malfunctions.  The copy should be fine and open with the same key. I've been doing this for years with LUKs encrypted disks with no issues.

Make sure neither drive is mounted when you copy it.
Make sure your target drive is at least as big as your source drive.

Consider your intended usage. If it's just a backup, you may find it more convenient to DD to a file instead of to a raw disk.
Raw disk copies are just like the original and can be mounted and opened the same as the original. You need to be careful about booting and mounting two or more identical clone drives at once as they can cross boot with a partition from drive one and another partition from drive two. They will work like this but you may discover later that changes are not in the drive/partition you thought they were.


Is Kali-Linux operating system is free from virus and worms? Friends, Is Kali Linux operating system is best to use? as a beginner in security domain can I start to go with Kali-Linux OS?? Can all features which i used with Windows can be used on Kali too?

While I would caution you against using any exploit tools behind the firewall of a domain that you want to keep safe, Kali Linux is run by the guys who offer the Offensive Security Certified Professional certification (a very well respected certification in the Pen Test scene, that I am planning on attempting once I get a few more years of experience under my belt).  So, the official download from them should be fine.

To answer your Windows question, no, not all of the features on modern Windows OS will work on Kali-Linux, as it is a striped down Linux OS and there are differences.  I highly recommend that you just buy a cheap laptop off of NewEgg and install Kali over it, or run it as a Virtual Machine on your Windows box.


Bizarre email sent from spam email address with contact details of someone I know and a friend of their's in it Someone I know (call them Darren Smith) recently received a rather odd email. It was sent to their personal email address, emailaddresswithnonameinit@emailprovider.com. The "From" field had "Darren Smith" as the name in it, but the actual email address was ninerandomlettersandnumbers@differentemailprovider.com.

The text of the email is this:

NameOfDarren'sFriend, Are you free at the moment?

Regards,
Darren Smith

I have no idea what this could be, how whatever this is got the name of the person Darren knows, or how it got Darren's original email address. Anyone have any insight as to what sort of attack this is, and what steps should be taken now?

This is a common phishing scam. It is meant to work like this:

Mallory is a baddie and figures out that Alice knows Bob. (Lots of ways this can be done, classic examples are looking on LinkedIn or reading employee lists published on the web.) Often Bob is Alice's grandboss or similar.
Mallory sends a mail to Alice, using a free email account with something close to Bob's name, asking if they are available.
Alice doesn't look too close at the mail, thinks it is genuinely from big boss Bob, and replies.
Mallory does some social engineering, telling Alice a story such as "I am stuck in a meeting, can only email, need to get someone important a last minute present, buy some amazon vouchers and send them to me, I will pay you back from work funds."
Alice buys and sends the vouchers and Mallory's scam has been successful.

There is an extra factor to what you've seen with Darren. Mallory in this case is not terribly bright and has mixed up Darren and Darren's friend.

The correct response is not to respond to the email.


Mutual authentication possible flaw I am taking this mutual authentication example from Wikipedia:

Server sends a unique challenge value sc to the client
Client generates unique challenge value cc
Client computes cr = hash(cc + sc + secret)
Client sends cr and cc to the server
Server calculates the expected value of cr and ensures the client responded correctly
Server computes sr = hash(sc + cc + secret)
Server sends sr
Client calculates the expected value of sr and ensures the server responded correctly
where

sc is the server generated challenge
cc is the client generated challenge
cr is the client response
sr is the server response

I am trying to see if there is a possible security issue here. Assuming we are using a strong hash function and AES symmetric key, do you think there exists a security flaw here?

I think server should authenticate itself first. The problem now is that the client can be fooled to authenticate to a third-party which will in turn actively authenticate to the server, which will complete at server end, even if it fails at client end. The man in the middle could then carry on with actions, even if the client has failed and disconnected for long time ago.

Best way here is to have the sender to send sc, AND hash(sc, hash(secret)) to the client at first step. At second step, before client generates cc, it will check that hash matches the expected value.

By double-hashing the secret, you gain additional security.

Otherwise, the communication goes out as outlined. Then it will be very secure, as the client will refuse to initiate authentication if the server-generated hash doesn't match.


How to detect mimikatz usage on LAN My boss is has made it clear that we need better ways of detecting mimikatz usage on the network- and I would agree. In place already for detection is suricata/ET PRO rule set on a couple of taps. These signatures for mimikatz are included in the ET ATTACK RESPONSE class. This is great but not optimal because the usage has to cross over the "internet" or "datacenter" taps to become visible to an analyst and even then relies on the quality and granularity of the signatures written. So I'm interested in pursuing options or ideas to detect mimikatz at the host level. I have the ability to pull attributes from many many hosts at once with some home grown threading and Python. I just need to know what to look for? Does mimikatz leave any breadcrumbs? Or better yet is there something targetable like a process name or executable path that will be consistent on different platform usage? I'm hunting mimikatz in a Windows environment- the only thing I have found that is interesting is the concept of honey credentials injected into the LSASS- BUT this would need to be a startup script that had admin rights and I do not want admin creds on endpoints. (The injecting creds are fake, but to hit LSASS you must be an admin on the local machine.) there has to be other means of detecting mimikatz in near real time right?

SANS first ran an article on the basics of what you are looking for -- a way to detect mimikatz on the network -- https://isc.sans.edu/diary/Detecting+Mimikatz+Use+On+Your+Network/19311/

However, remember that mimikatz is capable of Kerberos attacks --
https://dfir-blog.com/2015/12/13/protecting-windows-networks-kerberos-attacks/ -- as well as PtH attacks -- https://dfir-blog.com/2015/11/08/protecting-windows-networks-defeating-pass-the-hash/

More on the theory behind the Kereberos attacks is available from Microsoft, including their recommendations for detection -- https://www.blackhat.com/docs/eu-15/materials/eu-15-Beery-Watching-The-Watchdog-Protecting-Kerberos-Authentication-With-Network-Monitoring.pdf

This site also had some interesting log analysis techniques that I had not seen before -- http://securitynik.blogspot.com/2016/03/learning-about-mimikatz-skeletonkey_96.html

Finally, a good defense will also include some mitigation and prevention -- https://jimshaver.net/2016/02/14/defending-against-mimikatz/ -- however, remember that mimikatz has been rewritten in GoLang and Powershell, so your mileage may vary when trying to prevent a well-informed attacker.


What is a Sonic Wall? I found an old box in my garage and it contains a 'sonicwall' device. It looks like a huge router but I am unsure what it does. Do I hook it up between my modem and router and it somehow provides secure protection?

What is it and what is its purpose?

Also, what protection does it provide?

SonicWall is a company, now owned by Dell, that makes security appliances.

http://en.wikipedia.org/wiki/SonicWall

I am fairly certain you can find the specifics for any device you own on Dell's website or at sonicwall.com.


How secure credit card order system with blank mail I want to know how to secure credit card order with blank mail.

My boss instructing to create new site like as below:
1) User send "Blank e-mail" to new site.
2) The site returns mail including URL, the URL is display credit card number to start payment.
3) After input credit card number and press OK, then display input CVV2 code page.
   The input page is provided by credit-card company.
4) Payment is completed, then the site returns PIN code to the e-mail address.

We use "Blank e-mail" feature to get "from address".

The boss said, we always use CVV2, so the system is secure. But I think it is not secure because there are no limitation about try other CVV2 code with same credit card number.
And the system does not have membership, so there are no login system.
First target OS is smartphone (android and ios), and second target will PC.

Is there any idea to more secure the system, or any succeeded site with similar style, please let me know.

It's difficult to comment given that it's unclear what your purchase model is supposed to be. In particular it is not clear what the “blank e-mail” feature is for. Are you trying to do e-mail address verification?

The more usual method is to allow the user to enter an e-mail address on a web form, and then receive a mail containing a token or URL that confirms they received it. I think most people would probably find sending an e-mail to request that token in reply less convenient than the typical web form model.

There are reasons to want to do e-mail address verification but none that really constitute extra security for a simple payment processor form. If you are concerned about brute-force attacks against the CVV2 field, then (a) that's normally the payment system's concern, not yours; (b) e-mail addresses are not a scarce resource (anyone can create millions of them instantly), so verifying addresses and limiting attempts per address is not an effective form of rate-limiting.

Your step (2) makes it sound like you are serving the page containing the form to enter the credit card number (PAN) into. Is this not something also handled by the payment processor? If you are accepting PANs yourself you are bringing some hefty PCI-DSS requirements down on your head, are you sure that's what you want?


What organizations have 1B faces to train a facial recognition neural network? An article claims that a neural network was trained with over a billion images. Assume that the majority of images contain a face.

  The infrared camera takes an image and the dot projector uses around 30,000 IR dots to create a 3D dot pattern of your face. This data is sent to the the new A11 Bionic chip processor, trained with a neural network of over a billion images.

What organizations besides Facebook has access to a billion facial images?

Almost certainly Google. There are probably others. At the end of the day, you can just make a crawler and scrape images of the web. It is not necessarily 100% legal (grey area IMO), but it is not something anyone could prove in court anyway.


Email attachments malicious? So I recently encountered a phishing email, I didn't follow the link of course, but I noticed it had a attachment file of 1KB I didn't download it, but was wondering whether it was possible to be infected with malware just from simply opening the email? I've read numerous times in regards to spam emails to not even open them?

I accessed my emails via " outlook.com " using Microsoft Edge if that makes any difference to the circumstance.

it was possible to be infected with malware just from simply opening the email?

Yes, technically it is. [1, 2] Images can have embedded content that is run when your browser or email client trusts external senders (e.g. showing pictures in emails by default). This is why it is especially important to not trust pictures in emails by default unless you know the sender (at home and in corporate environments).

It is of course easier (and additional attack methods are made possible) for an attacker to include a malicious payload in an attachment or website to which they link to in an email -- even at 1KB (though admittedly this is a very small attachment size).

[1] https://www.opswat.com/blog/image-borne-malware-how-viewing-image-can-infect-device

[2] http://www.acenyethehackerguy.com/2017/11/capturing-creds-through-email-and-html.html


What famous attacks used a use-after-free vulnerability? I'm compiling vulnerabilities and related attacks, and I need to find a famous attack that exploited a use-after-free vulnerability. I've looked for a while though I can't seem to find any. I know there are lots of times use-after-frees were found in internet explorer and other softwares, though I only get pointed to the vulnerability and update pages, and not specific attacks.

How we broke PHP, hacked Pornhub and earned $20,000

  We have found two use-after-free vulnerabilities in PHP’s garbage collection algorithm.
  Those vulnerabilities were remotely exploitable over PHP’s unserialize function.


Actual issue? Phone switches from 3G to router makes session switch from https to http I heard that a security issue exists in some cases when a mobile phone has:

Connected to a website via https via 3G
Connects to a router

I'm told that that in this particular scenario the router maintains the https connection but the connection from the phone to the router is http.

Has anyone heard of this issue? Can anyone confirm or deny it?

If the phone switches networks, then it would have to create a new connection. The router can behave the way you describe only by having a server listen on port 80 (HTTP) and then proxying data back and forward to a different session over HTTPS.

A simple configuration issue cannot produce the necessary servers and proxying behavior for your scenario to be valid.

There is the SSLStrip attack that is similar to your description but it involves many more steps.


PCI DSS and ssh keys for root Referring to this PCI DSS 2.0 and ssh keys I want to ask

Is this PCI section 8.2 only for individual users or also valid if a user connects via ssh to a root account?

I prefer to ssh root@localhost instead of sudo, because you once unlock the key in ssh-agent and then can do passwordless actions on multiple servers.

With sudo you'll need to type your password on all servers, again and again (and it's the same, because ldap) frustrating at such a level that the password will end up in an expect script.

8.2 is not your problem, 8.1 is.  It's referenced in 8.2:

  In addition to assigning a unique ID...

8.1 states:

  Assign all users a unique ID before allowing them to access system
  components or cardholder data.

If you log directly in to the root account over the network, then there is no unique ID involved in accessing the system.  The system audit logs do not provide any correlation between the activities performed by root, and the employee who performed them.

Most QSAs interpret 8.1 as disallowing direct root login for this reason.

With that said, nothing in DSS requires sudo to require passwords for authorized users who have already authenticated themselves to the system.  Subject to your QSA's approval, you should be able to use NOPASSWD: to loosen the requirement for typing in passwords by authorized administrators.


Security issues with email accounts I am starting to become wary of giving out my email account to anyone, just by doing reconnaissance it is evident how easy it is to pull so much information from a person just by a email,

There is a privacy concern (IMO), as email accounts are associated with social networks, blogs and any other online accounts.

How can I increase my privacy and security when using email accounts? Should I use several hushmail account and forward all emails to my main account (which remains completely private)?

As you point out, there are several "classes" of email addresses that sites require, such as:

One-time, or limited-time use where the email address is only used to access the information, but no email is actually sent.
Sites where email is actually sent containing information, but this information is not considered sensitive (eg. social networking)
Sensitive sites (online banking, etc.)

There are as many types of systems in the spectrum that you can think of.  My personal system uses these three categories.  You may also want to separate "sensitive" sites from actual correspondence with family and friends since breaches on their accounts can percolate to your own.  Sensitivity of certain information may warrant their own email accounts.

One-time and limited-use sites use the email address as a login name only.  Therefore use services such as 10minutemail.com to generate email addresses for their use.  As long as you remember the email address name (or allow your browser to remember it), then you will not need the actual contents of the email account.  Or generate a new account each time you need to access information.

Sites which will actually notify you -- and you want to be notified of events -- require an account that you can dedicate to that course.  Create another account which you need not worry about. Make use of additional features, if they exist, such as gmail's "+" modifier to help streamline the process as required.

Sensitive sites are the email addresses you can carefully protect against giving out.

Placing these across several systems can help protect against a full breach.

Creating usernames which are uncommon or "random" can help prevent spammers with malicious intent from getting email to you by broadcast attempts.  That is spammers may send emails to well-known first names, or well-known firstname/lastname combos) at domains to see if anything gets through (bob@example.com or smith.jones@example.com).  As with any security solution, obscurity is not security, but it can provide a veil of darkness that the average malicious user will have trouble penetrating.


Option to secure docker socket from containers Objective

Understand the options to secure the docker.sock.

Background

As in those articles, giving containers the access to docker.sock is a risk.

Don't expose the Docker socket (not even to a container)
Access Docker socket within container
The Dangers of Docker.sock

However there could be cases where we need to deploy a pod such which needs to talk to docker daemon via the socket for monitoring or controlling. For example datadog which mounts the socket via hostPath mount.

Options

OpenShift requires explicit grant of SCC e.g. hostaccess to the service account which runs the pod for the pod to use hostPath, but it is OpenShift proprietary.

I suppose SELinux can be used so that any pods who access the docker socker are required to have a certain label.

Question

I would like to know if my understanding of SELinux label is valid, and what other options would be available.

References

Hardening Docker containers and hosts against vulnerabilities: a security toolkit

It sounds like you're asking about Kubernetes. PodSecurityPolicy is the Kubernetes upstreamed version of OpenShift's Security Context Constraints (SCC), and can be used to limit access to HostPath volumes. However, there is a known issue with the AllowedPaths implementation, so it is safest to disable HostPath volumes completely for Pods that don't require it. Assuming the docker socket requires root privileges to access, you can also restrict which containers are running as root (don't forget to set no_new_privs, disable AllowPrivilegeEscalation in Kubernetes).


Bypass app permissions I'm annoyed and actually scared by all the permissions that I have to grant the applications that is running on my Android phone. Is there is a way to bypass them ?

Let's say my microphone. My Facebook application wants to access it without my knowledge once I grant the permission.  Is it possible to make new virtual devices, like a microphone which feeds random noise and switch back when I really need them ?

Is there a custom rom for android which already does something similar ?

To my knowledge, CyanogenMod allows you to modify each app's permissions at any time after install. When an app requests a service that you've blocked in this way, the call will fail and throw a java.lang.SecurityException.

Android Marshmallow will partially bring this feature to stock Android, ie some permissions will be modifiable after install, but stock Android will never fully support this for all permission types because allowing you to block an app's internet access, in-app-purchases, etc interferes with Google's ad revenue.

As a final note, I stopped using the Facebook app when they added the mic permission. Too Creepy. When I was playing with the Android M dev preview a few months ago, I tried removing the Camera permission from a bunch of apps. Most apps popped up an error message like I expected when I tried to access the camera. Facebook, on the other hand, went ahead and opened the camera as if nothing was wrong, so I'm highly skeptical that Facebook doesn't play by the rules.

EDIT: Apparently the Facebook app does this in CyanogenMod too, confirmed by @Thanathan in this question.


Storing data encryption key in the DB. Safe or not? I'm currently taking over a service and while looking through the DB, I noticed that we encrypt some of our data using a function in the DB where the encryption key is hardcoded in the DB function.

As far as I know, this is not a good practice and makes the encryption pretty much redundant because the whole point of encrypting DB data is to protect the data should the DB leak to unauthorised parties. But in this case, if the DB is compromised, so is the encryption key and the encryption becomes meaningless.

Am I correct here or am I missing something?

Also, if it's a wrong practice, should I change the encryption/decryption process so that it happens on the server app level?

The rule of thumb is that you want to keep the encrypted data and the encryption key "as far apart" as possible, meaning that you want to minimize the probability that, given that the data is leaked, the key is also leaked.

This great answer has a ranking from one (best) to seven (worst) on where to store the encryption key. And, you guessed it, number seven is "in the database":

  7. Store the key in the database. Now you're not even trying. Still, a depressingly popular option.

So you might want to consider the other alternatives listed there. That said, storing it hard coded in a function is better than just storing it in a table if the following conditions are true:

The database server is not directly accessible from the internet.
The web user of the database (i.e. the user that the app logs in as) does not have permission to read the source code of the functions (so the web user could not read the encryption key).
Back ups of the database does not include the source code of the function.

Moving the encryption to the app layer does not necesarrily make things much better if the encryption key is just hard coded into the app source code instead of the DB source code.


Is OSX/MaMi a real malware or a simple filtering software? Recently a lot of communications spread starting from this analysis:
OSX/MaMi analysis
When I read this analysis, I found that 2 DNS servers are defined as default ones for the IP configuration:
82.163.143.135
82.163.142.137

I discovered that these 2 addresses belongs to an Israelian company:
GreenTeam Internet
(see: IP info)
who developped a product GreenTeamDNS to filter Internet accesses based on whitelist and blacklist upon DNS traffic requests. Thus, this software is clearly using DNS servers redirections.
I further tested these 2 addresses and they correctly reply as plain DNS servers or relays.
From your critical point of vue, which analysis is the right one?

This might be new on Mac but seems to be older on Windows. See for example this analysis from 2015 about some malware which changed the DNS settings to ones from the same owner and which also talks about the same silently installed root CA certificate. To cite "Given the above I would say this is a potentially legitimate company (in the past) turned rogue.". See also this article about the DNSUnlocker adware family which uses also DNS servers in the IP block owned by GreenTeam Internet. Also,  the way it is distributed does not really look like some benign software.


Are SSL Certificates (Private and Public key) generated by OpenSSL and makecert compatible? Are RSA SSL Certificates (Private and Public key) generated by makecert compatible with OpenSSL decryption ie. can I decrypt them with the openssl_* methods? I am working on two-way SSL authentication between a .NET client and a PHP service, so I want to know if I have to create OpenSSL certificates on the .NET side.

Both makecert and OpenSSL follow X.509, so they are compatible -- in theory. X.509 is extensible is various arbitrary ways, and has been extended in various arbitrary and exotic ways, so anything can happen.

Practically, OpenSSL powers a lot of existing HTTPS web sites (according to these statistics, Apache powers more than 50% of all Web sites, and when Apache does HTTPS, it does so with OpenSSL(*)) so chances are that Microsoft tried not to break compatibility in that matter. In my experience, .NET and OpenSSL talke to each other quite politely.

(*) Well, Apache can also use GnuTLS, but it seems to be rather uncommon.


Why can hackers get in network using tunneling? I can't hack but I like to read about it. From my readings (securityfocus, exploit-db, owasp, etc...) it appears that hackers can actually get in a network using tunneling ; I'm not from a network background but tunnelling is mostly for VPN right ? (Yes !)

What I mean is writen here at offensive security OSCP on the right (bullet point number 6)

So that would mean that even a firewall can't block them. How is that possible ? Is that the reason why when they find a new exploit on a software they can just get in the network and from there have fun exploiting the zero day ?

Tunnelling to bypass firewall filtering means that an attacker uses a "trusted" protocol in order to exfiltrate data from the victim machine.

For example, an attacker can inject exfiltrated data into a lookup DNS requests sent to a fake dns server controlled by him.

Victim machine--->DNS REQUEST--->FIREWALL--->Attacker FAKE DNS Server

You can reach the same goal with different protocols, think about maleware with a gmail account as C&C.


What is the attack surface on a L2 switch? I'm trying to figure out what makes a "top brand" switch better than a "cheap unknown brand" one with the same features.

I often see security thrown in the mix, but really can't understand how this is relevant, so I'm trying to figure out if it is.

The way I see it, most (all?) L2 switches just get some data that they have to pass to specific devices, no L3 stuff, no look up, just Alice has MAC X and is on port Y, I need to pass Z from port W to Y.

Now, besides CAM overflow and web interface exploits (I'm leaving VLAN hopping and other similar exploits out because they won't hack the switch itself) What could possibly go wrong? It looks like the Linux kernel used in most switches is ancient, but apparently, it doesn't get exposed to anything as it only runs the web UI/shell (the ASIC does everything?).

Am I missing something here?

Attack Surface:

Management
Traffic Isolation (VLAN)
Traffic Monitoring / Sniffing
Actual Traffic Passing / extra services

Management

Look at the management interfaces. A cheap switch example is a home router. Yes, it does more than switching, but the bugs are in the management interfaces. Similar to even the "top" tier cisco devices. Most of the CVEs are around baked in credentials, problems with the management, or problems with implementation of complex protocols.

Traffic Isolation

Many L2 switches will setup VLANs which should be isolated networks, and often we depend on this isolation for security. If you are using an L2 switch in this mode, then a compromise of the management or of the VLAN tagging that allows you to hop VLANs is your biggest worry.

If you're not segmenting traffic by VLANs, I'd argue the security of the switch really doesn't matter.

Traffic Monitoring / sniffing

Take the next level. You can setup a span port and monitor all traffic from all other ports. I personally assume any traffic that leaves my device will be monitored. So I focus on transit encryption. And in today's WiFi world, it's pretty typical for may devices to sniff your traffic. Maybe not a strong threat.

Actual Traffic Passing and extra services

What's left, actual traffic passing. These are the bugs that the NSA used to hack firewalls from the public internet. They find bugs in traffic that isn't simply passed from port to port. Spanning tree, VLAN logic, and the like. This is the stuff where the remaining attack surface lies.
Example:

Cisco CDP DOS
vulnerability in the Simple Network Management Protocol (SNMP) running on certain models of Cisco Catalyst Switches


Why are programs written in C and C++ so frequently vulnerable to overflow attacks? When I look at the exploits from the past few years related to implementations, I see that quite a lot of them are from C or C++, and a lot of them are overflow attacks.

Heartbleed was a buffer overflow in OpenSSL;
Recently, a bug in glibc was found that allowed buffer overflows during DNS resolving;

that's just the ones I can think off right now, but I doubt that these were the only ones that A) are for software written in C or C++ and B) are based on a buffer overflow.

Especially concerning the glibc bug, I read a comment that states that if this happened in JavaScript instead of in C, there wouldn't have been an issue. Even if the code was just compiled to Javascript, it wouldn't have been an issue.

Why are C and C++ so vulnerable to overflow attacks?

C and C++, contrary to most other languages, traditionally do not check for overflows. If the source code says to put 120 bytes in an 85-byte buffer, the CPU will happily do so. This is related to the fact that while C and C++ have a notion of array, this notion is compile-time only. At execution time, there are only pointers, so there is no runtime method to check for an array access with regards to the conceptual length of that array.

By contrast, most other languages have a notion of array that survives at runtime, so that all array accesses can be systematically checked by the runtime system. This does not eliminate overflows: if the source code asks for something nonsensical as writing 120 bytes in an array of length 85, it still makes no sense. However, this automatically triggers an internal error condition (often an "exception", e.g. an ArrayIndexOutOfBoundException in Java) that interrupts normal execution and does not let the code proceed. This disrupts execution, and often implies a cessation of the complete processing (the thread dies), but it normally prevents exploitation beyond a simple denial-of-service.

Basically, buffer overflow exploits requires the code to make the overflow (reading or writing past the boundaries of the accessed buffer) and to keep on doing things beyond that overflow. Most modern languages, contrary to C and C++ (and a few others such as Forth or Assembly), don't allow the overflow to really occur and instead shoot the offender. From a security point of view this is much better.


How to Verify Integrity of Transferred Files in a Client Server Protocol How do I implement integrity verification using the checksum of files in a client-server protocol where the client sends multiple files to the server. I am using the following steps:

The client connects to the server and sends files.
In server side, when the server receives the files, I have calculated Checksum (using this) of client and server files.
Then upon comparing the checksum of client and server files, integrity verification is done.

Is my process ok? Will the checksum calculation be the same if I need to calculate the checksum of video files?

Your process is not OK. How can you make sure checksum is transferred correctly or hasn't been tampered with along the way?
You need some sort of authentication before transferring file, a handshake! All this can be solved using SSL. You will not have to worry about anything.


Can I improve website security by storing SSL Keys in DNS? Is DNSSec required? Are threat models available? In light of recent attacks on SSL/TLS communication, people have been asking about ways to improve the security of SSL webserver communication.  Several great solutions have been mentioned in the following links (example 1, 2, 3 and  blog posting).

  There is a general agreement that if a network administrator uploads the website's SSL public key (or its hash) into DNS, security could be improved

The drawbacks of the proposed solution is that:

All recommendations for this particular solution require DNSSec, which adds complexity and has a cost associated with it.
Client software (browsers, Operating Systems) will require an update to actually check DNS for certificate information

In the spirit of providing immediate relief to the very broad security issue at hand, I'm questioning the assumed requirement of DNSSec.  By removing this requirement, and simply allowing the website owner to dictate the SSL intermediates (or specific public keys) they want to use via DNS, we allow the content publisher (or e-commerce site) to declare what is trusted, and therefore make some attack vectors much (much) more difficult to overcome.

Questions

Is DNSSec required for public key/hash distribution?

According to this link, DNS hacking is not a concern for the majority of users on the internet.  Notable exceptions include WiFi users and certain SoHo routers are of concern.  If DNSSec is only needed for these edge cases, why delay implementation for a borderline technology?

Are there any threat models comparing using regular DNS as a repository as opposed to DNSSec?

The premise of this question assumes that although using regular DNS is imperfect, it does make great strides protecting users against a general, system-wide vulnerability.

What should be stored, the hash, or the full public key?
How difficult would it be for vendors to support this extra validation of a SSL/TLS certificate?

Is DNSSec required for public key/hash distribution?

Yes. One has to have a trusted starting point, and in this case that's the signature of the root domain. From there, each corresponding subdomain is signed so there is a chain of continuity to demonstrate that your request was not hijacked at any step of inquiry.

Are there any threat models comparing using regular DNS as a repository as opposed to DNSSec?

DNS spoofing is already a common and low-barrier method of attack. DNSSEC was implemented primarily to prevent that. Verifying the server's certificate in the same channel as an unauthenticated DNS query provides no real security enhancement.

What should be stored, the hash, or the full public key?

In theory, one could store either to the effective same level of security. However, DNSSEC is designed around storing the whole key in order to sign zones, so I would gather that one might as well stick to storing full keys and signatures for every application.

How difficult would it be for vendors to support this extra validation of a SSL/TLS certificate?

I think the code complexity would be lower than that of verifying an SSL cert (that X.509 parsing is quite a nuisance). I suspect most browser vendors could roll this out with relatively little effort. More complex plugin systems (such as Convergence.io) are regularly written.


Decoding Honeypot Payload Apologies for the basic question. I have searched, but I had trouble even determining search terms.

I set up a Cowrie honeypot (SSH/Telnet) last night on a VPS. I find this in the cowrie log today.

  "data": "\"\\x16\\x03\\x03\\x00\\xcf\\x01\\x00\\x00\\xcb\\x03\\x03W\\xff\\x82(\\xa9\\x00^QZ\\xa7d\\xd4\\x8d\\xdf*\\xe7O}\\x12D\\x7f\\xb8\\x1eD`/\\x93l#\\xd4\\xb6(\\x00\\x00F\\xc0#\\xc0'\\x00<\\xc0%\\xc0)\\x00g\\x00@\\xc0\\t\\xc0\\x13\\x00/\\xc0\\x04\\xc0\\x0e\\x003\\x002\\xc0+\\xc0/\\x00\\x9c\\xc0-\\xc01\\x00\\x9e\\x00\\xa2\\xc0\\x08\\xc0\\x12\\x00\\n\\xc0\\x03\\xc0\\r\\x00\\x16\\x00\\x13\\xc0\\x07\\xc0\\x11\\x00\\x05\\xc0\\x02\\xc0\\x0c\\x00\\x04\\x00\\xff\\x01\\x00\\x00\\\\\\x00\\n\\x004\\x002\\x00\\x17\\x00\\x01\\x00\\x03\\x00\\x13\\x00\\x15\\x00\\x06\\x00\\x07\\x00\\t\\x00\\n\\x00\\x18\\x00\\x0b\\x00\\x0c\\x00\\x19\\x00\\r\\x00\\x0e\\x00\\x0f\\x00\\x10\\x00\\x11\\x00\\x02\\x00\\x12\\x00\\x04\\x00\\x05\\x00\\x14\\x00\\x08\\x00\\x16\\x00\\x0b\\x00\\x02\\x01\\x00\\x00\\r\\x00\\x1a\\x00\\x18\\x06\\x03\\x06\\x01\\x05\\x03\\x05\\x01\\x04\\x03\\x04\\x01\\x03\\x03\\x03\\x01\\x02\\x03\\x02\\x01\\x02\\x02\\x01\\x01\"",

I tried running this through http://decode.urih.com/ as hex and base64 (without the "data:" "\"). I then tried stripping a single \ from it, then both, then the space too - retrying and not getting anything back each time.

I have  tried searching, but when I find encoding/hash identifiers I'm not sure what format I'm to present it in, all slashes removed?

Can someone please help with the following questions.

How can you determine format?
Where do I even begin if I want to see the plaintext version?

\x16\x03\x03...

This is the begin of a TLS record and it looks like a start of a TLS handshake (i.e. HTTPS or similar). There is no plain text apart from maybe the target hostname if the client uses the TLS SNI extension.


Safely creating and communicating within a fully decentralized p2p network I'm not entirely sure if this is the right place to ask this, and I'm also slightly fuzzy on how the p2p system works, so correct me if I'm wrong.

I've been looking into the practical implications of decentralized P2P networks, and there's a few issues I've noticed, generally relating to the security side of things. First, as stated in this post, I can forsee that problems would arise with MITM and spoofing attacks, so I'm not sure what the best practice is. For instance, let's say a node A sends data to node B, and then B relays that info to C, what is stopping B from spoofing, sniffing or modifying the data? Also, wouldn't it be a huge risk on the part of all nodes to open the ports for a P2P connection in the first place? Is there some possible way for the nodes to communicate directly without opening extra ports? I'm mostly just wrapping my head around how anyone would implement this securely.

You asked quite a lot of different questions here. I'll try answering each.

Spoofing/sniffing:

The cure is encryption. More specifically Public Key Infrastructure. Then B can't modify (or even decrypt) data that it's relaying. The only question here is how you want to implement the key exchange (so that it can't be attacked).

Open ports:

An open port is by itself isn't a vulnerability. This really depends on the software that listens on it.

Communication:

Decentralized means that peers communicate with peers (without a central authority). Thus they need to listen to their peers for input.
(Because you can't really talk to someone who isn't listening to you.)

If you are really interested in this kind of thing check out the Tor project.


Why is 'Bearer' required before the token in 'Authorization' header in a HTTP request? What exactly is the difference between following two headers:

Authorization : Bearer cn389ncoiwuencr

           vs

Authorization : cn389ncoiwuencr

All the sources which I have gone through, sets the value of 'Authorization' header as 'Bearer' followed by the actual token. However, I have not been able to understand the significance of it. What if I simply put the token in the Authorization header?

The
Authorization: <type> <credentials> pattern was introduced by the W3C in HTTP 1.0, and has been reused in many places since. Many web servers support multiple methods of authorization. In those cases sending just the token isn't sufficient.

Sites that use the

Authorization : Bearer cn389ncoiwuencr

format are most likely implementing OAuth 2.0 bearer tokens.The OAuth 2.0 Authorization Framework sets a number of other requirements to keep authorization secure, for instance requiring the use of HTTPS/TLS.

If you're integrating with a service that is using OAuth 2.0 it is a good idea to get familiar with the framework so that the flow you're using is implemented correctly, and avoiding unnecessary vulnerabilities. There are a number of good tutorials available online.


Best Security measures for non-IT pro to take when at risk of hackers? I work at a WeWork and am surrounded by about 5 different IT / coding type of companies.  They apparently hacked me somehow, I don't know how, whether it was bluetooth or using WeWork wifi, or maybe the screen sharing app used to control monitors WeWork uses or the Papercut print client. Somehow they were on my PC, as if they were controlling it (like a screensharing remote access app).  They apparently thought it was funny, messing with stupid stuff like my volume settings, moving files on my desktop, writing in a Word document.  However, I'm not playing... I want everything on lockdown but I'm no pro.

What steps would an IT pro do if they were in a shared office environment to put their PC on lockdown?

Things I did:

Changed all my passwords to strong passwords, and am keeping different passwords for my important points of entry.  Ex. different passwords for home router, Microsoft 365, Google, etc.
Started connecting to the network by ethernet cable.  Leaving Wifi and bluetooth turned off.
Connect to VPN.
Started using Norton 360, I believe Windows Defender still runs too.

What else should I do?

fresh install of Windows?
get an encrypted router to connect to Wework ethernet?
switch to Mac?
stop letting Google Chrome store passwords?  I mean, if they can access my PC and see the screen all they have to do is go into Chrome settings they can expose all my passwords immediately.

What steps would you recommend?  I have a surface pro (5th gen) running Windows 10 Pro.

The original hacking occurred almost 2 months ago at which time I did the 'things I did'.. and believed I kicked them off?  I'm not so sure, I've been using the ethernet cable & vpn for about 2 months with no issues.  Just the other day I started having this problem, when I would come into the office and plug in and start-up, it would not connect to the network automatically.  I couldn't figure it out, I checked my ethernet connections they seemed good.  I went into network adapters, disabled/enabled and internet works perfectly.  Have had to do this 2 days in a row now every time I boot up.  I have a friend in IT I was telling about this yesterday she said it sounds like they are still on my PC or they are
'snooping' and that's why I have to disable/enable my router, she says I'm 'kicking them off' most likely.  Can anyone comment on this?

Sounds like you need to do a bit more to reduce your attack surface. While you have already done a lot of things to improve your situation which is good, unfortunately you have absolutely no control of your physical network which is generally the source of most hacking attempts. This is compounded even further by the fact that that it is a shared network and you have no idea what is happening on that network. For all you know, someone sitting a few desks down could be Wiresharking (eavesdropping) all your network traffic.

So with that said and assuming you are not experiencing any problems on your home network, here are a few steps I would advise you to take to start with.

First off, back up all your data and personal files, VERY IMPORTANT to do this properly as you don't want to lose any data.
Do a fresh install of Windows 10. This is an important step because it may well be that you have some form of malware on your machine that you don't know of and your AV is not detecting it.
After doing a clean install of Windows, install the latest updates and drivers for your PC and then try using Bitdefender Total Security. Norton 360 has a very low detection score and I would strongly advise against using it. The firewall on your PC is the very last line of defense against hackers and malware/spyware/ransomware etc. You want to make sure you have the best level of protection available to you.
After installing your AV, go to your network adapter settings and change your DNS to 1.1.1.1 (Cloudflare) or 9.9.9.9 (Quad9). If you don't know how to do this, Google is your friend.
Download and run Shutup10 or something similar. It reduces Microsoft bloatware and improves the security on your PC by disabling a number of hacker friendly breach points.
Since you use Chrome, you should then install a few security extensions on it. The most popular ones are:

Cookie Autodelete
UBlock Origin
HTTPS Everywhere (EFF)
Privacy Badger (EFF)

Disable anything you can that involves IoT connections. Try not to use them at all. If you do have to use something over WiFi or Bluetooth, disable the adapters straight away after using them.
Grab an external USB drive, encrypt it with a strong password, and then install an offline password manager like KeePassX on it for all your passwords. It is a bit tedious to start with but once you have everything in it, it is very easy to manage and maintain. Then, when you need to provide usernames, passwords or anything sensitive, you will simply right-click, copy-paste them into the appropriate places when working online. Once this is done, get rid of all your Google passwords and turn all that kind of stuff off.
Add two step authentication for all your online accounts. If you use a mobile phone, grab something like FreeOTP and use it for everything you can.
Keep using your commercial VPN to connect to the outside world when you are in the WeShare office. Most VPN provider's also have an extension available for your web browser. If so, grab it and use it as well.
If you are interested in going down the path of setting up your own router, then grab something that has the capability of installing third party firewall firmware like DD-WRT, OpenWRT, or Tomato. If you are really keen, you could go all out and setup a PFsense box!

There are many other things that can be added to this list but this is a solid starting point.


How can I tell if a keyboard for android is safe? Background: I am a normal smart phone user, with no experience in information security. I want to download a new keyboard for my Android 6 phone off Google Play, as my current keyboard is not great. I am not handling valuable information in my phone, other than online account passwords including banking passwords, etc.

Question: How can I assess the risks presented buy any particular keyboard? What risks should I look out for?

In terms of key-logging, am I more or less OK if a keyboard does not require network access? If so, can the keyboard gain network access in other ways than asking directly for the network access privilege?
Is asking for access to my Bluetooth bad?

The SwiftKey Keyboard wants access to:

  Calendar

  Calendar events plus confidential information

  Contacts

  Find account on the device

  Location

  Precise location

  Full storage access
  Networking:

  Full network access
  Connect and disconnect from wifi
  View network connections
  View wifi connections
  Receive data from the internet

  (and some other non-important things, like controlling phone sleep and vibration)

This seems like a security disaster to me; it is terrifying to think what can be done with these permissions!

How do I protect myself?

I am not handling valuable information in my phone, other than online account passwords including banking passwords, etc.

Aren't these passwords valuable enough? They are the key to your banking accounts and online accounts!

  How can I assess the risks presented buy any particular keyboard?

For an average or normal smartphone user, there's nothing much that can be done about it. Security experts can sniff the packets and try to see if anything sensitive is being passed on to the servers.

  In terms of key-logging, am I more or less OK if a keyboard does not require network access? If so, can the keyboard gain network access in other ways than asking directly for the network access privilege?

It should be okay, as long as you trust the application. Even apps without network access can wreak havoc on the phone if they contain malware. It's better if you go with a trusted keyboard app from trustable sources like Google Play.

Regarding the permissions being asked by SwiftKey keyboard, they've explained the purpose of each permission on this link. Although there's no guarantee that the information gathered is used only for the specified purposes.

My suggestion would be to go with a trusted keyboard app like Gboard or Swiftkey.


Difference between Architecture review and a Design review As the question says, I would like to know the difference(s) between an Architecture review and a Design review. If someone could explain the two using an example, such as an Architecture review of a network and the Design review of the same network, it would help greatly.

IT Engineering is part of the broader Systems and Software Engineering process, which has well defined stages that are taught in virtually every College and Trade School in the world.  In general there are numerous stages in the IT engineering process:  requirements, architecture, preliminary design, detailed design, integration and testing, security/penetration testing, staging, production, and operations.

So no, the Architecture stage does NOT include all aspects of design, cost estimation, material/component choice, documentation, and getting everything to work together, but does include planning.  All the rest are intentionally separate and further stages of the process.  An Architecture many times has an upper-limit cost target defined, plus may have some cost and schedule estimates of most-expensive components or critical-path sub-systems or components.  And sometimes may include some preliminary design of especially complex sub-systems of the IT Architecture.

Your IT architecture is a high level design of the overall major elements of the IT system and how they broadly interconnect: telecom, gateways, routing & switching, servers, desktops, remote access, security, etc.  Its review will need to answer questions about how the architecture meets requirements (for example, if remote access by employees is needed, how is that accomplished; or if there is a requirement for Internet facing servers yet protected back-end databases servers, what are the elements in the architecture that provide staged separation yet controlled access).  It is acceptable to have some unknowns and TBDs during the Architecture review ... ideally as few as possible but still this is a review of the conceptual vision for the IT system, not yet all its nitty-gritty details.

Design Reviews follow the Architecture Review, and there can be several Design Reviews depending on the complexity of the IT architecture.  The Design Review will fully describe the exact details of the IT system being proposed or being modified.  Some examples include:  what specific components (hardware and software) from which vendors and which models/versions (a bill of material aka BOM), what is the BOM's cost details (one-time and recurring), how specifically is the system maintained by the operations staff, what security tools are to-be in-place, how does the security operations staff use those tools daily, what is the routing plan, what is the IP addressing plan, what is the server loading and load-distribution plan (startup, typical, worst-case recurring, surge, and under-attack), what is the DNS implementation (external and internal), etc.  Each subsystem of the IT Architecture gets a detail review.

I would suggest you do some reading about IT Engineering and Systems Engineering ... there are all sorts of books available on a decent bookstore about this topic.  You can also search online for Enterprise IT Architecture Review checklists and Enterprise IT Detailed Design Review checklists ... some are available online from mostly the U.S. Govt and from Industry Standards bodies like The Open Group.


Is a security association (SA) implemented in ESP and AH protocols? I'm reading about security associations. I've understood that a SA is a virtual connection between a client and a sever, in which all the security parameters, such as encryption algorithm, IP origin and source HMAC algorithm... are defined.

My question is: Is SA implemented when using AH and ESP protocols, or only in ESP when confidentiality is required?

And there goes another question: How does the router know whether to use IPsec or not? By using the protocol field in the IP header?

My question is: Is SA implemented when using AH and ESP protocols, or
  only in ESP when confidentiality is required?

SA is also required in AH. To quote RFC 4302:

  3.3.1.  Security Association Lookup

  AH is applied to an outbound packet only after an IPsec implementation determines that the packet is associated with an SA that calls for AH processing.

There's no AH unless the SA says so; therefore AH requires an SA.

  How does the router know whether to use IPsec or not? By using the
  protocol field in the ip header?

Correct, IPSec runs over IP protocols 50 (ESP) and 51 (AH), as opposed to protocol 6 (TCP) or 17 (UDP) for more normal traffic.

More information about Security Associations and IP Traffic Processing can be found in the Security Architecture document, RFC 4301.  For example, section 4.1 of that document reiterates that AH requires SA in a more roundabout way:

  Security services are afforded to an SA by the use of AH, or ESP, but
  not both.  If both AH and ESP protection are applied to a traffic
  stream, then two SAs must be created and coordinated to effect
  protection through iterated application of the security protocols.


Is HTTPS URL in plain text at first connection? Let’s say I have never connected to the site example.com.

If this site is https and I write https://example.com/supersecretpage will the URL be sent in clear text since it's the first time I connect to the site and therefore the crypto keys were not yet exchanged? If not when does this take place? Could anyone explain the steps when I type that URL?

Short answer: No, the URL is encrypted, but the (sub)domain is sent in plain-text.
In your case a (passive) attacker knows that you are connecting to example.com, but it does not know which specific page you are accessing.

In short there are three times where an attacker can get information about the site you are accessing (ordered chronological):

(Sub)domain in the DNS query
(Sub)domain in the Client Hello (SNI)
(Sub)domain in server certificate

However the...

URL is sent encrypted via TLS

For more details read the explanation below.

Explanation

Note: When I am writing "(sub)domain" I mean both the domain (example.com) and the subdomain (mydomain.example.com). When I only write "domain" I really only mean the domain (example.com) without the subdomain.

Basically what happens is:

You type in https://example.com/supersecretpage.
The browser submits the (sub)domain in a special TLS extension (called SNI)
At some point the browser gets the SSL certificate from the server.
Depending on the certificate* this also includes the subdomain you're connecting to, but it may also include more than one subdomain and even more than one domain. So in fact the cert of example.com may also include www.example.com, devserver.example.com and how-to-develop-tls.example. These entries are called Subject Alternative Names and the cert is valid for all of them.
After the client verified the certificate and the client & server choose a cipher the traffic is encrypted.
After all this happened a "usual" HTTP request is send (over the secured TLS channel). This means this is the first time in the whole request where the full URL appears. The request e.g. looks like this:

  GET /supersecretpage HTTP/1.1
  Host: example.com
  [...]

* If the certificate is a wildcard certificate it does not include the subdomains, but just *.example.com.

Another thing is worth mentioning: Before the connection can be established at all the client needs to resolve the DNS name. To do this it sends unencrypted DNS queries to a DNS server and these ones also contain the (sub)domain, which can therefore be used by an attacker to see the visited domains.

However this does not always have to happen in this way, because you assume the user manually types in https://example.com/supersecretpage into the URL bar. But this is very rare as most users e.g. would rather type in example.com/supersecretpage. Another issue would be visitors clicking on an insecure link, which uses HTTP - in contrast to a secure HTTPS-link). Such links could e.g. be old links created when the site did not support HTTPS or did not redirect to HTTPS by default.
You ask why this matters?

In the such a (usual) case there is no https:// in the URL. When no protocol is entered into the URL bar all browsers internally "convert" this URL to http://example.com/supersecretpage (note the http:// there) as they cannot expect the server to support HTTPS.
This means the browser first tries to connect to the website using insecure HTTP and only after the website sends a (301) redirect to the HTTPS URL it uses the secure mode.
In this case the attacker can see the full URL in the unencrypted HTTP request.

You can easily test this by yourself by looking into the "network panel" of your browser. There you should see this "HTTPS upgrade":

However note that there are techniques to prevent this insecure first HTTP request. Most notably HSTS and - to protect even the first connection you make to the site - HSTS preloading, but also HTTPS Everywhere helps against such attacks. FYI: According to Netcraft 95% of all HTTPS servers vulnerable were vulnerable to such (SSL Stripping) attacks as of March 2016.


Do corporate systems need to be updated immediately after updates are available? I lived under impression that timely updates were very important. Even a home user wouldn't like their computer to demand ransom for their data. However, the less home and the more corporate our setting is, security only becomes more, not less important. A big company that has a lot to lose needs to apply all security updates the second they are available, which hopefully but not necessarily means 'sooner than a bad guy exploits the vulnerabilities'. There is simply no time for an administrator to wake up in the morning, go to work and apply them manually. And because of this, corporate systems must be set to update automatically.

And apparently this is not exclusively true for corporations: IIRC this is precisely one of the arguments I heard why home people are recommended to use cloud services to run their websites instead of running their own dedicated servers in their homes. The cloud updates their systems immediatelly; but if a home user runs their own server, they have to sleep sometimes, so the updates are at best applied each morning, so each night is a vulnerability window.

However, it seems I was wrong? Quoting competent people from Linux Mint forums: https://forums.linuxmint.com/viewtopic.php?t=311756

  As a rule, updates should always be done consciously. So that they won't ever interrupt or damage your work. So I think automatic updates are generally a bad thing. A corporate system administrator who enables them, should be fired on the spot.

  (...) What I mean is that a corporate system administrator should be the one who determines when updates to the machines of his company should be rolled out. He should first properly test them himself, on a test rig, and then roll them out at a time that no one is using those machines. After normal working hours.

  Such a system administrator should not, under any circumstance, enable automatic updates and therefore leave everything to the OS maker. Because that could disrupt work flows and could even create major havoc and damage in a company.

So, under my reasoning, this is a recipe for getting the systems compromised while the sysadmin properly tests the updates himself, on a test rig, and then rolls them out at a time that no one is using those machines? And then to see, for example, all corporate data, including the data of all company's customers, put for sale on dark web?

People seem to be worried that automatic updates introduce regressions that break systems. Which risks is, therefore, considered more dire by sysadmins: that an update introduces unexpected regressions or that reluctance to apply updates immediately creates a security vulnerability?

Do sysadmins apply updates immediately, or do they wait and test them carefully and only apply them outside of working hours?

There are two type of cases:

1. Vendor Released an Update
A bug/vulnerability may be discovered or vendor has just added new features and released a new update, at this point I exactly recommend you to update your services automatically.
Generally it doesn't cause any serious problem. Also, you can undo updates in popular softwares or services.

2. Vendor Hasn't Released an Update
A bug/vulnerability may be disclosed or you may want to add new patches, but there is no official update. So, you have to intervene and make everything yourself. Sometimes you have to do it, because some vendors may not release an update for critical vulnerabilities, for days, like Microsoft! I recommend you https://vullnerability.com website to track vulnerabilities real-time. So, you will be alerted when a vulnerability discovered and take an action as soon as possible before vendor. Its generally more dangerous and not recommended.

For both situations:
You should create backup for possible problems. I prefer to host my services in two different servers, the first server is real and the second one is backup, if I have a problem in first server, I immediately redirect my services to second server to don't lose data and customer.


How to generate random but unique tokens for authentication? I need to create unique and long tokens for email verification, but I am not sure about how. Currently we are on staging servers or we are just using os.urandom() in Django. But I need to know what the right way to go about the same is. Is guid() secure enough for the same? Basically these are login tokens that need to be stored for a long time and need be unique.

Also on the same topic, in order to make stuff a little more efficient for us, can we use XOR enc to store data in the string itself to optimize the DB queries?

Using os.urandom() is perfectly alright. It generates a cryptographically secure random stream of bytes. This would be impossible to guess for anyone.

Using guid() is also pretty secure, although not totally random.

Using XOR to encode parameters into your token is a bad idea. For one, it is vulnerable to bit flipping attacks. Even if the user can not decode the token, he may alter the contents encoded in it. A better solution is to send a HMAC along with the data, so that the user can not tamper with it.


Can I restore gpg private key from raw data to enigmail? I have recovered data from my local storage. The most valuable for me was to recover the private gpg key. I have found it in raw data files, I did delimitation based on the headers and footers. Now I have two separate *.key files with private key files content. How can I use it to rebuild my gpg keys, which I can use in Enigmail?

You could first get your public key from your private key like this:

  $ gpg --import private.key
  $ gpg --export $ID > public.key

Where you can determine the $ID of your key as follows:

$ gpg --list-keys

Afterwards you can import your key pair into Enigmail via File → Import Keys From File (as described in the Enigmail Wiki [1]).

[1] https://enigmail.wiki/Key_Management#Importing_an_existing_key_pair


Under HIPAA, is it allowable to remember/store user credentials? My medical chat application is handling PHI, and it enforcing unique, secure logins which ensure that only authorized / appropriate people can access that data. For now, I implemented touchID Authentication with iOS. By this feature, device owner can sign in to last logged-in user's account with touchID.

Under HIPAA, is it allowable to remember/store user credentials in web/mobile/desktop applications?

The security rule of HIPAA doesn't specifically address this. However, if you can prove that touchID requires actual validation of whomever is authorized for the ePHI for access-- then it suffices. However, you could be dinged on the implementation configuration for system security safeguards so you'll need to have documentation and compensating controls if required for any weaknesses related to touchID and specifically how your mobile device is managed. You may also want to validate with the vendor if a risk assessment has been performed for other customers for HIPAA environments.


Should the Secure cookie flag also be set on HTTPS only websites? Should the cookie secure flag be set on websites which are served only through HTTPS?
The Secure attribute tells the browser to only send the cookie if the request is being sent over a secure channel such as HTTPS

Let's say the victim connect to https://example.com and there is no http://example.com.
How can an attacker have access to the cookie? I mean if he intercepts the traffic the cookie will be encrypted.

There is no need to set this attribute if the traffic between client and server(s) for the cookie domain will always be end-to-end encrypted. But, can you really be sure that it is?

Server misconfiguration might cause plain traffic.
While example.com might be fully encrypted, sub.example.com might maybe not, but the cookie might be valid for this domain too.
There are attacks like sslstrip which cause a plain connection between client and MITM attacker even if the connection between attacker and server is encrypted.

Thus, in the interest of robustness it is better to set the attribute even if it seems to be unnecessary. See also Knowing a web application is HTTPS only, do HTTP cookie need the secure flag?.