Client-Server Authentication Security Issue This is a repost, because i accidentialy posted on stackoverflow first

I was wondering how i could achieve a high security level, using Client-Server Authentication. Below is a rough draft of what i thought about:

Let me explain it a bit more:

The C++ executeable is running on a gaming console which has an unique ID the user uses to sign up on my website
When the executeable is launched it will get the current module/file hash of the executeable and the unique ID ("Key" in the sketch) and do a webrequest to my website (example in blue on the sketch)
The auth.php on my website will then check if the file hash is the same as the file that was given out (detecting if the file was modified). It will also check if the "Key" is connected to a user
Then it will send back individual info from that user and also some data/offsets needed for the executeable to run properly later (This would prevent the attacker theoretically from just noping the internet connection, so he has to make a call to my website to get data that's needed to run the executeable properly)

Sounded good to me at the beginning but then i noticed some flaws:

Even though i'm obfuscating and encrypting the file a hacker will still be able to disassemble it. That mean's he could take out my check if the key is spoofed and just send the key of a registered user (he can also edit the hash that's sended to prevent the whole check if the file was modifed what makes it kind of redundant)
He could also read the data that's sended after a successful auth and then nop the internet connection, so there's no call to my website anymore and insert the data he got into the executeable to make it work

No matter of the security on the executeable a hacker will always be able to disassemble/decompile it at some point. That's why i think the Client-Server Authentication has to be so that even if the client is hijacked it won't be able to authenticate. I don't really know if that's even possible or if it's just the wrong approach.

I would really appreciate if you could leave some thoughts or ideas down below. Thanks for your time and have a good day :)

You cannot trust the client, and your client-server authentication cannot work.

Any hacker can run an unmodified version of your software, capture all data he needs, and change the client executable later. Using an interception proxy will allow him to change the request and use the original hash of the file.

Or he can use a valid key, download the missing parts, patch the executable to include that parts, and skip the authentication.

Using TLS does not help, not even certificate pining. As he is in control of the connection, he can even change the client executable to allow his own certificate to pass the checks.

He will be able to authenticate no matter what. Your protections are only speed bumps, not road blocks. List of broken DRM schemes includes Sim City, Diablo, Battle Field, Doom, Assassin's Creed, Dishonored, you got it.

If even Ubisoft, EA, Sony, Microsoft, Konami and others could not deter attackers, you will probable be unable to deter them too.


What are the risks of file server access over wireless? In our office, all computers connect to the network over wireless. The wireless is protected by a pass phrase and communication is AES encrypted.

On the same network is a file server that is used solely for sharing files between employees. Each user has a user-specific username and password to connect to the file server.

Whilst there it is not allowed to store confidential information on the server, such is human nature.

Is the file server adequately protected?

It is difficult for someone to tell you if a particular resource is adequately protected as it depends on the value of the files stored on the server as well as many other factors.

I am assuming that you are using WPA/WPA2-PSK, which is what most small businesses usually use. Every employee connects to the wireless network using the same password. The risk is that any employee can run a packet capture software such as wireshark and capture the authentication process of a fellow employee.

In such a circumstance, either the hash or the plain text password of the victim will be revealed. It depends on which authentication protocol the file server uses.


Securing Debian Apache PHP server I have a Debian Apache PHP server. I want to secure it after the classic installation process.

My usual steps are :

list items
update all packages
remove all unnecessary services like named, portmap, lwresd...
add a startup iptables script: block everything except 22 and 80 inside and allow all outside. Force SYN packets check, force fragments packets check, drop XMAS packets, drop Drop all NULL packets, drop local ip on wan, all only icmp type 0 and 8.
SSH : remove root login and password authentication. Use keys instead. Allow only the valid username. Protocol 2 only
PHP : expose_php=Off, limit PHP modules to used one's, don't display errors to the visitor: display_errors=Off and log_errors=On, allow_url_fopen=Off, allow_url_include=Off and remove dangerous functions
Apache: ServerSignature Off, ServerTokens Prod
Install additional package: fail2ban (SSH bruteforce protection), chkrootkit (rootkit detection), logwatch (day to day log care), munin (ressource monitoring), apticron (watch for new update)

Do you see something else?

I'd recommend getting a host based IDS configured and the signature database populated, removing any content supplied with Apache. Also overhawling the permissions model around logging so that you don't need to be root to read the files.

There's also several things you might want to do depending on what you do with the server - check the timeout and max post size for apache, set an open_basedir for PHP (along with the usual performance tweaks).


Hijacked Aol Email Account - Lack of security? First, I'm very sorry if this is not the place I should ask this, but it seems to be the best choice.

My Aol email account was hijacked during the night two days ago : the password has been changed (obviously), but also the recovery/alternative email adress, and worst, the security question.

I called one of AOL services, 1-800-827-6364, located in the USA,  and after twenty minutes, Alex, the hotline guy, told me that it was impossible to do anything, because I wasn't able to answer the security question. (Obviously, it's not mine).
So clearly, I will never be able to recover my account, which i'm a bit sad about it, but whatever.

Isn't it some kind of security lack that some guy is able to connect to your email account, and is able to change your alternative email without sending some link to it before confirming the change ? I want to have you guys' opinion about it. (And by the way, if someone has a solution to offer, I'll take it happily !)

Fun fact, I received on my alt adress a mail just before the drama (but it was 04 AM) :

  Our records show that the password on your AOL account was reset.
  If you did not make this change, or would like to view your changes, please sign in to account.aol.com."

Isn't it some kind of security lack that some guy is able to connect to your email account, and is able to change your alternative email without sending some link to it before confirming the change ?

Yes. Some systems delay the change of secondary email from being effective in order to allow a legitimate owner to recover it, but most systems simply allow it and instead rely on detecting after the fact that it was indeed stolen in order to reassign it.

It is often painful to get them to do that. You would expect them to have a log stating that the password, secret questions and recovery email were all changed 2 hours ago, and that you have access to the secondary email (eg. by providing the timestamp they sent it).

Maybe the user scripts they are using are simply not prepared for this eventuality, or their first tier support is unable to recognise a compromised account. See the article of the "Epic Hacking" suffered by Mat Honan for a number of failures by Apple customer support.

  (And by the way, if someone has a solution to offer, I'll take it happily !)

Try to get someone brighter than 'Alex' to handle your issue. Request your call to be escalated.
Report the account theft to your local police.

The existence of a police report should increase your odds of being taken seriously.
The police may request AOL the connection info from which the account was stolen (probably a dead end, though).

and of course the sooner you act, it's more likely they will believe you, and harder that their logs "already got deleted".


How does a client's web-browser know if a website is HTTPS only? How would a client's web-browser know if a websites is HTTPS only?

Here is the scenario, a client tries to access facebook.com by typing facebook.com in the address bar, the browser automatically goes to the non secure version http://facebook.com but Facebook doesn't allow it, it sends a redirect to the secure version of the website https://facebook.com.

This scenario seems vulnerable to me, an attacker (man in the middle) could intercept the traffic while the connection still was in HTTP and make the server never send a redirect to HTTPS and thus breaking the secure connection.

I'm pretty sure people already thought of this and fixed the problem but how?

Having a list of websites which are HTTPS only that comes with the web-browser doesn't seem to be effective.

Maybe the first time the client connects to the website, it receive a message that says to access the website via HTTPS only for a specific amount of time?

A client's web-browser would know if the website is "https" only by checking if the website is listed in it's HSTS pre-loading list.

As you mentioned, in a classic scenario, a MITM could intercept an http GET request and prevent the redirection to the https version of the website.

This is why HSTS pre-loading was invented : browsers can verify if the visited website is in its HSTS pre-load lists. If it is the case, it will query the https version immediately, without trying the http first. This mitigates the MITM scenario


How easy is JavaScript code tempering for a mobile application? Code tempering, i.e. make some code modifications is a serious threat for mobile applications, as you don't have control over a client-side app. Furthermore, accessing to javascript code source is trivial. But is modifying it also easy? How easy is JavaScript code tempering for a mobile application?

Edit: I'm interested in both website running on a server, and client-side application

Assuming you are talking about a web-app running in browser because of the tags:

That depends, tampering with JavaScript is trivial, if no precautions are made and that is also true for Desktop/Laptop devices.

The simplest and most important precaution is to use HTTPS, therefore preventing the code from being changed using MITM attack.

Another more advanced ones include SRI, which require hashes of the script to be included in the header or at least a nonce being used. This improves security a lot, as an attacker would have to have significant control of the server to subvert it.

However, if an attacker has full control of the web server, there is currently no way to mitigate such an attack other than checking the script manually every time.


How to restrict plugins/tools like Netcraft and Builtwith to detect server side technologies? My organization wants to restrict all the plugins/tools like Netcraft and Builtwith to detect all the server side technologies for security reason like platform, operating system name and version, web server name and version.
Only configuring the firewall, closing the unnecessary ports and OS hardening doesn't help up to that extent.

Look into how these tools work. Some information may be easy to remove, by e.g. setting the headers for your web server to report more restricted information. This can hide exact version. However, it's far harder to hide that you're running Apache than that you're running Apache 2.4.35, as it may reveal itself in how it reacts to certain inputs.

Sanitize all web applications, and rewrite paths so they do not reveal applications. For instance wp-content is a dead giveaway for Wordpress. This is a large task, and realistically includes rewriting parts of the application, probably waving good bye to official patches without modification.

Hiding platform you host the system on is even harder, as different kernels implement the TCP stack in slightly different ways. Abstract things, such as TCP sequence numbers, may reveal information about the platform. TCP Syn cookies may reveal information. And so on. Completely obscuring the platform is likely to be hard.

And what do you gain, in terms of security? You spend a lot of resources to hide information. Why not spend that on securing your application, so that it does not matter if an attacker knows that you're running Apache 2.4.35?


Is it possible to intercept https traffic and see the links? If a site uses https and transfers the customers credit card and ID in the url. Will an attacker be able to intercept those through a MITM attack? And through Sniffing.?

Can the packets be sniffed somehow to see the links?

If the Man-in-the-Middle attack succeeds, then, by definition, the attacker sees everything: success here being that the attacker impersonates both the client and the server, so the client talks to the attacker, the server talks to the attacker, the attacker decrypts on one side and reencrypts on the other. With a successful MitM, the attacker can see the links, the page contents, the passwords...

But, of course, SSL has been designed to defeat MitM attacks. The main protection is the server's certificate. To succeed at MitM, the attacker must create a fake certificate with the server's name, but containing a public key that the attacker controls. The whole point of trusted root CA and certificate validation is so that the client does not get fooled by a fake server certificate.

(If the human users sees the scary warning from his browser "this server uses an untrusted certificate" and still clicks on the "I don't care, connect anyway !" button, then the MitM succeeds. Security against MitM in SSL relies on the idea that the human user does not do anything stupid such as disregarding that kind of warning.)

Edit: as for what can be inferred from passive sniffing, then this does not include the requested URL per se; however, a few things can be inferred:

The intended server name (the "host name" part of the URL) will be known to the attacker. Modern browsers show it in cleartext as part of the Server Name Indication extension. The name also appears in the server's certificate, which is sent as cleartext as well.
Encryption hides data contents, but not data length. The attacker can then infer the length of the URL, especially if he gets to observe several encrypted requests.
Since lengths leak, the attacker can more or less see how many elements are downloaded by the client and their respective lengths, e.g. linked pictures. Depending on the site structure and whether the attacker can also browse the same site (as, e.g., another user), then he may figure out with great precision what the target user is actually browsing.


How to use XSS vulnerability to read file on server? Can I use an XSS vulnerability to read files on the server by injecting PHP code to the page? Ex: Use document.write to inject PHP code that read the file.

No. XSS makes it possible to run Javascript in a browser of another user. This makes it possible to do request on behalf of that user. Since the code is only run in the browser, you cannot use PHP code.

If you have XSS and you want to run code on the server, the best approach would be to steal the cookies of a logged in administrator using XSS, and use the admin interface to further gain access to the server. Stealing cookies with XSS does not work if the cookie is marked as httponly, because then you can't read the cookie with Javascript.


I don't understand how BIPS got hacked http://www.networkworld.com/news/2013/112513-bitcoin-robbery-276352.html

In this story we can see BIPS got hacked, but I don't get how it was hacked when it was offline because of the DDoS.

The story links to another article which contains a little more data. Namely:

[The] company was targeted on 15th November by a massive DDoS attack. Then on 17th November, it was followed up by a subsequent attack that disabled the site and “overloaded our managed switches and disconnected the iSCSI connection to the SAN on BIPS servers”.
“Regrettably, despite several layers of protection, the attack caused vulnerability to the system, which has then enabled the attacker/s to gain access and compromise several wallets,” the company said in a written statement.

From this, we may guess that the initial DDoS was not the actual attack, but may have been a way to harass the security teams, to force them to switch to emergency systems with perhaps suboptimal protection, to serve as a diversion, or maybe to gather information on the network structure and safety procedures. A DDoS or something equally crude and brutal is often seen as part of a larger attack scheme, if only for the chaos and confusion is creates.
The sentence about an "overloaded switch" would indicate that the switch was spammed to death with fake packets, in order to demote it to hub mode, thus allowing much easier eavesdropping of packets in the network, in particular exchanges between the BIPS server and its storage system, which appears to be a remote SAN accessed through the iSCSI protocol. In effect, this would allow attackers to read and write arbitrary files on what the server sees as "its hard disk"; that vulnerabilities may follow is then unsurprising. However, all of this supposes that the attacker could already hijack another system on the same LAN, so it is pretty clear that we do not get the full picture here.
In any case, this does not seem to be a weakness in the Bitcoin protocol itself.


Used laptop with potential BIOS/SSD firmware malware I bought a used laptop and I'm concerned about the integrity of the firmware on the hardware and bios. I realize these types of malware are very rare.

1) My question is that if I assume that the BIOS or SSD or NIC firmware is indeed compromised from the previous owner, what are some of security features that something like Qubes OS will provide me despite this?

2) I have read that installing AIDE/Tripwire on dom0 at the beginning of a fresh Qubes OS install can be a powerful tool to see whether the BIOS malware infection is going to damage the dom0 and other downstream VMs in any way going forward. Do you think this is useful?

3) The manufacturer website has downloads for BIOS firmware, SSD firmware, wireless LAN/WAN, etc. My BIOS and other firmwares are 1 year out of date. If I update these firmware over windows, and then wipe windows from SSD and start a fresh Qubes OS install, will the firmware stay updated? And will it also remove potential malware that was previously infected?

4) What are some good practices for preventing these types of firmware attacks? My system uses TPM 2.0. Is there a guide to get TPM2.0 working with dom0 to check and analyze logs? Is it a good practice to turn off/not update intel ME, disable intel TXT, AMT, and secureboot? Because that is what I did.

Hypothetical questions like this are difficult to answer and are thus discouraged. In order to be able to receive specific answers, you would first actually need to have been infected by the malware. Second, you would need to be capable of discovering, extracting, and analyzing said malware before anybody would be able to tell you what you should be worried about. So, I will hypothesize about the worst case scenario.

  1) If I assume that the BIOS, SSD, or NIC firmware is indeed compromised from the previous owner, what are some of security features that something like Qubes OS will provide me despite this?

Without knowing the exact capabilities of the malware, the worst case is that Qubes will not offer any protection. Since those components are at such a low level, compromised firmware could allow unobstructed access to all hardware and software on the computer. Virtual machines are no more secure than the hypervisor they are running on.

  2) I have read that installing AIDE/Tripwire on dom0 at the beginning of a fresh Qubes OS install can be a powerful tool to see whether the BIOS malware infection is going to damage the dom0 and other downstream VMs in any way going forward. Do you think this is useful?

It would be interesting to see the source of this claim. If the BIOS is truly compromised, capable malware could likely hide itself from any sort of userspace detection, so this wouldn't do you any good. AIDE/Tripwire keep track of file integrity, and I believe they encourage use of an external database so that it is less likely to be tampered with. Even if the malware needed to modify your userspace files, it could also probably replace or interfere with the functionality of these tools to evade detection.

  3) The manufacturer website has downloads for BIOS firmware, SSD firmware, wireless LAN/WAN, etc. My BIOS and other firmwares are 1 year out of date. If I update these firmware over windows, and then wipe windows from SSD and start a fresh Qubes OS install, will the firmware stay updated? And will it also remove potential malware that was previously infected?

Again, this depends on the capabilities of the malware and the method in which firmware is updated. Maybe the malware doesn't allow its firmware to be overwritten through the normal vectors. The only way to override anything like this would be to flash the chip directly with SPI or JTAG.

  4) What are some good practices for preventing these types of firmware attacks? My system uses TPM 2.0. Is there a guide to get TPM2.0 working with dom0 to check and analyze logs? Is it a good practice to turn off/not update intel ME, disable intel TXT, AMT, and secureboot? Because that is what I did.

The only way to prevent it in this case would be to buy a computer that isn't already compromised. I do not know what TPM has to do with logs. Without looking each one up, those Intel components may add some unnecessary attack surface and should probably be disabled. I also don't know of a security-based reason for why you'd turn off secure boot, since it can prevent some attacks (but won't likely provide protection against this type of malware).

TL;DR: maybe don't worry so much about something like this, since it's theoretically very hard for anybody to defend against it, even a security expert. If you really have to worry, buy a computer from a trusted source and don't ever let it out of your sight.


security performance criteria in employee reviews Have any of you security professionals been able to get security performance metrics into reviews that managers conduct for their employees?  If so, are there any helpful resources you could share to make that happen?

I'd like to respectfully offer a different perspective from the perfectly valid answer and comments already here.

I'm reading between the lines a lot, but I believe the original question is trying to achieve quite a good (and difficult) thing - prioritize security awareness at departmental level, with objective measurements of awareness.

The effect being that various managers are kept aware of how good direct reports are with regards to IT security, and there are hard numbers to refer to, not individual incidents. It's not just left as another thing for HR to deal with - you're treating it as training, instead of discipline.

I feel that IT Security is so nuanced that individual managers are better suited to evaluate their direct reports than HR is.

Phishing is much more of a threat to senior managers or financial controllers. It's important that they are "phishing-resilient" because their accounts have access to business critical systems. I'm not fussed if the maintenance crew score poorly against phishing - their accounts are likely to have very few privileges. In contrast, the maintenance crew has to be great at physical security, because they have access to the entire building (which may include switch cabinets, cable runs, etc.)

The metrics part is great because it's better to have numbers from a careful study instead of single-case incidents. But this is the hard part.

To do this you would need a well-designed framework for constant and systematic evaluation of each staff member, AND a "red team" that constantly tries to tailgate into buildings, leaves "malicious" USB drives in employee parking lots, phish employees, email nude-pics.jpg.exe to staff, etc. At the end of the day, you could then indeed construct great objective measurements:

"Resistance to phishing attack": Received 24 test phishing emails, visited the phish page 2 times, entered credentials 0 times,
"Safe treatment of unknown USB Drives": Returned 2 out of 2 "lost" USB drives to the IT Helpdesk.

Excellent, but very resource intensive. You could then gamify the system to increase response by comparing ratings between departments, improvements over time, awards for perfect scores, etc.

If you planned on deriving metrics from non-training, real-world incidents, I would agree that those are much less useful for staff training and awareness.


Is there a utility you would use to create wordlists from directories and files? I have a home directory and a gpg file I am attempting to brute force. Is there a utility that you know that will recursively create wordlist from directives and file contents?

You can use crunch for that:

-q filename.txt Tells  crunch  to  read  filename.txt  and  permute
what is read.  This is like the -p option except it gets the input
from file ‐name.txt

crunch manual


Can I use hardware token OTP to stop piracy? Our firm sells an offline desktop (.exe) software, we are thinking of using OTP (from hardware token like in internet banking) to stop people from copying the software without permission. Basically, each legitimate copy will have its own serial number and hardware token.

We are thinking that when the application starts up, it will show a login screen where the user is supposed to enter the OTP from the token. The token will generate OTP based on serial number, the current time, and a secure algorithm. THe application will authenticate the entered OTP. We are hoping that with this mechanism, one copy of the software will only be usable by one person (who owns the OTP).

The purpose is to stop casual users from copying the software (e.g. to friends, family). We know this isn't 100% secure, and I can think of many ways serious pirates can still copy the software illegitimately. But in this case, we are interested in stopping casual users to copy the software (e.g. to friends, family, etc.) which are normal behaviour here. Is there anything to worry about using this method. The most worrying flaw that I can think so far is that the user can manipulate the local time of the computer (this is very easy to do in Windows). Is there any reliable time-keeping in a computer that is hard to tamper with?

It is almost impossible to prevent a software program from being pirated, but to answer your question, if the user has no advanced computer skills you may be able to achieve some level of protection.

To prevent manipulating of the local time, each time your software starts and at a certain period of time, you should check system time and store it in a encrypted file. If the time you have read is before the last save time, then the date has been changed. Moreover, if the file is missing then someone tried to tamper with your application.

This is just a minor protection mechanism. More advanced protection mechanisms include:

Attempting to detect a debugger attached to the program
Encrypting parts of the code and decrypting them on runtime, use per-function signatures
Have other threads check this signatures
Analyze statistical information such as execution time, to detect attached debuggers

You can also have a look at SafeNet HASP products. Their purpose is to protect software from unauthorized use. Your software is wrapped in multiple layers of HASP software and a hardware token is needed for the application to run.

More details here:
http://www.safenet-inc.com/products/software-rights-management/sentinel-hasp-hardware-keys/


E-Commerce website with REST backend : do I have to secure Backend URLs accessed by Front end public pages? I have an e-commerce website with a REST backend and a Single page JS as front end.
I intend to secure my REST backend with OAuth2.

I don't want to oblige the user to authenticate when he first comes on the website, because as a e-commerce website, it is normal for the user to navigate to see the products, etc (maybe I am wrong...). So, on these 'public' pages, as I perform Ajax calls on by backend, is it worth to secure these URLs on my backend ? If not, what are the risks ?

Indeed, if I secure theses URLs on my backend, what can prevent any user to access these secured backend URLs by performing requests from the frontend ?

Maybe I am paranoid, but I think I should try to secure these URLs to prevent some attackers to use my backend for free or something else.

There would be no problem anymore for me if I oblige the user to authenticate. That's why I ask again if it is really the way to go for e-commerce...

Thank you very much.

Yes.  You are responsible for ensuring that only authorized access is allowed to your REST interface.  If the interface is meant to be accessed only from tje front end, you are responsible for ensuring that this is exactly what happens.

What are the risks?  well, what functionality does your REST API offer?  If an unauthorized cleint can connect, read data, and submit commands, then they can use your REST API to do whatever your REST API can do.  They can delete whatever your API will let them delete, modify whatever your api lets them modify, read anything that it lets them read, and create new whatevers that your api lets them create.  And i ftjere are other issues with your API implementation, like buffer overruns, then those will be exposed to the attacker, too.


I uninstalled GnuPG. Can I delete the ~/.gpg folder? I uninstalled GnuPG to re-instal it without Mail. I had to delete it rather than work out if there is a way to stop it from trying to sign my email as I had to send the email quickly! I now am going to install GPG Suit again and customise the email out of it but I want to know what happens with the current ~/.gpg folder. Do I delete it myself and a new one will be built when the program is installed or do things just get mashed on top without any adverse affect? Thank you.

Be sure you don't have keys stored in the .gpg folder that aren't saved elsewhere, and you will be fine deleting the folder.


Bluetooth 5 - is a pass key enough? So far I understood that from Bluetooth 4.2 onwards the Pass Key method is safer due to pre-shared public keys and a 128-bit encryption key. After this pairing process occurs, is the link between the two devices kept encrypted? Meaning that if users sniff data transfer between the two devices they can't see the actual data.

My device uses Bluetooth 5.0 and so I should not be concerned with the Pass Key method not being safe I think. Furthermore should the link between the two devices remain encrypted this would already be a secure measure. Should I be concerned with other security threats?

Thanks

You shouldn't be worried. 4.2 Bluetooth devices use Long Term Key to encrypt the data trasmission between them. The generation of Long Term Key are based on Diffie-Hellman. The generation of that key occurs after devices exchange public key and pair.


Which websites support U2F? FIDO Alliance's Universal 2nd Factor (U2F) is a new and promising approach to replace passwords. The FIDO Alliance comprises of many players but so far only Google website seems to support it. Are there other websites I can use to login with my U2F token?

Here www.dongleauth.info is list of websites,
self-hosted software and USB dongles compatible to U2F (as well as One
Time Passwords)


Help removing my domain from blacklists I bought a domain few days before. but it came to my attention that my domain has been blacklisted by many antivirus programs and search engines as the domain for previously purchased by somebody and he misuse it. Though i have asked few antivirus companies and search engines to review the domain, but i want to know what else i should do to get this thing fixed. Also what type of security certificate should i buy and from where?

please tell me the process in detail for buying a security certificate and best ways to get my domain name removed from blacklisted list.

Your best bet for this issue would be to compile a list in Excel that shows all the blacklists that you are on, and begin with identifying if the blacklist requires you to call and confirm the information or if it requires you to register with an account and confirm that it is no longer spamming.

| Blacklist Name | Date Identified | How Long before it can show clean | Contact Information |

I used to work at an ISP and we had IP addresses for different regions. Thus a large amount of traffic would get blocked because of people getting infected.

I found that for the spamhaus ones it would usually take a few weeks of no one being infected for us to be removed. Symantec and a few others also go off these lists, but it can also help to call and explain your issue. Barracuda is really good about this as well, if you call and inform them of the situation they will generally put in a ticket and 24 hours later you should be off the black lists.

As far as google, you will need to have your site re-indexed if you are showing as a malware site on there.

EDIT:
Here is a list of blacklists, and there delisting policies that should help you well along your way.

SPAMHAUSE - Removal http://www.spamhaus.org/lookup/

Google Malware Removal - https://support.google.com/webmasters/answer/168328?hl=en

Barracuda Spam Removal - http://www.barracudacentral.org/rbl/removal-request


Common SSL/TLS Vulnerabilities risk classification I'm working on a school project, which is a tool that generate security auditing reports in PDF.

I'm currently using testssl.sh which check for SSL/TLS Vulnerabilities

When a vulnerability is identified, I want to indicate to the user how much important the threat is to confidentiality and how easy it is to exploit.

I made this table a few days ago, and according to the CVSS v2 scoring system, the majority of the vulnerabilities severity are Medium, and many vulnerabilities share the same scores. I got confused on how to rate these vulnerabilities based on Impact/Exploitability and whether a vulnerability is a real threat.

Is there a way to classify these vulnerabilities into risk categories (i.e: Low, Medium, High) to show to the user how serious a detected vulnerability is ?

First, you selected a great idea for a project. Scanning a HTTPS Site and generating a report on the vulnerabilities with the specific SSL/TLS stack is small enough to be doable and useful still.

The problem with LOW/MEDIUM/HIGH classification for these vulnerabilities is that some of them are really easy to pull off, like heartbleed, but the result is not always very useful. Again, in the case of Heartbleed, you get to read some memory, but dont control what is read. It might reveal a certificate or session ID, but will probably be more junk than anything useful. That is why it's Exploitability was rated at 10, but the impact was a low 2.9.

Sometimes you have the opposite, where a misconfiguration which is uncommon will give remote root access, but the conditions to successfully exploit it are difficult. This would give you a low exploitablity score, but a high impact

You should consider using a standard formula, to determine risk, such as the one from OWASP. Risk = Likelihood * Impact

They have a more complex model for determining severity:


DDoS attacks on SSL/TLS Upon receiving a ClientHello message, most of the time a web server (and without authenticating the client) performs a diffie-hellman exponential modular operation to compute and save the f = g^a mod p which he would communicate back to the client in its ServerKeyExchange message. Does not that make the server vulnerable to DDoS attacks ? Does the protocol implement a mechanism to mitigate this sort of attacks ?

While there is some overhead in those calculations, this is generally not a problem as DDoS-attacks tend to exceed the network interface's capabilities before the RAM or CPU are overwhelmed with TLS-handshake calculations.

The calculations done for a regular, state of the art dynamic website delivered over HTTP do exceed the TLS handshake calculations by at least an order of magnitude. Thus, counting on the open TLS connections DDoS-ing a webserver seems somewhat superficial. Yes, there is some overhead, yes, it takes up ressources - but not enough to bring the machine(s) to a halt. Just actually making the machines deliver the content can be way worse.

Furthermore, this way DDoS amplification methods can not be utilized - attacking the network connection directly is more promising, from an attackers point of view.


Is there a tree hash form of MAC that can be used when encrypting data for storage on S3 using multipart upload? I am storing files on S3, some of which are very large, and need to be stored encrypted. I had planned on using Galois Counter Mode since it includes the MAC, however this won't work with multipart uploads to S3. I need to encrypt each chunk and store it on S3 along with a proper MAC, then calculate the MAC for the entire file once all parts are in place. Once a multipart upload to S3 is "completed" the parts are no longer accessible and there is just the single file. I think I need some tree hash mechanism for supporting this (note that the Amazon Glacier storage system is using this method), but I would rather avoid rolling my own MAC for all the usual reasons.

Here is a page discussing how Glacier uses tree hashing: http://docs.amazonwebservices.com/amazonglacier/latest/dev/checksum-calculations.html

Any suggestions? Many thanks in advance.

Update

I finally got this working. I hacked up the GCMBlockCipher class in BouncyCastle to support this. Here are the changes that need to be made:

The encryption key and IV will need to be safely stored somewhere (perhaps encrypted in a database) so that all machines processing the individual parts will be able to calculate the same initial values like hash subkey.
While the total length does not need to be known in advance, there will need to be a starting block index sent with each chunk, and each chunk sent (except final) must be a multiple of 16 bytes.
The counter value needs to be incremented based on the starting block index for the chunk.
An implementation that handles encryption as one long stream performs a single GHASH multiplication per processed block. By the time the last block is processed the hash value will be correct. In a parallel implementation you may be processing a chunk somewhere in the middle, so you have to make up for the "missing" multiplications that would have been performed when processing subsequent blocks. If the total length is known in advance this correction can be applied right after each chunk is processed, or at the end once all parts are in place. The hash values for each chunk will need to be stored.
At the end all of the hash values for the chunks (with multiplication corrections applied) need to be xor'd together then fed into a modified form of doFinal() which performs the rest of the GMAC calculations. Note that the final byte count needs to be fed in as well since that is part of the MAC.

The more mathematically inclined can probably come up with a better way of handling this. :-)

The GHASH component of AES GCM is linear. If you know the lengths of all file parts and the order in which they will be assembled, you can use this linearity to compute the polynomial value you need, and then add in the random part that makes GHASH into GCM. The spec for GCM should provide enough guidance on how to do it.


Storing passwords in access-restricted Google spreadsheets? I saw someone's interesting practice to store sensitive information.

He is saving all his thousand logins (including banks and email) in a access-restricted Google spread sheet, stored on his Google drive.

The link to the document is shortened using some URL-shortener and he uses that simple-to-remember link to open the document every time he needs a specific password or an account number.

His argument is that the practice is secure enough because:

The document is on his personal Google drive protected by Google, as for the external attacks. So the location is more secure than e.g. his PC.
The access to document needs google login, which is 2-way secured.
P.S. (I mean 2-step verification of google)
The URL to that document is not known to anyone else except himself, his browser, and the shortener service, all of whom cannot access the document without login details. Rest of the world doesn't know the location/URL.
He opens the document only on his PC, laptop, and mobile.

The information in such a document is everything that someone needs to impersonate him and I don't think this method is so foolproof.

Can some one justify technically, how secure this practice is? Can you suggest an alternative as easy as typing a URL everytime he needs to recall a password?

P.S. I am impresed at first sight, with these two professional utilities (password managers) dedicated for this purpose, came to know from the answers below: KeePass and Lastpass (any others?)

While both seem to be cost-free, first is preferable to me for being open-source -- I am going to give it a try.

Mentioning efficient alternatives (esp. as easy as a short-URL above) like this will be the most important take-away from this post. For me, in spite of having heard about password managers many times, I never really focused on them.

A threat to beware of is updates to google drive/google docs.  For example they add a feature to auto-cache frequently-used files and all of a sudden it's all on the phone in plaintext.  In fact it might already be there. Or the user installs the google drive app with default options for an unrelated reason. The big web-app firms are concerned with convenience and features, less so about security in ths sense (2FA is one thing, but once the data is in your hand it's your problem).


What does mov qword rbx, '//bin/sh' mean? I follow this tutorial in order to understand how the 64 bits shellcode work.

So, I code this shellcode and it's works:

BITS 64

xor rax, rax
mov qword rbx, '//bin/sh'
shr rbx, 0x8
push rbx
mov rdi, rsp
push rax
mov rdx, rsp
push rdi
mov rsi, rsp
mov al, 59
syscall

I understand all of this code except two instructions:

mov qword rbx, '//bin/sh'
shr rbx, 0x8

I understand that a qword is a data of size 64 bits but when I remove qword the shellcode doesn't work. Why I need to add qword?

And after the instruction shr, my strings should be looks like '%00//bin/s' no? Why not use shl instead of shr?

I understand that a qword is a data of size 64 bits but when I remove qword the shellcode doesn't work. Why I need to add qword?

Because you're moving a qword constant. When you type '//bin/sh' you're expressing an 8-char array. By prefixing with qword you're instructing the assembler to treat the right hand operand as an inline 64-bit integer. By default it will probably treat it as a pointer to that string, or some other behaviour.

And after the instruction shr, my strings should be looks like '%00//bin/s' no?

Integers on x86 architecture processors are stored as little-endian. If your compiler took it literally, your string would be encoded in ASCII as follows:
/  /  b  i  n  /  s  h
2f 2f 62 69 6e 2f 73 68

Which you can also show in the following instruction:
mov rbx, 0x2f2f62696e2f7368

This encodes as follows:
48 BB 68 73 2F 6E 69 62 2F 2F

We can split this up into 3 sections:
48        BB                     68 73 2F 6E 69 62 2F 2F
|         |                      |---------------------|
 \         \                             literal
  64-bit     B8 = MOV instr
  prefix        + reg operand
                + r/m operand

In this case the mov instruction byte (BB) also contains a 7-bit field which describes the register we're moving into (rbx) and the type of right-hand operand (literal).
But note carefully: the literal is not in the same order as the ASCII representation we saw above. Instead it is reversed due to little-endianness.
The problem here, of course, is this can't possibly be what happens in your shellcode. If the name was reversed in the bytes then the function you call would see hs/nib// and fail. Instead, your assembler is smart enough to realise that you want those ASCII characters in byte-order, which means it really encodes the following instruction:
mov rbx, 0x68732f6e69622f2f

This produces the following encoded instruction:
48 BB 2F 2F 62 69 6E 2F 73 68

As you can see, the // comes first (2F 2F) in the byte-order representation.

Why not use shl instead of shr?

You do both. Your code is missing an instruction, which can be seen in the tutorial. After the shl rbx, 0x8 there immediately follows a shr rbx, 0x8.
Their explanation does it justice:

After shifting 0x08 to the left (think of each numeric placeholder in the string as a 4, so moving 8 bytes over actually moves us two spaces) pushes the 11 right off the end. Now we have this:
0x68732f6e69622f00
Then we put it back like before by using shr by the same value, and we get this:
0x0068732f6e69622f
This successfully gives us our string terminated by a nullbyte without generating a single nullbyte in the machine code.

The first slash is simply a sacrificial character which gets discarded during the shl.
The reason for this trick instead of just loading the null in the first place or masking the rightmost byte with zero is that it requires no null-bytes in the exploit payload, which is very useful if input is ignored after a null (e.g. if a string is being copied with strcpy).


Is it secure to store a two factor authentication seed in a password manager? I wonder whether it is really secure to store the Two Factor Authentication seed code (e.g. the secret key for TOTP) within a password manager together with the user and password for the service.

If someone gets access to the decrypted password database (e.g. while the password manager is unlocked or by brute forcing the master password), the attacker also has access to the TOTP token which makes Two Factor Authentication pretty useless.

In my eyes, storing the Two Factor Authentication code in the password manager is everything beyond secure.

Assuming you mean the initialisation code for a given 2FA series, such as required when you first configure a TOTP generator for a specific service, then yes, storing it with the other login details isn't ideal.

As you say, should someone gain access to the password safe, they'd be able to log in without any hassle by using their own TOTP generator with the same initializations.

If you wanted to keep 2FA initialization values, a second password safe, kept apart from your day to day one wouldn't be a terrible idea, but you wouldn't want to keep the password in the main safe! Since you should only require the values very infrequently, they don't need to be as easily accessible. Even a print out in a safe may be acceptable.

Some services allow you to generate one use codes to regain access to your account in the event of 2FA device loss or failure. In that case, it's probably better to rely on those, rather than keeping the initialization values around, since they usually can't be used to gain access without a notification being sent.


Reducing risk from logging I am following the OWASP Risk methodology and have the threat "Installed software exploitation". I've created this risk based on the idea that a risk is found in say phpMyAdmin which can be exploited.

My question is how does one practically reduce the risk under the section Vulnerability Factors > Intrusion detection?

My server runs Ubuntu and has UFW enabled and ports severly restricted. However if someone were to find an upload opportunity for example and exploit it and hack the server - surely even an IDS wouldn't prevent it running and/or log the effect.

I appreciate there are multiple possible vulnerabilities but just wondered if there were any generic solutions?

As with many things, ensuring you detect a successful exploit requires defense in depth, and a little preparation.

We'll start with the assumption that an attacker will somehow break the "target software" and either have it or the account it runs under execute arbitrary code supplied by the attacker. Our goal is to be able to detect that this has occurred.

First, on the prevention side, you'll want to ensure that whatever target software runs under a separate account with least privileges. This implies that even a successful attack will not have access to the rest of the system. You'll also want to make sure the system gets regular security updates, etc. This mitigates the risk that the attacker will be able to elevate privileges from the account he popped to root or something else interesting. Finally, have only the minimal software needed, ideally only for a single purpose. (Don't comingle web/app/database on the same box.)

Now once you have those done, you can start looking detecting the exploit. For that, you should start with OS event logging. Did any unusual processes start or stop. Presumably, there'll be a pattern of "normal" usage, and if the attacker runs their own code, it might be in a separate process. An IPS/IDS should provide lots of insight into this -- much better to find a good one and configure it than to try to roll it yourself. Any IPS/IDS worth its salt should be sending event data out to a separate host (as @user400344 suggests).

On the OS firewall side, most server software doesn't initiate TCP connections to random endpoints, so you may want to configure the firewall to only allow traffic outbound to known destinations. This would also make it a little harder for an attacker to exfiltrate data. Upstream from the server, you could monitor TCP traffic to ensure it matches what you expect.

Keep a log of all processes started. There are various programs that can help you do this. (Also pipe that off the host.)

Next, at the application layer, you'll want to write to syslog or another service that runs separate from the target software. During the exploit, the attacker would be able to write to syslog, but not modify it.

If the target software schedules jobs, accepts commands, etc., then check to ensure those aren't modified except through an expected workflow.

You could run an IPS/IDS at the application layer too (web app firewall, if the target software is a web server), in which case that should provide additional defense.


Logged out of Facebook on all devices on a sudden. Should I be worried about being hacked? A while ago, I was opening Facebook app on Android and then I got the message "Session expired. Please log in again.". I then tried logging in with my current password and was success to log in my account. Before, long time ago, when I created this account, I'd set up two-factor authentication for my account and when I checked after I did the log in, it was still active.

After that, I opened my laptop and Chrome then went to Facebook, just to find out that the session on PC was also logged out. After I logged back in, I went to security under settings and checked the section "When you're logged in" and I saw that all of the past logged in entries are gone. The only entries I got were those log in on my phone and my laptop (also appeared to be my trusted devices).

I was thinking of someone had tried (and succeeded?) to access my account, then logged out of all current sessions. However, I did not get any suspicious prompt on my phone to authenticate an unusual log in (Like "Did you just logged in near location xxxxx?"), also no warning email from my registered email telling me about my account being accessed on an unrecognized browser or computer.

Tl;dr: Facebook account suddenly got logged out of all devices, password was not changed, logged in entries are gone, no email warning about account being compromised, no two-factor authentication prompt showed up.

My questions are:

Are there any chances that someone was successfully able to get into my account? If yes, then how could they bypass the two-factor authentication?
Is that incident normal or I should take security actions?

Thank you!

Facebook reported a data leak today and forced a large number of accounts to log off as a precaution. Source: NY Times and Facebook.

That NYT article says "The company forced more than 90 million users to log out early Friday, a common safety measure taken when accounts have been compromised."

Additional article from The Hacker News - "unknown hacker or a group of hackers exploited a zero-day vulnerability in its social media platform that allowed them to steal secret access tokens for more than 50 million accounts" and "Facebook has already reset access tokens for nearly 50 million affected Facebook accounts and an additional 40 million accounts, as a precaution"


Is it possible to safely access a USB pen drive in Windows via a virtual box with Linux? This is for a computer that has many different people plug in their pen drives into, for taking printouts. As a result, the computer is always infected with all kinds of Windows viruses.

Once the partitions of the system are deleted and Windows XP (yes, they still use XP) is re-installed, I wanted to suggest they use a Linux dual boot. But the procedure would be: Boot into Ubuntu, plug in the pen drive, copy relevant files to hard disk, reboot computer, log into Windows, open file and take a printout.

These people are not very knowledgeable about computers, and they have many customers, so the loss in time in switching between OS'es is too much. Their updated antivirus fails to detect most viruses.

I was wondering if instead, there is any way to run Windows XP, and have an Oracle virtual box in it which has Ubuntu installed in it, and when the pen drive is inserted, it gets mounted in the Ubuntu inside the virtual box instead of Windows, and hence prevents Windows from getting infected?

If not, then any other solution that could keep Windows from getting infected?

ps: They have a very old system with 2GB RAM, and they are not financially well off, so upgrading isn't an option.

EDIT: The answers in "how to safely access USB" does not answer my question. The question is about connecting a pen drive directly to a virtual OS and bypassing the hosy OS.

Assuming you do not use true passthrough (where the USB PCI hardware is exposed directly to the guest operating system, allowing the guest to modify the option ROMs, which execute on the host), it should be safe. Do be aware that virtual machines have a nasty history of not being particularly difficult to escape from, so advanced malware utilizing unknown flaws in the program may very well be able escape to the host.


Don't allow access to phpmyadmin page over the network? XAMPP Windows Is it possible to block access to phpmyadmin page over the network in XAMMP Windows? I want only localhost(127.0.0.1) to be able to access the page. Other people connected to the same network shouldn't be able to access it. Eg. if 192.168.1.2 tries to access 192.168.1.1/phpmyadmin they couldn't access it.

If I was running phpmyadmin and wanted to restrict access to localhost, I would use the Apache web server and would use the Order, Deny, and Allow directives to govern access. For example:

<Directory "/my/restricted/content" >
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
</Directory>

If you don't use Apache but your web server has something similar to Apache's mod_authz_host you should be able to set up a similar access restriction.


Can a CSR be created in OpenSSL with SHA2? Can a CSR be created in OpenSSL with SHA2? If so, what would the command be and what does this tell the CA, if anything? If you could create a CSR using SHA2 would it "tell" the signing CA to use it on the entire cert chain?

You can add, for example the -sha256 flag to the OpenSSL command line when generating the CSR.  I don't believe any CA will change how they sign your CSR based on this, and it certainly won't affect the certificate chain.  They're not resigning the cert chain for each key, the only signature operation they do is on your CSR itself.  Any intermediate/root CAs provided will be exactly the same for all customers.


Protect Identity with VPN using Cloud Services - Google Drive, Microsoft OneDrive, Dropbox, etc If you are using onedrive or any other cloud storage system is your identity safe when you connect and want to browse using a VPN or should you shut down all USERNAME / PASSWORD required services before using a VPN connection in order to remain anonymous?

it's a good question, especially considering that your browser's sessions are primarily saved as cookies and so the ip address you're coming from - vpn or not - doesn't really matter.  As a particularly egregious example, take facebook links on sites.  Those are loaded from facebook, which means you send them your cookie to then request them.  So if you're logged into facebook, facebook knows every site you visit and yes, your Ip too.

So the answer is yes.  To remain more anonymous on your VPN, you should only use incognito or private mode browser and never log into any identifying site that you also use without the vpn.


POODLE attack against TLS vulnerability According to a Qualys Blog, POODLE can now be used against TLS (all versions). I've read separately that in order to execute POODLE against TLS, the server must skip a step in validating the padding. Most sources name two manufacturers which skip this step.

How would an administrator verify or fix their implementation so that they are not vulnerable? (for example, if the company runs their own dedicated web server)

The blog you linked says to use the SSL Labs test for verifying and, if vulnerable, apply the patch supplied by your vendor.

If the company wrote their own web server, they are the vendor and will have to write their own patch.


Minimum acceptable CIS compliance percentage? How does a whole asset fail a CIS benchmarks assessment?
I am using Rapid7's InsightVM tool to run CIS scans on couple of our servers. One of them reported 68.27% compliance, while the other scored close too. However, in the summary of the asset, it has marked the status of the asset as 'Failed'. Is there a minimum compliance percentage an asset should meet for CIS compliance? I understand each benchmark rules failing or passing. But would like to understand the minimum acceptable compliance required for an asset to Pass, if there is such a minimum threshold. I
Is there a threshold percentage that the asset should meet?

I think there is no precise threshold for the CIS compliance. In my company we had to go through this server hardening process. What we did, we addressed all the failed ones. If company policy/standard allowed us to change the config as CIS recommended we did that, otherwise we mentioned the compensating controls against that or treated it as accepted risk. Its is not feasible to comply with all the listed requirements of CIS but failed ones should be appropriately addressed.


what fails in speculative execution that allows the read of memory out of bounds in Spectre vulnerability vs. normal CPU behaviour? Following google's Project zero blog entry for Spectre/Meltdown, there's this piece of code that exemplifies the attack:

struct array {
    unsigned long length;
    unsigned char data[];
};
struct array *arr1 = ...; /* small array */
struct array *arr2 = ...; /* array of size 0x400 */
/* >0x400 (OUT OF BOUNDS!) */
unsigned long untrusted_offset_from_caller = ...;
if (untrusted_offset_from_caller < arr1->length) {
    unsigned char value = arr1->data[untrusted_offset_from_caller];
    unsigned long index2 = ((value&1)*0x100)+0x200;
    if (index2 < arr2->length) {
        unsigned char value2 = arr2->data[index2];
    }
}

It is explained that the speculative execution followed by the CPU, will try to execute until

arr2->data[index2];

before reaching the condition

if (untrusted_offset_from_caller < arr1->length) {

that would prevent the access to a zone out memory of bounds.

My question is:

what would have prevented access to that zone of memory in a normal execution if the code would have try to do so explicitly?

I suppose in some place the OS and/or cpu memory access checks should stop that and that the speculative exec simply jumps over that (?).

It seems that patching that (not actually made) check (if my previous guess is correct...) would not suffice or is not the correct approach, as it has already been stated that two other conditions are needed: flushing the branch predictor & take the full address of the branch instruction into account (it seems that CPUs don't do that nowadays), but:

wouldn't the checks (if the answer to the first question is that additional checks are needed) or that 'flushing' impact in performance? and if so, has it been estimated how much? (when those supposed CPUs would/will be made).

Simplifying things a little, the problem is that something like

if (*p1) x = p2[256 * *p3];

may be processed as:

start loading *p1 into t1.
load *p3 into t2, and set t3 to 0 if it's a valid fetch, 1 otherwise.
load *(p2 + t2*256) into t4
wait for t1..t4 to be ready
if t1 was set, then...
  if t3 is set [access was invalid] then fire an invalid access trap.
  otherwise copy t4 into x.
discard t1..t4.

If reading *p1 yields a zero value, the fact that *p3 is invalid must not cause a trap (since code wouldn't actually ask to read *p3).  For whatever reason the designers at Intel thought it was easier to delay checking the validity of the first memory read until after the fetched value was used to compute the address of another speculative read, than to have an invalid memory read immediately force the speculator to assume its prediction was wrong.

Note that the problem isn't that the processor speculatively fetches from *p3.  The problem is that the processor makes use of that value without regard for whether it was legitimately acquired.  While present attacks focus on using the fetched value to compute an address, and then using the cache to find out what address is fetched, the fundamental problem is that the data gets read and latched without regard for whether the access is legitimate.  Any time a device physically fetches data that should be inaccessible will create a potential for side-channel attacks.  The best way to prevent such attacks is to avoid having the device acquire such data in the first place.


What are the privacy differences with Azure trustee delegates in China, Germany, and other locations? Azure has different privacy agreements set up with different datacenters as mentioned in this footnote

Azure is now available in China through a unique partnership between Microsoft and 21Vianet, one of the country’s largest Internet providers. (https://www.azure.cn/)
In Germany, Azure will be available via a new data trustee model whereby customer data remains in Germany under control of T-Systems, a Deutsche Telekom company, acting as the German data trustee.

In addition there are presumably different regulations for hosting in a UK based datacenter vs one in the US
Question

What are the privacy differences with Azure trustee delegates in China, Germany, and the GA offering?

Would it ever make sense for a US based person to leverage a German (or other) datacenter for production use?

Should I assume the lowest common denominator of privacy when two different datacenters interact with each other?

What would guide a US based person to opt in, or opt out of a given datacenter?

Specifically for the German one, Microsoft is an American company, therefore subject to American laws. Among many other things, such laws include the possibility to request information from an American company stored on their systems, whether or not those systems are on American soil.

I'll not go into all the details, suffice it to say that the way such information is requested and retrieved (e.g. without judicial oversight or informing the person the data concerns) often clashes with European privacy laws. Within the EU, Germany has some of the toughest privacy laws.

So the idea is that although it's still full Azure with everything you might expect, in the background it is not Microsoft operating the datacenter but the local German partner which means the data in the data center is not subject American laws.

I imagine the same applies to other regions as well, China has data localization laws for example.

For a US person, it might be useful to use one of these data center if you are processing personal data of EU residents, to ensure you comply with EU privacy laws or simply inspire trust towards your EU clients.

From a privacy law perspective, you should indeed assume the lowest common denominator.

Opting in or out of a given data center: business or legal requirements I would say.


Hide ports being knocked during Port Knocking A while ago I wrote an article about implementing Port Knocking using iptables. Later in the post, I also talked about making this mechanism more secure.
The way it works is that in order to open a port, like SSH port to connect, you need to knock some other close ports. If you knock those ports in correct sequence, your final port (in this case SSH port 22) will become open to connection. Recently I realized that any person, even with passive surveillance over the network, can detect the series of ports to knock. A simple MITM attack like ARP Spoofing (within the sub-network) reveals the ports to be knocked easily.
I was curious to know if there exists anyway, other than randomizing the ports each time, to conceal the port numbers from the attacker?

Obviously this is a bit of a frame-challenge, so I understand if you don't like this answer.  However:

The biggest advantage (in my mind) of port knocking is that it automatically filters out all the bots on the internet that go around randomly trying to brute-force every SSH server they find.  It can also be helpful in that it provides a small additional layer of protection against 0-day vulnerabilities in the SSH server (if no one knows your server is there then they can't attempt a 0-day, even if you are vulnerable).  However the point in both of these cases is the same:

Port knocking is most effective as a way of filtering out drive-by attacks against your server

Once you talk about a directed attack (i.e. someone with a MITM observing the port knocking process), then port knocking will definitely fail as a security method.  Even if there was a way to hide the port combinations from a dedicated attacker, the fact that they are specifically targeting your organization means that your port knocking security has accomplished its particular job.  It is simply supposed to keep out drive-by attackers, and it does as much.  Attempting to extend it to cover more targeted attacks which this security method wasn't originally designed for is probably going to cause you more trouble than it is worth (in the implementation and support of new security feature, and the risk of accidentally locking yourself out).

Can you hide the port knocking sequence from a MITM attacker?  I'm pretty sure the answer is no, although I'm not ready to make a definitive statement there.  Either way though, I think you're going to make a big headache for yourself to attempt to mitigate an attack vector with a defense mechanism that wasn't really designed for it.  As a result, I think you're better off finding other ways of securing your servers and keeping your port knocking simple.  You're probably already doing this, but simply turning off password-based authentication and allowing authentication via private-keys only is usually the first and most effective security measure for an SSH server and (IMO) a more effective way of blocking out drive-by attacks than port knocking.


How to fix WordPress CVE vulnerabilities or preventive measures? I have a WordPress site running on version 4.9.8. In the recent security audit done by the organization following issues were reported.

1) Wordpress: CVE-2017-1000600: Input Validation vulnerability in thumbnail processing can result in remote code execution.

Versions affected : WordPress version <4.9

2) Wordpress: CVE-2018-1000773: Input Validation vulnerability in thumbnail processing can result in remote code execution.

Versions affected : WordPress version 4.9.8 and earlier

3) Wordpress: CVE-2018-14028: Upload plugin and theme functionalities are not removing uploaded files after failure conditions.

Versions affected : WordPress 4.9.7

Following are my questions.

1) Are points 1 and 2 invalid in my case as I am on 4.9.8 version.

2) Are these issues fixed in the latest update?

Latest WordPress security release is WordPress 5.0.1 Security Release

If issues are not fixed in the latest version. Is there any way or plugin which can help me fix these issues?

So multiple questions here.

  1: Are points 1 and 2 invalid in my case as I am on 4.9.8 version.

So Vuln 1 (1000600) is invalid as it does not include 4.9, but everything below that.

Vuln2 1000773 is not invalid and is a finding. How risky it is is dubious though and based on how much access your users have. See the linked reference and below quote:

https://www.theregister.co.uk/2018/08/20/php_unserialisation_wordpress_vuln/

"As things stand, the objective scope of the vulnerability, and how easy it might be to exploit is unclear. Thomas's presentation contained a number of caveats omitted from Secarma's press release about the presentation, which boldly claimed the flaw left "30 per cent of the world's top 1,000 websites vulnerable to hacking and data breaches."

Crucially, an attacker would need a suitable account, be able to upload images or other files, and the site would need a vulnerable plugin installed before malicious commands could be injected, for example. To pull off a complete host system compromise, further vulnerabilities would likely need to be exploited to escalate the intruder's privileges."

  2: Are these issues fixed in the latest update?

https://www.cvedetails.com/version/263829/Wordpress-Wordpress-4.9.8.html

Not specified if 5.0.1 has fixed all of these; that said they are not listed on any sites as being found in 5.0.1. And all but one were fixed by 4.9.8.

https://latesthackingnews.com/2018/12/16/seven-wordpress-vulnerabilities-fixed-in-version-5-0-1/

This site references a PHP_uniserialisations_vuln being fixed for 5.0.1 which I imagine has to be this one... but can't say for sure. Eitherway, It's probably worth checking on a dev box if upgrading breaks anything and then pushing it, or verifying your users don't have permissions to allow the vuln to work.


Where to get all the root CA certs? Is there a common place where we can download all the root CA certs and get frequent updates for changes? This is one place where we can find the CAs, but we need to keep on checking for the updates. Are there any other places other than this one?

Depending on your application, you might not need "all" the CA certificates, but only the ones that you are able to trust.

You can use the Mozilla CA Certificate Store at:

https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/

Those are the CAs that are trusted in e.g. Firefox.


Communication between SIM, baseband and application processor I currently examine the hidden components of a smartphone, inspired by the research of Weinmann All your baseband belong to us and Karsten Nohl Rooting Sim Cards.

According to Weinmann, the application processor (with Android e.g.) and the baseband processor can share memory, so that an attack and takeover of the baseband stack offers the possibility to attack Android.
According to Nohl, it is possible to crack a SIM Card and install an own virus or application. This app could send premium SMS or something else.

Thus, the SIM is connected to the baseband and the baseband is connected to the application processor. So which attack surface does this connection offer?

The A3, A8 calculation occurs in the SIM and the A5 in the baseband processor, right?  So when I have a full control of the baseband, I can initiate a call or SMS and impersonate the phone?
If I had full control of the SIM card, then I could send SMS messages with the Ki or data of banking applets on the Sim Card? Can I initiate a voice call or attack the baseband OS with the Sim Card? Which communication protocol is used between the SIM and the baseband processor? Also AT Commands?-Since these would limit the attack possibilities.

Unfortunately, I haven't found a source which focuses on the connection between the three components.

I don't know anything about the application processor side, but I can tell you some things about the SIM side:

Subscriber Identity Modules are a type of smart card, and as such they not talk AT, but a separate protocol from ISO, commonly referred to as APDU. The rest of ISO 7816 is mostly innocuous, and doesn't even deal with broadband, which is fortunate because ISO doesn't provide them for free.

Enter 3GPP, which maintains the standards for smartcards connecting to the GSM network. These standards are a superset of ISO 7816 and are freely available at their website (go browse around there for a bit, it's an amazing website teeming with the most detailed information)

In the 11.11 standard, some of your assumptions are confirmed: The SIM does not do A5 encryption, you Mobile Equipment does that, the SIM does A3 and A8.

In the 11.14 standard things get interesting, these are the details of what SIM applications can do with the Mobile Equipment uplink. Turns out they can do just about anything, sometimes on the pinky promise that "It shall be possible for the user to deactivate this command". Voice calls, Data, you name it.

Whether or not the Ki is accessible to SIM applications may hopefully be found somewhere in the 31 series specifications. I haven't had the time to read through all that. 31.130 looks like a good place to start.


Bottleneck while creating XSS scanner for a website which returns API response instead of HTML I am trying to build an XSS scanner using Python for a website. The website has widget creation feature. The source code for the website has templates for each widget type. The website returns an API response for each POST call to create widgets, which is then fetched by javascript to populate the widget template with data.

Working of general XSS scanners:
Normally XSS scanners detect XSS by sending special characters and javascript keywords such as >,<,script,",etc in the payload/URL and then monitoring the html response to check if the characters are encoded or filtered. If the characters are not encoded/filtered, then the entire XSS vector is sent. If it is exactly reflected in html response, then we have an XSS vulnerability on the page.

Problem Statement:
The problem with the website which I am working on is that I get an API response instead of html. The API response contains the injected payload but has all the special chars in encoded format, but it shows up in the page source of UI without encoding,which triggers XSS. If I try to fetch the html of webpage using a GET call, then I get the html of the webpage but it has empty templates and no data in it.

Is there a way through which the problem can be overcome? I can take care of the coding part, but I am not able to figure out how to proceed with this problem. A general idea of how to proceed will help.

In this case the XSS is actually independent of the server side, which means you can actually ignore sending data to the API and instead focus on the UI. This means you could essentially write an XSS scanner that mocks the API, and then detect changes in the browser. You could use webdriver/selenium or similar to drive the browser.

Another alternative could be to use phantomjs, have it render the response, and then grab the full HTML from that.


Detecting code removal reverse engineering I'm writing some native code in Android. Although it's tough to reverse engineer native codes as compared to Java, still this is possible. I'd want a condition wherein if someone removes or comments my code in a certain method, I get to know about it, and take necessary actions (either stop the app, or do something else). So, is there any way possible I can detect whether my code has been modified or commented in a certain method by someone using reverse engineering?

There's no way to ever know for certain if someone is reverse engineering your code, an attacker can take your APK file and pull it apart manually or with tools.

If you are really paranoid and willing to experiment a bit you could work in a system of phone-home calls which are triggered by events and modified by parts of your code. A change in parts of your code could change the values sent as part of the phone-home calls. You could also use APK checksums, there'a a Stack Exchange question on this very topic which may help. None of this is a sure-fire way to know frankly, and you could sink a lot of time into it just to know if someone's tinkering.


Which encrypted USB stick is the better option? I am looking for a hardware encrypted USB stick to carry some important files such as my KeePassXC database, Key files, cryptocurrency wallets, certificates and other stuff with me.

There are some promising products I've came across:

Kanguru Defender

Kingston DataTraveler 2000

Kingston Ironkey S1000

The Kingston DataTraveler uses a hardware keyboard to enter the passcode while the Kanguru products and also the Kingston Ironkey products use a software solution to enter the passcode, while the encryption is still happening on hardware side?

I'm wondering which solution might be the safest thing I can get? Since I assume with a software passcode input I'm not safe from keyloggers?

What is your threat model? A compromised machine? Do you have infinite budget for this?

If the question is if using a hardware keyboard is more secure than providing the password via software the answer is (usually) Yes. As you noted, a software pin would be vulnerable to a keylogger sniffing the drive password.

However, note that if you unlock this USB in an infected computer, it could as well make a copy of all the files in the usb drive instead of only the pin (or even better, wait until you unlock your Keepassxc database, then exfiltrate the decrypted contents from memory), so it's not too reassuring that a thief got all the protected contents, but was unable to steal the safe passcode, albeit technically you were slightly safer.

On the other hand, perhaps the only thing you care about is that your maid is not a spy which modifies the designs of the new nuclear power plant so it blows up, in which case entering a pin in a hardware keyboard to get read-only access would protect you.

Another point which may compare against the hardware keyboard is the social context in which you will unblock the drive. If you will have to unblock the drive in front of others, how easy will it be to conceal the passcode from them? A good typer can often input in the computer keyboard a long password well-known to him quick enough that other people will probably not obtain it. Whereas a short pincode could be noticed more easily (but perhaps you could unlock it when hidden behind the computer with the excuse of connecting it to a rear port).

You mention that you will (always?) carry that usb with you. While not related at all to its security, you may be interested in how comfortable would be to carry each of them, as the hardware keyboard necessarily results in a bigger stick.

Discretion may be another factor you may be interested in, as a usb stick with a hardware keyboard really stands out.

Or quite the opposite. You goal to get an encrypted usb may be to impress other people (eg. some prospective investors on your company) showing how secure you handle everything, so it must have an external keyboard but also a biometric reader, but it doesn't matter if it's unreliable and they actually allow anyone.

All of this without taking into account the actual security of the encryption itself (Is the drive lying and storing the files unencrypted? Is the algorithm of drive A better than the one of drive B? Are they even implemented properly?). I would recommend having an extra layer of software encryption to counter that (eg. the KeePassXC file in the drive is additionally encrypted, as probably are those certificates).

As the main risk to an encrypted usb drive is unlocking it on an untrusted computer, an alternative to storing your files on an encrypted usb would be to use a small smartphone —completely disconnected— dedicated exclusively to save your passwords and other files (setup disk encryption and all other perks). Being a separate device, you can retrieve the password there and then type it into the not-so-trusted computer for actual use, without fear of compromising the rest of passwords stored there.


Where can I find worm traffic sample? I have a program that has to detect scanning activity of worms.

I need some samples of worms' traffic (pcap files) to try the program, and notes about the procedures which must be taken when running such files to keep my computer safe.

Are there any safe capture files that contain the scanning activity only without the worm payload? There is a sample capture for slammer worm at wireshark.org, but when I tried to open it I got a warning. What I should do in this case??

Frankly, I would install VMs using Virtualbox and create a standalone internal network. Then, I would infect one machine with Slammer and capture the traffic.

If you are going to be doing security research, then you will need to set up a lab like this and get your hands dirty. Your learning will be so much better.

Good luck!


Why do some internet banks force logout on back button? A design pattern I've noticed on internet banking sites is that you get automatically logged out and sent to a warning page if/when you hit the back button on your browser, ending your session and obliging you to log in again.

I'm presuming this is due to some sort of security consideration, but I'm at a loss to figure out what. What is the rationale for this behaviour?

A scenario such banks might want to protect you from could be this:

you visit your banking website and do your banking stuff.
after you are finished you log out and then navigate to some other website to look at cat pictures or whatever.
you leave your computer with the cat picture website open. Because there is nothing incriminating on your screen, you feel safe doing that.
your evil roommate comes along and presses the back button a few times.
they arrive at the cached version of your banking site, see your bank account and see that you still haven't paid your share of the rent even though you clearly have enough money to do that.

That's one reason why banking websites do not work when you navigate to them using the browsers back button.

But an even more likely reason could be laziness on the side of the web developers.

Allowing the user to use back and forward navigation creates an additional variable in a web application which needs to be kept in mind at all times.  Simply making this impossible removes that variable and makes it far easier for the developers to create a secure and bug-free application. Because bugs in banking applications can cause quite a lot of financial damage, developers in that sector are rather conservative and tend to limit usability when it results in a more predictable application use-pattern.


TLS - why combining handshake messages? I'm implementing a TLS-like prototype (for academical pruposes), and I've several problems in the handshake.

After the ClientHello, the server sends 3 frames in a row (ServerHello, ServerKeyExchangeand ServerHelloDone), and the client can't catch every one of them.

I also saw in the Wikipedia page of TLS that server handshake messages (these 3 frames) can be combined in a single "record".

The first question that comes to my mind is : Why combinig them ? To make bigger frames ?

Let's say in my case I automatically concatenate the 3 frames in 1, to ease the reception of all these messages. In my case, that would lead to a frame of ~700 bytes.

My second question is :  Could this "combining" bring security breaches ? Could someone take advantage of having all the information in one frame ? We agree that the system is secure when the frames are separated, the question is just on the concatenation of the frames.

The first question that comes to my mind is : Why combinig them ? To make bigger frames ?

If you use a single frame containing 3 messages instead of 3 frames each containing a single message the overhead is smaller.

  After the ClientHello, the server sends 3 frames in a row (ServerHello, ServerKeyExchangeand ServerHelloDone), and the client can't catch every one of them.

Since this is a TCP stream messages cannot be lost. It looks more like your client is doing the receiving of the messages in a wrong way. Often this means that the client is implemented to expect exactly a single message with a single read, but these can be even half messages etc because TCP is a stream and not a message protocol.

  My second question is : Could this "combining" bring security breaches ?

The information exchanged are the same. It only matters how much frames you need to transfer the information if somebody is unable to get all the data. But again this would be usually only because of a buggy design of the client/attacker and not a problem of the protocol.


Is any security gained from bank issued usernames in this authentication flow? My Bank's Online Banking feature doesn't use usernames. Instead, they assigned me a digit-only account number*. To log in, I enter my number, then it brings me to a new page to prompt for my password. However on the password page there is an image that I selected from a list of hundreds of images, as well as a caption, presumably in the event that you fat-finger your number. (for example: [picture of a rock] 'A cool lookin rock')

Is there any value gained in using this method of security? Is there a particular feature of this method that could be changed/dropped to enhance security? Should I be writing my bank an email?

Some Caveats:

I've tested with a few random numbers (and characters), they result in a password prompting page with one of the images and a generic caption
The picture captions share a similar format: they're always in lowercase and describe the image
There doesn't appear to be any form of Captcha on either the login or password page.

*Note: Not the same as my bank account number (I would have ran).

Is there any value gained in using this method of security?

A bit, but not much (which is why it is not common).

By issuing you a user ID instead of having you pick it, the bank has hardened the Online Banking enrollment flow against hackers interested in farming user IDs.  If you were able to pick it, you could try out various user IDs to see if they are already taken.

Now if they issued you your password, that would be a different matter (it would be really bad).

  Is there a particular feature of this method that could be changed/dropped to enhance security?

Eh, not really.  I suppose they could make the identifier alphanumeric to increase entropy, but perhaps they don't want to risk introducing offensive words randomly.  And you can get the same entropy increase by adding more digits.

  Should I be writing my bank an email?

No.  They probably thought about this quite a bit. If a hacker compromised your account, they are liable for the loss, not you, assuming they are a member of FDIC.

  I've tested with a few random numbers (and characters), they result in a password prompting page with one of the images and a generic caption

If their system is designed properly, those should be fakes.  A user ID should be hard to guess.  If they are sequential, there is definitely an issue.

  The picture captions share a similar format: they're always in lowercase and describe the image

The captions are just there for 508/ADA/WCAG compliance. Blind users can't see the images but they can have a screenreader read them the captions.

  There doesn't appear to be any form of Captcha on either the login or password page.

Most users hate CAPTCHA, and it's not really necessary if they implement a proper lockout mechanism with a timed automatic lockout release.


Is it possible to execute an executable with authenticated SMB? Assume the following:

An attacker has access to a remote Windows share on a remote host.
Attacker manages to bruteforce a local Windows account on the host and can login to it via SMB.
Attacker can write files via SMB.
Victim is fully patched and attacker does not have any zero days.
Victim is not a member of a domain controller, it is just a share with local Windows authen.

Can the attacker force the Windows computer to run an executable? If so, how?

While psexec or wmiexec (Linux python equivalent) will work, the latest Windows updates do not work with the default installation.

This is because the ADMIN$ and C$ shares are not accessible without explicit registry configuration.


Is MD5 hashing possible by divide and conquer algorithm I would like to compute the MD5 hash of a file
The file is uploaded to my webserver by my clients
The file is uploaded in pieces (called chunks)
The client also sends the md5 hash of the file so that the file integrity could be verified
The chunks can come in any random order. (The first chunk doesn't always have to come first)
My web server stores the chunks in persistence storage.
Is it possible for me to compute the hash (or any digest) of the individual chunks and arrive at the hash of the file?

The classical solution is using the Merkle-Tree. To use the Merkle-Tree for uploading, the client forms the Merkle-Tree and calculates the hashes, and sends you the root hash in advance in a secure channel with a digital signature.
In the Merkle Tree, the data (chunk) can arrive at the server in random order with the sibling hashes of the path from the data to the root. The server can use the root hash and the data and sibling hashes to check that the data is valid.
This will increase the bandwidth with O(log n) where n is the number of parts. With MD5 it will be 128*log n ( The log n is used for the height of the tree).
For example for a 1GB file, with each part is 1MB and using a 32B Hash function, like SHA256, for this the client needs to store 64KB hash values and for sending a 1MB chunk with a 320KB hash data will be transmitted and the overhead of the transfer will be 0.031%
The cost of verifying for each chunk will be O(log n), and remember the Cryptographic hash functions are very fast.
and don't use MD5 it is no longer considered to be secure Cryptographic hash function, rather prefer at least SHA256 or use the Blake2 which has speed records. There are also parallel hashes like ParallelHash of SHA3 and the Blake3. This can fasten the calculations whenever the parallelization provides benefits.
For a nice and comprehensive guide to  how the Merkle-Tree works see Squeamish Ossifrage' answer on Cryptography.SE


How is JWT implemented? I'm using django-rest-framework-jwt in one of my APIs. As you might know, the concept is simple: you send username and password and you get a token back. The token is not stored anywhere on the server.

By sending the token in the header of subsequent requests, the user associated with the token is extracted from database. I'm curious as to how this is implemented. How the server can extract the user and also the expiration time of the token by just having the token?

I know the concept of public/private keys but if this is implemented with the same idea, what would be the private and public key here?

A JWT token consists of a base64 encoded string containing header, claims and signature.

The claims section contains a JSON encoded expiration field, exp:

  Expiration time. It contains the UTC Unix time after which you should
  no longer accept this token. It should be after the issued-at time.

The username can also be stored in the claims object.

There are two options regarding "signing" of the JWT:

  JWTs can be signed using a secret (with the HMAC algorithm) or a
  public/private key pair using RSA.

With the secret, there is a private key, however this is used to authenticate the message using HMAC SHA256. There is no encryption, just authentication so a client could work out what was stored in the token, but not change it. HMAC is a way of calculating hashes without them being vulnerable to length extension attack. There is no public key in this method.

With RSA, the private key is used to sign the key, which can be verified using the public key when received by a client. Therefore only the component generating keys needs to know the private key.

See Understanding JWT for more information.