Difference between antivirus and sandbox? When reading about how antivirus and sandbox work, my understanding is that an AV scans a file to see whether it matches with known viruses signatures. Sandbox can be used to obtain the behaviors of a file when it runs. However, I don't know how sandboxes can be used to detect unknown malware or not. Could you please let me know this?
Thanks!

These are two quite different things. A little simplified:

An AV is a piece of software that can (among other things?) scan your system to identify and attempt to isolate and remove threats like viruses or other malware.

A sandbox on the other hand, is basically a context in which a piece of software can be run isolated from the rest of the world. Java applets running in a browser is a classic example, as should be Flash (though it is apparently not nearly as well isolated and safe as would be ideal): These are contexts where programs can run without having access to resources on the host machine (your PC), such as your file system, etc.

Another example can be a set of virtual machines. You could build your own "virus lab" by setting up several VM's running different OS's, then linking them together in an internal network, which will only be visible to those VM's. Now you could experiment by running malware on these machines, and seeing how it affects them, and how they affect one another, without affecting anything outside of their virtual network.

Another way to think of think of a sandbox, is as (ideally) a kind of digital software aquarium.


I found that the company I work for is putting a backdoor into mobile phones I have found out recently that the remote assistant software that we put in a smartphone we sell can be activated by us without user approval.

We are not using this option, and it is probably there by mistake. But the people who are responsible for this system don't see it as a big deal. Because “We are not going to use it”…

Am I wrong for going ballistic over it?

What would you do about it if it was your workplace?

  This question was IT Security Question of the Week.
  Read the Jun 16, 2012 blog entry for more details or submit your own Question of the Week.

Just because they won't use it, doesn't mean someone else won't find it and use it.

A backdoor is a built-in vulnerability and can be used by anyone. You should explain that doing something like this is very risky for your company. What happens when some malicious attacker finds this backdoor and uses it? This will cost your company a lot of time and money to fix. And what will your company say when people ask why the software contained that backdoor in the first place? The company's reputation might be damaged forever.

The risk is certainly not worth having it in the code.


What is "JTI/Suspect.131328" from McAfee? Using McAfee Endpoint Security 10.6 on Windows 10 it is the second time I got the:

Warning.

I cannot find anything related to it while Googling around: "JTI/Suspect.131328"

The question: is this a false alert? Or not?

McAfee's Rule Identifier 131328 is described in KB82925 on How to identify what rule corresponds to an Adaptive Threat Protection and Threat Intelligence Exchange event:

  Detect use of long -encodedcommand powershell

  Alerts on variations of the encodedcommand [base64] powershell usage

  WMI provides a way of executing code or moving laterally in an
  environment. Some legitimate software may use this way, so this rule
  should be behavior in your environment

It may or may not be harmful. That's why it's suspicious. Further investigation would require catching and decoding the base64 encoded PowerShell command and analyzing whether it's legitimate use or not.


Is it bad to only sign some of a domain's emails with DKIM? Is it OK if I sign a subset of domain emails, or is this an all-or-nothing game?

We use Amazon's Simple-Email-Service for sending e-commerce emails.

We would like to sign these with DKIM.

This same domain is also used for all email addresses for the corporation behind this e-commerce operation.

Due to some IT constraints, it does not look like we'll be able to sign the employee emails for many months to come.

Do spam protection servers look at the domain and see a DKIM public key and say, "OK, all emails must be signed", or do they look email-by-email and, if a signature is found, then they go looking for the public key?

DKIM doesn't tell you anything about whether a message is spam or not (although it's a bit more work to set up, there's plenty of spam that is signed with a valid DKIM signature).  DKIM is all about identity - do I know that this message is from the specified sender (and that it hasn't been altered in any meaningful way)?

No good anti-spam service will reject a message solely based on a lack of a DKIM signature.  If there is an invalid signature, then that's something to consider (i.e. maybe this is phishing); however, it's risky to reject in this case (because signatures can get broken in transit), and most anti-spam filters will not do that (at least by default).

The use of DKIM (without anything else) is to allow the mail client to indicate to the user that the message sender is verified (much as browsers indicate to the user that traffic is sent over SSL, or that a certificate is trusted).

So, the simple answer is yes, it is useful to sign messages, even if you cannot sign them all.  You can't tell your users that they should only trust messages that are signed, but they can at least trust some of them.  (Unfortunately, not a lot of mail clients yet expose this information, and users aren't yet trained to look for it, so the benefits aren't large - yet).

The simple answer to the second question is no, any decent spam filter will ignore the lack of a DKIM signature.

Further to this, there are two ways you can extend your use of DKIM, that do have an impact when only some messages are signed.

Author Domain Signing Practices (ADSP) is an optional extension to DKIM where you specify what should happen to unsigned messages.  Specifically, you can select from three choices:

unknown (this the behaviour you get if you don't use ADSP) - the domain signs some or all mail (or none, I suppose, although it would be then odd to have the record set up)
all - the domain signs all mail.  The recipient (or their anti-spam filter) gets to choose what to do with messages that don't have a valid signature; commonly these would be put into some sort of quarantine or flagged in some way so that the user is aware that they are probably fraudulent.
discardable - the domain signs all mail, and is instructing the recipient (or their anti-spam filter) to silently discard any messages that don't have a valid signature.  This is the same as "all", except that the sender, rather than the recipient, makes the decision about what to do with messages without a valid signature.  Anti-spam (or anti-phishing, in this case) filters don't have to obey an ADSP instruction, but they are likely to.

So right now, you should either ensure that you don't have an ADSP record, or that if you do it is set to "unknown".  Once you are able to sign all messages, you could move to "all" or "discardable", depending on what behaviour you would like.

Similar (but newer) to ADSP is Domain-based Message Authentication, Reporting & Conformance (DMARC).  DMARC incorporates policies for both SPF failures and DKIM failures, and incorporates information about providing feedback (to the supposed sender domain) about failures.  You've got basically the same choices as with ADSP, but more flexibility about how to work.  The example the specification provides as to how you'd start using DKIM/SPF is roughly this:

Deploy DKIM and SPF.
Publish a DMARC policy of "none" with a feedback reporting address (this is like ADSP's "unknown", except that you also state that you want feedback about failures, so if they are really from you, you can figure out how to fix the problem).
Tune your DKIM/SPF use until the feedback reports indicate that all your mail is appropriately authenticated.
Increase the DMARC policy strength to "quarantine" for a small percentage (this instructs the receiver to quarantine any messages that don't meet the policy, but only for a randomly selected percentage of mail).
Gradually increase the percentage (to 100%) as you get more confident that all mail is appropriately authenticated.
Set a DMARC policy of "reject" (again with a small percentage to start with, building over time to 100%), so that rather than quarantining, messages that don't meet the policy are simply rejected.

DMARC is new, so only a few anti-spam filters are using it at present, but that will (probably) increase over time, and there's little cost in adopting it now.

If you choose to use DMARC, then right now you could get to step 2, and then continue through the steps as you manage to get all mail signed.


Webhook sending Purchase Details to handling Purchases from a Third Pary Service Secure? I'm developing a mobile application for a client that sells digital courses on a service called Teachable that hosts their website and handles the purchase process for them. My client wants to keep using this service for the purchase process and when a user bought a course, he should have access to it on my app.

Now I did some research on Teachable. To my knowledge, it does not a provide a API or some sort of oAuth provider. However it does offer webhooks.

I though about a way to implement this behaviour but I have some concerns about my idea, so I would like to hear opinions from more experienced developers in the security field. My Idea goes like this:

Lets assume Alice buys a course called "Awesome Course 1".
The Teachable webhooks sends me a json object to my server, that include the following properties: { email: Alice@gmail.com, courseName: Awesome Course 1, courseId: 123}
Now In my Database, I create a random Id and add this json object to it. So I have something like this:
RandomKey987: { email: Alice@gmail.com, courseName: Awesome Course 1, courseId: 123}
I send Alice a mail that contains the Id RandomKey987
Alice goes to my app, creates an account/logs into her account (that is completely independent of the Teachable Mail/Account she used to buy the course) and enters the Id RandomKey987 in a form, to unlock her course in my app
On my Server, I create a Database entry under Alice's field to mark that she bought the course associated with the Database Entry RandomKey987, which in this case is the course "Awesome Course 1"
I delete the Database Entry RandomKey987, so no one can unlock this course a second time.

Now my concers are:

An Adverary could just send a similar Json Object to like in Step 2., that doesn't come from Teachable. The Attacker would need to know the http endpoint of my webhook and a valid courseId, wich I'm not sure if I can keep these private. Teachable does not provide an API where I could make a request, to validate, that the Json Object indeed refers to a valid purchase. Would be an imaginable solution, to just keep the http enpoint and the courseIDs private?
It won't be possible to guess the Id for a purchase in my database but could there be another way to get the key I send via email? Assuming no other person then Alice can read this email, this should not be a problem right?

Whats your opinion on this? Did I overlook an imporant security apect? Is there a better way to handle this problem?

tl/dr: If money is involved then you need a way to verify your webhook
transactions.  Your security keys, however, are probably fine,
although in the end that is a business decision for you to make.

Private webhook endpoint
Your concerns over a private webhook endpoint are quite valid.  In fact, this is one of the biggest dangerous for webhook endpoints - you need to verify that the person calling your endpoint is the person who is supposed to be calling the endpoint, and not an attacker.  It's especially critical for online ordering or anything that costs money.  Some systems verify the call by providing an API call where you send back the request you received to the intended sender for verification (aka a triple handshake), and some perform it with cryptographic signatures.  There are probably more ways to verify it, but verification is very important.
Obviously you can and should keep your webhook endpoint a secret, but this is more akin to a "security through obscurity" step, and not a super secure one either.  After all, any developer who has access to the code base will be able to find out what the webhook endpoint is.  You're also in trouble if your application code becomes public or accessible to an attacker, or if one of your own developers becomes an attacker.  Since half of all data breaches start internally, this is a very real concern.
Unfortunately there isn't anything you can do unless the provider gives you options.  I would push hard with them to see if they have any options for webhook verification.
Leaked purchase key
Leaked purchase keys are a danger but also a more fixable one.  You do want to make sure your keys are long enough that they can't be easily brute-forced.  That has the disadvantage that it makes them hard to type into an app, so you might try to figure out a solution where users can enter the key into the app without having to
type it out (QR Codes, links, etc...).
Of course email itself isn't always the most secure channel, but for most businesses it is "secure enough".  Inventing a new delivery mechanism for more secure code delivery will likely cause more problems than it will solve.
Fortunately the worst-case scenario of a leaked application key is probably not too bad.  After all, someone actually purchased the key, so if an attacker manages to intercept and make use of a single-use case key, the original purchaser will likely be contacting you wondering, "Why isn't my key working?!".  Presuming they can provide proof-of-purchase it will be simple enough for you to revoke the app access for the current user and grant it to the new user.
This does create the risk that someone may use social engineering tactics to trick your staff into giving them someone else's subscription, and it also runs the risk of grumpy customers.  However, since the marginal cost for you sounds low (i.e. it is relatively cheap for you to give someone else access to the system), the loss is low even if someone occasionally ends up with a free subscription.
That was a bit of a ramble, but the most important part is just the thought process.  Security isn't binary.  It isn't secure/insecure.  It is only ever "secure enough".  The more effort you put into security measures the more likely you are to cause trouble for your legitimate customers, and at some point in time it is more cost effective to stop adding security layers and accept that an attacker may occasionally succeed in stealing a subscription or two.  As a result the trick isn't to make things secure, but rather secure enough.


Should there be an anti-virus used on client provided files? This is based on Stack Exchange podcast # 25.

I really don't understand why there would need to be virus checking on uploaded files. It would generally be a bad idea to execute anything which was uploaded, so, so long as you make sure the files can't be executed... Granted, I also use Linux for my servers, so I leave the "execute" bit off.

"so long as you make sure the files can't be executed"

Most formal theories of security are predicated on a logical expression of one or conditions. The problem with formal theories is they fail to anticipate behaviors outside the model. How do you make sure that the files cannot be executed?

Even Linux and Mac OS X/BSD machines occasionally come into contact with file systems that do not have execute permissions. Specifically, most removable flash media are formatted as FAT32.

Do your Linux machines automatically mount removable media?

Do you have WINE or another Windows compatibility framework installed?

If you answered yes to both these questions then congratulations: you too can be infected by Windows malware!

On the other hand if you virus-scan every file by default then you have less to worry about.

I disagree slightly with Hendrik. The main reason to check files for malware is to keep your own systems up and running efficiently. Then secondarily to keep your clients clean. If you lack the resources to operate, then fairly soon you won't have any. And virus scanning files is not really an onerous chore if you automate it.


Hydra bruteforce is giving wrong passwords. Can't seem to work any help? Ok so what im actually trying to do is to bruteforce my own account on some website just to check myself .

This is NOT for illegal steps or use , im trying to crack my OWN password , and im trying to get help to see what im doing wrong with the software.

the thing is , when im starting the bruteforce , it doesnt recognize the real password it just pass to the next password and in the end it gives me wrong passwords to my username.
Sometimes it even gives like 3-4 kind of wrong passwords which is impossible.

I've tried in 2 ways , with terminal codes on blacktrack (hydra)
and im also trying with Hydragtk a ready software for bruteforce.

I've tried planty of commands on terminal way , this is one of them :

hydra -l admin123 -P /root/Desktop/passwords -S 80 -V 42.65.20.15 http-post-form

but no matter what command i use and no matter how much i change and play and add to the command it still gives me wrong passwords , anyone can help please?

Depending on the jurisdiction, what you are doing may be illegal nonetheless, even if that is "your own account". Technically, what you do is an online dictionary attack, so it entails a lot of connections to the target server, which hardly is "normal and fair usage" of the resources of that server. You have an account on that server based on the tacit (or explicit) acceptance of some usage rules, that your attack attempt breaks. To make an analogy: if you rent a safe box in a bank, then bring to the bank an industrial driller and begin to pierce the safe door, the banks may call the cops, even if that is "your" safe box.

Therefore caution is advisable. To make tests without incurring any legal inconvenience, I suggest that you run your own server as a virtual machine on your own PC.

In any case, what THC-HYDRA does is that it submits potential login+password pairs to a given Web server through POST requests -- and it must be able to determine whether the attempt succeeded or failed. At the HTTP level, the response code will always be a 200 (an "OK" code)(that's the whole difference between "HTTP Basic Authentication" and "HTTP form-based authentication"); the tool must somehow "understand" the returned Web page, which necessarily entails some heuristic analysis (the Web page which says "sorry, bad password" is meant for a human being, not for a machine). I suppose that whatever heuristics are applied by default by Hydra do not work well (or at all) for the site you are targeting. Maybe after a dozen attempts, the site returns another error page (no longer "sorry, bad password" but something like "begone, evil hacker !") which is misinterpreted by Hydra into a success report. This would explain what you observe (wrong passwords returned).

If the dialog with the server uses plain HTTP (not HTTPS), then you can observe the requests and responses with a network monitor tool like Wireshark. Otherwise, refer to the Hydra documentation to see how to configure it for response recognition.


Set Gateway for our LAN I am new to Networking. In our organization we try to setup gateway for security purpose so that we can block certain harmful websites. All I know is gateway is a device. What we have is the LAN setup, Mikrotik router (to assign static IP for every computer in our company).

The details I know is default Gateway, subnetmask and assigned IP address for our company.

I want to know how can I achieve these requirement with gateway. we ready to have a CPU for this process with UNIX/LINUX OS. I guess I can access the gateway from this installed OS, but I don't know how to do this?

Simply, my requirement is achieve security in gateway level, what else I can do with gateway and how to use it.

I hope I can able describe what I want, please let me know If you guys don't understand.

To secure the gateway, you need a UTM/NGFW. A UTM (Unified Threat Management) box will provide you with the features you are looking for. By sending all traffic through the UTM, you will be able to control/sanitize the traffic. Try the free SOPHOS UTM to get an idea on what you will be able to achieve.


Is Firefox's Lockwise secure? I have lot's of passwords saved in Firefox Password Manager, now called Lockwise. I recently installed Opera Browser on my machine. It somehow managed to import all the history-data and form fields, such as username and passwords into the Opera's local database.
As I understand, the username and passwords are send to the server e.g; Yahoo-Mail, in clear text via HTTPS. So Opera has to apply the credential information in the form fields in clear text.

So if Opera can get the passwords, any other harmful software might get it too right?

Am I missing something? So my final question is; Is Mozilla Firefox's Lockwise realy save?

I have two big concerns with Lockwise.

It doesn't auto-timeout/logout, so if an attacker gains access to your device, he/she also gains access to all of your passwords.
Passwords stored in Lockwise are also stored in Firefox. A master password can add a layer of security to Firefox on a PC, but the mobile version of Firefox doesn't have this functionality, so anyone who gains access to your Firefox account will also gain access to your Lockwise passwords even if you have a master password set up on one of your devices. The biggest issue there is that when you sync your Firefox account to Firefox on a mobile device, it stays logged into your Firefox account, so all of your passwords are there for the taking for anyone who gets into your device.

Further exploration of your question: https://medium.com/@JoeKreydt/how-secure-is-firefox-lockwise-password-manager-51d44dcf4dbc?sk=dc7b81811044ebc08e4a77eb6c2fa8fd


Why Say IP Addresses Are Harmless? Whenever I see someone on the internet ask the question, "Can someone find out my IP Address from my tweets/my tumblr/facebook posts/whatever else", the response I always see is, "Who cares! An IP Address doesn't even tell anyone anything! It's just a ruse, a scare tactic, people are so stupid to worry about it!"

I've seen how much information a skilled hacker can get once they trace back from an ip address and even for the average person, simply having a general vicinity of where someone is from or being able to show the ip address linked to an anonymous posting as identical to something posted under someone's real world info can be enough to fuel a fire.

I personally was being harassed online by someone where it was common knowledge that she lived in a very remote part of Wyoming. We had a traffic tracker on my website which included a breakdown of visitors by ip address and then more detailed information attached to the ip address (location, time visited, pages visited, etc).

Even though it's not enough to prove definitively that it was this person, everyone thought it was an awful coincidence that the same ip address listed as being from that very same small area of Wyoming kept popping up at the very same times when the woman was visiting the site to harass me. Especially since it was the only ip address tied to Wyoming. It was enough to have the ip banned.

Also, in the case of a static ip address, it seems it can be even worse. Example, a friend of mine was being stalked by someone. She used to post to her journal from her office. Her company's office had a static ip address.

Her stalker was able to get her ip address from her journal posts somehow and unlike a dynamic ip address, when he looked up the info on the static one it gave, it showed all of the company's information, including the street address of the building. He showed up there one day and security had to be called to have him removed.

My question, then, is whether or not the real "ruse" is saying that no one can get any meaningful information from an ip address and the fact that people are constantly being told not to worry about it when they should at least know how people can get their ip address if at all when on the web?

As people who work with security issues and/or programming with security in mind, do you personally feel that the privacy of someone's ip address should be a concern when building sites or do you guys agree that it's nothing worth worrying about?

Revealing your IP address doesn't compromise the security of your machine. If an attack on your machine is untargetted (i.e. the attacker just wants to use it to send spam or fishing emails, or as a proxy for targetted attacks), your machine will be scanned at random, not based on the IP address that may be posted in a forum. If the attack is targetted, the person conducting the attack will usually know enough about you to find out your IP address anyway, the real security comes from not having a vulnerable machine.

On the other hand, revealing your IP address compromises your privacy. It usually reveals what general geographic area you are accessing the Internet from, and who your Internet provider is; depending on your Internet provider, it may be possible to locate you quite precisely. It may also be possible to correlate your IP address with one online identity with your IP address with another online identity. So it's often not something you want to publish to the whole world.

Any computer you directly connect to knows your IP address by construction. As a website designer, treat IP addresses the same way you'd treat any other private data such as name, age, gender, street address, telephone number, ... Do not expose them to anyone who isn't a site administrator. Remember that webserver logs will usually contain IP addresses for every request, so protect the logs like you protect your user database.

Note however that it often isn't difficult to obtain someone's IP address online. All you have to do is host an image on a server that you control (costs <$10/month), and arrange for the person to browse that image in their browser. The IP address of everyone who viewed the image will be in the server logs.

This is why email programs usually require you to confirm whether you want to view an image, and one of the reasons why many social sites require all images to be uploaded to their own servers.

As a user, if you're really worried about revealing your identity, use a proxy. You trade privacy for bandwidth and latency, as well as privacy (the proxy knows what sites you've visited). You can go further and use Tor, which is a “split” proxy where different entities get to know your IP address (the entry node) and what site you're visiting (the exit node); you trade more bandwidth and latency for a bigger privacy gain.


Why do coffee shops not use WPA/WPA2? Would it solve many problems if they did? So I'm looking into public WiFi security in places such as hotels, coffee shops etc. It seems the current standard is just to use open wi fi connections in many of these locations. I would assume this is for a number of reasons:

Simple for the company - the provider does not need to train their workers in basic network security, don't need to manage keys or anything really, just plug the router in and go. Also costs the company less because of this.
Convenient for the user - the user doesn't have to concern themselves with trivial things like security, they just want to get straight to their online banking and shopping in a public place!
Ignorance - the person adding the free WiFi simply has no idea of the security risks involved, or they are dumping the responsibility of security onto the user, it's their data/money/identity after all

So, first question. In your experience, is it true that most coffee shops, hotels, airports typically use an open connection, or are protected networks more commonplace now?

If it is the case that most are unprotected, are there any other reasons as to why this is the case, beyond the ones above that I've listed?

Second question, assume a coffee shop with an open network, all traffic is extremely easy to sniff. Now picture the establishment upgrades it to WPA2/AES secured network. Is the network really that more secure?

Sure attackers can no longer easily sniff the network from down the street, but how hard is it for them to go in, buy a coffee and get the current key. Even assuming the keys are changed daily, repeats are never used, and they are complex enough to take months to crack, any attacker could just buy a coffee and connect to the network right? Or even get the key through social engineering, or just get a friend to get a coffee and the key.

I understand that WEP, WPA2 etc. all do encryption at a network (as opposed to user) level of granularity. I.e. if someone has the key, they can now decrypt all traffic on the network, so we're back to the problem that an attacker can read all traffic as if it was an open network, and it's already proven to be trivial to get the key. So, with this in mind, is an unlocked encrypted network equivalent to an open network? What sort of attacks could a hacker do on a WPA2 secured network? Could you do a man in the middle attack as easily as on an open network? Is it possible to create a rogue AP with the SSID and key, advertised with the same encryption standard, as possible with the open network?

Thanks for reading this lengthy post, and thanks in advance for answers to any of my three questions!

Instead of continuing in the comments, I think I will just answer your real question, which I understand to be - why is using WPA/WPA2 Personal with a public SSID and Passphrase not more secure than having an open network, and why doesn't WPA/WPA2 Enterprise work in the coffee shop scenario.

If the passphrase was public (as it would be in this scenario) and WPA/WPA2 personal is in use, anybody who has the passphrase and SSID name can decrypt anybody else's wireless traffic, as long as they can capture the initial 4-way handshake for that client (which occurs when connecting to the network).  If someone wants to decrypt someone's future traffic but did not monitor their client's initial 4-way handshake, they can simply force a new handshake between that client and the AP using a targeted deauthentication, at which point you would be able to capture the new 4-way handshake and decrypt all of their future traffic.  Of course, if the client under attack were to use a VPN, SSH tunnel, TLS, or some other strong encryption mechanism over the wireless, that traffic would be protected to the extent that the mechanism that they chose allows.

The reason why their traffic can be decrypted is that WPA/WPA2 personal creates a pairwise master key from the passphrase and SSID used when logging in.  The PMK is then used to create a Pairwise Transient Key and Groupwise Temporal key, where the PTK is unique per client and the GTK is shared for all currently connected clients (for broadcast traffic).  This PTK can be derived from the PMK using information from the 4-way handshake (which is negotiated in plain text).  Therefore, if you are able to sniff the 4-way handshake, you can get the information used to derive that client's PTK from the PMK that you already know because you know the passphrase and SSID (usually by doing PBKDF2(Passphrase, SSID, ssidlen, 4096, 256)).

WPA enterprise doesn't work well because everyone would need a way to authenticate, whether credentials (EAP-PEAP), certificate (EAP-TLS), or other (various other EAP modes), and this wouldn't support the coffee shop's goal of providing free wireless access to nearby individuals.


Does Google identify me from my 'phone? As per my previous question I would like to escape Google as much as possible.

Since I realize that I can’t do this completely, I will do what I can, although some might find it pointless.

I have abandoned Gmail, so Google are no longer automatically scanning my emails. Also, Google allowed third parties to read my emails, although, in fairness, that can be turned off – if you know that they are doing it, if you are aware that it can be turned off, and if you are tech savvy enough to know how to turn it off. Anyway, Gmail left a bad taste in my mouth, so I am using my own server and reading email with Thunderbird in Windows and K9 on Android.

I also don’t like Google knowing where I am, so use an Open Street Maps based routing app (I use it so infrequently that I forget which one it is :-)

I gave up Chrome and now use only Firefox Focus for browsing, which helps prevent extraneous cookies and trackers. Of course, if I want to be paranoid, my ISP (and server through which my data passes), can harvest my data & sell it on, so I really ought to be using a VPN.

Beyond Gmail and Google Maps, the only other Google product that I use is the Google Playstore, to insurance apps (although I do give F-droid precedence, where possible).

I was thinking of factory resetting my ‘phone and reregistering at Google Playstore with a fake identity 9anfd only logging in where absolutely necessary, in order to download, and immediately logging out afterwards.

Which brings me (finally) to my question. If I wipe my ‘phone & create a fake Play Store account, will Google still recognize me? I am sure that they could fingerprint my ‘phone, maybe even read its IMEI, but what if I sold it, so maybe they just go on my Playstore account? Maybe they check if I am still using the same IMSI/’phone number?

Is this particular paranoid idea going to be off any benefit to me, or would I just be fooling myself it if I believed that it would? Let’s assume that I always browse with Firefox Focus and use a VPN.

I realize that I only spoke of my 'phone here, but all of my desktop traffic goes over VPN, and I use a bunch of privacy add-ins for FireFox)

If you use Google Play Store, yes they still can track you. But there is a next step in your privacy improvement! :)

Don't use GApps (Google Apps). Actually don't use any google account on your phone. You need to instal some custom (open-source) ROM for your Android device (e.g. LineageOS). You'll need a root access.
Then install firewall frontend (e.g. AFWall+). When you activate it in white-list mode, it will block network access to all applications. You can easily select applications which you allow internet access (only trusted (read F-Droid) apps like K9, Firefox Focus, OSMAnd etc.). In this way applications from Play Store won't have internet access.
Install Yalp Store. Whit Yalp you can download and install PlayStore apps WITHOUT Google account. There are many other applications with the same purpose. You also have many sites for downloading APK files like APK Pure but use this sites only if you trust them ;)

The point is: you can use your phone without Google services, and you can use applications from PlayStore and you can even block internet access for that kind of apps that you don't know if they are stealing your personal data.

Hope you'll enjoy doing this!


Do integrity and authentication always come together? I cannot come up with a case where there is only one of them.

When there is integrity, a random person cannot modify the message without being noticed. That is, an unauthenticated user cannot modify the message without being noticed. Therefore there is authentication.

When there is authentication, nobody except the sender can change the message after MAC or signature is added. Therefore there is integrity.

Am I missing something?

You are not missing anything.  There is no meaningful distinction in cryptography between ‘integrity’ and ‘authentication’ of data on a channel between two parties.  Any attempts at distinction in the context of an adversary wallow in confusion of epistemology without a difference.  (If you really like the cute acronym CIA for spook stuff, maybe use the A for ‘availability’ instead!)

The words are not entirely synonymous, of course—for example, a dishonest politician does not lack ‘authentication’, and logging into your bank's web site is not doing ‘integrity’—but it sounds like you're asking how they apply a protocol in which there are three things:

A sender; call her Alice.
A channel or medium for exchanging messages, such as the internet, or a disk for storing and retrieving files.
A receiver; call him Bob.

Alice's goal is to transmit a message to Bob using the channel.  Presumably, the channel is subject to malicious tampering by an adversary; otherwise there's no security question here.  Presumably, Alice and Bob know something about one another a priori; otherwise when Bob receives a message there is necessarily no way he can distinguish a message Alice sent from a message the adversary sent!

Under what circumstances, then, does the protocol have authentication or integrity?  Either way, what it means is that—whatever steps Alice takes to send a message, and however Bob verifies the authenticity of a message—the probability that an adversary succeeds in fooling Bob into accepting a forgery is negligible.

In cryptography, we formalize the notion of ‘authentication’ or ‘integrity’ with the EUF-CMA game—existential unforgeability under chosen-message attack.  In the EUF-CMA game, Mallory, our heroic adversary, can ask Alice to send any message of Mallory's choice, in order to study how Alice is authenticating messages.  Mallory wins the game if they can fool Bob into accepting any message Alice didn't send.  Mallory would win the game even if the message is totally meaningless to Bob.  The protocol is said to provide EUF-CMA security if the probability that Mallory wins this game is negligible no matter how clever they are.

The EUF-CMA criterion applies to both symmetric-key authenticators, also known as message authentication codes, and public-key signatures; the main difference between authenticators and signatures is whether the power to send a message is the same as the power to verify a message, or whether the powers are asymmetric so that when Alice signs a message, anyone—Bob or any third party—can verify it too.

Outside cryptography, one might reasonably consider a sort of unintelligent adversary—a channel with random noise—and one might use an error-detecting or error-correcting code to provide integrity, meaning that the probability of undetected corruption is substantially smaller with the code, whereas the term authentication doesn't really come up in coding theory at all, so there's no contrast to make between the terms in that context.  One might even use a ‘cryptographic hash function’ like SHA-256, truncated if you have limited bandwidth, but one would be better off with a CRC.


Is it possible to find a buffer overflow in WordPress? I had an interesting conversation with a pentester who told me he had found a buffer overflow in Wordpress. The person in question was really adamant that this was true. The client is a bit skeptical about the technical skills of the pentesting firm and asked my opinion.

So the question I have is this: has anyone ever heard that someone found a buffer overflow in WordPress by just making a GET request to some PHP?

My opinion: If this were true, he would have found a buffer overflow in the PHP interpreter, and that would be huge. So I do not think it is true.

EDIT:
The BOF was in two places:

In a php function build by the client with the same payload as an XSS vulnerability (so something like 123">alert(0);
In the wp_session token with just a bunch of A's (~60)

It was all done externally with no access on the server in a routine quick pentest of around 10 different websites...

I'll update after doing an actual code review over the parts that should be vulnerable

EDIT:
So I did the code review and it was indeed a BS story. Not only did the BOF's not exist at all, he actually said to have found a SQLi in a part of the code that did absolutely nothing with a database.

But at least the discussion in the comments was very insightfull about possibilities of BOF's these kind of standard platforms and CMS's so I learned a lot! Thanks!

As PHP does memory management and a lot of stuff by itself, finding a buffer overflow specifically in WordPress doesn't really make sense to me.

Before discrediting that Penetration Tester, I'd ask him/her for documentation of the finding in question. As he/she works for said client (sounds like it, correct me if I'm wrong), it's his/her job to report such an issue to the client, including a documentation of at least a way to track down/reproduce the issue.

I'm very sceptical, as you say, that he/she only had access to the webservice from the outside. Verifying a low-level issue like a buffer overflow (which is even way beyond the webservice or wordpress in general) is next to impossible from the outside.

Executing one is tricky, even if you have access to the source code, which doesn't seem to be the case (assuming it's not a whitebox test).

P.S.: If you get an answer from the client/pentester, I'd love to hear it. You got me pretty curious for some reason...


How secure is BSD sockets? BSD sockets API was released in 1983.

As it was implemented 3 decades ago and still being widely used, is it secure in today's scenario where every software has to be actively protected against being hacked.

Is it secure enough to be used in a production-level code?

I am writing a client-server application which does use encryption at both ends, but are there any pitfalls in sockets that can be taken advantage by a hacker?

Note:
1. I am writing the application in linux.
2. I don't have anything against the guys who developed this api, they have done a brilliant job.

Your question contains a category error.

BSD sockets aren't a thing. They are an API to the kernel, comprised of a set of system calls. In theory, the code in the kernel, like all other code in the kernel, could have a security bug. However, the statement about 1983 does not reflect actual history. The only thing that dates from 1983 is the specification. The kernel code has been continuously maintained and frequently reimplemented over the history of the Linux kernel.

In any case, you have no choice. Sockets are the API to the internet on Linux. If you want a userland program to have a connection to the internet, you will be programming to the socket  API (unless you want to learn TLI, which has is just another interface to the very same kernel implementation).


Is malware programmed in high-level language will be more detected than malware programmed in low-level language? I would like to know if a simple malware designed to execute commands received by a C&C will have the same result rate if programmed in :

lower-language like C++
high-language like Python (converted to executable with a Python converter like
auto-py-to-exe)

During the static and dynamic anlysis : Do Antivirus have the same facility to detect libraries used between low-level or high-level languages ?

I presume that rate detection of the malware will be more linked with the comportement of the malware?

What the processor sees when it is executing is never the source code - it sees machine code, which in its human-readable format is called assembly code.

When you compile a program, in any compiled language (more on that later), the compiler takes the high level code, performs operations on it, links it all together and turns all of that into machine readable code.

Here is an example of Assembly for x86 "Hello World" (DOS) [Robert Montante, Bloomsburg University]

    org  0x100        ; .com files always start 256 bytes into the segment

    ; int 21h is going to want...

    mov  dx, msg      ; the address of or message in dx
    mov  ah, 9        ; ah=9 - "print string" sub-function
    int  0x21         ; call dos services

    mov  ah, 0x4c     ; "terminate program" sub-function
    int  0x21         ; call dos services

    msg  db 'Hello, World!', 0x0d, 0x0a, '$'   ; $-terminated message

This machine code we compiled only works for one architecture, and on that operating system. This is why we often need different binaries for x64, x86, Linux, Windows, OS X, etc.

This, however, is very annoying - having to recompile 6 different binaries for each version is tedious. This changed with the popularity of Java and the JVM (Java Virtual Machine) that ran it. Instead of compiling down to processor-level machine code, the programmer didn't have to do any machine code compiling - they only had to compile it to an intermediary "byte-code" which was then interpreted by the Java Virtual Machine.

This meant that, as long as you had the Java Virtual Machine installed, you could run any Java Application on your computer, even if it wasn't written for your computer. This does have its own problems though.

Anyway, to answer your question, with this background information. When Anti-Virus solutions "scan" they're normally just doing signature analysis. This is where the files and/or their components are compared to a big database of known malware signatures, analysed by the security researchers and computers at the AV company. This is why it's important to keep your Anti Virus up to date, because these new threats emerge all the time. However, it also means that, in general, there is no benefit to any specific language, or choice of abstraction level, for avoiding detection. Malware detection is typically mitigated during / post compilation by the malware creators, not during.

An exception, possibly, is Assembly Language. Some droppers (Small malware that installs other malware), are written in assembly language to make them difficult to detect, or automatically rebuilt themselves with randomisation to avoid signature matches. However the drawback to writing malware in assembly is it takes a long time and is very difficult.


Is it unsafe to use environmental variables for secret data? After reading this blog post in which the author lays out arguments against using environmental variables for storing secrets, I am unsure how to proceed with deploying my application.

His primary arguments are as follows:

  Given that the environment is implicitly available to the process, it's hard, if not impossible, to track access and how the contents get
  exposed (ps -eww ).
  It's common to have applications grab the whole environment and print it out for debugging or error reporting. So many secrets get
  leaked to PagerDuty that they have a well-greased internal process to
  scrub them from their infrastructure.
  Environment variables are passed down to child processes, which allows for unintended access. This breaks the principle of least
  privilege. Imagine that as part of your application, you call to a
  third-party tool to perform some action—all of a sudden that
  third-party tool has access to your environment, and god knows what it
  will do with it.
  When applications crash, it's common for them to store the environment variables in log-files for later debugging. This means
  plain-text secrets on disk.
  Putting secrets in ENV variables quickly turns into tribal knowledge. New engineers who are not aware of the sensitive nature of
  specific environment variables will not handle them appropriately/with
  care (filtering them to sub-processes, etc).

These seem soundly reasonable to me, but I am not a security professional. His alternative suggestion is to use Docker's secret-keeping functionality, but that's assuming that you're using Docker....which I'm not. I'm on Heroku. So I'm kind of unsure about this now. There doesn't seem to be any support for using Vault on Heroku, best I can tell.

In general storing secrets in environment variables does have some downsides, as Diogo says in his post.

Generically, for platforms like Heroku, or using technologies like Docker where the application is expected to be ephemeral, dedicated secrets management tools are the best way to go.  The idea is that there should be a tool which holds the secret in encrypted form and provides it to the application at runtime.

The secret can then live inside the application, generally as a file, which can be read and the secrets used from that file as needed.

Two examples of tools in this area are Hashicorp Vault and Square's Keywhiz.

In addition to this if you're deploying on a cloud, generally the cloud provider should have some kind of secrets management facility, for example AWS Secrets Manager.

I've not had much experience with secrets management on Heroku, however they do seem to have an add-on called ice which operates in this area.


Automatically erase data from SD card Is it possible to automatically format the SD card when someone put it in another PC?

 SD card is used in camera. And if someone wants to open that with another PC. It should be automatically formatted.

No, that's not possible. It would require code on the SD card that ran when inserted into a PC and could identify the PC, and the SD card standard doesn't provide for that.


Clone debit or credit card I would like to make some workshop about Debit or Credit card fraud (Skimming). So I need as much as possible information about it.

Is it possible to clone debit or credit card with MagStripe reader and encoder which usually sold by POS store like this one?

MagStripe reader and encoder 1

MagStripe reader and encoder 2

Is it possible to clone debit or credit card, can I cashout from ATM and transfer some fund to another account? In this case, I know the PIN number.
Please tell any factors which can cause failed or successful in case of Cloning debit or credit card and use it for evil purpose!, maybe there is any important factor like blank magstripe specification, magstripe reader and encoder specification, the ATM itself. the Card itself maybe any encryption.

FYI: In my city, the debit card still uses MagStripe and no Chip on the card and I just tested my debit card with MagStripe reader which cause leaked card number, expired date, and some unknown number.

Q1: Yes. The link for MagStripe reader and encoder 1 does exactly that. Can read credit or debit and write it to a new blank card and can also erase data on an existing card. the MSR605 comes with software to do all of this. These machines can clone ANY card with a mag stripe. Gift cards, hotel cards, rewards cards, credit cards, id cards, etc.

Q2: Yes. you can skim a debit card and if you have a pin you can go straight to ATM and get cash. The PIN is NOT provided in the skimmed data. Using skimmed cards at gas stations for example might also require you to type in a zip code associated with the card.

Q3: The only failure in skimming cards is if the machine is broken or card is damaged. Every card with a mag stripe is the exact same and every mag stripe reader can skim any and every type of credit card or any card in general with a mag stripe. If the card has a black strip on back then it can be read. They all use the same technology. The success rate of skimming a card with a black stripe through a Mag Stripe reader is 99%.

Real-life Scenarios and Scam

GIFT CARD SCAM: At Walmart you see stands with Gift cards on them. Let says the criminal takes 10 $50 Walmart gift cards(unactivated). He goes to the bathroom and skims the data off all of them then puts them all back on the shelf. He then will check the card numbers everyday on the website to see if they are activated. When a customer comes in and purchases that gift card, it gets activated and the criminal already has the data and can use it right then and there.

FAST FOOD SCAM: Another popular scam happens at Fast Food Drive-Thrus. The cashier has a skimmer next to the register. When you hand them your credit or debit card through the window, they will swipe the card through the register and then swipe the card a second time through the hidden skimmer. (Happened to me at a Taco Bell lol)

GAS STATION SCAM: There is practically a universal key that opens up any gas station pump. Criminals will open them up as put a device that will record all credit cards that are swiped. Use gas pumps that are close to the door, criminals usually install them on pumps out of site. Also look for a sticker on the pump where the pump door would open, if the sticker was peeled off to open the door it will say VOID VOID VOID across the sticker, that means some one went into the pump.

MOST PEOPLE DONT KNOW: Skimming a card with the machine is not only way to get skimmed data. A lot of cards have RFID chips inside
of the even if you do not ask for them. If your card has one you will see a symbol on your card that looks like a signal or wifi symbol with the 3 bars. There a RFID machines that clone this data. Someone can walk around the mall with this RFID handheld device and all they have to do is get less than a foot away from you and it will skim the data from the RFID chip. It can skim it right through your pocket, wallet or purse.

Funny example of what you can do with a skimmer. You can clone you credit card onto a hotel key card. Then go to McDonald"s and use your hotel key card to pay for food.

Prevent RFID skimming: You can buy a special sleeve or wallet to block the RFID signal. But i recommend just having your bank reissue you a new card without it.

Prevent MagStripe skimming: Use cash at drive thru windows or any business that uses your card out of your sight. - Change card numbers every 3 months because most criminals skim your card and sell it to others which means they could be holding onto your information for many months before selling it.

Experienced Skimmers: The best of the best will buy blank Visa or MasterCard gift cards. Then they will clone your card to it and use a embroider to actually punch in the actual name and card number onto the card(most gift cards have numbers that can be wiped off that are not embroided). They will also make a fake ID in case cashier asks for identification.

Hope this helps.


Executing vs Extracting PE32/PE32+ executable If you have a malicious upon execution ("running" it / double clicking on it) .exe , would extracting its contents with something like 7-Zip utility mitigate its effects? Or can it still do harm?

No, attempting to extract files from within a malicious EXE is not dangerous, unless there's a vulnerability in the tools you use and the malicious EXE is crafted to exploit that vulnerability. In general, for tools that are meant to be able to safely open files from arbitrary sources (and yes, unzip tools fall into this category), the only time opening a malicious file could be dangerous is if there's a bug in the tool's parser (and hopefully 7-Zip, etc. wouldn't have such an issue).

A program is an algorithm, like a recipe in a cookbook. A malicious program is one that tells you to do something like mix vinegar with chlorine bleach (don't do this!) and inhale deeply. Running a program is simply following the steps of the algorithm. If you run code that tells your computer to do a bunch of harmful stuff, you (or at least your computer) will be harmed, just as if you follow instructions in a cookbook telling you to breathe poisonous gas or create an explosion.

On the other hand, merely reading the program (in a hex editor, or an archive extractor, or something else) shouldn't do you any harm. It should be as safe as reading a recipe or other list of instructions - no matter how malicious, such as the bleach-and-vinegar example above - in a cookbook.

With all that said, you're talking about running an algorithm (7-Zip, for example) that takes another algorithm (the malicious EXE) as input, and does something with it. That "something" usually won't be "follow its instructions", but it's still possible for there to be security vulnerabilities in the program you use, such that somebody who knew what program you would use and where its vulnerabilities are could create a specially-crafted EXE that, when unpacked by your program, exploits a bug in the program to do something harmful. Bugs like that do exist, but they're relatively rare and exploits for them usually need to be pretty targeted at one specific program.

If you're trying to analyze a known or suspected malicious file and had this question, I can't really recommend you go ahead without doing a lot more research, because if your level of computer knowledge is such that you had to ask this question then you probably don't know enough to usefully perform malware analysis (for example, opening an EXE in 7-Zip will usually not tell you much of use) and also don't know what other precautions to take while doing so (at a minimum, mark the malicious file as non-executable so it won't run even if you accidentally double-click it and/or use a VM without network or host disk access so that even if it does do some harm the harm is contained).

On the other hand, tinkering is fun and a good way to learn things. Just, start with a "malicious" program that does something not-actually-harmful, and work your way up. Or, if you just want to know whether it's safe to open arbitrary files in 7-zip: probably yes, but make sure you're using an up-to-date version.


Boot from live usb to avoid being spied on Suppose the government wants to spy on you using government-designed malware. If you then want to visit sensitive pages on the internet, would it be more secure to use Tor browser within a USB - live boot environment (Ubuntu) as opposed to using Ubuntu from your harddisk with Tor? Can the USB live boot environment immediately get infected by malware if you use it from a certain location which is the same location you normally use your computer?

I know there are certain rootkits that infect UEFI but apart from such an attack does this strategy mitigate risk?

I know I could also use a live CD but my strategy so far was to reformat the USB stick after each secure browsing session and install a new version of Ubuntu on it from a computer at another location.

A live OS would provide a bit of extra security, but don't rely fully on it and assume that you're good. If you're trying to prevent becoming infected by using a live OS, it can help if the exploit tries to write to the USB/DVD since it can be reset, wiped, thrown away when done. Unplug other storage if you're concerned about your regular OS getting infected.

A live OS is good at keeping your environments safe up to a point. If you are already infected or if it can target you on a hardware level, there is not much you can do to ensure you won't be eavesdropped on that device.


Best practice for forgot password form, ok to leak that a given e-mail is invalid On our forgot password reset form, is it ok to leak that a given e-mail address entered is invalid? Or should we always just return success and check your e-mail, even if the e-mail is not valid.

I feel like always returning success can provide a bad user experience, i.e. if a user is trying to remember which e-mail they used for the service.

I would not say that it is a bad experience to ask the user to check their email account - that would be the location where they will be expecting to go to next, regardless. If they are not signed up you could send them an email saying that their email address is not associated to any account. This would stop any other user from verifying whether the email address is registered with you or not (username enumeration).

Please also see my answer here: How to prevent email discovery in forms?, which could be relevant.


How to securely set up wifi? Possible Duplicate:
  How to secure a WiFi network?

It seems like a simple question but I've thought about this for a while and have done quite a bit of Google searching.  There's a LOT of hand-waving.  I'd like to set up a wireless access point but lock it down with a better network topology (e.g. not have wifi running on the same subnet) and implement better security measures.  I'm not adverse to buying additional hardware.  Actually, I'm pretty sure I will have to buy more hardware to get it to work but it would be nice if I don't have to give up an arm or a leg to do it.

My experience with router equipment is the cheapo consumer-grade stuff with default firmware.  A few months ago, I bricked a $20 router attempting to install Tomato on it while trying to branch out a bit.

Once upon a time, I saw a wifi network setup where each user had to have a signed SSL certificate to just join the wifi network in the first place.  This was years ago and my memory is a bit rusty as to the specifics (or maybe I'm crazy and imagining things).  I'd like to do something similar if possible but I don't know where to start.  If possible, I also want to change access keys frequently and as painlessly as possible such as automatically deploy new SSL certificates every month to already connected devices and revoke the old certificates (and get a notification whenever this happens and for which devices).

I also want to set up a VPN tunnel for wifi to the internal network.  I have no idea where to start for this either.

I also want to set up a logging and notification system on my new wifi network for whenever any device successfully joins.  Again, no idea how to do this.

Basically, I'm looking for the magical words I need to search for on Google and a few good step-by-step tutorials that utilize good security practices and don't recommend things like "hide your SSID" that don't actually do anything.

Another solution would be a small all in one firewall appliance like a SonicWALL:
http://www.firewalls.com/firewall/sonicwall-firewall/sonicwall-tz-firewalls/sonicwall-tz-100/sonicwall-sonicwall-tz-100-wireless-n.html
We use a TZ210W at our office and it does everything you mention.  It has a guest wireless for just Internet access.  Using wireless requires a VPN client and username & password to get to the internal LAN. We also use MAC address filtering as an additional control.
We can use both SSL VPN and full client VPN for remote access.
It has built in email alerting.  You can also send the logs to any syslog server.


A secure connection with an application and a dedicated server I'm wondering if this kind of technology is already exist (not VPN), I'm looking for a method to make secure internet connection within a dedicated server, where my laptop has a desktop application to encrypt and decrypt the data before sending or receiving it and the server has an application to do the same. Please check the attached illu for more details.Thanks

I know of at least one technology that does what you are wanting: stunnel

stunnel is a secure proxy that uses public key cryptography. A typical use case scenario is securing a http web service. This is done by running the proxy on port 443 to receive and send secure messages, and directing the unencrypted traffic to the http web service, which is running on port 80. Port 443 is then exposed to external networks, while port 80 is restricted access so that only connections from the local machine are allowed.

stunnel can be configured as both a server and a client, which as I understand is the solution you are looking for.

Disclaimer: I haven’t used it before, I recommend  doing your own research before relying upon it.


ECDSA Keys Changed, SSH insecure now? I'm running some non-critical Ubuntu servers in my dorm room in college. Turned them off before break, come back, SSH in, and get a warning that the ECDSA keys have changed.

It looked pretty much like this

Warning: the ECDSA host key for '<snip>' differs from the key for the IP address '<snip>'
Offending key for IP in /home/<snip>/.ssh/known_hosts:14
Matching host key in /home/<snip>/.ssh/known_hosts:12
Are you sure you want to continue connecting (yes/no)?

This looks a lot less scary than the server identity changed error so I'm not worrying too much but still, what would cause this to change? Is this something I should be worrying about?

When you connect first time to a given SSH server, you get the usual question with the key fingerprint; afterwards, the SSH client stores a copy of the server public key in the .ssh/known_hosts file. But the SSH client actually stores two keys: one for the server name, and one for the server IP.

For instance, assume that server foo.example.com has IP 10.0.0.8. Upon your first connection (ssh foo.example.com), the SSH client will get the server public key, display the fingerprint (a hash of the public key), ask for confirmation, and then store in the known_hosts file two mappings, one for foo.example.com, the other for 10.0.0.8, both pointing to the same public key.

When you connect back to the same server, SSH verifies the two mappings. If the first mapping (the one for the name) yields a public key that is distinct from the one recorded in known_hosts, you get the scary error message with UPPERCASE LETTERS (that's how it manages to be scary), and the client refuses to connect any further (so the message is not only scary, it is quite inconvenient as well).

Another situation is when the first mapping matches:

The user types: ssh foo.example.com.
The DNS system resolves that name to IP 10.0.0.8.
The SSH client connects to that machine, and obtains the SSH server public key.
The obtained public key matches the one found in .ssh/known_hosts under the entry foo.example.com.
BUT the obtained public key does NOT match the one found in .ssh/known_hosts under the entry 10.0.0.8.

In that case, you get the exact message that you display in your question. The SSH client has some assurance that you are talking to the intended server -- the public key matches the one recorded for the same server name -- but something is still amiss, hence the warning, and the confirmation prompt.

This can happen when the server IP has changed. With the example above, suppose that, last week, foo.example.com had IP 10.0.0.7, but bar.example.com had IP 10.0.0.8. At that time, you connected to both. But last week-end, a sysadmin with slight obsessional compulsive disorder decided that some IP had to be changed, so that he could setup more efficient, regular and mathematically elegant networking rules. So he "moved servers around", and set bar.example.com to IP 10.0.0.16 and foo.example.com to 10.0.0.8. Our friend the sysadmin dutifully configured the DNS to report the new IP. Now, we are on Monday, and you want to connect again. Your SSH client talks to the DNS, gets the new IP for foo.example.com, and all is fine, except that the recorded key for 10.0.0.8 does not match the public key of foo.example.com: indeed, your known_hosts file contains a copy of the public key of bar.example.com, listed under the IP 10.0.0.8, which, up to last week, was bar's IP, not foo's.

A sysadmin with OCD is not strictly necessary for this scenario; it can also happen with dynamic IP setups, or with some cases of load-balancing.

Solution: use a text editor and remove the offending entry from your known_hosts (line 14, in your case). You can also use the command ssh-keygen -R <host> to remove the particular entry. Next time you will connect, the client will display yet another warning (this time complaining about the absence of any recorded public key for the target IP), but this one will fly by almost unnoticed, because there will be no prompt at all. The SSH client will then record the public key again in known_hosts, and set things right, at least until the sysadmin hear voices again.

Alternatively, disable host IP checking in the SSH client, by setting the option CheckHostIP to no (in the system-wide /etc/ssh/ssh_config, or your .ssh/config, or directly on the command-line: ssh -o CheckHostIP=no foo.example.com). Host-IP checks are useful to detect abnormal situations of wandering server names, but for some sysadmins, server IP jugglery is perfectly "normal".


If I install Burp certificate in my system and try to access HSTS certified site and site will work and is it safe? Can I intercept request via burp suite CA certificate for HSTS sites and is it safe or not?

It will depend on the fact whether you have installed the BurpSuite(portswigger) certificate as a trusted authority in the browser. Once you do that, you can intercept any website with burpsuite. But if you do not install the above mentioned certificate in your browser, you will not be able to intercept website which has HSTS enabled.
The website being safe or not is not related to whether the site can be intercepted or not using burpsuite.


Can I safely post the output of lspci, lsusb, lshw? I'm having trouble with my SD card, and have been asked to inspect the output of tail -f /var/log/syslog, sudo lspci -v -nn, sudo lsusb, and sudo lshw. tail shows nothing when I insert the card, so there's nothing to post - no worries there. Inspecting the output of the other commands, I can't find any evidence of an SD card being listed, so I'd like to dump the whole output in Gist for someone else to inspect and double-check.

Can I safely dump this output to a public location without compromising security? It looks to me like if I X out the device serial numbers, you won't learn anything about my individual machine. But I'd like to be sure :)

I don't mind someone being able to identify what kind of machine I have, or being able to learn something that would enable them to compromise my machine if they had physical access - I've heard the Ubuntu security model can be circumvented with physical access anyway.

Syslog contains errors or application logs. You will find php logs, restarts of programs...

lshw will return what hardware you are running in a very detailed way.

lsusb will return info about your usb device and it's driver.

lspci will give some more info about attached pci devices.

It's basic trouble shooting really, they want to know when you insert your SD card what errors are given in the syslog and what type of hardware you are running to check for incompabilities.

It's nothing special actually for a desktop. Just read what you post in the syslog as it might contain an email address from time to time (but probably not because you are using it as a desktop).

So in short, it is not dangerous in your situation.


How long is a 2048-bit RSA key? On stackoverflow:

'2048 bits, or 1400 decimal digits'
https://stackoverflow.com/questions/11832022/why-are-large-prime-numbers-used-in-rsa-encryption

On Wikipedia:

'RSA-2048 has 617 decimal digits (2,048 bits).'
http://en.wikipedia.org/wiki/Key_size

I don't understand how many decimal digits a 2048 RSA key has.

One bit can be 0 (zero) or 1 (one). So 2048 bits gives 2^2048 distinct numbers. A decimal digit has ten possible values 0, 1, 2, ... , 9. So to find the number of decimal digits to make 2^2048 distinct number we need to solve

2^2048 = 10^n

Take a logarithm (base 10) on both sides to get

2048 log(2) = n log(10)

I.e.

n = 2048log(2) = 616.5

which means you need 617 digits.


How can I crawl the internet for malware? For anyone who wants to study malware, there are a few websites that publish malware samples and/or URL feeds for anyone to retrieve and study.

As opposed to performing such file-based analysis, I want to perform analyses which take features of the URL and the referring page into account. This requires me to crawl individual URLs till something interesting is found, such a document or an executable file.

However, I, as an individual who does not have any access which may be helpful to this purpose (such as access to email inboxes of an organization, or links to security researchers and/or companies), how can I crawl the internet to find malware?

Try starting with public spam email messages.

For example, some accounts on mailinator.com receive a lot of spam. There is also a lot of public spam available on untroubled.org.


When using private browsing can a website view data stored before private browsing was turned on? If a browser has been used to visit a few sites and has active logins and then the user turns on private browsing, can the sites still access data such as cookies and cached files that were created before private browsing was turned on? For example in Opera's Private Browsing help page it says that no trace of the websites you visit in Private Browsing mode are left after closing the browser but does that mean websites can still collect data on you if the either have access to a cookie or associate data with your IP? If this can happen is there anyway to make things more secure and private?

Normally cookies are not shared with a normal browser session. When you start a private browsing session, no cookies will be present. If you close your private browsing session all of your cookies will be deleted.

In regard to your IP: considering this will be shared there is a chance of course that the server will be able to see that two sessions have originated from the same IP. Furthermore there are actually more ways to fingerprint a browser (for instance query versions of Java, PDF reader, installed plugins,...) which could compromise your anonymity .


How to convert a SSL certificate to an authority? How can one convert an SSL cert provided by an authority to another authority, so one can generate "valid" certs for different domains?

What you are looking for is to modify the certificate in a way that it contains the ability to be a CA, i.e. set the CA flag to true. Fortunately you cannot simply modify a certificate, because any kind of modification invalidates the signature and thus nobody will trust this certificate anymore. This  is essential because otherwise everybody could just create certificates for sites they don't own and this do man in the middle attacks.


Is it safe not to encrypt ping packets? I am running encrypted communication with ping tacked on after decryption and deserialization is complete.

I.e.

incoming data -> split into packets -> decrypt -> deserializer -> actual message or ping

outgoing message or ping -> serializer -> encrypt -> send

I would prefer ping be handled before any decryption happens and make it part of the lowest socket layer instead.

What I wonder is if I introduce any weakness this way. (The actual crypto layer may be TLS or similar.)

I don't see how manipulating the unencrypted ping would enable much, given that I only use it to test the liveness of the connection and get a RTT.

Am I overlooking something?

EDIT:

Just so this is clear - it relates to a custom server-client protocol for a game. The "ping" here is simply a special packet periodically sent from server to client and then back again.

This helps both client and server ensure that communication is open: one can implement the check "if ping isn't seen within x seconds, assume that the connection is broken".

Your question is quite unclear on the particulars, so I assume that you mean the following:

You have some sort of VPN going on between machine A and machine B, and the VPN encapsulates all IP packets from A to B and from B to A within an encrypted tunnel which probably uses SSL/TLS for the encryption part.
The VPN picks up all packets, whether they relate to TCP, UDP or ICMP.
You are wondering whether making the ICMP Echo packets (aka "ping") travel outside of the VPN, unprotected, would open vulnerabilities.

Under these conditions, the answer seems to be "no, it does not open any vulnerability", under the following argument: VPN protection is about protecting some specific traffic, between A and B, against interference from outsiders. As long as your "important traffic", the one you wish to protect, still goes through the VPN, then that traffic will keep on being protected. Note, though, the following points:

It may be hard to configure a VPN software to exclude, explicitly, ICMP Echo requests and replys, but still include TCP and, crucially, other ICMP message types. While the "ping" protocol is pretty benign, some other ICMP messages can be important for proper network traffic propagation. Also, since a "ping" consists in a request and then a reply, both ends of the tunnel (machines A and B) should be configured to not-protect the ICMP packet.
You do a "ping" for a reason. If the "ping" is unprotected, then it can be altered by attackers, which may impact the reason why you do the ping. Attackers could block either the request or the reply, simulating a "down" machine (arguably, if they can do that, they can also block all the VPN traffic as well, so that point could be quite moot).
A "ping" going outside of the VPN tests whether the machine on the other side is up and running, but, by definition, it will not test whether the VPN link is also up and running. The other machine could be up but the VPN service down, and then the "ping" will not tell it to you. Thus, handling the "ping" outside of the VPN does not offer the same functionality as an in-VPN "ping".
Similarly, in many VPN setups, one of the machines actually is a complete local network containing many machines with private IP addresses. A "ping" request going through the VPN can be directed to any of these machines with private IP. A "ping" outside of the VPN can reach only machines with a non-private, Internet-reachable IP address, i.e. the VPN gateway. There again, functionality is different.

This also begs the question: why would you want an "unprotected" ping ? The only reason I see is when the VPN appears to be down or unresponsive, and you want to know whether the culprit is the VPN software on the other side, or the network in-between.


How do you deal with massive port scans? This morning I was looking through firewall logs and saw there were about 500 packets marked as port scan. The scanning range was from 1000-1200 5000-5200.
The IP address is 85.25.217.47 which seems to be somewhere in Germany. And these guys continuously scan our ports on a regular basis.

The packets were all dropped by the firewall (a Sophos SG125). What I normally do is I just add the IP range to our blocking list so next time it just drops them by a specific rule.

How do you guys deal with port scan attacks?

I ignore them. And if you have a reasonable security posture, you should too.

Your servers should have no ports open to the general public other than those that you use to serve the general public.

For example, your web server should have open port 80, 443, and maybe 22; everything else should be SSH-tunneled or otherwise VPN'ed if you need to connect to it, unless you expect random nobodies on the Internet to be using the listening service. Perhaps you may want to remap SSH to port 222 or or something in the upper range to avoid filling your auth logs with failed logins, and that should be as exciting as your servers get.

If instead the port scan is hitting your outbound corp gateway, then the scan should show zero ports open, because your corp gateway isn't a server. And you, like a wise IT admin, run all your servers elsewhere on the internet, not inside your corp network, for a whole raft of reasons I won't go into here.

A port scan should reveal to the attacker nothing that they couldn't reasonably guess. And if this is not the case, then your problem isn't the port scan, it's the public secrets you're trying to hide by blocking port scans.


Is encrypting a salt value with a password/plaintext a viable alternative to straight up hashing? The basic problem, as far as I can tell, is that hashing's flaw is that the password is in the hash.  Asymmetric encryption's flaw is that the password is encrypted and can be reversed.

The posts that I have seen say don't use asymmetric encryption and use a better hash algorithm (bcrypt/scrypt/etc) to be "secure".

What if instead you used asymmetric encryption (such as Rijndael/AES) and encrypt a known plaintext value unique to each user with the users supplied password (could be hashed for better value) and store the result.

Would this not then provide an encrypted string that could be stored that protected the user's password from recovery?  Or is there some inherent flaw that I am missing/overlooking?

I don't see what problem you're solving. Imagine what will happen if your database gets compromised. The attacker will have this encrypted string, salt, and (likely) the encryption key.

What keeps them from decrypting any user's salt or password, and having the password?

It's pretty hard to invent something that will be more secure than algorithms developed by professionals and have been "battle-tested" for many years (namely, bcrypt).


How does blockchain client trust other nodes? If we consider any blockchain based system (bitcoin, for example), how does initial trust setup works?

When a new user wants to join blockchain network, how does the client know that it talks to legitimate server? It does not know number of servers, it does not know their public keys, etc. I believe it also cannot rely on some certificate authority.

There are a couple ways to bootstrap a blockchain client node. The most used one is the DNS Seed. On most coin wallets, there are a list of hard coded DNS records that point to peers.

It's possible to download peers.dat from the blockchain official site, and have the client node connect to peers from that file. This is not the most used way, but works.

The least used way is to connect to the IRC channel for the blockchain, ask the users there and connect to the peer by hand. Not used today for the absolute majority of coins, but can be used for a little know, small ones.

After discovering and connecting to the first peer, the node will listen to transactions and build its own node list.

On the bitcoin software (and almost every other coin), there are a special block named Genesis Block that are hardcoded on the application. This way you can connect to any peer, trusted or not, and ask for the genesis block. Having the genesis block and a list of peers, you can ask different peers for different blocks and calculate their hashes following the chain, and see if their hashes match. With enough known nodes, it's practically impossible (mathematically possible but very, very unlikely) to nodes to fool your client. It's like having dozens of complete strangers that never communicated before telling you the same fake numbers on the lottery draw.


Directly signing a file with gpg or instead its checksum file? It is my understanding that when file is signed with gpg the signature will provide 2 guarantees, a proof of ownership of the signature and the integrity of the signed data.

lets say I have a doc.txt I want to sigh, so I use:

gpg --output doc.sig --detach-sig doc.txt

but I see that many software destitution use a slightly different scheme to provide the same guarantee using extra step.

instead of signing doc.tx directly with gpg a checksum of doc.txt is created and then this checksum is signed with gpg.

So why add this extra step with the checksum file?

Imagine you have a 250GB file (a disk image, a Blu-Ray movie, something very large), and you want to sign it. It would be a massive process to calculate the digital signature of it. And to check the signature would be massive too. You would not want that.

Instead, you use a good, fast hash (SHA-family or MD5, for example), calculate the hash of the file, and use the slow, CPU-intensive digital signature only on the very small hash.

If anyone changes the file, the hash will change and invalidate the signature. if someone alters the hash, the verification will fail. Either way you are protected.


How does IP tracking work? Excuse the naive question (I'm more of a dev than a web-sec person)

In the past I've had webservers hacked and usually i've traced it to some random machines which seem to have been compromised (i assume part of a botnet etc trying to find a way to add my server to the network).

I've always kinda left it there after reviewing the logs and realising nothing too bad was done and the exploit was now patched.

But I've often wondered, what if I needed to identify the threat. Could I go to the authorities? What could they actually do? If it was hollywood dreamland theyd have a big map up on a wall sized screen and in seconds they'd route through all of the proxies and find the source....

As far as I can work out this isnt possible unless you either had 100% access to every ISP in realtime OR you were back-hacking every proxy with whatever exploit and following the incoming connections OR done via the Tier 1 exchanges?
All of which are no small tasks..

Is that about the size of it?

You have pretty much hit the nail on the head, which is why for most organised crime online the key is to follow the money, which is much more traceable.

Depending on paranoia level an attacker could route through multiple proxies, use TOR or other anonymising tools and generally obfuscate to whatever degree they want, and whilst some ISPs will cooperate, a canny attacker will route through countries where they won't.

Have a look at the question on Anonymous and Lulzsec -
 Why is it difficult to catch "Anonymous" or "Lulzsec" (groups)?


Appearance of yam bitcoin miner I had a VM based on Ubuntu 16.04.03 and the only package added to it was OpenVPN.  The purpose of it was to provide a VPN into my private network sited within the cloud environment.   The hypervisor is also 16.04.03.

The other day I noticed 100% CPU utilization on it and once I logged in I noticed a "yam" process consuming all the user cycles.  Google search revealed it likely to be a bitcoin miner.

None of the other VMs on the system or the hypervisor seemed to be affected.  I have 20 hyperthreaded cores on that system so I reasoned that if the malware had been capable of it they would have gone after 40 threads instead of the 2 they got.

So I killed the process then took down the VM with the intent of rebuilding it in the morning.  Foolishly I didn't take other actions.

In the morning I discovered that all the VMs on that system were down and the passwords had been changed on the hypervisor.   I could log in via an SSH authorized_key authentication but could not sudo with my regular password.    Worse, the ZFS zpool had been destroyed.  All the Ubuntu updates got applied.

So I had to go to the co-hosting location site (fortunately local) and recover the system with console access.  I was able to bring up the storage array and the other VMs.   I changed all the passwords (quite a lot of them quite a pain.)

So my questions are as follows:

What exploit might have been used to get into the VPN VM but not the others?  Only that VM had OpenVPN on it.
What exploit might have been used to take down the ZFS array and passwords in the hypervisor?  Is it possible the exploit could have been closed by the upgrades?
It seems to me that if they had root-shell access they could have done a lot more damage than they did.   Is the fact that they did not a) because they were being "nice" or b) they didn't really have that level of access?

I realize that these questions can't be answered definitively with the information detail I have here, but any guidance or suggestions from someone who has experience with a similar situation would probably be helpful.

As you said, it's hard to make good guesses, so this isn't a full answer (it would have been a comment but it's too long for that).

  It seems to me that if they had root-shell access they could have done a lot more damage than they did. Is the fact that they did not a) because they were being "nice" or b) they didn't really have that level of access?

In my (limited) experience, attackers of servers often aren't even interested in root access because the things they want to do (set up a spam mailer, a bitcoin miner or use your system as a proxy for various purposes) don't require it. I've been administrating internet-connected servers for 15 years and I haven't yet found an attacker who was interested primarily in the destruction of the system he took over (but as I said, I only have a handful of cases I can look back to).

  What exploit might have been used to take down the ZFS array and passwords in the hypervisor? Is it possible the exploit could have been closed by the upgrades?

This is what I would be most worried about. I'd be asking myself how the intruders were able to touch the hypervisor. There's 3 options in my mind:

They attacked the hypervisor through a network service running on the hypervisor (possibly ssh if it's the only one)
They attacked it through the shared ZFS filesystem (depending on what exactly you're sharing in the ZFS, that's very likely or pretty much impossible)
They attacked the VM and then escaped out of the VM into the hypervisor.

Option 3 would give me nightmares. It's possible, there are various demonstrations on security conferences, but I haven't heard of it occuring much in the wild.

What to do

As your questions almost certainly can't be answered by anyone here, you'll have to answer them yourself. You do this by inspecting your systems, looking for the entry point of the malware.

If you can take a snapshot of your VM (or even better, make a copy of it), this is a good way to preserve possible proof of the breakin method. If you can't, you'll have to work on the live VM.

Finding out how an attacker broke into your system is important because if you don't, you can't trust your system to not get infected again. So there's really no way around it.

Once you know how the attackers got in, you'll have to decide whether to install your system from scratch and close the hole, or try to find out what the motives of the attackers were. If you go the second route, you run the risk of guessing wrong and leaving behind a system you can't really trust any more, because it might still contain malicious surprises the attackers left behind.

I'd vote for full reinstall, but sometimes from the things an attacker did on your system, you can tell with high confidence that he was only interested in a single thing (like mining bitcoins), and once you remove that, you can be fairly certain your system is clean again. Still, it's a risk.


Is TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 a safe cipher suite to use? Is TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 a safe cipher suite to use for a TLS 1.2 connection to a Tomcat server? What are potential weaknesses or better alternatives? I am looking for a cipher supported by Java 8.

TLS ciphersuite names are structured in such a way that you can tell what algorithms and key sizes are used for each part of the handshake and encrypted session. Let's break this one down and see if there are any improvements we can make:

TLS - This doesn't signify anything in itself, but does allow me to mention that TLS 1.2 is the latest version of TLS and does not have any known vulnerabilities.
ECDHE - Elliptic Curve Diffie-Hellman with Ephemeral keys. This is the key exchange method. Diffie-Hellman key exchanges which use ephemeral (generated per session) keys provide forward secrecy, meaning that the session cannot be decrypted after the fact, even if the server's private key is known. Elliptic curve cryptography provides equivalent strength to traditional public-key cryptography while requiring smaller key sizes, which can improve performance. Additionally, they serve as a hedge bet against a break in RSA.
RSA - The server's certificate must contain a RSA public key, and the corresponding private key must be used to sign the ECDHE parameters. This is what provides server authentication. The alternative would be ECDSA, another elliptic-curve algorithm, but you may be restricted by the types of certificates your CA will sign.
AES_128 - The symmetric encryption cipher is AES with 128-bit keys. This is reasonably fast and not broken (unless you think NSA has backdoored AES, a topic for another time). Other than AES_256 (which may be too costly performance-wise), it's the best choice of the symmetric ciphers defined in RFC 5246, the others being RC4 (which has some known weaknesses and may be broken relatively soon) and 3DES_EDE (which only has a practical bit strength of 108 to 112, depending on your source).
CBC - Cipher Block Chaining mode. Here's where you can probably improve your choice. CBC mode is a way of employing a block cipher to encrypt a variable-length piece of data, and it has been the source of TLS woes in the past: BEAST, Lucky-Thirteen, and POODLE were all attacks on CBC-mode TLS. A better choice for performance and security is AES_128_GCM, which is one of the new AEAD ciphers introduced in TLS 1.2 and has good performance and security characteristics.
SHA256 - This is the hash function that underlies the Message Authentication Code (MAC) feature of the TLS ciphersuite. This is what guarantees that each message has not been tampered with in transit. SHA256 is a great choice, and is the default hash algorithm for various parts of TLS 1.2. I'm pretty sure that using SHA-1 would be OK here, since the window for exploitation is so much smaller than, e.g. the certificate signature. AEAD ciphersuites are authenticated to begin with, so this additional MAC step is not needed or implemented.

Essentially, you have chosen a good ciphersuite that doesn't have any practical problems for now, but you may wish to switch to an AEAD ciphersuite (AES-GCM or Bernstein's ChaCha20-Poly1305) for improved performance and protection against future CBC-related vulnerabilities.


List additional cart items in ecommerce website I am using an ecommerce website.  When I log in, I would expect my cart to be empty. But it shows the cart items selected by another user who previously used the same machine and logged out. Is this a security issue?

In short, yes.

That is not a well designed website and I'd stay clear, certainly don't put any of your payment details into it!

With regards to your question, it's a little vague so I want to expand on it to ensure I clear all ground.

If you're speaking specifically on what could happen if user1 could see user2's basket (nothing else)? Then the only security concern is user1 knowing what user2 has in their basket. From a certain perspective, it's harmless, however, usually after a basket comes check out, and if user2 entered more private information, we can only assume this data is there still also!

On the above assumption, it would seem if you were just logging in, and seeing someone else's basket, that website doesn't support sessions (why oh why!?). So, other than a terribly built website, in the context in which you speak, nothing else could be done.

If this website did store sessions, you wouldn't quite be able to just log in and view another users basket, however, let's assume for this question that we can do that, then yes, it's a huge security issue.

Session's are something created and act as a global variable on a server, the session has a unique identifier to you, and nobody else. A session is identified through a token, which is delivered to the browser as a cookie.

They are used for a variety of purposes, simply transferring information from one page to another or storing items in a shopping cart for a specific user requires a session.

Hijacking this session, simply put, essentially makes you the owner of that account.

Session Hijacking is a thing, and a terribly effective attack on vulnerable websites, see here to see why.


A predictable password generator for offline clients I know this sounds like pretty dumb question. Why would you use a password generator at all if it's predictable.

But suppose you have a server and client - the server always requires a password and has a pool of n possible username/password combinations.

In order to connect the client has to provide valid credentials.

You don't want to hardcode the password into the client software but instead implement an algorithm that will figure out the right password based on timestamp.

I am looking of a robust algorithm to achieve that, or suggestions for a better approach to the problem.

You want to set up a security system where the password is derived, both client-side and server-side, from the current timestamp via a certain algorithm.

Either

you keep the algorithm secret (security by obscurity) which is a terrible choice, as once the algorithm is discovered your whole system falls apart, or
you introduce a shared secret, which must be shared between client and server, in the computation of the password; in this case you might as well use the shared secret as password, without need for the algorithm. (This is what is done e.g. in RSA Tokens, where the shared secret is embedded in the hardware.)

In both cases, you need strict time synchronization between client and server to be sure that the algorithm outputs the correct result.