When prompted to add a certificate or profile to connect to a secured WiFi network, how can I tell if it's safe to install it? Sometimes when I connect to secured WiFi networks on my computer, such as my internet provider's WiFi hotspots around the city, I'm asked to add a certificate to my certificate store. When I'm on my iPhone, the way this manifests is that I'm asked to install a profile.

I vaguely remember profiles and certificates being used maliciously, but I don't remember the specifics.

Is it still possible for these certificates to be used maliciously? Can they be used for SSL MITM? How can you tell if it's safe to install these certificates or profiles?

Never install a certificate you don't trust.
If you trust a certificate, the company/ person that issued the cert can mitm (and certainly will) any https connection you make. The system is often used by companies to monitor their employees activities. Would you accept that for your personal data ? I think not...


How to give a web application a key in order to decrypt data in a database My situation is that I need to store sensitive data in a database for a web application. The sensitive data includes things like refresh tokens for Oauth2 systems, secret keys for other APIs etc.

I'm trying to build this assuming that an attacker already has access to the server and can see the binaries that are running the application (no source code on the server), the environment variables and the databases etc.

So basically the thing I'm trying to protect against here is an attacker being able to read sensitive information from the database.

To do that I assume I need to encrypt the data before storing it in the database, but this has left me with the problem of how to provide the web application with the keys to encrypt and decrypt the data in the first place.

If an attacker already has access to the server then environment variables, config files and even other servers that the application can make HTTP requests to seem useless because the attacker could just do the same things the application does to request the keys anyway.

So from what I can figure out implementing a workflow where the application requests the keys isn't going to work. Instead I need a workflow where the application is given the keys instead.

Initially I thought that I could just enter the keys manually on application startup and keep them stored in memory, but the problem with that is then I would need to manually intervene to start up each instance of the application. Ideally I want startup to be automated as much as possible which would mean giving the keys to some kind of script or something, in which case I'm back at square one.

So far the only way I've come up with of providing the application with keys somewhat automatically is to implement an endpoint of some kind that can be POSTed to with the keys.

The idea is that I start up the application on the server, but the application rejects all requests because it doesn't have the keys yet. The keys are stored on a separate machine somewhere; this machine could be in the office or another server etc.

The machine with the keys then POSTs to the application endpoint to give it the keys over an HTTPS connection and the application stores the keys in memory until it's restarted, at which point it will need the keys POSTed to it again.

Once the keys have been provided the application will accept requests like normal and shut down the endpoint that accepted the keys.

This does mean that an attacker could find the endpoint and try POSTing keys to it themselves, but it's highly unlikely that they would provide the correct keys anyway and even if the application accepted the keys in the small window of time where the endpoint would be available the decrypted data would be incomprehensible anyway.

So now my questions are, am I overthinking this, and is there a better, industry standard way of providing keys to a web application for the purpose of encrypting/decrypting data in a database?

If there isn't an agreed upon method for doing this then would my idea be feasible and what kinds of things am I overlooking that could actually weaken security instead of strengthen it?

Initially I thought that I could just enter the keys manually on application startup and keep them stored in memory, but the problem with that is then I would need to manually intervene to start up each instance of the application.

Whilst memory only is in practice notably more secure than on disk if they have enough access to the underlying machine running the application they can just take a core dump and lift the keys out of there.

  So now my questions are, am I overthinking this, and is there a better, industry standard way of providing keys to a web application for the purpose of encrypting/decrypting data in a database?

The best approach I have seen is to have them stored on the application server in a config file which is not readable by the user which runs the application. They are passed in either as arguments or by IPC when the application is started.

This means privilege escalation on the application server is required to obtain the keys. If the DB server is compromised the keys aren't there.


What password length is sufficient in 2020? What the title says: Assume Alphanumeric characters. Some years back I vaguely remember that 8 characters was not really sufficient protection against brute-force, but any more characters it got to a point of reasonable security(?)
If found this answer which states that in 2018 a single GPU could crack an 8-character password hashed with SHA-256 in ~26 days.
In the meantime some years passed, and supposedly computing power got bigger. What is a reasonably secure password length in 2020? Or in other words, how high have security researchers put the bar on brute-force in the meantime?

If found this answer which states that in 2018 a single GPU could crack an 8-character password hashed with SHA-256 in ~26 days.

This benchmark is irrelevant to determine the necessary strength of a password, at least if a proper password hash is used. The benchmark is more useful to show that SHA-256 is not a useful algorithm for password hashing.

What password length is sufficient in 2020?

The length is not that much relevant either. If you pick from a small but known set of easy to remember but long passwords all what matters is the size of the set, not the length of the password.
If you use a password generator instead to create random alphanumeric passwords, then 8 is still sufficient, assuming proper password hashing (i.e. slow hashes with unpredictable salt). Of course, nobody can really remember such random passwords, so better use a password manager. And if you use a password manager anyway you can also use longer passwords with no additional efforts and thus reduce your risk in case bad password hashing was used.


Email received regarding Security flaw in website I received an email to techsupport@websitename.com (pretty generic email) saying that there was a security flaw in my website etc. etc

My initial reaction was that this was a scam. (How/why did they find our site.)

However, they didn't seem to be looking for money (so far) and they also had emailed it from a gmail account (which seemed off to me, spam is usually sent from weird domains) - also google marked it as important.

The overall writing is clearly not well educated, but it isn't as bad as they usually are.

The email address also seemed like a gamer addresses (some weird name and a few digits)

This is the email:

  Hello,

  I have found a Web Application Vulnerability [XSS] in
  'websitename.com' which can lead an attacker to perform
  unauthenticated tasks like account takeovers and other malicious
  stuffs like web defacement (your site), port scanning through your
  servers to other servers on internet or may use your website to spread
  Ransomware, and this bug is needed to be fixed as fast as possible.

  Being a responsible security researcher, I m sending this mail
  directly to you without making the bug public, so if you are concerned
  about your website's security and want detailed information and
  Proof-of-Concept of this bug, please contact me on my mail -
  email@gmail.com

  Would be happy to know - do you provide any rewards (bug bounty) /
  swag as token of appreciation for reporting bugs ?

  Thank you,

  -(Foreign sounding) Name

Italics have been changed for privacy

Question:

Is this a typical things that scammers would do?

If so what are they trying to gain, what would be (if any) the risks of replying to the email requesting some more information.

On the other hand, if it is in fact a legit "responsible security researcher" what kind of questions should I ask to find out.

TL;DR: It's probably well-intentioned and not a scam, but just poorly written.

I don't know of any kind of scam that would be based on this.  Certainly there have been attempts to extort website owners for money based on knowledge of website vulnerabilities (and the implicit threat to exploit them), but that doesn't look like the case here.

It's not a very well-written disclosure email.  I've certainly stumbled across vulnerabilities before (obviously, attempting to exploit them on a site that hasn't given permission would be illegal, but there are some that can be obvious without attempting exploitation), and sent emails with the same intent as the author above, but I try to provide all the detail in the first email.  I want to help.  I don't want to bounce back and forth in email land.

If it were me, I would ask them for details: what page (or pages) contain the vulnerabilities, which parameters are injectable, and whether they could share a proof of concept.  If you're not familiar with XSS, I recommend reading the OWASP page on the vulnerability.  It's both very common and can be critical, depending on the context.  A typical proof of concept (PoC) for XSS won't be dangerous to you or your site, but will do something like pop up a javascript alert box containing the hostname of the site, your session cookes, or even just the number 1.  Any of those show that a malicious attacker could be running Javascript on your site, which would have significant implications for your site security.

As some have pointed out, it's also possible the lack of information is them playing it "cagey" will looking for a reward/payment.  Obviously, if your site does not have a published bug bounty, you're under no obligation to do so.


Justification for PCI DSS compliance I had a software for firewall analyzer, it had an issue and stopped from working.
The problem is I lost all the logs was collocated from this application, I contacted the support team but they couldn't do anything.

My question is: for PCI DSS compliance is it possible to have a business justification for this incident, as the logs are lost, or what to do in this case.

Please help.

My question is: for PCI DSS compliance is it possible to have a
  business justification for this incident, as the logs are lost, or
  what to do in this case.

You can try justifying why you lost the logs, but in all honesty if you can't maintain a suitable secure copy of them then its debatable whether you are (or even were) truely PCI-DSS compliant. (I don't know what levels you are intending to be compliant against)

That said: PCI DSS Requirement 10.5 and its
sub-requirements describe the methods that must be employed to protect logs:

10.5 Secure audit trails so they cannot be altered
10.5.1 Limit viewing of audit trails to those with a job-related need
10.5.2 Protect audit trails from unauthorized modifications
10.5.3 Promptly back up audit trail files to a centralized log server or media that is difficult to alter
10.5.4 Write logs for external-facing technologies onto a secure, centralized, internal log server or media device
10.5.5 Use file-integrity monitoring or change-detection software on logs to ensure that existing log data cannot be changed without generating alerts (although new data being added should not cause an alert).

I have highlighted the ones that I believe you accidentally failed to comply with. Therefore I would make sure you update your policies and ensure that you have suitable controls in place to ensure it doesn't happen again. As long as you can demonstrate your corrective measures I think you will be fine.


How much can I trust Tor? How much can I depend on Tor for anonymity? Is it completely secure? My usage is limited to accessing Twitter and Wordpress.

I am a political activist from India and I do not enjoy the freedom of press like the Western countries do. In the event my identity is compromised, the outcome can be fatal.

Tor is better for you than it is for people in countries whose intelligence services run lots of Tor exit nodes and sniff the traffic.  However, all you should assume when using Tor is that, if someone's not doing heavy statistical traffic analysis, they can't directly correlate your IP with the IP requesting resources at the server.

That leaves many, many methods of compromising your identity still open.  For instance, if you check your normal email while using Tor, the bad guys can know that that address is correlated with other Tor activity.  If, as @Geek said, your computer is infected with malware, that malware can broadcast your identity outside the Tor tunnel.  If you even hit a webpage with an XSS or CSRF flaw, any other web services you're logged into could have their credentials stolen.

Bottom line, Tor is better than nothing; but if your life is on the line, use a well-secured computer for accessing Twitter and WordPress using it, and don't use that computer for anything else.


Can visiting a malicious website infect an iOS or Android device? Can visiting a malicious website infect an iOS or Android device?
We're talking about visiting such sites via a browser. We're not talking about downloading any malicious apps.

What day of the week is it?

In theory, no. Merely visiting a site will not infect you.

But as they say, the difference between Theory and Practice is that in Theory there is no difference.

I practice, defects in the implementations of some components of the browser are found (sometimes in Javascript, sometimes in Java, sometimes in PDF renderers, sometimes even in font rendering) that permit malicious code (or data, because it's sometimes hard to tell the difference) on a malicious website to infect even passersby. This is called a "drive-by" attack.

But that's a serious breach in security, and such defects tend to get patched very quickly.

If you visit a website on a day after the malefactors have written code to exploit such a defect but before the day your browser gets patched, then yes, you can get infected. The day before the malicious code is placed on the website, or the day after your browser is patched, you're safe.

Like I said: what day of the week is it?


Is there a way to sign a 624 bits message on 256 bits I'm looking for a way to sign a 624 bits message on 256bits (sig length = 256 bits) with an asymmetric keys system?

I'm trying to sign a qrcode so a client can be sure that this qrcode has been emitted by the server.

It should be very hard to generate a qr code without the private key. (It should take more than a month)

The client has a public key.

Is it possible to obtain a "secure" (Meaning I can't sign my own qr code under a month without knowing the private key) priv/pub key signature system on such a restricted space?

Thanks!

Yes; BLS can do that.  (Message length is only relevant to short signatures in very limited circumstances.)


Web Based penetration test that uses MD5 for password I'm trying to penetrate test a web based form (which is MikroTik's login form) with different tools for security measurement.

I've tried THC-Hydra but problem is the password computed as MD5 first and then it is send to the form, like this:

username=USERNAME&password=458871649ad64f39c81ba19be9829c58&dst=&popup=true

As you can see, username is sent as plain text but password (which was entered as PASSWORD here as example) is computed as MD5 first and then sent to the server while Hydra puts password as plain text.

Any idea how to work it with Hydra (or any other tool)?

When using Hydra, you normally use -P password_list.txt to specify the input passwords. You simply need to md5sum this list. Consider this script hasher.sh:

#!/bin/bash
filename="$1"
while read -r line
do
    echo $line | md5sum
done < "$filename"

Now you can hash your original password list:

./hasher.sh password_list.txt | cut -d" " -f1 > hashed_passwords.txt

Finally, you can use hydra against your target using this new list of MD5s:

hydra -L logins.txt -P hashed_passwords.txt <any other options> <target>


Save decrypted pcap or decrypt on reading with rdpcap I created a small program with runs command:

tshark -i2 -o wlan.enable_decryption:TRUE -o "uat:80211_keys:\"wpa-pwd\",\" Passphrase:SSID\"" -w test.pcapng

This creates the file test.pcapng, but it is not decrypted. I know from Wireshark docs that you cannot save decrypted file. You can only open it in Wireshark and provide wifi key or using that command and filter everything you want. Can I somehow read and decrypt on the fly using rdpcap because I created a very long program that uses rdpcap to read pcap and then it extracts all important (relevant) info. I don't want to just delete it, is there any way to decrypt it using rdpcap?

EDIT:
I found pyDot11 which seems to do what I want but there is no guide or example code for decrypting WPA. Can someone share the code for decrypting WPA?

You use airdecap to decrypt and save 802.11.


Confusion Matrix for Generated Signatures in Snort How do we come with True Positives and False Negatives rates when creating signatures in IDS? How do we measure the signatures efficiency? I've seen so many papers that discuss the same, but how do they come up with these numbers?

How do we measure the signatures efficiency?

You don't want too much false positives, or your users will be impacted for being denied access to legitimate sites. On the other hand, false negatives allows attackers to bypass the filters and attack your infrastructure. So an IDS with the lowest false positives/negatives rates is better than the others.

  how do they come up with these numbers?

They create a list of URLs, both malicious and clean, and send to the IDS, recording the result. This is how they get the amount of false positives and negatives.

You can create the same list by checking your log files and manually labelling them as malicious or not. Check those labels against the IDS log file, and you will end up with the Confusion Matrix.


Why use a password manager to protect browser logons when e-mail client is neglected? Friends use password managers like lastpass or dashlane which have plugins for the browser, but not for the email clients (thunderbird or livemail).
But surely the email password is the Achilles heel of security because if you have that you can easily perform password resets to get access to any websites used.

If the password manager doesn't protect your email client a trojan can steal your email profile containing the email passwords.

Of course if you don't use an email client you don't have this vulnerability, but many still do.
Many people use password managers and email clients so where's the flaw in my logic?

Many email clients protect the password in similar ways to a password manager (and some do not). No flaw in your logic, although once you get malware designed to steal password manager passwords, all bets are off anyway.

That's once reason why 2FA is so important. By setting up 2FA, even if malware gets your email password, they cannot use it apart from your system. They would need to control your email client in order to use the "password reset" functionality you mention. Is it possible for attackers to do this, yes, but the level of complexity is much higher than simply grabbing a password from memory/configs.


Is there a website or other resource that lists operating systems/platforms and the included root certificates? I need to choose a certification authority (CA), to get a certificate, but I noticed that there are several of these only present in some operating systems/platforms like windows. I need to choose one that is present also in Linux (the more distributions the best) and mac.

Is there such a list/resoucer?

On Windows, CA are normally centralized in the OS, in the "trusted CA" store. Microsoft manages the default contents for this store, and they do this following an explicit "management program". You can find the list of CA there.

Apple also runs a similar program and documents the list of root CA that a brand new OS X will trust by default. Of course, any user is free to alter the list, although most users will keep the defaults.

However, any browser is free to use the OS list, or to use its own. On Windows, Chrome and IE will follow the OS-provided list; on OS X, Safari and Chrome will also follow the OS-provided list. Firefox, on the other hand, has its own list (and, indeed, its own SSL implementation). The list of root CA included by default in Firefox is available on this page. That list applies to all platforms on which Firefox runs.

On Linux, there is no real OS-provided list of trusted certificates (well, there are root CA certificates in /etc/ssl/certs/, but it is unclear whether they are actually "trusted", or simply "known", or which applications use these CA). In any case, Firefox on Linux still follows its internal list; Chromium (on Linux) is documented to use Firefox's list (specifically, to use the same default list as Firefox; local changes to Firefox don't impact Chromium, nor vice versa).

It seems that the Opera Web browser now uses Firefox's list (it relies on the NSS library which handles SSL for Firefox), so it should be considered similar to Firefox (in that respect) on all platforms.

So, for good interoperability, you should choose a CA which is on the lists from Microsoft, Apple, and Mozilla/Firefox. A root CA listed on all three lists will be recognized automatically by the overwhelming majority of users.

I am not aware of any maintained page anywhere which would aggregate these separate lists into a synthetic view. The operational word here is "maintained".

A further complication is that there are two kinds of root CA: the "normal" CA, and the "EV-Qualified" CA. The latter claim to be more thorough in their identity verification; the practical consequences is that their certificates are more expensive, and the padlock icon will be green (or similarly "highlighted") instead of grey. This distinction has attracted some criticism; e.g. Peter Gutmann states that the EV certificates are a trick to raise certificate prices with little security benefit since they don't solve a security issue which really existed in the first place. Yet they exist. If you want the green padlock, you'll need a root CA which is recognized as "EV-Qualified" by the major browsers. You can start with the list from the Wikipedia page.


Is a wired public network more secure than a wireless public network? I use wireless and wired networks at my university (which do connect to the Internet), both of which I connect to using my own computer. To access the Internet from these networks, students and staff must login to a portal and enter institutional credentials. For the sake of this question, I am assuming that both networks are routed through the same array of switches.

Here's my question: Is the wired network at my institution inherently more secure than the wireless network? Would I be less susceptible to eavesdropping by other clients within the network(s) if I used the wired network?

This question relates more to a fundamental question about the inherent vulnerabilities in wired and wireless network setups (respectively) than to the specific scenario described above.

If I am obviously misrepresenting something or if clarification is needed, please let me know.

It kind of depends on the security used for the wireless access points, and the authentication methods. I would expect WPA2 with 802.1X as this is common for enterprise networks. However there are many EAP variants, some of which are insecure. For the exact details you should find the authentication method used. It doesn't necessarily need to be so, but usually wifi is more vulnerable to attacks


What implications does IPv6 have for internet worms and script kiddies? Though IPv6 is not here yet it one day we will all lose our familiar IPv4 addresses and be communicating over the internet solely with IPv6 addresses.

What interests me is the implications this has for those who scan the internet hunting for common vulnerabilities. At the moment a common method for internet worms is to scan the subnet upon which they lie (they infect a machine on 80.7.2.4so they scan all IPs at 80.7.*.*, maybe expanding out to 80.*.*.*). Whilst it's still non-trivial to 'scan the entire internet', scanning 1/255th is completely feasible.

What I would like to know is will this still make sense when we are all running on IPv6 addresses? We will be moving from 4,294,967,296 addresses to 340,000,000,000,000,000,000,000,000,000,000,000,000 addresses. Will it be anywhere near as simple for these worms to scan their 'neighbourhood'? Or will network nodes be so sparsely distributed that an IPv6 address becomes a commodity in itself?

People who scan the internet will have to find a different source of addresses than just sequential enumeration. Search engines provide a great database of in-use hostnames and addresses, as does DNS.

Scanning the neighborhood might be feasible, but that depends on the neighborhood. In a subnet where DHCPv6 is being used, you can still scan other addresses, since DHCP servers typically assign addresses sequentially from a pool. If autoconfiguration (SLAAC) is used, it becomes harder. If you know what hardware to look for, you know 40 of the 64 hostbits (24 bits vendor ID + 16 bits fixed 0xfffe), and you need to brute-force 24 bits. That is doable.

If privacy extensions are in use, you can still look for SLAAC addresses since a host using privacy extensions has both his SLAAC address and his privacy address.

On server networks, most hosts will be numbered sequentially, using funny words (b00b, babe) or based on info like VLAN number or IPv4 address. These are all enumerable.

So, to sum it up, you can't scan the whole internet, but you can partially smart-scan networks.


Ideal time for cookies to expire? I get that websites that contain confidential personal information (e.g. banking system) have short sessions and expiration time for cookies for obviously reason.

But what are the causes for sites, say Wikipedia, to require logging on every 30 days (used to be 14), while supposedly more sensitive sites like Gmail don't? Is this just the personal preference of system admins or something more?

From OWASP:

  In order to minimize the time period an attacker can launch attacks
  over active sessions and hijack them, it is mandatory to set
  expiration timeouts for every session, establishing the amount of time
  a session will remain active. Insufficient session expiration by the
  web application increases the exposure of other session-based attacks,
  as for the attacker to be able to reuse a valid session ID and hijack
  the associated session, it must still be active.

It all depends on the risk appetite of the organization. Each organization will do a risk assessment and decide what type of data they are protecting and what their customers find acceptable in terms of usability. For instance, Gmail may not expire their sessions because it is deemed that the benefit of users not having to log in each time generates more revenue than the reputational losses they have when a Gmail accounts is hacked due to non-expired cookies. Of course the content of an email inbox might be sensitive or it might not be, it's debatable.

Bank applications on the other hand are in 99% of the cases containing money. Furthermore the reputational outfall of "bank X customer gets hacked" generates a lot more unrest than the Gmail example. Customers will start calling the bank worried, they might loose clients who believe their system is unsafe etc...

In the end it's just looking at your threats and vulnerabilities and assessing what the cost and benefit is of implementing mitigating controls (which in this case is the expiration date of a session).


What prevents recorded voice samples being used for authentication on other systems? What technical measures are used to prevent recorded voice samples from being used for authentication on voice recognition/id systems?

A client wanted to simplify user logins and mentioned the ATO as an example. I am concerned about how easy it could be to bypass voice authentication.

Nothing, except loss of fidelity due to the recording and playing back, provided the system is amenable to a replay attack.

But if you do acquisition and playing back at a higher fidelity than the voice recognition system was built for, the latter won't have a clue.

It might be possible to analyze echoes and harmonics: a human phonatory system does not produce sounds from a single point in space, while a loudspeaker does. This would require several sensitive microphones placed in different positions, to be able to calculate time-of-flight for different phonemes.

Challenge/Response

Another possibility is if the attacker has only access to a fixed recording and we can also do voice recognition.

I think I saw this in some 007 film, with the guy approaching a voice-activated door and fiddling with his watch, from which the 'Nice party. I recommend you the shrimp salad...' captured the evening before in the villain's voice issues forth, unlocking the door.

But what if the door had asked, 'Repeat after me: horse battery staple correct'? The shrimp salad wouldn't have cut it.

So:

the voice is enrolled
the user is asked to pronounce a certain sequence, different every time
the sequence and the voiceprint must match.

This reduces the chances of a replay attack because even if someone recorded my voice saying '577892', they wouldn't be able to pronounce in my voice '297779'. Or would they? With a large enough sample and voice synthesis technology similar to Loquendo TTS, it is possible to have a computer say anything in my voice. With only a few words or digits, the attacker doesn't even need that much technology.

The need to avoid both false negatives and false positives, added to the background noise, requires threading a very difficult needle: you could reject exactly identical phonemes as being recordings, but background noise (either real or faked) would make this very hard - two playbacks of the same sound would be acquired as different, while the same person's voice will naturally generate almost identical phonemes.

Over a telephone, any attempt to distinguish between "real" and "artificial" phonation will fail, because the phonation will always be artificially flattened by the sender's microphone.

I am in no way an expert in artificial voice fakery, but I'm quite confident that a very reasonable budget to acquire voice samples, recording equipment and a voicesynth framework will allow you to bypass any such voice-authentication over the phone. Against an unprepared opponent armed with just a tape-recorder, voiceprint plus challenge/handshake will probably always win.


How are open-sourced operating systems and software kept secure? I have been wondering about his for awhile. I have Linux running on a PC at home. I had a jailbroken iPhone. They both have attributes that make them very attractive, and they are also FREE! But I haven't been able to find anything that discusses how they are kept secure from Trojan horses. I don't suppose I can run a virus scanner on the source files to see if they are safe. If I can, I don't know how to do that.

How confident should I be about security with Linux and jailbroken iPhones? What prevents intentional security holes caused by private or government hands?

I understand that there are risks even with privately developed operating systems, but in those cases, I have some sense of who has the responsibility for them. Not so for these two cases and for other open-sourced or crowd-sourced software.

The theory is:

Closed-source software is mostly non-trojaned because the vendor of such software is legally responsible for the software contents, and easily tracked down, should a hidden malicious code be revealed to be part of it (e.g. through reverse engineering).
Open-source software is mostly non-trojaned because it is very difficult to inconspicuously smuggle extra code when the source code is in plain view of everybody. Presumably, open-source code is regularly read by other people so backdoors would soon be detected.

The practice is:

Closed-source software is mostly non-trojaned because nobody bothered to plant a backdoor in it.
Open-source software is mostly non-trojaned because nobody bothered to plant a backdoor in it.

If I were to include a backdoor in an open-source operating system, I would try to put it in the Random Number Generator. Writing a proper, secure RNG is hard, so chances are that some obscure alterations could go unnoticed but result in predictable output -- thus predictable outcome of key pair generation (e.g. for SSH keys), and things like that. And due to the hardness of writing a proper RNG, I could still plausibly claim mere incompetence, not malice, should the backdoor be discovered. Case in point: about one year ago, there were such rumours of backdoor in RNG code in OpenBSD (apparently, the rumours turned out to be unsubstantiated -- however, I confess that I did not check the code myself).

What must be remembered is that both detecting backdoors (in source code or compiled code), and planting backdoors without being detected, are difficult arts. Professional spies abhor indiscretion; trojaning is usually felt as "too risky".


Idea for an encrypted pastebin NON-web application I have an idea for an app that might be useful (though if it isn't, I've still learned in the process, which is what matters).

There are a bunch of encrypted pastebin web apps out there (e.g. defuse.ca/pastebin.htm) that perform the encryption/decryption on the client using JavaScript.  So end-to-end encryption is achieved, UNLESS someone hacks the server and modifies the JavaScript so that future users who connect get modified JavaScript code that leaks their unencrypted password back to the hacker.

My idea is the user should interact with a standalone client app instead of a browser app to remove the JavaScript vulnerability.

User downloads client standalone app.  Some security is provided during download / install because:
a. Client app is digitally signed
b. Downloads happen from an https server
c. SHA hashes are available for downloaded files
d. Source code for client app is available
User launches app and selects "new paste".  He see a big text box.
User types/pastes text and clicks "Submit".  User is prompted for a password and enters it.
Client app CSPRNG generates 128-bit salt S.
Slow derivation function takes in password and S and derives 256-bit key K and 128-bit initialization vector IV.
Aes encrypt performed (128 bit block size, 256 bit key, CBC mode, PKCS7 padding) using plaintext, K, and IV to produce cyphertext C.
Client app calls server (rest call to https uri), passing it S and C.
Server stores S and C in a database row (S is primary key).
Server tells client the data is stored.  Client tells user "data saved" and presents S to the user as the unique paste identifier.
User makes a note of S (text file on his computer, e-mail to himself, etc... it does not have to be kept secret).  Password must be kept secret.
Later, the user launches the client app again.
He chooses "open existing paste".  He inputs S and selects find.
Client app asks the server to find a paste matching S (rest call to https uri).  If it does, it returns the encrypted text.
If paste is found, client app prompts user for decryption password.  He types it in.
Slow derivation function takes in password and S and derives 256-bit key K and 128-bit initialization vector IV.
Aes decrypt performed (128 bit block size, 256 bit key, CBC mode, PKCS7 padding) using plaintext, K, and IV to produce plainText.
Client app puts plaintext in the box.  User may alter it and re-encrypt or close it and make a new paste (go back to step 2).

Notes:

Several users may view the same paste if:
a. They agree in advance on a password or the password is communicated from user 1 to user 2 after he makes a paste, AND
b. The user who makes the paste shares S with other users (this may be shared insecurely).

Questions:

What security vulnerabilities does this setup have and how might it be improved?
Am I missing anything vital in terms of the user experience?
Re: Step 17.  I read that you should never use the same salt twice.  It would be annoying for the identifier of the paste (S) to change with each modification / reencryption (if multiple users are accessing the same paste they would need to recommunicate the new S each time an update/reencryption is made), but is it unavoidable to do this if I don't want to sacrifice security?

Thanks in advance!

I am a member of the thought police in a dystopian police state and I can eavesdrop on all internet traffic.

Through my detective work I have found out that Bob is a thought-criminal. But Bob is outside of my grasp.
I noticed that Bob used your program to upload several cyphertexts with the salts S1, S2 and S3 to your server.
I also noticed that Alice, Charlie and Dora requested the cyphertexts with the salts S1, S2 and S3 from your server.

Do I know what's the content of those messages? Not yet, but when I detain all three and interrogate them for a while, then one of them will surely crack. Do I even care? Actually, I don't. Associating with Bob is reason enough to convict them for treason.

How could you make my job harder?

Use TLS with forward secrecy for the communication between server and clients. That way I only know who uses your service and when, but not which message exactly they uploaded/downloaded. When the number of non-treasonous files is much larger than the number of treasonous files, then arresting all your users just in case would be unfeasible (we only have so many interrogation rooms, and our economy can't afford to lock up too many of our work drones at once). Caveat: When I manage to seize your server I can eavesdrop on your users again.

You could also make your client request a lot of random (but valid) files the user didn't request and doesn't even have the password for. That way you can obfuscate the communication network of your users and force me to waste my time with detaining a lot of random people who don't know anything.

But if you really want to give me a headache, get rid of your central server and switch to a distributed architecture like Freenet where all data is distributed over the client-network and nobody knows which client holds which documents (not even the clients themselves). But such a drastic architecture change would send you back to the drawing board to redesign your protocol from scratch.


Why is STARTTLS used when it can be downgraded very easily? People are making a big fuss about how you absolutely have to disable SSLv3 because TLS can be downgraded to SSLv3 and there is barely a server left on the internet that speaks SSLv3.

At the same time, almost every mail server out there will happily support STARTTLS, which can be trivially (like: 3 lines of code or so) downgraded to plain text.

What am I missing?

The problem you describe is not the use of STARTTLS by itself but the optional use of STARTTLS. Mail systems can be setup so that TLS is required in which case the mail will not be delivered if STARTTLS will fail or if the peer does not offer support for STARTTLS in EHLO. Required STARTTLS is is as safe as required TLS from start.

The reason STARTTLS is not mandatory in most setups is because there are still enough systems out there which don't support TLS. The current transparency report from Google shows only 90% of all mails delivered from Google by TLS, which means that 10% of the mails are delivered to an MTA which does not support TLS.

Apart from that even with mandatory TLS the mail is not delivered in a sufficiently secure way. TLS is only used between the various hops during mail delivery and does not provide the end-to-end security which TLS provides in HTTPS. This means every mail server on the path has access to the plain text of the mail and can read and modify it, unless the mail is additionally protected with end-to-end protections like PGP or S/MIME.


DOM based XSS using window.location.hash Target code:

if($(location.href.split("#")[1])) {
  var target = $('#'+location.href.split("#")[1]);
  if (target.length) {
    $('html,body').animate({
      scrollTop: target.offset().top - 160 //offset height of header here too.
    }, 1000);
    return false;
  }
}

It uses from location.href, so I though about using an injection script like this:
target-url.com/#"+alert(1)+"", escaping the string and placing an alert(1) to trigger an alert in the page. If I edit the script using Chrome Dev tools, the script is successfully executed:

But when trying to inject this script in the URL, analyzing the browser console, I see a jQuery error:

jquery.js?ver=1.11.3:2 Uncaught Error: Syntax error, unrecognized expression: %22+alert(1)+%22%22.
It appears to fail because it's replacing " with %22. But I need to scape the string scope, since location.href.split("#")[1] returns a string, and I need to leave the string scope to run the script.

Is there a way to bypass this URL encoding or this scenario is not exploitable at all?

Is there a way to bypass this URL encoding

No, modern browsers correctly URL encode this value, and that cannot be bypassed.

But that's not the only problem. There's actually no double-quoted string here which you could escape with " (nor a single-quoted one which you could escape with ').

There was a jQuery vulnerability in earlier version where $('#') would lead to XSS, but that is fixed in recent versions.

$('') still leads to XSS, but there is no way to get rid of the # (and the URL encoding would also still be in the way).

Given all of this, I would say that the code isn't vulnerable.


Why do browsers warn about mixed content for images? I'm dealing with a phpBB forum user who wants to set up SSL on their entire site to secure user credentials and "private" parts of the website.

However, they want to preserve the traditional forum user experience of user generated img tags to offsite content, which triggers a browser mixed content warning. The only solution we've come up with is an SSL granting proxy. After pondering the problem for a while now, I'm curious why do browsers warn specifically about images? I understand the case for javascript, but images?

I would assume your reasoning is something like, "If the person constructing the page chose to send some of its images insecurely, then the browser should respect that this decision was done for a reason and allow it without a warning. The page is as secure as the entity providing it wanted it to be."

By contrast, the reasoning of the browser developers is something like, "We are putting a secure icon on the page as seen by the user and the user should be able to assume that means the whole page is secure. If some part of it isn't, the user deserves to know that."

Both arguments are valid, they're just different interpretations of what it means for a web page to be secure.

There are specific risks with images too. The image is requested in the clear using the HTTP protocol. This discloses any information in the URL or headers. The most serious threat is that the image could contain instructions or information that the user would assume securely originated from the site the user chose. This could be used for phishing attacks.


Strength of below aes encryption Need to store encrypted user code in our database and get the decrypted form in return. Using the standard node module crypto to do so. Wanted to understand the strength of below encryption in terms of security. Does it offer enough security and how does choice of password affect strength of encryption here. Sorry a bit new to security and encryption.

var crypto = require('crypto');
var algorithm = 'aes256'; // or any other algorithm supported by OpenSSL
var key = 'some_password';
var text = 'EGGDFRR';

var cipher = crypto.createCipher(algorithm, key);
var encrypted = cipher.update(text, 'utf8', 'hex') + cipher.final('hex');
var decipher = crypto.createDecipher(algorithm, key);
var decrypted = decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');

var key = 'some_password';

This needs to go.

Using a printable string as the actual key is not a good idea. You're likely only going to be selecting printable characters from the bottom half of the ASCII table which is a very small amount of entropy per byte, and sure this may be for testing but you would do well to look into the complete solution even at this stage.

Even if you're only exploring or practising, old habits die hard. Start secure.

The crypto module provides for a Password-based Key Derivation Function (PBKDF2), that can turn printable strings into pretty good key material as the crypto.pbkdf2 class.


Bidirectional encrypted communication between two systems I have two network peers that need to use custom, encrypted application protocol to communicate with each other. Exchanged messages are fairly small, usually less than couple of hundreds of bytes, and key exchange is performed in person. Is it then reasonable to make the following assumptions:

No certificate authority is needed, since both parties know each other and agree upon using a particular key pair.
Since the exchanged messages are small, and the amount of traffic very little, encryption and decryption of messages do not cause any measurable spikes in CPU load or network lag, therefore, it is not necessary to use a symmetric session key (all traffic is encrypted using RSA 4096 key pair).
A time stamp, HW ID and HMAC is added to each message to verify both the data integrity and the authentication of the message.
Because of this, full-fledged TLS is not needed, RSA is sufficient.

Am I missing something? Would this mechanism be immune to MITM and replay attacks, as well as brute forcing?

all traffic is encrypted using RSA 4096 key pair

So you don't like performance?

  HMAC

Wait, HMAC — that requires a shared key. If you have a shared authentication key, why are you using RSA at all? Use a shared key for confidentiality as well.

  A time stamp

What if the clocks diverge?

  Because of this, full-fledged TLS is not needed, RSA is sufficient.

You've got it backwards. What, in your scenario, requires using a non-standard protocol? A non-standard protocol means:

More bugs because it hasn't had as much review by experts.
More bugs because you had to write custom code instead of using well-tested, maintained libraries.

Note that I haven't reviewed your protocol, 1. because you didn't tell us what your protocol is, and 2. because reviewing a protocol is rather more work than expected in a Stack Exchange answer. But just spending one minute with the things you mentioned raises several red-orange flags.

Use TLS with a pre-shared key unless you have a good reason to do otherwise. One good reason not to use TLS is if you want to exchange individual messages rather than maintain a session. In this case, the round trips necessary for TLS are a waste, and you should probably use DTLS instead.


Make firewall management public? A friend of mine installed a new firewall software at his company. Sometimes he works from home, and also has to maintain the firewall.

The firewall management software is a web site. My friend made the management software reachable by https://firewall.company.org.

Is this a good idea, or a bad idea?

If it was up to me, I would make the management software only reachable from within the company's network, and use a VPN tunnel to access the network from home.

Theoretically, if there aren't any problems with the authentication mechanisms of the website and it is implemented securely (using an SSL connection, no flaws in the implementation that can be exploited, etc) then it doesn't matter.  That said, that is a BIG if.

It would be safer to remote in to the company through an already existing gateway, but if there isn't an existing gateway in, and depending on what the firewall is responsible for (if bypassing it wouldn't result in exposing the internal network from the outside, but only allowing things from the inside out), it could potentially be safer to administer the firewall this way than open up a gateway in to the entire network (since a VPN could potentially have a similar vulnerability.)

If the firewall being down would allow external attackers in, then it's no more safe than the VPN being added since a compromise would give access to the internal network.  A VPN probably has a smaller attack surface area, so it's probably safer in that case.

Either way, he better be sure to put a lot of security in to the credentials for remote access and have them lock out quickly if a brute force attack is attempted.  It would probably even be worth using a certificate based authentication as well since it is pretty much the keys to the kingdom.  I wouldn't personally want to put such functionality on the Internet, even behind a secure portal, unless I absolutely had to.


Encryption of TCP communication? I am using an exe application which is communicating with a Raspberry Pi device with manually configured TCP ports. The application will send data from port 1234 to the Raspberry Pi which is listening on 19000. But the communication is not encrypted. Can someone suggest me how I can do the encryption between these two ports?

I surfed a bit and got the idea that I can implement SSL over TCP. If someone has a better solutions I would love to hear it.

I surfed a bit and got the idea that I can implement SSL over TCP

Using SSL/TLS over TCP is a good idea.

It is an established, well-known and well-studied protocol where lots of libraries can be found and lots of documentation exist. And, properly used it offers strong encryption and also protection against passive sniffing and active man-in-the-middle attacks. But make sure you use recent TLS libraries and follow current and widely published documentation so that you actually make proper use of the security offered by TLS. Also, don't try to "cheat" by disabling certificate validation etc - while it looks like it would work it will usually be insecure.

Given that you don't have much experience in this area you should in no way try to create your own protection layer since it is very likely that you will introduce problems which you will not be aware of - see also Why shouldn't we roll our own?.


Recommended operational security for generating one's primary key pair? I have been looking for an operational security guide for generating one's asymmetric key pair for (Open)PGP. I have found plenty of technical guides for how to use GnuPG to generate RSA key-pairs, for example, but not much organized content of how to do so securely.

The use case is an average user wishing to use asymmetric encryption for signing, encrypting, and decrypting email and other file types. The threat model for creating the key pair does not include having to fend off three-letter agencies, organized crime, terrorists, or malicious corporations (i.e., there doesn't need to be a step regarding hiring body-guards or getting 24/7 security systems).

I've gleaned from various sources online (including the very helpful GnuPG mailing list & documentation, the Debian Wiki, RiseUp.net, and this guide) the following steps as a general guide, but I am not sure if I am missing something. What else does one need to consider in this scenario?

Find a computer that you think is relatively free of malware
Download a Live Linux distro CD/DVD/USB, and verify its signatures to make sure you are not installing a tainted version
Launch the verified Linux distro

Make sure the distro is completely disconnected from any network connection before proceeding
Configure GnuPG by editing the .gnupg/gpg.conf file to follow the guidelines here

Use GnuPG to create private RSA key, and two subkeys (signing &
encrypting)

Set expiration date on (public) sub-key
Create both a paper and digital backup of master private key
Store the backups in two different physical locations, so no single point
of failure
Create a revocation certificate for the private master key
Create both a paper and digital backup of the revocation certificate
Store the backups in two different physical locations, so no
single point of failure

Strip the master private key from the keychain
Copy over GnuPG keychain without master private key to work computer, personal laptop, etc.

"Relatively free of malware" is probably not good enough if you're going to run the key generation on the installed OS, and probably irrelevant (to key generation) if you're going to use a LiveOS.  (I'm ignoring here the possibility of firmware exploits aka BadBIOS, since your threat model doesn't seem to encompass them, and they're basically impossible to defend against given the current state of things.)

Your process seems mostly reasonable, but keep in mind that even without the master private key, having your crypt & signing subkeys on those other machines does pose some risk.  While you can always replace them if they're compromised, that won't prevent someone from decrypting data that was encrypted prior to rotating keys, and they can still sign things as you until you revoke your key (and the verifiers pick up the revocation!).

Also, keep in mind that settings like cert-digest-algo SHA512 may cause interoperability problems with people using significantly older versions of software, particularly old versions of the commercial PGP.  If you're not concerned by that, then carry on.

For your paper backups, I'd look at Paperkey, which is written by David Shaw, one of the authors of RFC 4880 (the OpenPGP spec), which strips down the key to the bare components needed to reconstruct it.  This means you can print a much smaller key, increasing your likelihood of success when you go to scan+OCR or re-enter your paper backup.


Can be WiFi credentials obtained by autoconnection feature + a mimicking hotspot? Mobile devices like smartphones and tablets have the feature to autoconnect to wireless networks of known name. The same is with laptops and other hardware using WPA2. Is it possible to:

a. Obtain the target hotspot name, like "john home network"

b. Setup a new wifi network with the same name by using e.g. Android adhoc hotspot.

c. Wait for the person to e.g. make a call outside the original hotspot range, expecting the smartphone to autoconnect to fake hotspot (after unlocking).

d. Catch the credentials sent to the fake hotspot.

No, this would not work because all passwords sent to password protected routers are encrypted (this is why De-Auth ing a client and then sniffing their handshake as the re-authenticate does not work). The router compares hashes and not plaintext.

You may also be interested to know that this is not dissimilar to an attack called "the evil twin attack," Google that and you'll get plenty of info...


Testing web applications from an end user's perspective I have been looking at OWASP and other forms of checklists on testing web applications. One of the best practices is to ensure session IDs generated are sufficiently random and unpredictable.

Assuming that I am a corporate end user without having permissions to install software on my laptop, to test the security of a web application from my web browser.

From my understanding, if we were to have a web app that always enforce an encrypted HTTPS (SSL/TLS) connection to prevent the disclosure of the session ID through MitM (Man-in-the-Middle) attacks, this ensures that anyone cannot simply capture the session ID from web browser traffic.

If the session IDs are indeed encrypted due to HTTPS, are we still able to determine if the session IDs are sufficiently random and unpredictable? I was asking myself this question and for me, a close and probable answer I would give myself, is no. (I might be wrong)

Am I also right to say, to know that if session IDs are generated randomly and unpredictably, you would actually need to have access to the internal web application code? There are probably a lot more that I can't do without additional tools to gather more information on the web application.

What are the other kind of test cases - as an end user, who might not have advanced tools to sniff the network or to read underlying code, to test more comprehensively and value-add on my test cases on the web applications? For e.g. testing for invalid input and seeing if errors are thrown.

If the session IDs are sufficiently random and unpredictable?

To check just for randomisation and unpredictability, I use myself Burp Suite - Sequencer.
Burp Suite Community edition is free to use.

  You would actually need to have access to the internal web application code?

Sequencer can make any request where in response you get ID you want to check. It can make a lot of requests and analyse the response cookie. In the example, it would be JSESSIONID.

e.g.

Request: www.google.com/login

Response: Cookie: JSESSIONID=5858FBAA9874233FB133936RR9D3E21F

  What are the other kind of test cases to check for sufficiently random and unpredictable cookies?

It would be hard to analyse randomisation and unpredictability without any tools.

  Test more comprehensively and value-add on my test cases on the web applications (without tools)

You can check for something like CWE-209: Information Exposure Through an Error Message.

Hopefully someone else can add to this answer who is maybe not testing with tools.


If I set http.sslVerify to false in git, then will the connection be secure? If I set "http.sslVerify false"(in .gitconfig file) in git, then will the connection be secure? In between, we are using pfsense firewall and squid+squidgaurd for web-filtering.

Is this a good path to use?

The connection is not secure. If git isn't verifying the SSL certificates of the remotes, a MITM attack is pretty simple and straightforward. Anyone could tamper with your code and even build exploits into your software without you even noticing; thats about the worst thing that can happen to a software project.


Amazon Turk - How secure is it? Strange behavior I just had this really strange experience with Amazon Turk, where suddenly I was logged into someone else's account. I was logged into the company's Turk account, left my computer for a while, refreshed the tab and BOOM, someone else's account.

Does anyone have a clue what this could be? It was a real person, a real account, I saw all of their information. It's possible that someone who has access to this account also has access to the account I saw (not sure yet), but that shouldn't affect me, right?

Bug in AWS? Problem on my end? I've been looking for the solution now for about 20 minutes couldn't find a thing.

How is this possible? Should I be worried?

I did some more research and figured it out. I'm using a client's AWS account and was not aware of how they set up the IAM. Apparently, it's the cross-account access settings that caused this. It was set up a long time ago and nobody really bothered to tell me how it was set up, nor do I think they really payed much attention...

http://docs.aws.amazon.com/IAM/latest/UserGuide/delegation-cross-acct-access.html

So I learned my lesson here and will never assume things when using an a client's AWS account.


How does bypassing HSTS with SSLSTRIP+ work exactly? I am doing research on bypassing HSTS. I read this guide on bypassing HSTS using SSLSTRIP+, but there are a few things that I don't understand.

  First thing to do is to fire up MITMf in SSLstrip+ mode, I'll also be using classic ARP spoofing to become man-in-the-middle:

  So now when 192.168.10.23 browses to www.google.com he will be redirected to wwww.google.com!

How exactly is the victim being redirected. Does the DNS packet contain some sort of redirect? Or is it something else that redirects the user to wwww.google.com?
And another thing. Is this figure is still applicable to SSLSTRIP+?
The documentation of the DNS2Proxy tool from LeonardoNve states the following:

  Automatically the dns server detects and correct the changes thats my sslstrip+ do to the hostnames to avoid HSTS, so will response properly.

What exactly is being corrected here?

This is answered going off the available information you linked to.

  How exactly is the victim being redirected. Does the DNS packet
  contain some sort of redirect? Or is it something else that redirects
  the user to wwww.google.com?

When the user navigates to www.google.com, sslstrip acting as a MITM will redirect the user to wwww.google.com using HTTP. For example, via a Location HTTP response header:

Location: http://wwww.google.com/

  And another thing. Is this figure is still applicable to SSLSTRIP+

That image doesn't seem right for sslstrip or SSLstrip +. As it can't intercept actual HTTPS requests, the request from the client should not be using the HTTPS protocol for the request. It is more like

GET http://facebook.com  ----> sslstrip   ---> https://facebook.com

and it initially prevents HTTPS from the client by changing both links and redirects from HTTPS to HTTP that are returned in any HTTP responses.

  What exactly is being corrected here?

It appears that via the configuration of DNS2Proxy you can set how subdomains are resolved. So when www.google.com is redirected to wwww.google.com your *.google.com rule sets the resolved IP address which is returned. So in your config you set *.google.com to the A record for www.google.com.

Having said all this

My conclusion: It doesn't work.

If there is a HSTS rule on the browser already, the initial request to www.google.com will be over HTTPS anyway meaning that it can't be intercepted by sslstrip.

Additionally, if a site is in the HSTS preloaded list (like Google's domains will be in Chrome), it is required that includeSubdomains is specified. Therefore wwww.google.com will only be fetched over HTTPS too.


Where can I configure certificate rules on Windows 10? This excellent SSO answer recommends to use certificate rules on Windows’ executables, as explained here by Microsoft. The latter says that the “location” of this setting is:

  Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options

I would like to do so, but I do not manage to find that corresponding control panel on my Windows’ PC (running in German). There is a German version of that article, but the line in question reads basically the same:

  Computer Configuration\Windows Settings\Security Einstellungen\Lokale Policies\Security Optionen

Since it does not start with HKEY_whatever, I think it is not a registry entry. But what else?

Computer Configuration − could mean this window?

But there is nothing like “Windows Settings” in that dialog.

Windows Settings − looks like the caption of the new control panel. But I do not open that from any “computer configuration”, but directly from the start menu.

Security Settings − could be this panel?

Local Policies − nothing like that…

Here is where I am lost. Can you please point me to the setting, maybe with some screenshots so that I can guess on my translated interface where to find that setting?

The articles on Windows IT Pro Center are in a hierarchical order, and it is expected that it would be unnecessary to repeat the information provided on previous levels. Your answer is three levels up:

Security policy settings

  Security policy settings are rules that administrators configure on a
  computer or multiple devices for the purpose of protecting resources
  on a device or network. The Security Settings extension of the Local
  Group Policy Editor snap-in allows you to define security
  configurations as part of a Group Policy Object (GPO).

  For more info about managing security configurations, see Administer
  security policy settings.

Security policy settings reference

Security Options

System settings: Use certificate rules on Windows executables for Software Restriction Policies

If you are applying this to a single computer, your options are:

Local Security Policy (Win+R secpol.msc):

Local Group Policy Editor (Win+R gpedit.msc as suggested in the comments):

On a Windows AD domain you'd use the Group Policy Management or Security Configuration Wizard.


Which type of encryption algorithms android supports, and which would be better? I read this documentation, and I have written an algo to encrypt and decrypt a string. But I don't know how many types of algorithms android supports.

Regarding DES and AES (As wiki documentation) there are many types of both, so which one will be better?

On DES and AES: use AES.

DES and AES are block ciphers: they encrypt data by "blocks", where a block is a 64-bit (for DES) or 128-bit (for AES) quantity. To encrypt a "message" which is not a single block, you need to use a "chaining mode" and possibly a "padding": the chaining mode defines how data is split into blocks and assembled again, and the padding consists in extra bytes added at the end of the message so that the total length is appropriate for whatever splitting the chaining mode uses. The padding must be such that, upon decryption, it can unambiguously removed.

The "standard" chaining mode and padding are called, respectively, CBC and PKCS#5. The PKCS#5 padding adds between 1 and n bytes, where n is the block length (hence 8 for DES, 16 for AES), so that the total padded length is a multiple of n. CBC links blocks together and requires an Initialization Vector (IV) which should be a sequence of n random bytes; it is very important that the IV bytes are generated with a cryptographically strong random number generator (i.e. java.security.SecureRandom) and that you generate a new IV for each message. The IV must also be sent along (unencrypted) with the encrypted message, because the receiver will need it to decrypt the data.

For the block cipher itself: DES comes in two flavors, the "original" DES, and "Triple-DES", also called "3DES" or sometimes simply "DES". The original DES uses a 64-bit key, out of which 8 bits are ignored, so the effective key length is 56 bits, and that's too short for security. 3DES uses a 192-bit key (24 bits are ignored, so 168-bit effective key length) and is believed to be robust; it is also three times slower than DES, which is already not that fast.

AES was designed to replace DES, and is generally thought to be better in all respects. AES has three flavors, dubbed AES-128, AES-192 and AES-256, which differ by the key length (of 128, 192 and 256 bits, respectively). 128 bits are more than enough for security, and longer keys imply a slight computational overhead, so a 128-bit key is preferred.

To get a list of algorithms supported by a Java virtual machine, try this:

import java.security.Provider;
import java.security.Security;
import java.util.Map;
import java.util.TreeSet;

public class ListAlgo {

    public static void main(String[] args)
    {
        TreeSet<String> algos = new TreeSet<String>();
        for (Provider p : Security.getProviders()) {
            for (Map.Entry<Object, Object> e : p.entrySet()) {
                String s = e.getKey().toString()
                    + " -> " + e.getValue().toString();
                if (s.startsWith("Alg.Alias.")) {
                    s = s.substring(10);
                }
                algos.add(s);
            }
        }
        for (String a : algos) {
            System.out.println(a);
        }
    }
}

(This is for "normal" Java; for Android you will probably need to change things a bit with regards to the final output.)

The encryption algorithms will be those where the string begins by "Cipher.". Anyway, if you want the most widely supported algorithm combination, it will be "AES/CBC/PKCS5Padding" with a 128-bit key: if a given Android-based supports a single cipher, it will support that one.

If you are in a situation where encryption is warranted, then chances are that you will also need an integrity check; see javax.crypto.Mac. For a MAC, when in doubt, use HMAC with SHA-256 (if SHA-256 is not supported, fallback to HMAC with SHA-1).


Is constantly downloading large amount of files from a web server considered DDoS? For example, there's like a million files stored on a website (publicly, anyone with a link can get it), and I wrote a program to retrieve it one by one. Since obviously my program pings the server constantly for the files and can potentially crash the server, does this consider a small, tiny form of DDoS?

I'd say no. A DDoS is a distributed denial-of-service attack. Writing a program to sequentially download files stored on a server certainly isn't distributed as long as you plan to run the program on a single computer. It's not an attack if a) you don't intend to crash the server and b) there's no reason to believe running your program will do so.

If the goal of your program is to crash the server (and your program meaningfully restricts bandwidth) then running the program could be considered a DoS (plain denial-of-service attack). But even if you don't intend to crash the server but there's a good chance your program could do so, then your actions could be considered an attack.


How do bots communicate in the zeus botnet? I read on http://www.abuse.ch/?p=3499 that: ZeuS is now using an “IP list” which contains the IP addresses of other drones participating in the P2P botnet. An initial list of IP addresses is hardcoded in the ZeuS binary.
From what I understand, the bots use a hardcoded ip list to communicate with each other. what I don't understand is, how can bots behind a NAT network communicate with each other when the IP addresses behind a NAT network are invalid?

You could read something like Infosec Institute's Botnets Unearthed – The ZEUS BOT, but it boils down to:

It's not a peer to peer setup, it's a client/server setup.  Malware clients try to contact command and control servers which are not behind firewalls that prevent access.

You see a list of command and control nodes (or, better, make sure your own firewall is blocking all of them) at the ZeuS Tracker, which is the source of the I-Blocklist ZeuS blocklist (and many others).


Keylogging over the internet Is it possible for a foreign entity to get a keylogger on your computer without physical access?
Thinking of security of never-saved local passwords.

Key loggers can be inserted on to a system via a wide range of attack vectors. Not all are reliant on physical access - although some are.

Keyloggers are generally broken down into two main categories - Hardware Based, and Software Based. Those each have sub-categories of their own based on where the keylogger resides on the system, or the methods it uses to track key presses.

Those that are reliant on physical access can arguably be harder to trace, depending on the physical security of the location. For example, you may be able to detect that a keylogger was used, however if the physical access to the site cannot be monitored through cameras or other physical security measures then once the keylogger is collected there is little to track the attacker on.

Whereas those that do not require physical access to the machine will usually 'dial home' and send their information back to the attacker. This could leave a bigger trail of breadcrumbs to trace the attacker down but has the benefit of all being performed without physical access to the infected device.

Attack vectors for non-physical keyloggers include but aren't limited to having the user open an email attachment that contains the payload, gaining control of a users WiFi session and sending them to a fraudulent website that will serve up the payload, or even distributing them via online advertisements. There are simply too many ways to serve up a keylogger to a system to have it listed here.

The following Wiki breaks things down quite well: https://en.wikipedia.org/wiki/Keystroke_logging


How victims decide to auto-connect to an Evil twin or not? When someone sets up an evil twin AP (obviously with the same SSID and Mac address of the victim AP) and then sends de-authentication packets to force connected users to disconnect from the original AP, do users auto-connect to the new AP? If the evil twin has a stronger wifi signal, does this mean users prefer to connect to the evil twin?

First to correct you , for EVIL TWIN you don't need same bssid (MAC) as Target AP

Main Targets for EVIL TWIN are active probing of client device for SSIDs Already in its PNL (preferred network list) , so  of we somehow replace bssid in PNL with out fake AP's bssid , Client will prefer associating with us .

  Do users auto-connect to the new AP?

Out of various AP announcing SSID in our PNL which AP will be in our PNL It Depends on a lot of things few are as below :-

SNR :- AP with highest signal to noise ratio is always prefered

Lowest Delay in probe response :- Among the APs the AP with Lowest

DOT11 authentication :- If Open dot11 its fine but  if shared key dot11 auth is applied , same wep key must be on our fake ap , or we need to allow failed handshake also

DOT1x authentication :- if Dot1x is applied for dynamic keys Management (802.11i) then Protected EAP is not vulnerable to EVEN TWIN if proper root CA  certificates are deployed at client side


What are some ways to anonymize your writing style? I imagine that if someone suspected an anonymous online persona of being a specific real person who also had writing samples available online (like a blog or social media) they'd be able to compare the styles of writing. What are some ways to prevent this? Should techniques be done on your anonymous account or your identifiable one?

There is a program written in Java called Anonymouth which assists with this:

  Anonymouth is a Java-based application that aims to give users to tools and knowledge needed to begin anonymizing documents they have written. It does this by firing up JStylo libraries (an author detection application also develped by PSAL) to detect stylometric patterns and determine features (like word length, bigrams, trigrams, etc.) that the user should remove/add to help obsure their style and identity.

On its own, Anonymouth is only of limited value. Anonymizing your writeprint analysis requires a basic understanding of linguistics and stylometry. Basic stylometry involves the so-called 5-feature analysis, where five major writing style features are analyzed (paraphrased from Wikipedia):

lexical features - The analysis of the lexicon, the author's choice of vocabulary. Different people use different words at different rates, which can make them quite unique. I, for example, tend to use the word tend a lot. I would need to avoid that if I wanted to hide my writeprint. Using simple, short, and common words can reduce the potential of this feature.
syntactic features - The analysis of the author's writing style and sentence structure, such as: punctuation, use of passive voice, and sentence complexity. Using sentences that are as simple as possible with a standard writing style can help weaken this feature.
structural features - The analysis of the author's organization of the work. These include paragraph length, spacing, indentation, use of oxford commas, etc. Just as with making the 2nd feature less useful, making this feature less useful can be done by following standard writing styles rather than using one that naturally evolved with you.
content-specific features - The analysis of the language that is contextually significant to subject of the written work. Examples include the use of slang or acronyms that may be shibboleths. E.g. a set of botnet owners can easily be divided into those who say "C&C", "CnC", and "C2".
idiosyncratic features - The analysis of errors and other ungrammatical elements that may be unique to the author. This is by far one of the most damning features and has lead to numerous people being deanonymized by their writing style. Small mistakes made on one non-anonymous identity can carry on to anonymous identities, potentially linking them.

Many of these features can be anonymized by using standard English with completely proper grammar and spelling, and short, simple sentences. Idioms and the like should be avoided. It's also possible to emulate other authors in order to fool analysis. If all else fails, simply waiting can help. A person's writing style drifts over the years, so it's unlikely that a document authored by you several years ago will be easy to tie to what you write now. This does not mean it is impossible, just harder.


How do I restrict network access to websites using a monitoring system? I am making a Java Project a LAB MONITORING SYSTEM for my University practical exams. Where a teacher or admin can monitor some selected computers and can give permissions to what the user at that computer can do.

One application is deployed at the admin computer and one application is deployed at the client computer (which is being monitored).

The client application is responsible for making permission in effect.
Permission likes.
-Whether the USB Port should be enabled for disabled ( as they should be disabled during examination).
-Disable or enable task manager.
etc.

Since the client application is responsible for making the permission in effect and it is running as a service that can be configurable by the administrator only.

I want that the admin can block some sites or can enable only selected websites that the client can browse. And if the user tries to access a restricted website, then a message should be displayed that "This website is Restricted by the ADMIN".

This software model is only for LAN networks.
How can I accomplish the above task?
Please help
I will be very grateful to you.

One possible solution to this problem is changing the /etc/hosts file (or equivalent) on the target system to point to a webserver running on the local intranet displaying your message of choice.

Example on Unix-like (Unix, Linux, BSD, Mac) systems:

# Static table lookup for hostnames.
# See hosts(5) for details

127.0.0.1       localhost
::1             localhost

your_webserver_ip blockedsite.com

A simpler approach (without the webserver) is doing this:

# Static table lookup for hostnames.
# See hosts(5) for details.

<snip>

172.0.0.1       blockedsite.com

The Windows equivalent to this file is C:\Windows\System32\drivers\etc.

Do note for all these examples you will have to have root/admin privs.


Security Protocols for a Blog What are some security protocols that I should be aware of when starting and running a personal blog? I am steering away from WordPress and will another hosting service.

The blog will mainly just be static content with a section for readers' comments.

There is always a trade off between the level of security and the amount of time and effort that you're willing to put into a project. For a personal blog I would reccomend you keep these things in mind.

Always update your CMS. No matter if you choose wordpress, drupal, django, or something else make sure that you always check for security updates. The very minute you publish something on the internet it will be scanned from around the world for weaknesses. Keeping up to date with the latest patches will keep you much safer.
Use a strong password! There are some good posts on this site regarding password management. Automated scanners will be brute forcing your admin page the second it is published. So use a unique password.
Use multi factor authentication, if possible. For the admin page of your site you can sometimes enable multi factor authentication. If the CMS that you choose offers that as an option, use it.
Keep backups. In the case that something goes wrong. Make backups as often as you are able to. (If you're making periodic posts, just back up the site after each post).

An alternate solution. You mentioned that your site will be "mainly just be static content with a section for readers' comments." If this is the case then you may want to look into static site generators. The idea is that you can generate a very nice site (especially a blog) offline. The site generator will spit out for you static html/css/js. You can then take these files and use a CDN (Amazon S3, for example) to host the site. Your web site will have a really hard time ever being hacked if it accepts no dynamic content! Comments can also be enabled on a site by offloading that work to another provider. Discus or Discourse may be viable solutions.


How are VLANS logically separating a switch? I'm having some difficulty understanding when people say that VLANS provide security by logically separating/dividing the switch into different sections after trunking the VLANs on a router and allowing the hosts on the different VLANs to communicate with each other. I can see how they would provide security if the VLANS could not communicate with each other but I'm struggling to understand what would be the purpose in allowing these VLANs to communicate with each other via a router instead of keeping them separate.

Some attacks are prevented by VLANs regardless of what the router allows.  Arp poisoning, for example, or broadcast-based attacks like DHCP hijacking.  Two hosts segregated by a VLAN cannot attack each other in those manners.
However, for security the presumption is that the router will not allow everything, but will apply some access controls or NAT hiding between the two VLANs.  In that event the router should be able to provide all the security that it could between two physical VLANs.


Hibernate SQL Injection - Fortify 360 I am using Fortify 360 to analyze my code's security. Fortify has identified a Hibernate based delete method to perform a delete based on an object that has been passed in. My understanding of hibernate is that hibernate will delete a row in the table the object is associated with based on the objects id (the id is a number). Fortify has flagged this as SQL Injection:Hibernate(Input Validation and Representation, Data Flow). Fortify does not seem to like that Hibernate is executing a dynamic SQL statement using unvalidated input. Would a certain fix be required or just caveat this as a mitigated risk?

public List findByItemProp(String propName, Object value){
   try{
     String qs = "from ItemTypes as model where model."+ propName +"= ?"; /* <-- flagged by Fortify */
     Query qo = getSession().createQuery(qs);
     qo.setParameter(0, value);
     return qo.list();
   } catch (){}
 }

I'm afraid this report is probably too lacking in details to provide a diagnosis.  I can't diagnose this issue for you without seeing the code.

You definitely should not disregard a static analysis warning as "mitigated risk" when you haven't done anything to mitigate it and don't understand whether the warning represents an exploitable vulnerability or not.

I suggest you start by educating yourself about SQL injection, about security Hibernate, and about this particular warning.  Most likely Fortify has online help that provides a detailed explanation about this warning; you should start by reading that.  Read the following Fortify backgrounder on SQL injection in Hibernate.
I also recommend the following articles: How is SQL injection typically stopped in a Spring/Hibernate setup,
ORM injection, and How to avoid SQL injection in Hibernate (A Hibernate Urban Legend).

Update (4/20):  I see that you updated the question to include the code.  Thanks.  The code you provided is indeed dubious, and I think it is reasonable for Fortify to complain about that code.  Looking at this code, it is not possible to verify that the query passed to createQuery() is a compile-time constant, which is why Fortify issues a warning message.

Basically, the code you show appears to be constructing a SQL query using string concatenation.  That's dangerous.  If propName can be influenced by the attacker, then you've got yourself a possible SQL injection vulnerability.  It is best to avoid constructing the SQL query in this way.

In particular, there is a myth out there that using prepared statements (or parametrized queries) is inherently immune from SQL injection.  This is true, but only if the query itself is a compile-time constant that cannot be influenced by the attacker.  If you insert untrusted data into the query itself, then using it in a prepared statement doesn't somehow magically make you safe.

So the best practice is that, when you use a prepared statement, make sure the query can be readily verified to be a compile-time constant (and cannot be influenced by the attacker).

To sum up the general rules of thumb: (1) Don't use string concatenation to build up a SQL query.  (2) When you want some dependence upon runtime values, use prepared statements to bind runtime values.  (3) Make sure the query that you use to create the prepared statement can be readily verified to be a compile-time constant.  Following these practices should help ward off SQL injection attacks.


I know scrypt is newer than bcrypt, but is there any reason it would be weaker? From what I read, scrypt is (on paper) more secure than bcrypt, but it's pretty new so it's better to let it get time-tested and scrutinized first. However, is there any good, compelling reason to assume that it won't stand up to scrutiny?

Not yet.  If there were any good, compelling, reason, cryptographers would already be warning people off of using it.  Internally it uses SHA-1, which has shown weaknesses for collisions, but in password storage, the concern is more preimage attacks than weaknesses, and there are no indications SHA-1 will fall to preimage attacks in the foreseeable future.  Scrypt is incredibly simple in structure, I doubt that any weakness would be found in it that would not actually be a weakness in SHA-1.


Why is Chrome asking for the application-specific password and my account's password every time? I enabled Google's two-factor authentication and found it ironic that Google Chrome Sync requires #1 You account password, and #2 an application-specific password. First of all, don't applications either require one or the other, but not both? Secondly, why does Chrome not remember the application-specific password I gave it? Why do I have to go generate a new one every time I change the account password? And third, why doesn't Chrome just use the random number authentication instead of an application specific password?

I just find it ironic that it asks for both #1 and #2 unlike every other app and wanted to understand why.

I was also wondering why chrome ask every time a new application-specific password. Then I realized the reason is that the computer which chrome run on is not a trusted computer. I made it a trusted computer then chrome never asked specific password again.

Here is how to make a computer trusted, quoted from here

  You can add your computer to the
  trusted list at any time. When you sign up for 2-step verification,
  you’ll be asked if you want to trust the computer you’re using. You
  can also mark a computer as trusted by selecting “Trust this computer”
  when entering a verification code.


What kind of attacks against home router's NAT do exist? I always thought NAT was some kind of a security feature and I still think it is, because if it didn't existed the internet, respectively the clients behind NATs, would be even more insecure, since for example port 445 would be directly open to everyone scanning clients etc.

But there seem to be some attacks, in which all the attacker needs to know is the WAN IP address.

Which?

There are some good lists of security issues here already. However I have not seen anyone mention NAT Pinning yet.

Quoted from Samy Kamkar's site on how NAT pinning work:

  Attacker lures victim to a URL by convincing them that there are pictures of cute kittens on the page.
  Victim clicks on URL and opens the page.
  The page has a hidden form connecting to http://attacker.com:6667 (IRC port).
  The client (victim) submits the form without knowing. An HTTP connection is created to the (fake) IRC server.
  The fake IRC server, run by the attacker, simply listens, unlike me according to former girlfriends.
  The form also has a hidden value that sends: "PRIVMSG samy :\1DCC CHAT samy [ip in decimal] [port]\1\n"
  Your router, doing you a favor, sees an "IRC connection" (even though your client is speaking in HTTP) and an attempt at a "DCC chat". DCC chats require opening a local port on the client for the remote chatter to connect back to you.
  Since the router is blocking all inbound connections, it decides to forward any traffic to the port in the "DCC chat" back to you to allow NAT traversal for the friendly attacker to connect back and "chat" with you. However, the attacker specified the port to be, for example, port 21 (FTP). The router port forwards 21 back to the victim's internal system. The attacker now has a clear route to connect to the victim on port 21 and launch an attack, downloading the victim's highly classified cute kitten pictures.


Finding artifacts using bulk_extractor in different methods I have specific number of artifact, and I want to search for those particular artifacts in the disk image using the bulk_extractor tool via different methods using Random Sampling, Stop List, Alert List, or Search Text. I want to know which method is most efficient, and how can I reproduce such test scenario and get results.

This answer describes each of the methods that you list. They are different and not commensurable.
Random Sampling
This approach picks a set of random sectors, sorts them, and analyzes them in order. (They are sorted because it's faster to seek randomly chosen sectors in sort order than in random order if you have a mechanical drive.) This is useful for analyzing 1TB of data in 10 minutes, as discussed by Simson Garfinkel in this 2012 video presentation.
Stop List
A stop list is a list of words that should be ignored. For example, there are many email addresses in the Linux kernel: you should probably ignore them. However, you probably want to use a context-aware stop list (which bulk_extractor supports) so that you only ignore the Linux developer's email addresses when they appear in the Kernel, and not when they appear elsewhere (such as in an email message).
Altert List
Sometimes you are working on a case and you want to know immediate if you target's email address is found. You can add that target's email address to the alert list, and you will be alerted.
Search Text
This is text that you might be search for.
Your question asks: "which method is most efficient." This question doesn't make sense, because the methods implement different functionality and you didn't define what you mean by "efficient."
Your second question asks: "How can I reproduce such test scenario and get results." It is not clear what this question means.


Computer's IP address used by another in closed network? I got an alert in the newest OSX (newest Macbook Air) and in Eduroam network that my IP address is used by another machine.
This is my first time in life.

I think I may have been attacked because I was doing some important research at the time of interruption.

What can be the reasons for such situation?

I think it should be very rare situation.

What does it mean that some other computer share the same IP address as yours in a closed network?

What you mention is referred to as IP conflict. Most probable reason is misconfigured static settings on the other computer, nothing to worry about. Or it could be a DoS as in the router won't know where to forward the packets. In our eduroam infrastructure we automatically block these situations. Consult your University's NOC (Network Operations Centre, i.e. your network administrator.)


How to spoof file extension when it is appended to the file name every time? I have an arbitrary file upload vulnerability and I can put my file in any directory. Unfortunately, the serverside script appends ".jpg" ALWAYS to the end and I'm having trouble bypassing it. %00 (NULL), \, nothing seems to work. Does anyone have any ideas?

In situations like these where you have full control over where the files get output, it might be best to turn your attention towards potential LFI vulnerabilities. It's unlikely you'll bypass the extension suffix, but if you're able to get PHP code into the JPG EXIF data, you can use LFI to include that PHP.

The next suggestion I would make is to check and see if Javascript is adding the .jpg extension. If it is, just disable it and try uploading again.

Lastly, double check the request in burp and make sure that your NULL byte payload is actually getting through to server and that the filename is correctly stated in the request before you send it. It may be that when you select the file that there is an intermediary process in between that you may be able to also intercept that's adding the .jpg extension.


How to tell if an email source is spoofed? I've received an email to my gmail account from FCMB, a bank in Nigeria (flashing warning lights already).  It's not addressed to me (i.e., the email starts off "Dear Daniel," [not my name]).  But the email address is mine.

When I look at the headers in Google, it really does look to me like Google received it directly from FCMB.com.  Here's the relevant bit (I think):

ARC-Authentication-Results: i=1; mx.google.com;
   spf=pass (google.com: domain of ebusiness@fcmb.com designates 41.223.147.112 as permitted sender) smtp.mailfrom=ebusiness@fcmb.com;
   dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fcmb.com
Return-Path: <ebusiness@fcmb.com>
Received: from lin-smtp.fcmb.com (lin-smtp.fcmb.com. [41.223.147.112])
    by mx.google.com with SMTP id n5si1099097wmi.93.2019.09.04.11.31.49
    for <XXX@gmail.com>;
    Wed, 04 Sep 2019 11:31:50 -0700 (PDT)
Received-SPF: pass (google.com: domain of ebusiness@fcmb.com designates 41.223.147.112 as permitted sender) client-ip=41.223.147.112;
Authentication-Results: mx.google.com;
   spf=pass (google.com: domain of ebusiness@fcmb.com designates 41.223.147.112 as permitted sender) smtp.mailfrom=ebusiness@fcmb.com;
   dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fcmb.com
Message-ID: <5d700316.1c69fb81.8dceb.fbc9SMTPIN_ADDED_MISSING@mx.google.com>
Received: from INTRANET (unknown [172.27.15.3])
   by lin-smtp.fcmb.com (Postfix)
   with ESMTP id 69410875FC
   for <XXX@GMAIL.COM>;
   Wed, 4 Sep 2019 19:43:36 +0100 (WAT)
MIME-Version: 1.0
From: FCMB <ebusiness@fcmb.com>

How can I tell if this really being sent to me legitimately? Is this being faked in a way that I am missing things? In which case I want to better understand it since if not for all the red flags, I would have concluded that this email is legitimate.

P.S. This is the third email I've received in the last 2 months from FMCB that is addressed to "Daniel".

To be honest this looks fine. It would be helpful to see the mail itself.

The whole fcmb.com domain is valid. They are not listed on any blacklist.
Those IPs are all valid.
They use emailprotection by trendmicro. They have valid certs by GlobalSign issued for the hostingprovider of their website, Incapsula Inc.

Here is some information on the bank:

https://en.wikipedia.org/wiki/First_City_Monument_Bank

This is the procedure:

I start with those "received" fields and check the "from" values. In your case there is only one field.

We find lin-smtp.fcmb.com and 41.233.147.112  this is correct as lin-smtp.fcmb.com actually resolves to 41.233.147.112. You can check this with a reverse DNS lookup.
In spoofed mails they sometimes add false values here like a nonexistend domain or ip. But typically they only adjust the "Return-Path"

"Received-SFP" indicates they have a SPF record set on their domain. This technique is used to determine which sending addresses are allowed to send mails in the name of said domain.
Its whole purpose is to avoid spoofing.

The IP we found can be check for blacklist entries (i used Cisco Talos reputationcheck/ MXToolbox Blacklist lookup).
Usually spoofed addresses are only used for a short period because they get discovered.
We can make sure this IP has been associated with said domain for long enough, if we check passive DNS databases(Risk IQ).

as lin-smtp.fcmb.com is a subdomain of fcmb.com we can go on with that.
It brings up a web page that looks plausible. I searched for them and found their Wikipedia article.

I followed with another reverseDNS lookup against fcmb.com:

a records: 45.60.1.138 / 45.60.1.138 both belong to Incapsula Inc with ASnumber 19551 (the same company that issued the websites SSL certificate) they are actually known for webhosting and protection.

Maybe you should contact them.


Are buffer overflow applicable only to arrays? I've tried searching this question, maybe because it is obvious and I've had a look at Wikipedia and OWASP

Do buffer overflows only happen when you overflow the array size or can you buffer overflow other things?

Buffer overflows occur on, no surprise, buffers.

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

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

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