Could a hardware keylogger be installed in a laptop keyboard replacement? I recently purchased a keyboard replacement for my laptop, manufactured out of country.

Is it theoretically possible for a hardware keylogger to be installed? If so, would it be possible to transmit data remotely?

The replacement itself is quite thin and doesn't look like it has any flash memory devices.

Yes, it would be possible for a laptop keyboard replacement to have a keylogger installed. While they are quite thin, they still have a small low-power microcontroller chip which processes the keyboard input. A different microcontroller of the same form-factor that has its own flash memory and which keeps a log of keystrokes could easily be installed instead. Transmitting the data remotely would also be possible simply by adding a transmitter to the system (which can be very small and very thin).

The chances of a hardware keylogger existing in the keyboard replacement you purchased are remote, unless you work with classified or otherwise valuable information. If it really concerns you, you should try to buy the keyboard locally off the shelf. This will ensure that you are getting the same keyboard that anyone else would get, and that no modifications have been done beforehand specifically for you.

You should be aware that virtually all consumer keyboards actually act like wireless keyloggers in that they emit electromagnetic radiation that specifies the key pressed whenever you press a key. This is not an intentionally malicious design decision, but an unfortunate result of the type of electronics that are used. While it does not mean that keyboards will store what you type, it does mean that someone who is dozens of meters away with specialized equipment may be able to detect what is being entered on the keyboard. Just as with getting a keylogger, the risk that this will be used against you is low.


Design and Security Architecture - where should IPS/IDS be placed? I am a system architecture working on projects - mostly CDN related projects - and I am currently a bit confused about where the IPS/IDS should be placed. We have a NGINX-based webserver for the edge which is being protected and monitored with NAXSI as its WAF. All servers are using SELinux, and they are using firewalld as their system firewall. Requests should be directly sent to the NGINX edge-server, and I am trying so hard to avoid network dumps.

The question is, where should the IPS/IDS be placed. Should it be on the edge-server itself or it should be on another machine? Performance is the most essential consideration that we should have.

|          |
|          |                            --->> OTHER SERVERS
| FIREWALL |                           /
|          |                          /
|          |  ---->>>    NGINX EDGE  ------>> OTHER SERVERS
|          |                          \
|          |                           \
|          |                            --->> OTHER SERVERS
|          |
|          |   should IPS be on NGINX EDGE? Or should I add another
|          |   machine in front of NGINX EDGE - Closer to Firewall ?

Not far from a matter of taste... More exactly it really depends on too many factors to allow a definitive answer. Just some hints:

the sooner is better if you want to be warned against attacks against the edge server or the firewall itself
after the edge can be better if you have very high traffic to avoid a bottleneck at the IDS/IPS
after the edge can make sense if you have HTTPS traffic decrypted at the edge level and want to analyse it

But you could also imagine a Network IDS close to the firewall for non TLS encrypted traffic and Host IDS on the application servers for the TLS encrypted part


Are there trackers that work even for people who are using extensions like Privacy Badger? If so, what are they and how do they work?
(This is within the context of a blog. I do not have access to the server).

That is in theory possible. Privacy Badger monitors all the domains that are consulted when you fetch a webpage and then looks for third party domains (Domains that arent equal to the domain of the website you entered) that apear on many different sites asuming that these are trackers or ads. Of cause there must be a whitelist for google code and so on... but basicly that is how this plugin works.

When one creates a tracker that is divided over a huge load of domains and uses them in a round robin way it might be possible that it is not or just after a very long time detected and blocked by Privacy Bager. Indeed this can only work if they change their domains constantly because they otherwise could be blocked by simple blacklisting. Like I said its theoretically possible...


Viewing URLs on Mobile Devices What are you doing to help your users view URLs in emails on mobile devices? Our training program is helping people to understand how to view URLs before clicking the actual link. On mobile devices this is difficult and every attempt is a risk due to having to hold press to highlight or copy the information.

What suggestions do you all have other than copying the URL into another app to view the text, disabling your cellular and wifi before attemping to hold-press to view the URL, or waiting until you reach a desktop device for suspiscious emails?

There are 2 ways to achieve your goal.

Safer and easier way:

Use an anti-malware solution that will help you to block the phishing links. Keep the signatures of this anti-malware solution up to date.
Risky and harder method:

Jailbreak your mobile phone, then write a script that collects IP/domain feed from Open Threat intel sources like OTX alienvault, VirusTotal, etc. Then block the connections to this IPs/Domains. You may want to use it in cron to make it dynamic list.


Is this enough for an NIDS I am doing my senior project on network intrusion detection system (Ethernet networks) and I am having a bit of trouble deciding if I have added enough features.

Currently the system detects the following things:

ARP Cache poisoning attacks
TCP DOS attacks
UDP DOS attacks
ICMP Floods
TCP Port scanning
UDP Port scanning
Web policy violations FTP and Telnet will be added soon

It understands Snort rules, and using the publicly available Snort signatures can detect the use of network mapping tools and several other things.

So my question is:

Have I packed enough features to the system for it to be called a baseline NIDS?

By definition, that is a NIDS. That may or may not be enough for your project.

What is possibly more important for a real world NIDS is how it is updated, how is is tuned, how it is managed, how it reports on exceptions or alerts etc. Any of the following would be useful in a NIDS.

Updates - using Snort signatures is useful. Is there any heuristic/learning capability
Tuning - how do you train the system, and keep it updated when network topography or usage changes?
Management - is this standalone or part of an array?
Reporting - do you alert on thresholds, likelihoods, or just on a signature match
Logging - what do you log, and where? Syslog server functionality?


In this case, does Virtualization gives more security? A: running an OpenBSD machine with a httpd and a smtp server?

vs.

B: running an OpenBSD machine as virtualization host with QEMU having two guest OpenBSD system: one for smtp and one for httpd.

Q: Which solution provides more security? For first look, I could think that Virtualization is another layer of security so it's better.. then in another thoughts... could it be that virtualization add just another layer of complexity so another layer of security bugs?

UPDATE to "B": no, the smtp and the httpd guest cannot talk to each other via layer3. QEMU.

Possible attacks: from script kiddie to security researcher that spends several months to get into the server. Only static html pages are used, no cgi/php and the smtpd server is OpenSMTPD. No unneeded ports are used, even SSHD is listening on a non-internet-faced interface.

Virtualization offers some layer of isolation. In your "B" case, if (for instance) there is a remotely exploitable hole in the SMTP server, then an attacker who exploits it may gain full control of the virtual machine which runs that SMTP server, but he will still be "outside" of the two other machines (the guest with the Web server, and the host). This may help contain breaches. However, this isolation is relative to the communication channels which you use between the systems: for instance, if the Web server code has the ability to send emails, then I suppose it has a way to talk to the other system. There may also be some shared file hierarchy. Also, it would be overly bold to claim that existing virtualization software offers "perfect" isolation: security holes allowing an escape from a guest, into another guest or into the host, have been found (and fixed, but found nonetheless) in all VM engines.

This is (as usual) a trade-off: VM bring extra containment, but nothing "perfect" (perfection cannot be achieved with concrete machines), and at the cost of some overhead: splitting the machine into three will imply somewhat more CPU usage (not a lot more), more RAM usage (in substantial amounts), and more disk usage (a little more or a lot more, depending on how much "sharing" is done between the systems). More importantly, with three systems instead of one, you have increased complexity, the well-known bane of security. Instead of one system to manage, you now have three. This increases cost of system administration.


Will carrier servers allow the ISP to see anything I'm doing even on a VPN? AFAIK, if the connection to the VPN server is properly set up, the ISP is not able to see any of the traffic.

Nevertheless, I just found a worrying comment to this blog post:

https://www.stealth-phones-guide.com/blog/anonymous-sim-card-scam

I Just wanted to double check with the experts of this website: is it true what the guy states in his comment?

That is, if I am routing all my traffic through a mobile hotspot with a prepaid sim card, using a VPN on both devices (say a laptop and the mobile phone acting as hotspot), will the ISP be able to see anything but a connection getting into the VPN?

The answer to this question would have been a sound NO, but this guy adding the details of a "carrier server" and a prepaid SIM made me doubtful, as he seems to know more than me.

The idea of that article is, that there are some people who use SIM cards sold them as "anonimous", where as actually there is essentially less anonymity. But to many people this is natural. If you are calling smb. or if you are using Internet, of course the local mobile providers register such calls and Internet connections. They know your phone number at any time. What they don't know right now is your name, birth date, etc. If police want to find a person by such anonymous SIM and if this person uses it time to time, this person will be found very soon.

To VPN: When your phone establishes a VPN connection, it retrieves certificate of the VPN server and validates it. If it is valid, the phone uses public key of VPN server to initialize encryption in the VPN session. It does not matter, via what networks the connection is established, because nobody can decrypt the traffic.  The nodes between you and VPN server will of course know how much data at what time you sent or received. Based on this they can even know with high probability what kind of data is sent: text, images, audio, video. But they cannot decrypt the traffic.


Http redirect using Location, but using falsely supplied data from host header If I have a domain www.mysite.com, and I am making a request to www.mysite.com on port 80 using telnet, but I send a host header with another domain name(www.wrong-domain.com), but the server doesn't correctly verify if the host header contains it's own domain, and initiates a redirect response with Location header set to the user supplied domain from the "host" header.

Can this lead to any specific attack scenario because of this?

I am not looking at HTTP splitting type of attack, since the server is not vulnerable to it, but can this lead to other kinds of attacks?  My first thought was something like redirect amplification, similar to dns amplification, but that doesn't look like possible.

Below is the output from the telnet.  The server doesn't verify if the host header contains its own domain, and uses it to create the Location header in the response.

P.S.:  The site is not vulnerable to HTTP splitting attacks.

telnet www.mysite.com 80
GET / HTTP/1.1
host: www.wrong-domain.com

HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
Cache-Control: private
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Location: https://www.wrong-domain.com/
Content-Length: 0
Date: Sun, 11 Jan 2015 15:57:26 GMT

The web server doesn't know what DNS lookup you did to get to it. As far as the server is concerned you're only ever doing something like telnet 1.2.3.4 80 GET / HTTP/1.1 host: www.wrong-domain.com
or telnet 1.2.3.4 80 GET / HTTP/1.1 host: www.mysite.com

In this context any domain in the host header is not right or wrong. The server reads that header and handles the request with a specific configuration if available or with a default configuration if not (this is what allows serving multiple domains from the same server/ip address).

Unless I'm missing something the redirect response here is not really a problem, you requested wrong-domain not  mysite and the server told you that the content you requested might exist somewhere else.

That said it is important to make sure that the default configuration on the server does what you want it to do, because a misconfiguration could leak information that you do not intend.

In this case it looks like the default configuration of your server is set to redirect all requests to HTTPS. Which is ok, but depending on what your goals for the sever are, a better way to handle it might be to have the server redirect any unknown domains to a known domain, or perhaps to just drop the connection. Thereby either reducing additional traffic to the server or at least directing it to somewhere useful.


Recover UTF16 Strings from Slack Space Using the disk image provided by the CFReDS project here, we are tasked with recovering deleted text, much in Russian, some in English, in UTF16BE. In the allocated space, this goes relatively quickly using fls and icat.
However, some data seems to be in the unallocated (slack) space. If this were ASCII, we could use grep with "abi" parameters. But that's not working.

This is different than the question here which is more straight forward and can be solved with grep -abi - but, as this problem necessitates the recovery of UTF 16 the problem is a bit different and seems related more to questions such as this asking how to grep UTF16. Also, the answer provided here is a bit skimpy on details. For those seeking to simply recover ASCII text and deleted files from slack space, the walk through provided by Linux LEO here is much more detailed.

I've tried using XXD to dump the hex through sed to remove 'B9' and from hex back, with no luck.
This issue of grepping non ASCII in slack space seems to be an issue that interests a few people, (cf here ). I tried looking at liblightgrep here, which unfortunately fails on an unspecified build dependency (right after libboost_options).

How can I recover non-ASCII text that has had the file headers purposefully removed from slack space?

Maybe strings can be of help? With the -eb parameter it will extract UTF-16BE strings.

As for Russian characters not being found, I am not aware of a tool that will find them directly. But, Python to the rescue:

russian_str = u''
f = open('fakeslack', 'rb')

while True:
    c = f.read(2)
    if c == '':
        break
    if c[0] == '\x04':  # russian chars start with 04
        russian_str += (c[1] + c[0]).decode('utf16')  # big endian
    else:
        if russian_str != '':
            print(russian_str)
            russian_str = ''

This works for me on a fake slack file that I generated by pasting some words from Russian Wikipedia between some English words and whitespace:

$ cat fakeslack
foobar
fewufew
fweu
ncd
Википедию кораблях  fweufweАйоваnwefwe
$ recode utf8..utf16be fakeslack
python ru_strings.py
Википедию
кораблях
Айова


How to make Automated API calls which are at least minimally secure? How do I go about writing scripts (for automation) in Powershell (and possibly even Python) that help me access APIs while keeping the credentialing information either secure IN the script and/or outside it (if stored and retrieved from outside)

Initially, I had thought to use Lastpass, like I do for web-browsers, and somehow retrieve the credentials in a secure fashion, but they dont have any support for any such thing.

I then studied the Windows data protection API, and the key used to encrypt the password is specific to both the user and the machine that the code is running under, but since I am deploying and setting up VMs and containers a lot, and need to access SOME of the APIs as part of the setup process, I cannot use the method.

So how should I go about doing this?

I heard we can use keepass or those like it, but how would you use them in keeping your credentials safe for your code while retrieving them for your API calls?

What should I do?

As Anders pointed out that there's duplicate, it doesn't well cover your case which differs in a way that it's not key for encryption but password for API.

You can use another web service which would be serving one-time passwords, it could work this way:

Your Python script from server A connects to server B which is "password server"
You send credentials to password server to authorize yourself
You retrieve one-time password (or 1-day password) for API
You connect from server A to server C where API is and you send your one-time, or 1-day password
The API server C checks with server B whatever this password can be used
If they key matches, you get positive response from server C (API) to server A (Python client).

You should be using SSL (TLS) for all connections and verify if the certs are OK to prevent MITM attacks. You could be also using user-certs to authorize yourself along with the password.

You can extend security of such system in many ways, for example, limiting one-time password to your Python script IP address.

Also, your API server C can cache the passwords so it wont be retrieving them from server B every time you make API call (ideally in RAM).

The benefit for security is that you have full auditing on server C, and no permanent passwords, so you don't need to change them.


How does one go about building a system with which to Van Eck Phreak? I've been reading plenty on the Internet about Van Eck Phreaking/TEMPEST and I'm curious as to how one might go about building a system to try it out. All I've found so far is this website. It hasn't been updated in fourteen years. Is there just nothing out there for this? If so, why? It seems fairly straightforward.

I'm not up to anything nefarious. I kid you not, this is for a science fair project.

What you're really talking about here is unintended electromagnetic emissions, and that goes way outside of the scope of grabbing monitor data via EM.

The main thing you're going to want to look at is TempestSDR. This is a project explicitly designed for doing exactly this kind of thing against real modern hardware. All you really need is an SDR, a decent antenna, and the software.

If you'd like further info and more cool stuff to take a look at, here's a huge link dump:

Melissa Elliot abusing laptop shielding problems to dump screen data at DEFCON21: https://www.youtube.com/watch?v=5N1C3WB8c0o
The seminal paper on LCD TEMPEST: https://www.cl.cam.ac.uk/~mgk25/pet2004-fpd.pdf
Making audio tunes with TEMPEST on a radio: https://www.youtube.com/watch?v=oLQbp6hj7-c
In-browser TEMPEST test for CRTs: http://www.janschejbal.de/projekte/tempest/
https://www.cl.cam.ac.uk/~rja14/Papers/ih98-tempest-old.pdf
https://www.cl.cam.ac.uk/teaching/0910/R08/work/slides-ykrt2-videorf.pdf

Then we've got more modern attacks against ICs and electronics in general using EMI probes and SDRs:

https://csrc.nist.gov/CSRC/media/Events/Non-Invasive-Attack-Testing-Workshop/documents/03_deBeer.pdf
https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-811.pdf
https://www.esat.kuleuven.be/cosic/publications/thesis-182.pdf


Telnet port open on my router public IPv6 address Recently I upgraded my home router into this one. It is a cheap one, but it has features I needed: IPv6 support and Gigabit Ethernet.

So I decided to give IPv6 a try. I configured a Hurricane Electric tunnel, so every PC on my home LAN got a public IPv6 address. I configured IPv4 firewall and NAT quite easily through web interface, but the router has very simple IPv6 firewall - it blocks anything incoming. So I disabled it and configred Windows Firewall on each individual PC.

Recently I tried to check the security of my network, so I did a Nmap scan of each host. Everything was OK until I got this output for my router:

Not shown: 992 closed ports
PORT     STATE    SERVICE
23/tcp   open     telnet
53/tcp   open     domain
6666/tcp filtered irc
6667/tcp filtered irc
6668/tcp filtered irc
6669/tcp filtered irc
7000/tcp filtered afs3-fileserver
9999/tcp filtered abyss

Nmap done: 1 IP address (1 host up) scanned in 16.55 seconds

And this was the public address (Client IPv6 Endpoint). Scanning the IP from routed prefix gave same results. telnet gives me a login prompt which accepts my router username and password (its weird that web interface doesn't listen on IPv6 address). The router also does a DNS Proxy for my network, thats why port 53 is open.

How big of a security problem this can be? Is there anything I can do?

Update:
I have contacted the consumer support and they told that they condiser to implement IPv6 firewall in next firmware version. It is going to have configurable rules.

I can disable DNS proxy service and set DNS servers on individual PCs. If I ignore the open telnet port, will I be safe enough?

Update 2 Actually disabling the service didn't work as expected: it just stopped giving the routers IP as a DNS server through DHCP, so I configured the router to give my ISP DNS servers. It is still listening on the public IPv6 address. However, I managed to disable telnet entirely on both IPv4 LAN and IPv6 address.

Using the telnet interface over an insecure link (the Internet) is insecure, but simply having it there won't do much harm. The insecurity of telnet comes from its lack of encryption, but it's not an issue if you don't send anything sensitive through it in the first place.

However, what is more concerning is the DNS port that is open - it could be abused to attack other hosts through DNS amplification attacks (UDP being spoofable, an attacker sends a DNS request with the source IP being set to the attack's target IP, and your router in turn sends its reply to the target).

Finally, if all of these services are indeed available over the Internet, you should also consider whether the firmware of the router is reliable enough. I personally don't trust routers anymore, even if they seem secure their firmwares often have hidden vulnerabilities like hardcoded passwords or CSRF vulnerabilities in their web interfaces.


Is there any way for a Content-Security-Policy to block a CSS function, (specifically the url() function)? I would like to block the execution of any instance of CSS's url() function in CSS provided by my server. One promising method would be a CSP, but I'm not sure if this is possible using a CSP. Is it? And if not, what is the best way to accomplish this?

The reason is, there are some instances where users can modify CSS for other users, and I don't want them to be able to cause IP address leaks of users via the url() function.

Content Security Policy provides only a way to restrict the target of a request based on the context of the target but not on the actual source of the target. Thus it is not possible to restrict access specifically for url() called from a CSS but it is possible to restrict access for images.

Since your objective is to make sure that no IP leaks occur I think restricting only url() from CSS might be the wrong approach from start. While url() from CSS might be the only way available for users it is not the only way other sites can be accessed from within your code in general. For But for leaking IP it does not actually matter what the source of the request was, i.e. user provided URL's or your own code. So it might be better to simply have a list of white-listed sites where embedding is allowed and deny access to all others and apply this list globally to your site.


Can a malicious WIFI network force a connection Say I enter a place with public WIFI. Of course, I would not connect to the network since I know it's risky, but I do have my computer turned on. Can an attacker know my computer is there and force a connection to it? If they would be able to do so, than my precaution is wasted, and any attacks a malicious network could do would be done.

Telling me whether this could be done and how to stop it would be very helpful, thanks.

As a sidenote, connecting to a known network may not be safe either, could hackers "replace" an existing network with a malicious network with the same name? If so, how to protect myself against it?

Yes, under certain conditions.

If you have previously connected to a "hidden" wireless network, your NIC may continuously broadcast their BSSID's in hopes of connecting to them. It's the only way to "automatically" connect to a hidden network, because there is otherwise no way for the card to know when it is in range to a known hidden network.

This looks like this:

Hello, 'Home Network'? Are you there?
Hello, 'Office W-Lan'? Are you there?
Hello, 'Home Network'? Are you there?
Hello, 'Office W-Lan'? Are you there
...

An attacker can listen to these probes and reply with "Hello, here is this 'Home Network' you are looking for." If the network was unsecured, or you have an OS that doesn't mind quietly deprecating security, you will then automatically connect to a malicious network.

This of course has a lot of "if" conditions, so if this is a real problem for you in practice is not sure.


Meterpreter SSL error after sleep While heavily using metasploit on pentests, I start using sleep meterpreter command. I understand that this is not a persistence method, but sometimes it's very convenient.

Sadly, when sessions wake up they fail to establish connection with this error:

OpenSSL::SSL::SSLError SSL_accept returned=1 errno=0 state=unknown state: tlsv1 alert protocol version

If I send six or seven session to sleep, I get only one or two after waking up. No one loves dead sessions.

I create sessions with exploit/windows/smb/psexec and the payload is windows/x64/meterpreter/reverse_tcp. I know that TCP payloads use SSL encryption, instead of htHTTPp, but I can' t elaborate why it fails.

MSF version is Framework: 4.12.23-dev-e403df5 Console  : 4.12.23-dev-e403df5.
Also, I don't update msf while sessions are sleeping. Also, there is no difference noticed if multiple sessions wakes up to one LPORT or multiple ones.

Can any one help to solve this problem, cause it's very annoying.

OpenSSL::SSL::SSLError SSL_accept returned=1 errno=0 state=unknown state: tlsv1 alert protocol version

That is a common OpenSSL response when the TCP stream below the handshake is broken.  You say you are pentesting at the moment this happens, this has network security connotations but not the ones one would probably guess at first.  This answer is an educated guess based on seeing that error several times.

When your session is asleep it does not send keepalive packets (i.e. does not send extra ACKs).  Such a "dead" TCP session will be cut off by a stateful firewall, no matter if the firewall considers the connection valid (or harmless) or not.  Since you are pentesting I would imagine you are working within a network where several firewalls are in place.

Why would a stateful firewall do this?

Today, stateless firewalls are pretty much history* therefore all firewalls are stateful, they keep the state (and history) for each connection that goes through the firewall.  They perform this not only for NATs but for any traffic passing through the firewall.  Such a stateful firewall is vulnerable to a DoS attack by leaving too many hanging connections and filling its memory.  To prevent that a stateful firewall have a timeout upon which it drops the hanging (no traffic during the timeout) connection.

When you wake up your SSL session, it sends an ACK.  But the firewall had long dropped that connection from its memory and is clueless about the existence of the TCP session, therefore it answers with RST.  The RST provokes a state=unknown error from the SSL level.

The system at the other side of the firewall may well be aware of your connection, and would answer had the ACK reached it.  But the firewall will not let that pass.

What can you do about it?

Not much.  You could run a stateful proxy on your own machine which would keep sending TCP keepalive on one side (the outside), but would not require keepalives on the other side (the inside, loopback).

Yet if you, for example, put your entire machine to sleep, then the stateful proxy will not send extra ACKs anyway defeating it purpose (and it will make connection debugging even harder that it already is with just the firewalls).

* A stateless firewall is vulnerable to trivial attacks (bypasses), such as IP fragmentation of the initial SYN packet.


What is the traffic volume of practical DDoS attacks I wonder what is the volume of traffic, in terms of requests/second, forms a legit DDoS attack against a website. I know it highly depends on the website and where it is hosted. But is there any real-world example that at least gives some numbers. For example, for 10M request/second, what size of website can be taken down?

I can only find some online news such as GitHub Survived the Biggest DDoS Attack Ever Recorded, but it is not very easy to interpret the unit they use, i.e., 1.3 Tbps, into number of HTTP requests from technical point of view. If interpret literally, one regular HTTP request include tens of headers that may range from few hundreds to few thousands of characters, and then count for a few thousands Bytes and then tens of thousands bits. If calculate this way, assuming a request is with size 5Kb on average, then 1.3 Tb would be roughly 200 million requests. But I don't think it is the right way to consider.

Link11 (a European security firm providing DDoS protection) reports that in 2020 the bandwidth of an average attack to their customers was about 5 Gbps, and the maximum bandwidth was about 400 Gbps. Source: https://www.helpnetsecurity.com/2020/04/20/ddos-attacks-increasing/

A recent post on Cloudflare's blog reports that over 60% of the attacks are under 500 Mbps, and almost 30% of the attacks are between 500 Mbps and 10 Gbps. The largest attack they have seen recently was about 550 Gbps. Source: https://blog.cloudflare.com/ddos-attacks-have-evolved-and-so-should-your-ddos-protection/

What does that tell you? Not much. It just tells you that cyber criminals can afford a lot of bandwidth, but most of the time the attacks just need a few Gbps to be effective. From the above article by Cloudflare:

  Even though 10 Gbps from an attack size perspective does not seem that large, it is large enough to significantly affect a majority of the websites existing today".

It's difficult to come up with specific examples or general answers to your questions though. There are a lot of different types of DoS attacks, at different levels and with different techniques. Some use empty packets, other use specific packets, other target specific high-level protocols, other focus on the application rather than the network, and so on. So if you have a 10 Gbps attack, that's 10 Gbps of... what? Bogus TCP packets? SMTP connections? HTTP requests to a large image file? HTTP POST requests to run a cpu-intensive task? Who knows. So your question is way too broad.


How to list all the permissions requested by an extension? To install an extension, the browser (Chromium Web browser) give us an alert "can read all data on your computer and the websites you visit" , Sometimes we need to install an extension at least to block ADs , Is that possible to list all permissions requested by an extension? And how to change the permissions granted to an extension?

Menu > Settings > Extensions > Details

You can't change the permissions of an extension. It is assumed that the extension can't work properly without all the permissions, so allowing it some permissions and not others would break it partially.


AngularJS Sanitize function vs. server-side output encoding I mainly audit web applications and provide the companies with security countermeasures and recommendations. Currently, I have an issue with giving a correct recommendation when it comes to AngularJS Sanitize function against XSS protection. I have doubts to say that it's OK or to recommend that output encoding shall be enforced at the server-side.

Can anybody help me with this issue or is able to clarify the difference?

tl;dr:
Encoding should be done at the time the data is being used in context - when the code is composing HTML, javascript, etc from untrusted data - that's true whether you are composing on the server or client.  At that point you know what parts are data, and what the encoding context is.  You should leverage binding (ng-bind) in Angular for context specific encoding. The AngularJS Sanitize function is useful when you need to "sanitize" a hunk of untrusted HTML.

Details:
Its good to be careful when the term "sanitize" is being used, because different libraries use it differently - it can mean validation, canonicalization, simple encoding, parsing and encoding.

The AngularJS Sanitize function  "sanitizes" inputs by parsing the HTML into tokens. All safe tokens (from a whitelist) are then serialized back to properly encoded values.  In this way it behaves similarly to
the OWASP HTML Sanitizer Project and the older OWASP Antisamy project.

See
https://odetocode.com/blogs/scott/archive/2014/09/10/a-journey-with-trusted-html-in-angularjs.aspx for more information on using the library.

This is a fine way to encode untrusted input if you don't have the luxury of composing the HTML, javascript, or URL from its parts.  However:

The parsing and removal of tags is more prone to being bypassed - I don't know of any current issues
It modifies the HTML to remove unrecognized tags, which can sometimes be fragile
It has to make assumptions about whether the underlying content is encoded
The tag support will be limited to the white list - however, you can decorate the $sanitize service to change the list

So where you can:

Encode at the time the data is being used in the context - for example by using binding.
Leverage the Sanitize function if you didn't compose it
Try to leverage CSP (Content Security Policy) as a defense in depth


What aspects of image preparation workflows can lead to accidents like Boris Johnson's No. 10 tweet's 'hidden message'? The BBC reports that the image Boris Johson posted on Twitter to congratulate Joe Biden contains traces of the text "Trump" in the background. The BBC article links to a Guido Fawkes' article, and when I download the tweet's JPEG, convert to PNG with macOS preview then subtract a constant background, there it is!
When I do a similar check on the blanked out area in my image in this post I see nothing, i.e. it worked.
My goal there was to show an image of a battery but to ensure that no personal information like the battery's serial number would be visible or detectable. Sharing that on the internet might be a small but nonzero security issue.
I breathe a sigh of relief but then wonder for future reference, in order to be sure that blanked out areas are fully blanked out:
Question: What aspects of image preparation workflows can lead to accidents like Boris Johnson's No. 10 tweet's 'hidden message'? What are the most prominent things to avoid doing in order to avoid accidental hidden residues like this?

import numpy as np
import matplotlib.pyplot as plt

# https://twitter.com/BorisJohnson/status/1325133262075940864/photo/1
# https://order-order.com/2020/11/10/number-10s-message-to-biden-originally-congratulated-trump/
# https://pbs.twimg.com/media/EmPRWjyVoAEBIBI?format=jpg
# https://pbs.twimg.com/media/EmPRWjyVoAEBIBI?format=jpg&name=4096x4096
# https://twitter.com/BorisJohnson/status/1325133262075940864

img = plt.imread('biden.png')

average = img[20:100, 20:100].mean(axis=(0, 1))

imgx = (img[..., :3] - average[:3]).clip(-0.005, 0.005) + 0.005
imgx = imgx.sum(axis=2)  # monochrome
imgx /= imgx.max()  # normalize

plt.imshow(imgx, cmap='cool')
plt.show()

Summary:
The most likely explanation is that the old text was removed by using a fuzzy or smooth eraser tool.
Analysis:
In the image below I have only increased brightness and contrast to make the "hidden message" more visible. Nothing fancy. The slight red tint is only due to the fact that the black background of the original has a very slight red tint to it.

As you can see there is a very clear gradient in the most visible hidden text fragment (under "shared priorities"). The other fragments also show some signs of gradients, but there are no gradient effects used in the text about Biden.
Hypothesis:
These seemingly random gradients together with the fact that the "hidden message" appears to consist of small random fragments of a much larger text makes me think that whoever made this picture removed the old text by using a fuzzy eraser tool. They manually swiped the eraser tool back and forth over the text until they didn't see the old text anymore. But the fuzzy eraser tool doesn't remove everything if you pass over quickly just once. This is by design to avoid sharp edges in an image.
In the picture below I have swiped a big fuzzy eraser back and forth a few times over the original image to show what the results may look like. Obviously, in my picture some parts are still a little too visible, but I still think it gives a good idea of what type of effects this could cause.

Solution:
Don't use a fuzzy eraser tool to remove things you want to remove completely. In this case there's no need to use an eraser tool at all. Just fill the whole image with the background color, or maybe even better, just create a new image from scratch. The only thing they wanted to keep was the size and the background color and that should only take a few seconds to replicate in a new image.
Update:
As requested by @Tristan in a comment, I have tried to replicate the process completely. Here is a picture where I have removed the Biden/Kamala text with a fuzzy eraser tool and then placed a new text on top of it:

And here is the same picture but with increased brightness and contrast to highlight remnants of the old text:


What is the power of my ISP about my modem? I have speed problem for my internet connection. When I called my ISP they said that the source of the problem is your VDSL modem.TTNET is my ISP and modem is provided by ISP. I wonder

How they can claim this.
If I don't change my modem they will see it?
What else information then can get from my modem?

4.if I use a modem not provided by ISP, this will reduce the access?

How they can claim this.

The ISP has control over your VDSL connection since the ISP is one end of the connection. They can determine if the problem is caused by the VDSL connection, for example because there are too much errors on the line etc.

Given that the modem is provided by the ISP they have often also some kind of access to it (depends on the ISP) and might get additional information from it, like the signal strength of the WiFi connections between your systems and the router.

  If I don't change my modem they will see it?

It is unclear if you are allowed to change the modem in the first place. Even if you can they might refuse to provide deeper support if you use your own modem since they are unable to get some details to debug connectivity problems if they don't get access to the modem.

Anyway, they can at least find out if the problem is the DSL connection itself since they have control over this connection. They can find out if any problems with the DSL connectivity might be caused by the modem or by a bad line. If they don't find any problems with the DSL line they can conclude that any problems you report are likely originate on your site, i.e. bad WiFi connectivity or similar.

  What else information then can get from my modem?

This depends on how much they manage the modem. In the worst case (full control of the modem) they might in theory have access to your internal network.

  if I use a modem not provided by ISP, this will reduce the access?

Since it is unknown what level of access they have know (and what level of access they need to support you) it is unclear if the situation gets better if you buy your own modem. But if you choose the right modem you might get at least more visibility and more control of what your ISP can do.


What are the differences between dictionary attack and brute force attack? Can someone explain the major differences between a Brute force attack and a Dictionary attack. Does the term rainbow table has any relation with these?

Similarities
Both a dictionary and brute force attack are guessing attacks; they are not directly looking for a flaw or bypass. Either can be an offline attack or an online attack.
An online attack tries automated routines providing input to a legitimate system. They are not looking to create an exploit in functionality, but to abuse expected functionality.
An offline attack attempts to emulate the encryption/hashing and requires a known output of that process (i.e., you don't attack the system, you already have the hashed/encrypted password)

Brute Force Attack
Definition: Attempts to determine a secret by trying every possible combination.
Qualities:

The number of attempts is limited by the maximum length and the number of characters to try per position (or byte if considering Unicode passwords)
The time to complete is greater, but there is greater coverage of likely cleartext value (all possibilities only if set to the maximum length and every possible character is considered in every position)

Physical World Example: Given a combination lock which requires three numbers to be taken in sequence, you try every possible combination - e.g., First 1-2-3, then 1-2-4.
Note, a brute force attack may not necessarily try all options in sequential order.  An advanced brute force attack may make certain assumptions, e.g., complexity rules require uppercase, first character more likely to be upper than lower case).

Dictionary Attack
Definition: Typically a guessing attack which uses precompiled list of options. Rather than trying every option, only try complete options which are likely to work.
Qualities:

The dictionary or possible combinations is based upon some likely values and tends to exclude remote possibilities. It may be based on knowing key information about a particular target (family member names, birthday, etc.). The dictionary may be based on patterns seen across a large number of users and known passwods (e.g., whats the most globally likely answers). The dictionary is more likely to include real words than random strings of characters.
The execution time of dictionary attack is reduced because the number of combinations is restricted to those on the dictionary list
There is less coverage and a particularly good password may not be on the list and will therefore be missed

Real World Examples:

Access to a secret club requires knowing the owner's name, you guess "Rob" or "Jake" rather than "computer"
Given the same lock example above, you try a combinations equating to the birthday of the lock owner or the lock owner's friends and family.

Trade Off
The main trade off between the two attacks is coverage versus time to complete. If you have a reasonable thought about what the password will be, you can skip unlikely answers and get a response in a faster amount of time. This is important because passwords are often subject to change and because as password length increases the time to guess every possibility grows really, really fast.
Hybrids
There are of course attacks which leverage both techniques in the interest of balancing the tradeoff. For example, if the attacker believes a user is likely to form a password by concatenating a dictionary word and then adding a number (which he increments each time he is required to change his password), then the guesses being executed may combine the word list and then append numbers (e.g., "mypassword2014" and then "mypassword2015"). Hybrids may also combine words in a brute force manner: Consider a requirement for a user to change his password every 90 days, he may form passwords like "mypasswordsummer" and then "mypasswordfall". The attacker then builds a hybrid attack which will take a dictionary word and then append other dictionary terms (potentially the same of different dictionaries) to make guesses.

Rainbow Table versus Dictionary/Brute Force
A rainbow table is generally an offline only attack. In a brute force attack or dictionary attack, you need to spend time either sending your guess to the real system to running through the algorithm offline. Given a slow hashing or encryption algorithm, this wastes time. Also, the work being done cannot be reused.
A rainbow table is precomputed listing. You actually work backwards from the hashed/encrypted text. The attacker will run through the algorithm to get every possible output given every possible input. The list of inputs may be brute force, dictionary, or hybrid. Based on the list of outputs, the attacker now has a reuseable table mapping inputs to known outputs.
With the precomputed table, a simple lookup is now possible given the encrypted/hashed version of the password. If you can find the victim's encrypted/hashed version you can easily return the real plaintext password. Rainbow tables are used to reduce redundant work. There is a trade off with doing the work up front and storing the tables. For example, if you were just doing a brute force or a dictionary attack, you can stop as soon as you find your answer. However, the rainbow table must be fully calculated.
If you were to run a a rainbow table attack and the 5th entry out of 500 million entries was your match, then all of the effort and time used to create the other 499,999,995 passwords may be considered wasted. However, if you are looking to break multiple passwords to reuse the table over multiple attacks, the time savings can add up.


WPA2 Enterprise EAP-TLS Key Exchange I'm in the process of implementing 802.1x WPA2 Enterprise Authentication using FreeRadius and EAP-TLS (Mutual TLS Cert Based Auth).

I am keen to understand how to actual protocols work together and how they keep our WiFi network safe.

I understand the basics of Cert-based auth, using pub/priv keys. I also know that in regular HTTPS, a session key is created by the client, and sent to the server, however EAP-TLS doesn't seem to work like this.

I am looking at this diagram: http://tldp.org/HOWTO/8021X-HOWTO/images/8021X-KeyManagement.png

My understanding (after reading the above diagram) is that after TLS auth is successful, the FreeRadius server will generate a Master Key, and then derive a Pairwise Master Key (PMK). It will then somehow send the PMK to both the Client Supplicant and the Access Point, and then they will use the PMK to generate other session keys to encrypt the actual data.

However, after doing some tcpdumps on both my laptop and the FreeRadius server, I do not see any keys being sent or received, apart from the following.... In the capture from the Freeradius server, inside the final Access-Accept packet being sent to the AP, I see MPPE-Send and MPPE-Recv keys, which is weird, as I'm not using MSCHAPv2.....

On the client (laptop) side capture, I do not see anything between the final EAP Success (That is basically empty), and the start of the 4-way WPA2 handshake (at which point the PMK must be known)

So my question is, where is the PMK being sent from FreeRadius to the AP and Client?

Thanks!

Here is another diagram from Layer3

So... the server sends it's certificate to the client to validate it's identity and the client also does the same, after this comes any other inner authentication protocol if required.

The MSK (Master session key) is derived from the TLS Master Secret via a one-way function. It is in this MSK that the PMK is generated.

The MSK is divided in half, the first half called Peer(STA/Client/Supplicant) to Authenticator Encryption Key (32 octets) is the PMK or Enc-RECV-Key and the second half is the Authenticator to Peer(STA/Client/Supplicant) Encryption Key (Also 32 octets) or Enc-SEND-Key.


Is it still unsafe to email credit card number nowadays? We all know not to do it, but someone emailed my credit card number and cvv code to my gmail.

I'm wondering if the risk is so low I don't have to call to cancel my card.

The email is sent from a reputable ISP's email account, via its ADSL dialup (the ISP is the biggest in the country) to my gmail address. Is it safe to assume that the ISP, connected to the backbone, would deliver the email to gmail server without going through unsecured pc? So I don't need to cancel my card?

Let's see:

Even if what you say is right and ISP is solid as rock

Do you trust this "someone"? If answer is no - cancel the credit card in any case.
Your credit card number + CVV is now in this person "Sent" folder, if his mailbox will be hacked attacker will have you CC.
Your credit card info will be stored forever on Google servers
I would cancel it


What security precautions should we take when letting a C# application send/receive emails? I'm writing a web application which will be able to send signed and encrypted emails to someone else outside my trust boundary. It will also retrieve S/MIME encrypted (and maybe also signed) emails from different accounts.

What security precautions do I need to make?

More specific questions:

Is there a need to implement any kind of input validation (for the emails received). The attachment will be stored in a database and accessible via the web UI.
What about output sanitization? As the email will be encrypted and signed, is there a strong need to do anything with the contents before?

Main concerns would probably be
- your server is taken over as a spam bot
- your server is used to phish your legit customers with malicious emails originating from your server

Implement logging & review it so you know when your server starts sending unexpected emails on your behalf

Implement whitelisting such as
- whitelist of allowed outbound recipients , if they're not on the list your email server won't send it
- whitelist of allowed sending servers, if attacker tries send email to your email server it is rejected because not on the allowed list of sending servers


Why AJAX is not used to log in? I'm wondering why AJAX is not used to log in nor register in most of the pages and it's used PHP reloading the whole page.
Is it about security, or it's just that it's not practical at all?

I'm wondering why AJAX is not used to log in nor register in most of the pages and it's used PHP reloading the whole page. Is it about security, or it's just that it's not practical at all?

Ajax is not a special thing regarding the transport of the login data, because it is a HTTP request done in the background instead of the foreground. Thus if done correctly the security should be the same.

But, with a normal foreground HTTP request you update the full page and thus take the current browser tab fully into a different security level (i.e. logged in vs. logged out). With Ajax you update only part of this page. If you are not careful you might mix this way content from different security levels on the same page so that data from different security realms might interact with each other.

Thus using a new page instead of updating an existing page is not only the more simple approach but also the one where it is easier to verify that everything was done correctly.


Token authentication and storage / websocket issues My application is running an API authentication that uses tokens rather than cookies.

This leads me to ask a few questions :

What is the most secure way to store the token ?

By using random tokens you eliminate the issue of CSRF attacks but on the other side there are no Secure and HTTPOnly flags.

I thought of maybe using some kind of trick using the new ECMAScript Harmony Object.freeze() and Object.seal() features but this seems to be more of a hack than something that would be secure.

How should I authenticate WebSocket clients like Socket.io on top of HTTPS ?

Most libraries like Socket.io, ws, Sockjs and Faye don't allow to set custom HTTP headers or it's not compatible with the various fallback protocols like Flash sockets.

One possibility would be to send the token as part of the handshake in the URL's query arguments but I don't really like it because it means that :

1) - Tokens will be shown in logs files that log only the URL

2) - I would have to authenticate first during the handshake and then every time I send data which would mean two separate systems.

That's just on top of my head by thinking a little bit about it. There might be some more underlying issues.

Am I just too paranoid and this option is actually secure ?

I could also implement some kind of asymmetric scheme using a public / private key system, but this seems just to error prone / complicated to be a reliable solution.

My final question is more of a consequence of the questions above :

Is the trade-off of having random tokens rather than cookies worth it ?

On one side you don't have CSRF attack vulnerabilities but on the other side you have a lot of other cases where the answers (for me at least) doesn't seem to be so clear-cut.

Thank you in advance !

To store the token:

For a traditional (non-Ajax) web app you usually store the token in a hidden form field.
For a single page app you usually store the token in a JavaScript variable and include it in the JSON data with each request.

This approach avoids the token being in the URL, and it works with WebSockets.

Most applications use a cookie as the main session ID, and have a second token which is purely to prevent CSRF. You can ditch the cookie and solely use the token, as you suggest, but doing this is not standard practice, so you should only do it if you're sure you know what you're doing.

As you mention, cookies have an HttpOnly option that is not possible with tokens. Although tokens don't have a secure flag as such, that is less important, as you can adjust your code so the token is only ever sent over SSL.

One other thing to be aware of is you can now prevent CSRF without using tokens, primarily using the origin header. However, most sites still use tokens.

You can do normal cookie authentication with WebSockets. This question has some information. I don't know what the CSRF implications of this are.


Does the .net mvc/iis stack support whitelists for bidirectional authentication for SSL/TLS connections? I'd like to limit access to some of my REST api, such that only bidirectional SSL/TLS connections are accepted, where the "other side" matches a detailed, restricted, whitelist.

Is this something that's easily supported by the microsoft stack, as part of their MVC implementation - and, if it is, is there an example of how I might use it?

As a nice bonus, it would be cool if i can check the incoming certificate matches a list of domains (ie, check that the cert is issued to a domain that's on my white list, and that the connection is coming from that domain, as opposed to whitelisting some ip addresses - so i can allow the certs to change between trusted authority sources, and the ip addresses to change arbitrarily).

Your question is rather unclear because every TLS connection is, by nature, bidirectional: it allows bytes to flow in both directions. I suppose that you mean connections where both the client and the server show a certificate.

On the client side, the server's certificate is accepted if all of the following hold:

The server's certificate can be validated, i.e. put at the end of a chain of certificates, that begins with a trusted root, and all the names, signatures and various extensions match along the chain.
The revocation status of all these certificates can be ascertained to be "not revoked" with fresh enough information (obtained from CRL and/or OCSP responses).
The expected server name, i.e. the name which appears in the URL that the client uses, appears in the server's certificate (in the Subject Alt Name extension, as per RFC 2818).

By default, the .NET client code will rely on the set of trusted roots valid for the account under which the client code runs; this is a fusion of the "Root" certificate stores for the "current user", "local machine" and "enterprise".

On the server side, the client's certificate can be validated by IIS. In that case, IIS has two modes:

clientCertificateMappingAuthentication: the client certificate is validated against the set of trusted roots of the server; the issuing CA (the one which immediately signed the client certificate) must be part of the enterprise NTAuth store; and then the UPN is extracted from the client certificate and looked up in the local Active Directory server. The part about the "NTAuth" store is where you can restrict client certificates.
iisClientCertificateMappingAuthentication: IIS does the job, not the AD server (i.e. that's what you do if the server is not part of a domain). After validation against trusted roots, IIS can do a "one-to-one mapping" in which a client certificate will be accepted only if it is bit-to-bit identical to a certificate registered into IIS, and then mapped to a specific identity.

There are many configuration options. And you can programmatically override most parts of the process. For instance, see this page for how to configure on the server a custom class for validating client certificates; with such a class, you can do everything you wish to do (but beware, you can also do some very weak things, such as trusting the certificate on face value without any validation).


Is it possible to hide malicious code within/behind an image? Is it possible to hide malicious code either within an image, or behind it as it is displayed on a webpage and then if the user saves this image, they actually are downloading the malicious code?

This is kind of vague so I have been having trouble finding much on Google regarding this, if this exists I would definitely appreciate a link to where I can read more about this.

There are lots of methods to hide information inside an image, like inside the meta data, after the image or even inside the image using steganography. In case of real executables you need some code to extract the information from there before you can execute these as programs. But in case of Java, Javascript or similar programs such a file could actually be image and code at the same time and gets immediately executed.


Is a 6 digit numerical password secure enough for online banking? My bank went through a major redesign of their customer online banking system recently. The way security is managed across the platform was also reviewed. The password I am able to set now to log in is forced to be 6 digits long, numerical.

This goes a long way against what I thought to be a secure password policy. On the other hand, I trust my bank to know what they are doing.

Could you help me understand how good this policy is?

Compared to common practices in the sector.
From a more general IT security point of view.
As a customer: How much should I be worried  that my account may be easy to compromise?

Notes:

The user is id card number, which is almost public data.
Someone entering my account is still not able to make a payment before it goes through another security mechanism (which we will assume to be good).

A 6 digit numerical password doesn't do much.

Why 6 Digits?

Troy Hunt has an excellent blog about being forced to create weak passwords where he talks about various bad practices including forcing short numerical passwords and puts forward the often used excuse that

  “We want to allow people to use the same password on the telephone keypad”

The only valid reason to require a numerical only password is that the only input available to a user is numerical (e.g. with ATMs); (similarly the only valid reason to require a human readable password is that a human will read it - which would be a very bad sign if it was used not just for telephone banking, but for the website too).

But if that is the reason, why on earth would they force you to use the same insecure pass code online (or on mobile), when you have access to a full qwerty keyboard?

How easy to brute force the way in?

There are 106 possible passwords consisting of 6 digits.

For an unskilled attacker, getting into your account is no problem at all if they have your username and unlimited attempts.  You should assume they have your username.  Usernames are not secrets.

Let's maybe assume the bank has thought of this, and locks each account after 3 bad tries, or perhaps initiates a robot-limiting option like a captcha to try again after that.  Then the attacker still has a 3/1000000 chance of getting in to a random account within that window.

That means if they attack 1000000 accounts, they can expect to get into 3.
And making 3000000 requests would not take very long at all.

Compare that to how many passwords there are with 6 alphanumeric characters (by most security standards, far too short, and not complex enough).

There are 626 = 56800235584 possible 6 character alphnumeric passwords.  That's still too weak but it's already 56800 times stronger!

Stored securely?

Needless to say, if the user database was breached, 106 possible passwords is ridiculously low entropy, and whatever hashing and salting system they've used, they can't keep your passcode secure.

Your bank's plan in the case of a database breach is presumably to roll over and cry.  Maybe they think the outcome is so bad they just aren't going to plan for it.

Assuming the other authentication method is secure, should I worry?

An attacker seeing your finance history is a really big issue; you should be worried even if the other authentication method blocking transfers is secure.  And you should not expect the other method to be secure.

How much other information is leaked about you without the 2nd authentication method?  Your name, address, email, maybe?

These are more than enough to start doing background research on you, to get additional info - these could be clues to your other password, or good strong information on how to phish you.  They might try calling you, using the information they have on you so far to gain your trust, pretending to be the bank, and trick you into revealing other secrets about yourself under a ruse that you need to authenticate to them by answering the last few questions they need in order to get into your account.

As another example, if the 2nd authentication method is a strong password, but you (and for most customers the "you" isn't tech savvy) but the customer happens to have ever been included in a database breach for another website where they used the same username/email and password, then its game over. - This logic applies to any username/password based system, but is particularly relevant in this case because the attacker is able to discover other information about you exposed by the first insecure authentication method, and because the 2nd password is now the only barrier to them taking your money - this is one reason why industry standard is to require a 2 factor authentication on banking websites before showing the user anything.

As for industry standards; my bank have an no max length password with the ability to take special characters, and then follow it up with a 2nd passcode which can only be entered by selecting some letters from a series of drop downs (so the entire 2nd passcode isn't used in a single attempt).

I'd prefer it if my bank used an out of band 2nd authentication factor; such as a code being sent to my phone.


How does a CSRF logout pose a potential threat to a website? Websites like SuperLogout logs the user out from several websites at one go.
I want to know in what way does this pose a potential threat to the users of the website?

How can this be combined with a phishing attack?
And any other potential threats?

The only threat I see there is someone logging a user out by CSRF to force the victim to enter his credentials again. But this would only be useful if the attacker had a way to capture the credentials. This would require one of these possibilities:

The attacker has found a XSS weakness in the targeted website that allows extraction of credentials by changing the action attribute of the form for example
The attacker is able to perform a MITM attack on the victim and the targeted website does not support SSL so the credentials can be captured in cleartext
The attacker has direct access to the clients PC and has installed a keylogger which will then capture the credentials

In most cases CSRF logout won't be a serious threat at least not compared to other vulnerablities that can be found in many webapplications.


Find and name all .local hosts Is there a way to find and name all of the hosts registered as .local?

I tried various iterations of nmap but they only give the IP address of all local hosts and doesn't provide the .local names.

My router (ER-X) doesn't seem to provide this viewing function even though it obviously is handling this coordination. Nonetheless, I'd love a client based solution such as provided with IP addresses with nmap.

A "client-based solution", as you mentioned, would be dependent on the service providing the DHCP leases. In the case of it being your router, you'll need to query the device for the systems it has issued DHCP leases for.

Alternatives

If you're looking for basic host enumeration tools (i.e. things you would use on a pentest to do host discovery), you can use the following tools:

fping -a -g <ip-range> 2>/dev/null
dnsrecon -r <ip-range>1
various nmap scans
nbtscan <ip-range> (For Windows hosts broadcasting netbios names)

Using a variety of the techniques above, you should be able to get a pretty accurate depiction of the hosts on the LAN.


Is it possible to create a certificate for a key pair which I do not possess? Perhaps the answer is no, and perhaps this is a dumb question. However I am trying to understand the underlying principles better.
My understanding of certificate signing process.

I generate a key pair.
I create a CSR. [CSR is essentially the public key + DN information signed using the corresponding private key to prove ownership of the private key.]
I provide the CSR to a CA.
CA verifies my ownership of DN and the private key.
CA signs the public key, DN and validity using its private key, hashes this signature and appends to create a certificate.

Scenario:

I have a public key for which I do not possess the corresponding
private key.
Can I create a CSR without the private key?
Can I create a certificate for this CSR if I am the CA and I ignore to validate the private key ownership?
Can the above be trivially demonstrated using openssl commands which are available or does it need tweaks and custom tools?

Your understanding of certificate signing process
Yup, I think you generally have this right. One minor quibble is that it's not necessarily the DN that's being verified; nowadays the important information is usually carried in the SubjectAlternativeName field(s). Often a CA will only require the CSR to contain a public key and signature, and any other metadata in the CSR is ignored and taken instead from your account info.
Also, to elaborate on your 2., the CSR format is specified in RFC 2989 and does indeed include a mandatory signature field. Any CA worth their salt should validate an incoming CSR by checking that the signature validates under the public key contained in the CSR and reject the CSR if it does not.
 4.2 CertificationRequest

   A certification request shall have ASN.1 type CertificationRequest:

   CertificationRequest ::= SEQUENCE {
        certificationRequestInfo CertificationRequestInfo,
        signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
        signature          BIT STRING
   }

Scenario:

I have a public key for which I do not possess the corresponding private key.

Can I create a CSR without the private key?

Technically yes, you can throw any random bits into the signature field and have a syntactically-valid CSR, but anyone trying to process the CSR should reject it because it has a broken signature.

Can I create a certificate for this CSR if I am the CA and I ignore to validate the private key ownership?

If you're the CA you can do whatever you like. You don't even need a CSR; if you have access to the CA private key then you can create certificates containing data you want by producing the X.509 ToBeSigned (TBS) structure in a hex editor, signing it, and stuffing the TBS structure and signature bytes into the right place in an X.509 object.

Can the above be trivially demonstrated using openssl commands which are available or does it need tweaks and custom tools?

This I would need to go away and play with, which I don't have time for right now. The core question is whether openssl has a setting to disable CSR Proof-of-Possession (PoP) checks when issuing a cert from a CSR. If yes, then it'll happily sign any broken CSR you give it.


Why do "Forgotten Password?" links generally reveal usernames or registered email addresses? It seems that most sites or systems will just state

  Invalid username or password

As a means to not reveal usernames for use in brute force (and other) attacks. Seems like a good idea as a general rule.
However, many of them you can follow the forgotten password? link and quite often you can get

  This email address / username isn't registered

Should this not follow the same process and not reveal this information?

Is it just bad design practice that has become the norm?

Edit to add; I'm thinking about a secure system where the users aren't able to self register, nor should the general public have access. So it should be secured to those who have access and that's all.

Yes, it is bad security practice indeed.

When using the Forgotten Password feature, the site should respond with a message: "An email has just been sent to the specified email address, if it exists and is registered within our system. Please read the email and follow the instructions."

Or simply: "Please check your email inbox for instructions on how to proceed to reset your password", since it's a safe assumption that the account reset procedure was initiated by the legitimate account owner.

EDIT: It has been pointed out that an attacker might find out whether an email address is registered in the system by trying to open an account with that address. To thwart this attack, the registration procedure must be changed too; the user should be allowed to register only after he/she verified his/her email address, as follows.

Upon entering an email address for a new registration, the site should respond with the message "An email has been sent to the email address you provided. Please read the email and follow the instructions to complete the registration, if necessary".  Then the email message would contain the steps to follow to complete the registration, or a simple warning to the user if the email address was already registered.


Is it safe to point a (sub)domain to my home IP address? I have my own website and I created a subdomain that points to my home IP address. It is useful for personal things like entering my domain for wake-on-lan and letting my friends enter it to join multiplayer games I host from time to time. But is pointing a subdomain to my home safe?

The real risk is having incoming access to your home network at all.  The fact that it is accessible through DNS does not significantly add to the risk.  The "bad guys" find open ports through port scanning, not through lookups by name.  Edited to add: Unless you are a high-profile target.  If your domain is something like, um, Target.com or HomeDepot.com then you may be singled out.

What is extremely important is that you know exactly which ports are open and have taken steps to be sure they're used only in ways that you intend.


3G/4G network SMS Interception I am not really experienced with how the 3G/4G network work, but I know that SS7 have some security vulnerabilities, and Diameter protocol brought over some of the SS7 vulnerabilities.

So I would like to ask for example,if I am on a 4G/LTE network It is still technically possible to intercept any SMS being sent to me regardless of who, because of SS7 vulnerability(Just harder in this case)? or is it impossible now?

The protocol is insecure by definition as it needs to pass over a public open network for everything to operate flawlessly.

If you need private communications, use a secured web or email connection, or a call encryption app.  Note however that call encryption needs to be set up on both sides and the key (password) should be transmitted securely over another channel (like email).


Discovering IP or Mac address of mobile devices passing by. Is it possible for someone to discover the IP and/or MAC address of my mobile device, even if I do not attempt to connect to their network?

Yes, the MAC address can easily be discovered, but your device won't have an IP address unless it's connected to some network!

Let's assume that you are not connected to any network.

The attacker can discover your MAC address by sniffing on monitor mode, because your phone is probing for pre-associated networks, and the attacker can easily find the MAC address through that process.

And for the IP address, if the attaker is on the same Wi-Fi, then Yes, but if you're on a different network, I don't think he will be able to get much from that IP address.


If we cast a value is it still necessary to escape it with mysqli_real_escape_string()? real_escape() is a function which needs memory for its functionality, so I was wondering if there was any necessity to do that if we've already cast it?

$num = (int) $num;

Can we use real_escape() just for string parameters?

It's true that casting can mitigate SQL injections, but unless performance is a huge concern for you, I'd use mysqli_real_escape_string() anyway, for two reasons:

Your application might change in the future. Even if your application is only passing integers into your queries right now (via this particular function call or whatever), your code may be modified in the future to accept strings, etc. I'd propose that you're better off planning ahead a bit, and that you should seal off this potential future security vulnerability right now, while it's on your mind.
A less experienced developer might "refactor" away that cast. I can see a junior dev coming through your code at some point and saying, "Why is this cast here? We're only passing IDs into the SQL anyway," and then refactoring away that cast. I'd recommend using mysqli_real_escape_string() even if only to give future developers a heads-up that there's a security issue at stake here.

At the very least, if you're going to rely on a cast to implement security, I'd leave some very conspicious ALL CAPS comments in your code to make it clear that that's what you're doing.


SSD full disk encryption What's the state of FDE with software such as TrueCrypt, VeraCrypt for SSD's - my main concern being that SSD's leave some free space to prolong the life of the drive - would it store unencrypted data there, or is there some new way in which SSD's  or the encryption software work that would guarantee there is no unencrypted data on the drive when using FDE?

Whether it is an HDD or SSD, FDE will not write unencrypted data to the drive.

However on an SSD, there are no guaranty that data that existed before the FDE install are securely erased. (unless you are destroying the drive)


A thought experiment about obfuscating the location of a smartphone when it is in use, is it possible? I was thinking about how smartphones are very difficult to use in a way that does not transmit your location, with all the networks it has to connect to (and let's say a 'burner phone' is too expensive of a solution because of the prices of prepaid credit). I was thinking of a possible solution, I just don't know if it's possible, so I'm hoping someone here can inform me on the technical possibilities/pitfalls.

The idea

Let's say you have a server at home. When you're away from home your smartphone could potentially use any open wifi networks in the vicinity to establish a vpn connection to your home server.

When that is done, your home server would need to be able to receive phone calls in some way (maybe with some sort of bridge which bridges a landline to an ip phone on the network?), and then route any incoming calls to your smartphone over the vpn connection.

That way your smartphone would be able to receive phone calls over a vpn connection, and all incoming/outgoing calls would look like they're going to/coming from your home. Only the owner of the open wifi network you're connecting to, would know where you are (but that is a much more decentralized alternative to the centralized solution of always being connected to your mobile phone network).

Is it at all possible?

I know there are a lot of maybes, but can anyone inform me of the theoretical possibility of this idea? Would it be possible if the neccessary software were available? Can you improve upon the idea?

By the way

I know that there are apps that encrypt phone calls like redphone, silent circle etc, which make sure the contents of a phone call are relatively safe. What I'm trying to solve with this idea is how your location is always up for grabs because of your phone having to connect to a network of sorts. Even when you're using said apps.

A burner phone could solve the problem of hiding your location, but that is an expensive solution (prepaid credit is a lot more expensive). With my idea your phone could disconnect from all networks as soon as an open network is found, and connect to your home server.

It's not possible this way. A (GSM) cell phone (re-)registers about every 15 minutes with the network, and also when there is a need for a cell change, even when there is no actual communication activity. Thus the location of the phone is trackable almost any time, when switched on.


How to decrypt .lock files from ransomeware on Windows I am helping a friend which is an accountant and got all of her books locked due to this. Here are some details:

BTC address of the attacker:
1MBwkTssJkqRvXmAFcSEZ3xTD39A9rkyYA
Email:
helptoyou1@india.com
File name example:
V1rf3n+NT9R1ZM7SmU0.helptoyou1@india.com.8464DBdhFhbd4.lock
Filename of ransom notice: How to restore files.hta

Neither globe nor globe2 could help ("error: reference files missing" after dragging and dropping both an encrypted and non encrypted file to it at once).

Also this thread at Bleeping Compuer did not help much.

My friend paid 1 BTC to the scammers, after which they sent no key and asked for more money (obviously). Unfortunately, I am not much of a cryptographer, so I am seeking your help to decrypt the files.

Edit:
This is what Recuva says (unable to recover since file x was overwritten by file y.lock)

UPDATE: No solution was found, the person had to format her computer and lose all the data.

I don't think you will see those files again, unless you have a back up.

You can view the transaction history of the Bitcoin address you were asked to pay to here. As you can see, there are 303 transactions in total and many of them are for 1 BTC.

That implies that the same Bitcoin address have been given to multiple victims. This in turn means that it is impossible for the perpetrators to know who has paid, and what encryption key should be sent. (Hence the odd request for a screenshot, I presume.)

So either they are incompetent in their handling of the ransom, or much more likely, they are not restoring any files, instead just milking victims on more and more money. And if they are not restoring any files, why even bother to encrypt them when you can just overwrite them with random garbage?

So those files are probably gone, no matter if you pay or not.

Edit: There are some good points in comments. Potentially the screenshots could be used as proof of payments, although a flawed one. And even if payment does not lead to decryption the files might still be encrypted.

But even with this taken into account, unless a remedy for this specific version of ransomeware pops up, you are very unlikely to be able to restore your files. Nkals answer has a great link to a repository of such remedies.

Edit 2: This Troy Hunt blogpost follows a similar line of reasoning about extortion and Bitcoins.

Edit 3: The recent WannaCry outbreak has made me reconsider this answer. Apparently WannaCry uses three hardcoded bitcoin wallets, but people still seem to have gotten their files decrytpted. So I think the base assumption of this answer is wrong.


Processing Exceptionally High Volume Singular Flows I wanted to know if anyone had experience sensoring single flows that generate 90 kpps or upward of traffic. My conundrum is that I use tools which I would like to be able to properly see an entire flow with (Zeek, Suricata), however both of these utilities are not capable of handling larger traffic volumes if a single connection exceeds a "worker thread's" maximum processing rate. Because a single connection is able to generate this volume of traffic, I am not aware of a load balancing method and accompanying software that would produce similar resulting information from Zeek & Suricata(Understandably this matters a lot less with Zeek, as seeing the entire connection isn't strictly necessary, however having a giant connection fill the rx ring results in losing subsequent connections).
For referencing I'm currently using the AF_Packet family sockets for both Suricata in Zeek, which are both in their own fanout. I get roughly 48,000pps running suricata with 4 capture threads with my current configuration and ~26,000pps per Zeekctl cluster.
I'm aware the most sensible thing to do would be to strictly analyze the flow, and then filter it out pre-sensor, however I'm doubtful policy in my org will allow me to do this, but I've been unlucky in my search for a satisfactory tool or reconfiguration.
I am hoping someone might have experience handling this type of situation or knows of software which has a less restrictive processing per "worker/thread" rate that would produce similar results(or honestly any results that aren't massive amounts of packet loss).

First thing I would look into is switching to use PF_RING sockets.
If that's not sufficient then it's probably a job for dedicated network packet broker hardware.  You will want to look at vendors like Arista, Gigamon or Ixia.  Some high-end switches may have the functionality built-in as well.
If you are really and truly CPU-bound by single flows and not total flow volume then short of buying CPUs with extreme single-core performance you are probably out of luck with Zeek and will have to switch to e.g. a commercial flow processor that supports on-NIC hardware packet processing.


How to identify a company's public network address range? Which methods can I use to identify a company's public network address range(s)?

This relies on some factors. When its a big company and they own complete subnets these information are stored within the whois record. You can either use commercial tools which allow you to search a dump of whois records for the company or lookup all public available hostnames of that company. You would normally start with the address of the web, mail and dns server(s).

When it comes to small or middle sized companies there are in most cases only single hosts that are public accessable. In most cases this addresses and servers are rented or even shared hosting addresses. You can easily figure this out by performing reverse lookups of that address.

To find more hosts assigned to a domain you can download the latest dns dump from censys.io (formerly available on scans.io) and then grep it for the domain to find subdomains. You can then also perform a dns "bruteforce" by prepending commonly used hostnames to the targeted domainname. This can be done with dnsrecon for example.

Also there are situations where a subnet is assigned to the hosting company but the range contains more then one website of that company anyway. To find websites of that company in a ip range you can use a tool like EyeWittness which will create screenshots of every website in that range. To be said: This will not work with virtual hosts when you use the ip address of that webserver as an address.


Is purging AES keys allowed legally? We're developing a service, that encrypt e-mail with AES algorithm.

Keys are stored in our server.

We thought about having an expiration service, that is deleting the key from our server. This means that the message would become virtually unrecoverable.

It is open worldwide, but I fear of USA :) Servers are in USA, but they can easily be moved.

Is this against some internet regulation or something?

As far as I can tell (and IANAL), all the broad-scope laws requiring information retention by corporations apply to publicly-traded corporations. Private companies are free to operate in secrecy destroy any information they see fit, except in the case of pending litigation or other court order.


Run as different user VS. Run as admin Can anyone explain what the security implications are between these options and how they should be used?

In windows (10)

Run as different user
Run as administrator

These two options have to do with account permissions which relates to file access, network access, and more depending on the policies within an environment.

By default in Windows 10, when you launch an application you launch it as a standard user. In some instances, the OS will determine that you need administrative credentials to launch the application and automatically escalate your privileges or fire off the UAC (User Account Control) popup to ask if you want to run an application. The system them tags your system utilization and the application permissions based off the user trying to run the application.

Now, some applications like the command prompt don't always require administrative credentials. In these instances, the command prompt will run as the standard user account even if the acting user resides within the administrative group. However, if the user needed to run an administrative task from the command prompt, they will need to search for the exe, right click, and select run as administrator. In this case, the same user account is associated with the application, but the application is granted system level access.

The remaining option, "Run As User" is really helpful in enterprise environments where a help desk agent may need to support a user. Instead of logging out of the user's session, an agent could enter credentials through a screen sharing session to launch standard user level access tools that are blocked by policy to the originally logged in user.

Lastly, there are instances in which "Run as administrator" is also run by a separate user from the logged in account. This will duplicate many of the effects of the Run As User but with administrative privileges for the application.


Possibility of Man in the Middle attack in SSL Protocol during initial Handshake This is my understanding of Digital Certificate Signing mechanism so far. Correct me if I am wrong.

www.abc.com(SSL enabled) is typed in the browser for the first time
The server of abc.com sends it's public key and a Digital Signature to the browser. Along with other content, the Digital Signature contains abc.com's public key in an encrypted form. That encryption is performed with Digital Signature's private key
The Digital Signature is decrypted with the corresponding public key already stored in the Browser(already stored because it is from a Certified Authority). This decryption gives Server's public key
The decrypted public key and plainly sent public key are compared for equality to verify the Trust
If successful, then the symmetric key is generated, encrypted with the server's public key and sent for further communication.

Now, consider a possibility for MITM attack:

The hacker gets a copy of data packets that are transmitted from server to browser after step 2
Since every browser has CA's public key, he can decrypt the digital signature and verify the equality with server's public keys
Now, he can further generate his own version of the symmetric key, encrypt with server's public key, send to the server and pretend like an actual user

So, can a hacker's symmetric key possibly confuse the server with the original symmetric key sent by the actual user?

Will the server reply back to a hacker or only to the actual user?

Is this vulnerable or is that not possible?

Do correct me what I am missing.

This would not be possible at step 3 (emphasis added by me).

Now, he can further generate his own version of the symmetric key, encrypt with server's public key, send to the server and pretend like an actual user

The public key cannot be used to encrypt, only to decrypt. The encryption is performed on the server using a corresponding private key that is kept secret and never leaves the server.


What are the advantages and disadvantages of installing an operating system through network? Netboot is a technology that allows a computer to boot through the network, instead of starting on a hard drive, USB stick or DVD, it connects to a remote server to retrieve a disk image to start.
It is widely used in companies to install an operating system in a few minutes.

It is useful for testing some distributions under Windows or Linux, without losing time to burn several CD.

What are the advantages and disadvantages of installing an operating system through network and is that Secure?

The advantages are various:

You can save a lot of bandwidth.
You can customize installs with SPECIFICS. For example, if you have multiple departments, with multiple needs, you could create specific images for specific departments. E.g., a system with network specific tools for say, those who work in a NOC. System with say graphics applications for a marketing/graphics department.
Another benefit is it makes things simple to upgrade/update from a single source versus: "Oh someone forgot to mark this CD/DVD/USB" From a security standpoint, the biggest benefit is you control what is installed from the ISO level.
You also minimize having to run the risk of allowing a "boot from USB/DVD" rogue images from being introduced.


What else can be sniffed? I'm a pentest newbie. Recently I've learned about sniffing in LANs. From the books and internet resources I'm studying, the sniffing (or packet capture) is always done on either Wired LANs (Ethernet 802.3) or Wireless Lans (Wifi 802.11).

But what about others like cell phone communication, SMS etc. They also use wireless. The information is all around us like in the case of Wifi. Why can't they be sniffed? Why didn't I find any example/situation or any resource where they explain these things.

Kindly, just tell me what all can be sniffed and what not?

Machines create noise that maybe be detected by an attacker.   If this noise undermines a physical cryptosystem then its called a side channel attack which is a very interesting and diverse research topic.

Like it or not,  passwords are the gold standard and the human interface devices we use are very noisy.  The electromagnetic noise produced by typing on a regular WIRED keyboard can be sniffed. As if that wasn't bad enough the vibrations from your keyboard can be sniffed with a laser.

Using an FPGA the HyperTransport bus was sniffed on the XBOX to obtain its secret key and break its (poorly designed) anti-piracy system.  Microsoft should have been aware of this,  because bus sniffing isn't new.   Its also been used to break password protected hard drives.

Communication with a smart card can also be sniffed.

CRTs and even modern LCDs are vulnerable to Van Eck Phreaking.

The MPAA is using canines to sniff for pirated dvd's.


What exactly is meant by serverAuth and clientAuth I'm building a network that will allow employees and customers to access the
company systems.
To that end I'm using a Red Hat Enterprise Linux (RHEL) 7.0 server as a firewall/authentication server.
Initially for test purposes I'm going to use self-signed certificates.
The operational scenario is the client system (Windows 7/8) establishing a VPN/IKEv2
session with the server.

I have to distribute a public-key client certificate to the windows systems.
Do I also have to define a server certificate, which holds the private key?
Here's where I get a bit confused, because I've seen so many variants: I've seen the Extended keyUsage field set to both clientAuth and serverAuth; to just clientAuth; or to just serverAuth.

My assumption is that the client in trying to establish a VPN/IKEv2 session with the server, should be "authorized" by the server if the client sends the "correct" public key.  So should I set the EKU on the server cert to clientAuth? or serverAuth?  or both? (which doesn't make any sense to me)

Theory
This is the usual process in theory:

Your client establishes a connection to the server. The server presents its certificate. The client then makes sure that:
(1) the cert is valid,
(2) the server is in possession of the matching private key via a challenge and response mechanism,
(3) that "serverAuth" is set in the certificate.

Then the server may or may not ask the client for a certificate of its own. And it's pretty much the same in this direction again.
The client presents its certificate. The server then makes sure that:
(1) the cert is valid,
(2) the client is in possession of the matching private key via a challenge and response mechanism,
(3) that "clientAuth" is set in the certificate.
Otherwise the server drops the connection.

Practice
Now whether your software actually enforces step 3 is a different matter altogether.
So, how do you find out what works?

(1) Thorough way: Read the manual, do some experimentation, contact software support.
(2) Lazy way: Just set each and every usage flag on the certificates.

Standard RFC 5280
Now RFC 5280 describes the EKUs in section 4.2.1.12 but is not very verbose.


https://linearalgebras.com/ Is there anything wrong with this site? Whenever I try to open this site, my Firefox displays a warning:

The owner of linearalgebras.com has configured their website improperly.
To protect your information from being stolen, Firefox has not
connected to this website.linearalgebras.com uses an invalid security
certificate. The certificate is only valid for the following names:
*.github.com, github.com, *.github.io Error code: SSL_ERROR_BAD_CERT_DOMAIN

How can I check if it's safe for me to access the site?
Any help would be appreciated.

It is (kind of) a misconfiguration.

The site is hosted on GitHub Pages and it does not have a certificate configured for the linearalgebras.com domain. GitHub does not seem to offer the option to configure a certificate for custom domains (although it can be configured with CloudFlare).

As GitHub does not block HTTPS connections coming to its addresses and seems to use the same infrastructure for its core services as well as GitHub Pages, any connection coming to the servers will get a certificate for GitHub-owned domains.

That said, there is no security risk in accepting the GitHub's certificate for linearalgebras.com and using the site over HTTPS. The connection would be encrypted and data could not be intercepted by a 3rd party. GitHub as a hosting provider would be able to access the data anyway.

Side note: if you try opening http://192.30.252.154/ (the address DNS resolves to, but without SNI), you'll see the GitHub's 404.