Anthem Leak - How do I find out if I'm affected? Recently, Anthem (A health insurance company somehow associated with Blue Cross Blue Shield and potentially other insurance providers that I am unaware of) was the victim of a large data breach. I've seen reports that Anthem had a vulnerable database with the records of 80 million customers. I've also seen that they haven't informed many of those individuals.

How can I or my family have been affected? Or do I just have to sit around and wait until someone tells me?

On a similar note, how do I take precautions if I have been affected? If my medical information was stolen there isn't much I can do is there? For passwords I can change them and not use the same password (which I don't), but is there anything else I should be thinking about?

Thanks!

First, if you're a current or former member of Anthem, (or think you may be) they have a toll-free number you can call for more information on the breach and how you are affected: 1-877-263-7995.  They have also set up an FAQ with more information on the scope of the breach.  I'd suggest reviewing this to get a better idea of how you've been affected.

What precautions can you take?

You can change your password to any Anthem website, if it makes you feel better, but there's no indication at this point that passwords of any kind were accessed.  (It seems to be a customer database that was pilfered, not an application database with authentication credentials.)
Verifying that you don't re-use passwords between sites is generally good practice, which you've said you already follow.  A breach can be used as a periodic reminder to review passwords, change weak ones, and reassure yourself that you're not re-using them.
You should definitely monitor your credit, since critical PII (SSN, DOB, all of the sort of information you'd need to set up a financial account) was released.  They'll provide free monitoring for some period of time if your information was released, but I'd generally recommend that you should be regularly monitoring your credit in an on-going fashion, regardless of whether your information has been released in a specific breach or not.
No medical or credit card information appears to have been stolen, so no reason to worry about that at this junction.  Again, however, it's always good practice to monitor credit card statements closely.  Though they weren't impacted by this breach, they're stolen frequently enough that it's important to always be on-guard against card abuse.
Be extra on-guard for phishing attempts.  I've personally had my email released in data breaches lead directly to broadly-targeted phishing attacks.  So, be extra wary of emails purporting to be from Anthem, or related to Anthem.


Google+ Sign In - One Time Code Flow vs Pure Server Side flow I'm reading the documentation about Google+ Sign In, more specifically, its server side flow. It says (https://developers.google.com/+/web/signin/redirect-uri-flow) that one-time code flow has security advantages over pure server side flow. It says:

  "This one-time code flow has security advantages over both a pure
  server-side flow and over sending access tokens to your server."

I can see the advantages of one-time code flow vs sending access token to the server but I can't really see the advantages of one time code flow vs pure server side flow. I was wondering if somebody can point some of those out.

It seems like the only security advantage is that if using one-time code flow, browser component and server component of the client each get their own token. In pure server side flow, only server gets the token and web application flow only client gets the token. Sending token from client to server, and vice versa, exposes end user to a certain risk. Using one-time code flow there is no sending token from client <--> server and the risk of tokens being compromised is less.


Does gitolite provide an attack vector for the shellshock vulnerability? On the gitolite documentation page it says the following:

"Before running the command, however, sshd sets up an environment variable called SSH_ORIGINAL_COMMAND which contains the actual git command that your workstation sent out. This is the command that would have run if you did not have the command= part in the authorised keys file."
how gitolite uses ssh

As I understand an attacker needs to be able to 1. control the content of an environment variable and 2. trigger the execution of any bash command, to be able to exploit the vulnerability.

It seems that 1 is possible with gitolite but is any bash code triggered after this environment variable was set?

You can check it like this:

env LC_FB='() { :;}; echo vulnerable' ssh git@yourserver.com

With my gitlab user I saw vulnerable appear so I changed the shell to ZSH like this:

sudo chsh -s /bin/zsh git

Hope this helps.


Cleartext data in a session cookie: which kind of vulnerability? I was running Wireshark while using a website, when I noticed a session cookie storing in cleartext the email address, my first name, my gender and the date of birth I set during the signup process.

In my opinion, it is a vulnerability because it allows an attacker who is sniffing the traffic to retrieve personal data that are useless to manage the session (why do they even need to store my date of birth in a cookie?) and that, in any case, shouldn't be sent in cleartext.

Before sending a report to the website, I would like to be sure about the proper term for this vulnerability. I browsed through the CWE website (http://cwe.mitre.org/), and I think this should either be an example of CWE-315: Cleartext Storage of Sensitive Information in a Cookie or a case of CWE - 319 : Cleartext Transmission of Sensitive Information.

My two (strictly related) questions are:

are the information listed above (date of birth, gender, first name, email address) considered sensitive information in the sense of the CWE definitions? The server is located in a EU country, if that helps;
If they are indeed sensitive data, is this an example of CWE-315, CWE-319, both, or something else entirely?

Yes, this information should be considered sensitive, particularly in the aggregate.  E-mail addresses are always PII, and adding date of birth, gender, and first name only makes it even more so.
It is definitely an example of CWE-315.  It may be an example of CWE-319 as well, if the cookie is ever transmitted over HTTP.  If it is only ever transmitted over HTTPS, it is not a CWE-319 issue.

I agree that regardless of whether HTTPS is required or not, this is definitely a issue that you should report them.   This is not an acceptable practice, and more so if the cookie is a persistent cookie, and not just an in-memory session cookie.


Export laws on the cloud (key size) Do the U.S. export laws around AES-256 apply to applications hosted in the cloud?

To expand on Thomas's answer and my comment, in this particular case:

Exporting AES-256 encryption to certain customers is restricted by the US Government.
For example, if you are selling to the government of China, you need an export license. But you can sell to a private entity in China.

You can not get a license to sell to certain embargoed countries and persons:

These include Cuba, Iran, Iraq, Libya, North Korea, Serbia, Sudan, Syria, and Taliban-controlled areas of Afghanistan.
Some countries, including China and Russia, require an import permit (or prohibit import) for encryption products.

Which doesn't give you a definitive answer where the cloud is ill-defined, so the solution will be to use a cloud provider who will agree under contract to limit the geographical distribution of your cloud. Many already do this - e.g. IronMountain allows you to choose the exact locations you want your data to be in, and cloud providers in the EU are supposed to keep customer data within the EU.


auditd rules for both 64-bit (b64) and 32-bit (b32) architectures I'm looking at the OpenSCAP Security Guide for CentOS 7:
https://static.open-scap.org/ssg-guides/ssg-centos7-guide-index.html
Under "Record File Deletion Events by User" (as an example), it provides this auditd rule:
-a always,exit -F arch=ARCH -S rmdir,unlink,unlinkat,rename,renameat -F auid>=1000 -F auid!=unset -F key=delete

It advises to set "ARCH to either b32 or b64 as appropriate for your system."
I have a 64-bit system (uname -m returns x86_64), but checks fail unless I include rules for both b32 and b64:
Title   Ensure auditd Collects File Deletion Events by User
Rule    xccdf_org.ssgproject.content_rule_audit_rules_file_deletion_events
Result  fail

I'm wondering why the b32 line is needed. I tried testing this by setting the architecture to i686 and deleting a file, but it appears to use the 64-bit syscall:
touch audit_i686
setarch i686 rm audit_i686

I'd like to to understand the reason for the 32-bit architecture line and be able to demonstrate the reason for it to any skeptical sysadmins.

I have the same issue on my RedHat machine.
First, you add the 32-bit calls because your software may be using 32-bit calls. There are 32-bit libraries that run under 64-bit architecture. It's difficult to guarantee that your are not using 32-bit calls.
Secondarily, you do it to make the scanner, and the folks reviewing the scan results, happy. Consider how many lines need to be in your audit log, per the scap. You will have 1 finding for every entry missing the arch=b32. Now multiply that by the number of machines on your network. That is a lot of findings.
On my machine, I have 80 findings. I have over 10,000 nodes. That means, my system scans will show a MINIMUM of 800,000 Findings.
I am correcting the ones that I can "make go away," and writing a "Findings Report" to send to the scanner people to fix the scans.
In my scenario, my scanner is being stupid. Your entry:
-a always,exit -F arch=ARCH -S rmdir,unlink,unlinkat,rename,renameat -F auid>=1000 -F auid!=unset -F key=delete
Make sense. My Scanner looks for this:
-a always,exit -F arch=B32 -S rmdir -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B64 -S rmdir -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B32 -S unlink -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B64 -S unlink -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B32 -S unlinkat -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B64 -S unlinkat -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B32 -S rename -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B64 -S rename -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B32 -S renameat -F auid>=1000 -F auid!=unset -F key=delete
-a always,exit -F arch=B64 -S renameat -F auid>=1000 -F auid!=unset -F key=delete
That's TEN entries for what should be TWO lines. I have to write up every single one and say that best practice is to but all the calls on 1 line per architecture.
I need to have the 32 & 64 bit architectures in my audit because we ARE using 32-bit libraries in a 64-bit OS.
I am not going to break them out onto 5 separate lines. Our audit logging is already choking our system. Removing anything I can, or combining lines is what I am working on now.

Unless the scanner gets fixed, we are going to have lots of exceptions.

Ok, now back from that secant. Unless you can PROVE that you have ABSOLUTELY NO 32-bit system calls, you need to double the entries and add both architectures to the audit log.


How does Cycript / Cydia Substrate hook into processes? I am currently doing some research on techniques about hooking mobile applications and came across some frameworks like Xposed (Android), Frida (Android and iOS) and Cycript (iOS).

The documentation about Xposed and Frida is fairly good explaining how exactly they are doing it. Xposed states to manipulate the binary starting the Zygote process and loading an additional JAR file that assists in hooking the methods. Frida documentation explains that it uses ptrace (in Linux environments) to attach to a process, allocating and populating a bootstrapper that loads a thread to launch a .so file containing the frida agent, in a nutshell, if I understood it correctly.

I couldn't find useful documentation about the strategy that Cycript pursues. I know that it is built on top of Cydia Substrate that does the actual hooking. I couldn't find details about how exactly Substrate accomplishes this either.

I further understand that on iOS the objective-c runtime enables runtime manipulation as it is runtime-oriented.

Does anybody know how exactly Cycript / Cydia Substrate works to hook/inject into applications?

Thanks in advance.

It figured out that is apparently working by adding the DYLD_INSERT_LIBRARIES into the program's launchd manifest and thereby every time the application is started it loads the malicious payload by loading the dynamic library.

Still, are there other techniques how to perform runtime hooking / manipulations on Android and iOS?


What are the differences between HSM and SE? What are the differences between a Hardware Security Module (HSM) and a Secure Element (SE)? Can both terms be used interchangeably?

I came across various related question (TPM vs. HSM and TPM vs. SE) but the various HSM and SE definitions found online were very closely related.

To which category does a cryptographic co-processor with secure hardware-based key storage like the Microchip ATECC608A belong to?

A hardware security module (HSM), a secure element (SE), a smart card, a trusted execution environment (TEE) and a secure enclave (SE again) are all computing environments designed for secure execution. They generally have some properties in common:

They are isolated environment with a degree of tamper resistance. They're designed to make it hard to extract data from or crack.
They hold some unique cryptographic keys which allow off-device entities to communicate securely with one specific device. In particular, they can't be cloned.
They either only run code from the manufacturer, or if they allow third-party code, it has to be signed, often not by the end-user of the device.
They offer a limited set of interfaces in order to reduce the attack surface.

The difference between these various types of environments is their form factor. This can influence how much they fulfill the various criteria; for example an environment that is isolated by software can't reach the same level of resistance to side-channel attacks as one that has physical protection. The exact definitions can vary. Typically:

A hardware security module comes in a big box and lives in a server room. It either has its own shelf on the rack or plugs into a PC extension card slot. It has some physical tamper resistance, designed to self-destruct if you try to open the box. It's plugged in 24/7, has a battery inside, and will die if the battery runs out. The physical connectivity can vary; Ethernet, PCI and USB are common. HSM usually have a proprietary communication protocol but offer at least a PKCS#11 interface.
A smart card is a chip which is usually embedded in a credit card-sized piece of plastic. Some are smaller, for example SIM. It takes its power from the device it's plugged into (or the device it's in radio range of, if it's contactless) and sits in someone's wallet while not in use. Calling something a smart card generally implies a ISO/IEC 7816 interface.
A secure element is smaller than your nail and soldered to a board or may even be part of a system-on-chip package. It's fully isolated from other computing environments on the same board or package, but it may or may not be resistant to physical tampering. A secure element plugs in to whatever bus the chip has and has a proprietary logical interface (but often the manufacturer will provide a PKCS#11 interface on top).
Sometimes, if the secure element is inside the same chip package as the main processor, it's called a secure enclave. This is the case of Apple's secure enclave, for example. But sometimes a “secure enclave” is only logically isolated and not physically isolated.
A trusted execution environment or secure enclave is a software environment which runs on the same processor as a less-secure environment. It's isolated by a small piece of software that relies on hardware functionality (e.g. Arm TrustZone, Intel SGX). Terminology and interfaces vary depending on whether you're in the Intel or Arm world.

Once again, keep in mind that what I'm presenting here are typical characteristics, not formal definitions. In a nutshell, if it hurts when you drop it on your foot, it's an HSM. If you carry it in your wallet, it's a smartcard. If it's a non-removable smartcard, it's a secure element.


Why is it said that we can obtain a digital signature from a CA when all we obtain from the CA is a certificate? Several sites, like this states that

You can obtain a digital signature from a reputable certificate
authority such as Sectigo

But digital signature is something you create using a piece of text and your private key using a signing algorithm. How can I obtain a digital signature from a CA? Shouldn't I just be receiving the digital signing certificate from the CA and creating the digital signature by myself?

It is a bit oversimplified and mixed together here.
We need to distinguish a few things:

The CA issues a digital certificate with a digital signature to you
You can use the signed digital certificate to sign other data (depending on the certificate, that can be TLS handshakes, e-mail signatures and so on).

You can obtain a digital signature from a reputable certificate authority such as Sectigo

What they mean here is that a certificate authority takes your certificate signing request (CSR), adds or removes certain fields from it, puts it into a slightly different format (a "to be signed certificate") and adds a digital signature to it, which makes it a valid, trusted X.509v3 certificate that you can use to sign other things.

Shouldn't I just be receiving the digital signing certificate from the CA and creating the digital signature by myself?

Yes, this is exactly how it works.


DRM Video encryption I had some work where I needed to secure streaming. So I looked over all DRM protections that are currently available, and then I found out that I had 3 opinions, first to use very expensive DRM (Adobe) that would cost fortune, second one was to use some cheap one which require installation of some bad quality plugins and doesn't have support for all browsers and third one was to use AES-128 encription which is not really DRM, but can handle some things. Then I start thinking, and here is what I did.

I created streaming server that will:
Create separate key for EVERY chunk in EVERY session, that means that key never repeats. chunks are relatively small 1chunk per 3 seconds. then I encoded key by base64 and got 24 bytes that were exactly 192 bits which is same length as AES-192, After that I shifted every byte for specific number of spaces, for each character different shift and replaced padding of 64 with some random chars. As a result I got unrecognizable base64 which looks like random key. Then after that I did reverse in the flash player. and as a result I got player working pretty good. And changed player to fake aes 192 by m3u8 playlist information.

So basically site is intended for small language group of people (around 12mil) and generally doesn't have very valuable content (videos that are valuable for students). Now What do you think, what is possibility for someone to find out what is goung on and how to decrypt (basically i believe they will try to decode first as AES-192 because of key length and m3u8 info)? Do you thinkthis is enough secure for low budget in low salary country?

Let's get this out of the way first: DRM is not a solvable problem.

Simply loading the flash player into a reverse engineering tool and reading the code will reveal what you did, and since you're giving them the key they can just decrypt the video. It's something anyone familiar with Flash reverse engineering could do, and it's probably something you could pick up from Google if you've got a background in general code and security concepts.

If you're looking for something more solid, you could look into solutions which use HDCP, which essentially provides end-to-end encryption of content up to the actual display device (e.g. a computer monitor). However, this may limit your userbase, as the HDCP feature was designed primarily for use in devices like BluRay players where TVs are known to support HDCP, rather than cases like computer monitors which may not (though many do).

All in all, you just have to decide how much effort you want to put in as a deterrant. If someone wants your video, they can capture it just fine using a screen capture application (e.g. Fraps) or exploit the analog hole.


Issues with the use of network surveillance tool in your company? What issues will we face with the use of network surveillance tool in the company network with respect to the Telecommunication Interception Act and Privacy Act ?

And what policies could be implemented to mitigate these issues ?

If you are thinking of monitoring the network traffic of your own employees:

The most important thing you can do is warn your users that their communications are subject to monitoring by the company at any time, and they should have no expectation of privacy in their communications.

If you are thinking of building surveillance capabilities into your networks:

One security risk is that the surveillance capability provides a way for attackers to eavesdrop on traffic without authorization.  I know that surveillance capability is only intended for use by law enforcement, but building it into your systems introduces the risk that it could be misused.

For an eye-opening example of this risk, I encourage you to read up on the Greek wiretapping case in 2004-2005, around the time of the Olympic Games in Athens.  In 2005 it was discovered that the Greek telecommunication carrier's surveillance systems had been compromised and were under the control of unknown external agencies, who used the surveillance capability to wiretap over 100 cell phones belonging to key government officials: the prime minister, minister of defense, minister of foreign affairs, members of parliament, and so on.  The wiretapping capability had been build only for use by Greek law enforcement, but someone else took control.  They wiretapped phones for 10 months before the compromise was detected; no one ever figured out who did it, but given the sophistication of the attack, it's natural to suspect foreign spy agencies.

For more on the risks of building surveillance into networks, I recommend the following articles:

Risking communications security: Potential hazards of the "Protect America Act"
Internal surveillance, external risks
Tapping, Tapping On My Network Door


Web of trust and signature types? (sig1, sig2, etc) I have read about The OpenPGP trust model but I don't see any mention of the specific signature types.  Are all signature types (sig0 - sig3) treated the same by tools such as gpg or the PGP Pathfinder?

Jens has answered this quite well.  Basically, the signature levels are defined in the man page under --ask-cert-level and --default-cert-level.  sig refers to cert level 0, which "means you make no particular claims as to how carefully you verified the key."  This is the default when signing a key.  They run up through levels 1 and 2, to the highest level, sig 3, which "means you did extensive verification of the key."


Shibboleth SP two resources and two IDPs I am looking for some recommendation / advice, with the following scenario:

Using apache 2.4 and Shib 2.
The setup is SP initiated.
Only one Apache web server
I am protecting two resources.

example.com/siteA
example.com/siteB

SiteA's IDP is OKTA, while siteB's IDP is Auth0.
SiteA user base is different to Site B
We do not want siteA's user base access SiteB's resources.

At the moment I have pretty much a traditional setup:

Shibboleth2.xml loads the IDP meta data for both sites in the Application default attribute:

In my ssl.conf I have the following:

<Location /siteA>
        AuthType shibboleth
        ShibRequestSetting requireSession 1
    ShibRequestSetting entityID  http://www.auth0.com/abcd
        require valid-user
</Location>

<Location /siteB>
        AuthType shibboleth
        ShibRequestSetting requireSession 1
    ShibRequestSetting entityID  http://www.okta.com/defgh
        require valid-user
</Location>

So, based on the current set up, user one logs into siteA and authenticates via Auth0 IDP, this process will eventually create the Shibboleth cookie. Now, user one from siteA attempts to access SiteB, and they gain access because they already have the Shibboleth cookie.

So, how does one ensure the cookie is bound to the end points, i.e., if the Shib cookie is created for SiteA, I don't want that cookie to be valid for SiteB, I want to force the user to have to authenticate, and in this case user one from SiteA wont be able to authenticate as they don't have an account in SiteB OKTA IDP.

There are several solutions to this problem:

Instead of "require valid-user" use a different authorization rule. E.g. if you know that users from IdP 1 have a common attribute (e.g. schachHomeOrganisation=company1.com) that only they have and users from the other IdP 2 have another common attribute (e.g. o=Company-XY) then use these attributes for access control with "Require shib-attr  schachHomeOrganisation company1.com" and "Require shib-attr schachHomeOrganisation o Company-XY". Obviously, your SP would need an entry in attribute-map.xml for these attributes.
The better and safer solution would be to configure a separate logical Shibboleth application for the two sites, the default one that you already have in ApplicationDefaults which has metadata only for the auth0 IdP, and another one with an ApplicationOverride (e.g. with id="myotherappname"), which has metadata only for the okta IdP. This can be configured by using an ApplicationOverride element in shibboleth2.xml for the second application. In apache for the second application you then would add to the apache directive "ShibRequestSetting applicationId myotherappname"


Does flooding with bytes cause buffer overflow? If I flood a C program with bytes can I cause buffer overflow, or is there other stuff I have to take into account?

Flooding bytes is one thing but how are you going to do it? There are many takes on this.

There are generally two types of buffer overflows, through the stack or through the heap. The most common one of all would be through the stack which can be illustrated in the answer of this post and in this site (using c) both using c to illustrate.

This site also does a really good job of illustrating and breaking down the flow of the exploit, also using c.

It talks about the,

Memory Layout of a C program and how it runs, (if you can grasp this concept well, half the battle would be already won)
Common & Key registers
Memory Management during function calls
How the vulnerability is exploited on the low-level codes of C/C++ (which c functions are vulnerable to the exploit)
Designing respective payloads


Forged SSL without installation of root CA, possible? Consider visiting a secure website like Gmail. Is it possible to forge the website certificate only by having full control over the internet provider?

I mean is it practically possible for a provider with no access to user machine (for installation of its root CA), to apply a forged certificate for some secure websites so that the browser built-in security check doesn't alert mismatch certificate?

No. Interception of HTTPS connections is usually done by governments in cooperation with ISPs. Governments obtain a valid certificate from any one of the CAs who have their Root certificate among the Trusted certificates in browsers and operating systems. Governments use legal means to force CAs to issue them certificates. This is only possible for governments who have a CA within their jurisdiction, meaning all the large states of the world have this theoretical capability. How widely this is used in practice is unknown. It can be (sort of) detected by SSL Observatory and I have seen some extensions for Firefox that notify you if SSL certificate has been changed since your last visit.


Security concerns with opening ports New to network security here.

Is exploiting known/zero day vulnerabilities on "listening" services after scanning for open ports the only way or at least the most common way to compromise a system?

Of course we're not talking about completely different things like DDOS, malware and whatnot.

Just wondering if opening up ports and running server services has any other security risks.

Opening ports, especially to untrusted networks can have a number of risks (one of which, as you've correctly identified is 0-day vulnerabilities)

Depending on the service that's listening the configuration could be a larger source of concern. Things like default or easily guessable credentials are the source of many security issues and these are generally quite easily exploited as the information about what the default usernames/passwords for various services are is easily available.


What is the difference between concealment and secrecy in context of confidentiality? I just started studying up for the CISSP and am having trouble understanding few concepts.

This is regarding confidentiality, Below are some of the aspects of confidentiality

Sensitivity
Discretion
Criticality
Concealment
Secrecy
Privacy
Seclusion
Isolation

My question is about concealment and secrecy. These two concepts appear to be the same. Can someone explain how they are different?

Concealment is hiding something or someone. What is concealed may or may not be protected. Perhaps it is merely hidden. Concealment is something done to prevent disclosure, usually a single action.

Sergeant Jones wants to conceal his truck from aircraft, so he hides it in a garage. But if he had wanted to protect it too, he would have put in a bunker. Concealment means hiding. We rarely speak of a level of concealment.

Now he has a plaintext message. He is going to conceal it inside a photo and send it to the friendly local militia. If he had wanted to protect that message, he would have encrypted it.

Secrecy is a practice, the state of holding secrets, between people. Everything that Sergeant Jones does is done in a climate of secrecy vis-a-vis a specific threat or threats. We can then speak of levels of secrecy. Secrecy expresses overall security needs--the big picture of relationships, trust, privacy, and disclosure.


Setting Up My first network Labs? so i'm a complete newbie to this field, but i'm using this book - 'Metasploit The peentration Tester's Guide' - by David Kennedy, etc.
I'm attempting to set up the virtual labs needed in order to actual proceed. However i'm stuck on the DHCP server instrucion. in the book its not very clear to me. But it says i need to install it.
I'm just wondering if the DHCP server needs to be installed on the Kali machine i will be using to get into the other virtual machines, or do i need to install it on the vulnerable virtual machines?
Furthermore the book told me to follow this guide online - http://www.yolinux.com/TUTORIALS/DHCP-Server.html
However when i try to install the server on kali linux - apt-get install dhcp3-server i get this error : E: package 'dhcp3-server' has no installation candidate.
Just wondering what i'm doing wrong here? As im not sure how to install this without this error, and if i'm even installing it on the correct virtual machine? Thank, any guidance is really appreciated.
Are there any updated guides to help me through this?
BTW i have already updated the Kali repositories.

Use isc-dhcp-server. Read the manual for info on options and blocks in the configuration file. You may just as well use unbound, or dnsmasq. I recommend dnsmasq, it's very versatile.


Are security scrutinies conducted by independent agencies on open source software like Ubuntu or Mozilla Firefox? Any intentional malware injected into open source software by the same people who are developing them may eventually get known as the source code is open to the public. However, if the code base is large, average people dont have the time and resources to go through it and hence it is possible for such malware to remain undetected for a long time. Hence it is important to develop independent agencies to regularly scrutinize changes to the software. Do such agencies exist and are they reliable?

There is no simple or single answer to the question.

Do individual projects get reviewed by independent agencies? Yes. Here is an instance of Mozilla hiring such an agency.

Are those agencies reliable? That's an impossible question to answer since the question has no scope.

However, there are numerous independent researchers who comb through code hoping to find errors and mistakes so that they can get recognition. It's that cloud of independent testers that really helps to shine a light on open source code.

Remember that reviewers do not need to review the entire codebase regularly. All they need to do is to review the patches as they come out, for that is the code that changes.


Are two DNS MX records pointing to the same IP a availability risk (single point of failure)? Are two DNS MX records pointing to the same IP a availability risk as in a single point of failure (SPOF)?

Even if there are three DNS MX records in total for example:

mx1.example.com 192.168.1.1
mx2.example.com 192.168.0.1
mx3.example.com 192.168.0.1

No.
Taken from Wikipedia (Single point of failure - Wikipeda):

  A single point of failure (SPOF) is a part of a system that, if it fails, will stop the entire system from working. SPOFs are undesirable in any system with a goal of high availability or reliability, be it a business practice, software application, or other industrial system.

Since in your case if the server with the ip 192.168.0.1 shuts down the MX service will still be able to work since it has another backup server (192.168.1.1) this is not a SPOF problem and all is okay.


Encrypted access tokens - expiration date My idea is to use encrypted tokens - where upon authentication (with username and password), backend would encrypt user_id, timestamp and an SHA-256 over those, base 64 encode it and return to the client as an access token. This way I can eliminate the need for a persistent token store.

This is similar to the scheme described in this article (there are some differences though).

The logic I would like to have, is that when token is used constantly (i.e. longest interval between subsequent API calls is no longer than N), user shouldn't be prompted for the reauthentication.

The issue is that encrypted token's validity cannot be extended, since changing the timestamp means the value of the token changes.

I can see the following solutions:

1) Each time token is validated, issue a new token and return in to the client. On every request, client would forget about the previous token, and store the new one instead.

+ solves the issue
+ logic on the client is rather straightforward
-- for one user, multiple tokens would be valid at the same time

2) Do implement an API endpoint which would accept an expired  token, and would issue a new token in return. This endpoint would have some configurable value M, so if token is expired by more than M, new token wouldn't be issued.

+ solves the issue
+ for one user, only one token would be valid at the same time
-- logic on the client is a bit more complicated - needs to refresh token.

Is there another solution, based on encrypted tokens? (I know we can get around that issue with regular, persisted tokens).

You could encrypt the userid:timestamp:hash, base64 it, and send it as a cookie. On every token validated, recalculate a new one with a new timestamp and send back.

Record every invalid token for a user, and invalidate every token coming for the same user and same IP address for a period. This complicates the life of anyone trying to bruteforce tokens.

You don't have to care too much about a user having more than one valid token, only that you are talking to the same user. If a user opens multiple tabs on your site, multiple valid tokens will happen.


Blocking DiagTrack outbound connection after malware infection I was scammed and I thought those scammers were really from Microsoft so I let them remotely connected to my computer. I don’t know what they installed on it.

After I realized that it was a scam, I reset my computer, cleaned all the drives and reinstalled Windows 10. I thought whatever virus I had should have gone away.

But I typed in “netstat -ano” in command prompt, and I still see this:

TCP    192.168.1.9:49793      111.221.29.254:443     ESTABLISHED     6752

I looked up the PID in Task Manager, it is DiagTrack service which is like a key logger right? And the IP that’s connected to it: 111.221.29.254  has been reported 8 times in AbuseIpDb.com.

I don’t know why after I totally reset my computer, this IP is still connected to me.

I thought about blocking this IP by modifying host file.

I used nslookup 111.221.29.254 but couldn’t find the hostname for this ip.

Server:  NF4V.Home
Address:  192.168.1.1

*** NF4V.Home can't find 111.221.29.254: Non-existent domain

Is there anyway I can block this IP from connecting to my computer?

Is there anyway I can block this IP from my router?

If this is a basic, fresh Windows 10 install, this is probably NOT persistent malware. This is most likely Windows Telemetry services - since Windows 8, Microsoft has been adding more and more automated "phone home" functions into their OSes - some of which are exceptionally difficult to disable. This is all related to the "Application Experience" functions of the OS (benign reasons to do this - to get performance data about the OS and applications, to determine how people use their OS. Malevolent reason to do this - data gathering, ad serving, etc)

References to this server online point to Microsoft Singapore, and there are a lot of people reporting DiagTrack as a Microsoft telemetry service and reference the same IP address that you see.

You can verify that this is a Microsoft tool by using another Microsoft tool called Process Explorer (download this from Microsoft, search for Process Explorer and SysInternals - a great suite of tools for digging into the OS). Running Process Explorer, you can view all of the running processes on your system, what company created them, and whether they are digitally signed (run Process Explorer, choose displayed columns - add Company Name and Verified Signer, then select Options - Verify Image Signatures). This will check that the running processes are coming from officially valid files from the publishers. If the image is digitally signed, it's either a good Microsoft product or Microsoft's code signing certs have been compromised and we're all in a world of hurt ;)

You can try to disable this and other Windows telemetry by opting out of the Application Experience program, but some telemetry functions continue to run in Windows 10. Another researcher proposed 'sink-holing' the telemetry traffic by blocking the routing to this IP ( http://sphughes.com/2015/09/04/block-microsoft-telemetry-using-null-routes/ ) - but of course, Microsoft would prefer that you did not do that.


Email for the second factor in 2FA systems the scenario is in a corporate environment and not connected to internet. The other day I was arguing with my colleague on whether email is good enough to be the second factor in a 2FA system.

My administrators will log in to the system via our corporate network, and then an OTP will be sent to his email which he will use to enter the system.

However my colleague is for the OTP to be sent to the mobile phone. I said that even if he is going to use a mobile phone, he is still going to be in the internal network to key in the OTP. It will not differ much because the email server is also in the internal network. I also mentioned that it's much easier to lose a mobile phone, whereas an email server won't fail that easily since it can be running in redundancy.

What are your opinions? Does more secure organizations today rely more on mobile phones for OTP?

By definition, 2FA is if you authenticate users based on two of the following:

Something you know (like a password)
Something you have (like a key)
Something you are (biometrics)

I see that people often argue in which category e-mail should belong. Although many argue that it belongs in the "Something you have" category, I think that it should rather belong to the "Something you know" category because it is most often just protected by a password. Therefore, password+email OTP is not really 2FA. And also, could a person be using the same password for his e-mail as for the system logon?

Using password + mobile phone OTP would be real 2FA (Something you know + Something you have)


Is it ever safe to publish hashed data? I'm having a friendly debate with someone who thinks that a website can safely make public sensitive data about it's users as long as that data is hashed (don't ask why, it's a long and hypothetical story). My position is that this opens the data up to brute-force attacks at least and that no hash is truly unbreakable given enough time and resource, therefore even hashed data should be protected and kept private. Who's (more) right? Can private data safely be made visible in public as long as it is hashed, or not?

You are correct that brute force attacks are feasible, especially if the data being hashed comes from a relatively small search space. Here is a recent example where New York cab details were inadequately disguised using a hash. From the article:

  It turns out there's a significant flaw in the approach. Because both
  the medallion and hack numbers are structured in predictable patterns,
  it was trivial to run all possible iterations through the same MD5
  algorithm and then compare the output to the data contained in the
  20GB file. Software developer Vijay Pandurangan did just that, and in
  less than two hours he had completely de-anonymized all 173 million
  entries.

Note that it is not the use of MD5 that is the problem here. Any hash algorithm could be brute forced in exactly the same way.

It may be possible to render the hashing irreversible by adding salt before hashing; however at that point you would do just as well to create a lookup table mapping sensitive data to entirely random values—then there will be no hash algorithm to break.

Of course this all assumes that there are associations in the data that you wish to preserve after anonymising. Otherwise the safest approach is to entirely omit or mask any sensitive data.


How could a server know if it is connecting with a particular app via tcp or not? If a particular app being developed uses tcp to connect with a server, how could the server be sure that the connection is being made from that app? I know that sources can be easily spoofed and destinations can be gained from packets by sniffing, but how could an app differentiate its packets from a sender not using the app?

Thanks very much in advance.

There is no way to be sure that the traffic is coming from a specific app.  Since the app is in the control of the user, the user can always make their own application that acts the same as the application that was intended for the server.  There are ways to make it harder for someone to do this and I can provide more details if you want.


Difference between masquerading and replay attacks? I know that masquerading is to impersonate a false identity and replaying is the same wherein unauthorized person uses the credentials of the authorized one to have the privileges.Then what is the difference between the two terms?

These two terms do not have meanings at the same level. Masquerading (or impersonation; the two terms are equivalent) is any attack wherein the attackers acts (emits data packets or the like) as if he was some other user or entity in the system. Replay attacks are attacks where the attacker simply sends a data element (e.g. a data packet) which was previously sent by some other user, in the hope of reproducing the effect.

Thus, a "replay attack" is often a specific kind of impersonation; or you can consider replay attacks to be a tool used to implement an impersonation attack.


Securing login redirects If somebody were accessing a protected page while logged out, they would be redirected to a login page:

/login?next=/something/123/manage?sort=desc

If a successful login, they should be redirected to the page they have been intending to view:

if verify_creds(user, password):
    login(user)
    return redirect(request.args['next'])

How to verify that an attacker cannot use the next parameter to visit a phishing site? Is it sufficient to check if next starts with /, ie a relative link or should I try to check if its a valid path in my application?

Is it sufficient to check if next starts with /, ie a relative link

No, it's not sufficient. Take this script as an example:

<?php header('Location: ' . $_GET['next']); ?>

An attacker could trigger an open redirect via redirect.php?next=//example.com/. You browser interprets this as an absolute URL using the same protocol.

  should I try to check if its a valid path in my application?

That would be the most secure solution. If checking valid paths is not an option, you should instead make sure the URL starts with /[a-zA-Z0-9] (that is one slash and one alphanumeric character).

Checking that it starts with / and not with //, as suggested by @BenoitEsnard, might be secure in some contexts but it's not always sufficient. Take this example (and ignore the obvious XSS problem for argument's sake):

<meta http-equiv="refresh" content="0; url=<?php echo $_GET['next']; ?>">

Here, an attacker could achieve a redirect via redirect.php?next=/%26sol;example.com/ which HTML-encodes the second / and wouldn't be picked up by a filter that checks for a // beginning.

The OWASP cheat sheet on unvalidated redirects has some additional advice.


Placing authorization data on JWT claims I am an application developer and am building a token-based auth mechanism for my application. Essentially, the user will log in with username+password, if the credentials are valid, my code will generate a JWT (probably going with a 30-minute expiry, at least to start with).
If they attempt to request authenticated resources, they will need the JWT stored as a bearer token in their HTTP auth header. When this happens, I'll verify/validate the JWT, and if its good, give them access.
Right now I'm struggling with a particular aspect of the design here and I was wondering what the security best practices dictate in such a situation, and that is: what information can/should I put as "claims" on my JWTs?
I guess to start with, I'm not entirely sure what the underlying intent of a JWT claim is, which might help point me in the right direction.
But basically, with respect to my authorization scheme, I'm wondering if it is a good practice (or not) to not only place something in the JWT that identifies the requester as a principal in the system (identification), but also to place claims on that token regarding access control; meaning, do I put a list of all my user's roles, ACLs, etc. on a JWT claim?
Beyond authorization-related data, what other information do you typically see (correctly) added to a JWT in the form of claims? Thanks in advance for any and all help!

Great question! I've seen a wide range in the level of complexity of JWT tokens. Let's break your question down. (Wow this post got long. TL;DR at the bottom)

Intent of a JWT

I guess to start with, I'm not entirely sure what the underlying intent of a JWT claim is, which might help point me in the right direction.

To me, the intent of a JWT is to assert that a user has successfully logged in. Conceptually, when looking at a JWT system, I try to split out the following components and think about them separately:

The "identity provider (IdP)": this is the component that handles the login page(s) and issues the JWT once the user has successfully completed whatever login stuff was required of them. We think of this as a kind of authority that is asserting that the user is who they claim to be.
The Relying Party (RP) / Resource Server: this is the component (typically a filter on REST endpoints) that inspects the JWT and decides whether or not to serve the requested resource. This relies on the identity provider to have correctly verified the user's identity.

Validating the IdP's authenticity
In some cases these may really truly be separate components; for example if your app accepts Google or GitHub as an OpenID Connect (OIDC) Identity Provider. Or both "components" may be within your app, automagically provided by Spring Boot.
JWTs will always be cryptographically signed to prevent the user from tampering with them (for example extending the "exp" timestamp, or claiming to be a different user.
The case where your app is both the IdP and the RP, it's common to sign using the HMACSHA256 ("alg": "HS256") crypto algorithm. This is a "symmetric" signature meaning that the signer and the verifier need access to the same private key.
In the case where the IdP and RP are different, you typically see an "asymmetric" or "public key" crypto signature, typically RSA-SHA256 ("alg": "RS256"). This is more complicated and you end up needing to carry more metadata in the JWT to deal with establishing trust between the two components (see below).

Typical JWT claims
Case: self-signed (alg: HS256)
These can be very simple. I've seen some production systems as simple as:
{
  "sub": "1",
  "exp": 1516239022
}

Just a userID and an expiry timestamp. The REST controller can look up the user in the DB to check their access permissions.
If, for performance reasons, you want to avoid that db lookup, then you can put all needed info in the JWT. Typically this would be the user's group, role, or other access control permissions. If the info you're putting in the JWT starts to be sensitive (ie you don't want the end user seeing it) then you might need to move to encrypted JWTs (aka "JWE").
As your system gets more complex, you may find the need to track more metadata. For example if some parts of your app are ok to be accessed with password-auth but some pages need "step-up" with multi-factor, then you need to track in the JWT whether this user logged in with password or MFA. As you add more microservices, you may find that you need to add an "aud" (Audience) claim so that JWTs intended for one part of your app can't be used against a different microservice.
Case: separate IdP and RP (alg: RS256)
Here the JWT payload is going to be a bit more complex. The following things may come up in order to establish trust between the IdP and the RP:

The RP will need to know the RSA public key to use when verifying the JWT signature. Typically this will be part of the IdP "metadata" that is available for download and needs to be added to your app's config data.
"iss" (Issuer) Claim: The IdP will typically include its own name in the JWT so you can check that against your configured IdP metadata.
"aud" (Audience) Claim: Typically the IdP will include the name of the RP in the Audience field so that you know this JWT was intended for your app and the user has not cut&pasted a JWT from another app that happens to use the same IdP. Obviously, the IdP needs to know what your app is expecting in the "aud" claim, so more metadata to exchange.

JTI (JWT ID)
JTI (JWT ID): this gives a unique ID to the JWT token. Some security scanners have started complaining if this is missing. Personally, unless I'm missing something, I don't think this is necessary unless you're trying to enforce that JWTs are one-time-use, or you want a hard logout mechanism where the server tracks "Revoked JTIs", etc.

Wow, this answer got a lot longer that I expected. Hopefully it's helpful!
TL;DR: At a bare minimum a secure JWT system needs:

Crypto keys to sign and verify JWT signatures.
A "sub" claim with a userID that your REST controllers can use to look up a user's permissions.
A validity period to ensure that JWTs are short-lived. You can use either the "exp" (Expiration Time) or "iat" (Issued At) claims depending on whether you want the IdP or the RP to be in control of how long JWTs are good for.

Any other claims will depend on the complexity and needs of your app.


Why is a fully-patched OS less important than AV? How to explain to traditional people why they should upgrade their old Windows XP device? <- The interesting point made in the highest upvoted answer to this Q is that a fully patched OS is largely insignificant for the security of an 'average home elder'. On the other hand, regular backups and AV software are essential.

While I do understand the point about backups, the point about patches vs AV is surprising for me precisely because I was usually being told something opposite.

Usually, I was being told that for the security of a home user, the first points to consider are: Full disk encryption (defense against device theft), password managers that allow one to abandon reusing passwords (defense against hacked websites), fully patched software and enabled firewall (defense against malware, especially the kinds that infect the computer without a person's knowledge and consent), backups (defense against hardware failure and attacks that somehow slip through the other lines of defense).

Antivirus software, while still important, nonetheless is dead last on the above list because:

The main purpose of AV is to defend against well-known, indiscriminate threats. This, as I understand, often means threats that would be stopped either by fully patched software or user's diligence (do not run unknown executables, do not click on links in phishing e-mail, ...) in the first place. Even worse, fully patched software paired with user's diligence will be able to stop far more threats than AV.
AVs slow the computer down and open up their own attack vector.

Sources (examples): 1, 2, [3](

Of course user's diligence cannot be relied upon (many claim the human is the weakest link in any security system), especially in the case of home elders, so I'm not going to argue AV software is not important. It's just that I cannot see how can fully patched OS be less important here?

Note that since we're talking about the 'average home elder' I do not consider it a realistic scenario that they are personally targeted. However, I should note that I've been told about such a case that a hacked website of a parish was installing malware on its visitors' computer. For this reason I'm not sure if it is possible to rule out drive by download.

Your thinking is correct when considering this from a technical information security perspective. Your post states It's just that I cannot see how can fully patched OS be less important here?. It's not.

The question you linked is about communication, not the technical best practices for securing an endpoint. The upvoted answer to that post is trying to address the problem of communicating to a user that an ancient, unsupported OS is a bad idea.

To a relatively skilled attacker, AV on an XP device in 2020 would be a minor hurdle/nuisance (if I were the attacker I would consider it basically a non-issue), while a fully patched endpoint with the latest OS release and the security best practices you mention (backups, local firewall, pw manager, etc.) would be a far greater challenge to own. I also agree with you placing AV last on the list.


Modes of Attack on Time-Bombed Password I'm one of the co-founders of plaintextoffenders.com. We recently received a submission for which I'm not sure if there is a means of attack or not. The site in question is a hosting/VPS/etc. company.

Once someone clicks on Forgot Password, an email is sent to the user's email address. It specifies a password reset address (good) which is time-limited to 15 minutes (excellent) but also contains the user's temporary password for those 15 minutes (huh?).

While this is clearly not an indication that they are storing passwords in plain-text, it got me thinking whether sending the temporary password, along with the time-limited reset link, had any security implications.

Update: After reading your answers and going through the wording of the email carefully, I've found that the password supplied is not the temporary post-reset password, but the password that will be used permanently after the reset link has been clicked. This fits in with our mandate and the post will be published. Thank you all for your answers!

A "password reset address" is a temporary password -- and one that can be leveraged into a permanent password. A "password" is a piece of information that a user can present to be granted access. The "password reset address" fits that definition.

So I would say that the particular bridge of "password over email" has been crossed already. The inherent risk of such sending is mitigated by making the address applicability limited in time -- just like the "temporary password".

One could argue that the "temporary password" is a bit more risky in the following sense: if an attacker eavesdrop on the email, he can use both the password reset address and the temporary password, but using the temporary password leaves fewer traces, whereas actually resetting the password will be easily spotted by the rightful owner, on account of him not being able to log on any more. The difference is slight, though. I would say that the "temporary password" feature is quite useless but not significantly more risky than the password reset address itself.

(I suppose that the "temporary password" is for people who need access fast but don't want to break their own, cumbersome, slow password renewal policy. An edge case to help people who happen to dig their own grave.)


Authentication of an indefinite number of technicians in an offline scenario Are there any possibilities to authenticate a changing number of (service) technicians towards a device without an internet / network connection? With the possibility to revoke the access later?

Edit: Without using PKI for technical reasons. :/

You can use PKI, each technician will own a private key and a Certificate Authority shall issue each technician with a Certificate that authorizes anyone who can demonstrate possession of the corresponding private key access to the device for the specified amount of time. The device checks for access privilege by checking the signature of the certificate against the CA's Root Certificate, its expiry date, and the certificate attributes that describes the level of access that the technician has been granted. This allows the device to recognize new technicians while remaining offline.

If this is going to be used to maintain physical devices with NFC or USB ports, you may want to consider implementing this with OpenPGP or x509 smartcard for convenience and security.

Revocation comes naturally when the certificate expires, or you can force early expiry by using a revocation list. The devices has to be online to download the latest revocation list or another technician will need to update the revocation list on the device.


Using Tor browser on a Windows machine Suppose a person is running a Windows 7/8 operating system. If she/he uses the TOR web-browser, can Microsoft see what they are browsing?  Would that not defeat the point of using TOR in the first place?  Does Microsoft not parse through saved/captured data on non-Windows browsers the way it does for Internet Explorer?

Tor browser prevents somebody watching your Internet connection from
  learning what sites you visit.  It prevents the sites you visit from
  learning your physical location, and it lets you access sites which
  are blocked.

This statement is valid for Microsoft Windows OS. So to answer bluntly: No.

EDIT:

Following your comment: As by your machine being compromised you are asking if your Tor browser activities are no longer that protected.

From the official documentation you can read:

  The User Agent MUST (at user option) prevent all disk records of
  browser activity. The user should be able to optionally enable URL
  history and other history features if they so desire.

So as long as you did not change the default settings of your Tor browser, it won't save your browsing history in any file. This way, even if your machine is compromised, your Tor browsing activities are still protected.


What is cleardot.gif next to the senders signature in Gmail? I am concerned that my computer has been compromised because I sent an email out - but now I noticed that there is a link in the email I did not insert, and I am worried I have a virus or something.  I am seeing an invisible image called cleardot.gif appearing next to the sender's name at the bottom of their email. (immediately to the right after "Sincerely, [their name"]).  It only happens with this one person. Where does this come from and what is it?

Here's the HTML code:

<img class="" src="https://mail.google.com/mail/u/0/images/cleardot.gif">

Probably a form of "read receipt" verification coming from the sender: Has Your Email Been Read? Read Receipts and Web Bugs

To summarise:

If you need to access internet assets (images, etc) in order to view an email, these assets can be personalised for your instance of the sender's email (e.g. [host]/img/message[uuid].png). If you access the image, the sender knows that you (or your software at least) has read the email.

Privacy controls and filter lists within most email clients can block automatic loading of internet assets in an email. The resulting emails might look ugly but at least your privacy hasn't breached.

Note: The fact that the URL in question doesn't seem unique isn't an issue if this is being done by Google on the behalf of the sender (or themselves); as to fetch the HTTPS asset might require your login cookie, which thus links the image request to you.


What's the fastest protocol to target for password attacks In a Windows domain environment, there are numerous protocols (SMB, LDAP, Webpages, RDP, FTP, etc.) that query against the same Windows based AD.  Many of these protocols have their own overhead that takes time, or issues that produce bad results (e.g. silently drop multiple simultaneous requests).

I'm in a training course where lockouts are not enabled, so what is the fastest/most stable strategy for performing network based dictionary/bruteforce attacks for domain accounts using standard tools such as (but not limited to) hydra in a domain environment, assuming clients/DCs with these ports are open and available?

In my environment I have LDAP, RDP, FTP, SMB, RPC ports, but am interested in hearing of other protocols options to look for.

I haven't precisely done what you're describing, but I would expect most online bruteforce and dictionary attacks to quickly run into account lockout thresholds.

One workaround for this is password spraying - trying just a few of the most common passwords against many accounts. Unless the environment's controls are tuned to detect such activity, you're likely to get at least a few valid credentials without detection - and by distributing such an attack across many protocols, you might be less likely to be detected!

But in practice, you'll almost always find this unnecessary -- because it's more efficient and reliable to exploit an unpatched system, steal credentials or hashes from that system, pass (or crack) the hashes, pivot to another system with higher-privileged credentials, and repeat until you acquire the target level of access.

Edit: I see now in your comments that the artificial lab environment that you're working with explicitly has no lockout thresholds (not usually a real-world scenario).

Of likely available protocols (including the ones that you've listed), I would expect DC-based LDAP to be the service most likely to be A) already tuned for high performance, and b) have direct access to the back-end authentication data (eliminating performance issues related to a secondary service that must then relay the authentication attempts to the back-end AD infrastructure).

I would expect a high-speed Hydra attack directly against AD LDAP, in parallel against all available DCs (including read-only DCs), to be the most likely way to even start to approach the saturation point of the aggregate back-end AD authentication capacity. Theoretically, to increase per-source throughput, you could distribute hydra to all available workstations and servers in the environment.


How does IKEv2 work on Android without raw sockets I was exploring the IKEv2 StrongSwan client implementation for Android. What I fail to understand is that Android and Java do not support raw sockets, whilst the IKEv2/IPSec works below the transport layer, which seems counter-intuitive. How exactly does the communication happen after the CHILD_SA aka IPSec SA is established?
References:

The official documentation for IKE Charon keying daemon does mention the use of 'socket' in the architecture diagram, but I was unable to find any further reference to it.
I'm aware of the fact that StrongSwan's Android client uses a user-space implementation of libipsec, but again how does libipsec communicate without raw sockets?

Any help to fill the gap in my understanding is much appreciated!

The client only supports UDP-encapsulated ESP. These packets are sent/received over the same UDP sockets that are already used for IKEv2. This limitation is mentioned on the app's wiki page.


Hypothetical: if I wanted to swap my corp laptop for an exact replacement? I love my corporate laptop. It's nothing fancy: Lenovo Thinkbook 460s with ram upgraded to max for VM use. That said, I've pounded this thing into the ground and gotten attached to it. I have to return it when I leave this job and I had the flash question of "what if I wanted to secretly swap it with another, newer, computer and keep the one I'm attached to?"
From a moral standpoint I'm giving the company the exact same laptop, in better shape. I'd dd the hard drive after image transfer, so no issues from an information leakage standpoint. Remember, the goal is that this is done in the most ethical way, ignoring that I'm keeping the O.G. hardware.
So, here's the challenge, how to do this? Many issues to deal with. Mac address being the first. If the nic is hardwired on the board (which it will be), life will get really tricky. That doesn't include bitlocker or etc and the corporate image rejecting many possible checks when put on a replacement clone comp. (cmos, tpm, etc.).
Any sys admins or hackers that can give some interesting insight to this thought problem?
Also, in all honesty, I'd never do this. I'm fascinated by the puzzle.

The data on the laptop is likely more valuable than the laptop itself.  Many orgs will sell you old laptops once they reach end of life but they will require the laptop back from you to wipe it clean and purge data from it as well as licenced software etc. Asking to buy it and being honest is not only the most ethical thing to do, but the smartest thing to do. (Not least because why would you want to keep an old worn out laptop over a brand new one?)

Before we even get to security controls, you will face a number of problems trying to swap out the machine for a new one. Getting the exact same spec laptop will be hard, first of all these spec machines are usually sold exclusively to enterprises, secondly the same models tend to have differences from year to year, the IT guys will probably intimately familiar with these differences.

I do not recommend saying your laptop was stolen, mature orgs will launch an investigation, data officers and legal teams could become involved, this will would mean there is a good chance that the police would be involved, so you would end up breaking a lot of laws, not least wasting police time.

In the same vain I do not recommend saying the laptop was broken, as the IT department will require the broken laptop back, to ensure that it can be safely disposed of.

Many security controls will dictate the requirement of an asset inventory of authorised devices, including the CIS critical controls, ISO27001 etc. This will mean there is a chance that each asset will be tracked and auditable against its MAC address (which will allow switches to only allow authorised devices on the network), device owner, hostname, serial number, and asset numbers. Additionally the laptop may be part of the orgs domain.

So if the goal is to get this “done in the most ethical way”, I think you will fail straight away. Proably a better way of saying it is to get it done in the least unethical way, as you would likely need to do the following:

Break the law
Circumvent the companies security controls
Breach your contract of employment
Break the orgs security policy
Break the orgs acceptable use policy
Break the orgs data handling policies

If the orgs has basic security controls in place (minus drive encryption) then you would also need to:

Source an identical laptop
Remove tamper proof asset tags and place them on the new laptop
Configure the new laptop to spoof the old laptops MAC address (Which would revert to the hardware address once reinstalled)
Change the serial number of the new laptop to that of the old laptop (This would need to be done in the BIOS and would probably require you to flash the BIOS)
Have the laptop reimaged with the orgs image and joined to the domain with the same hostname, which would require access to local admin right on the laptop, domain admin rights and/or the orgs imaging server

TLDR: If the org has some basic security controls in place then swapping one machine out for the other would not only break the law but would require considerable effort.


In Signal Messenger what is the purpose of verifying a safety number? I've read the official page on safety numbers but they are still unclear to me. Without verification, there still is end to end encryption, so what difference does it make? Is it that a phone number is easy to spoof so an adversary could pretend to be someone else but with a safety number verified you would know if it's not really them?

The safety number is actually the fingerprint of your public key.
By verifying this, you verify that the public key you are encrypting the messages to, is in fact the same as the keys used by the other party in the conversation.
If not verified, you could be encrypting your keys with a Man in The Middle's keys, which then proceeds to decrypt the messages, read them, and reencrypt them with the recipients key. You would be none the wiser.
By verifying that the public keys is identical for both participants, you remove the possibility of a MiTM attack.
It's explained in detail in this blog post from Signal.


Are we obliged to provide a complete log should auditors ask for it? We have a system that outputs and rotate logs on a daily basis.

If an auditor requests us to provide logs of a particular date for a particular task, are we obliged to provide a complete full day log? Or can we provide, say an omitted log or screenshot of the log portion that shows only portion of the particular task? Would auditor questions the integrity of partial / omitted / screenshot of logs?

My personal answer is that I would not agree to providing complete full day log as these logs may contain other confidential or sensitive information that may be out of the audit scope.

This depends on the type of the audit and the contract between your company and the auditing company. Furthermore privacy laws, agreements concerning privacy related data and NDAs may play an important role in judging the request.

As a practical advice: Ask your legal department as this is not a question rooted in IT but in laws and contracts. Try to explain your concerns in a way that is understandable to lawyers with little IT background.

You can try to provide a stripped down log as initial response and ask the auditor to clarify if additional data is needed and why. But whether this approach is a good idea or not, depends on the situation.


How to bootstrap trust in an on-premise environment? As part of moving from few on-premise monoliths to multiple on-premise microservices, I'm trying to improve the situation where database passwords and other credentials are stored in configuration files in /etc.

Regardless of the the technology used, the consumer of the secrets needs to authenticate with a secret store somehow. How is this initial secret-consumer-authenication trust established?

It seems we have a chicken-and-egg problem. In order to get credentials from a server, we need to have a /etc/secretCredentials.yaml file with a cert, token or password. Then I (almost) might as well stick to the configuration files as today.

If I wanted to use something like HashiCorp Vault (which seems to be the market leader) for this, there is a Secure Introduction of Vault Clients article. It outlines three methods:

Platform Integration: Great if you're on AliCloud, AWS, Azure, GCP. We're not
Trusted Orchestrator: Great if you're using Terraform, Puppet, Chef. We're not
Vault Agent: The remaining candidate

When looking at the various Vault Auth Methods available to the Vault Agent, they all look like they boil down to having a cert, token or password stored locally. Vault's AppRole Pull Authentication article describes the challenge perfectly, but then doesn't describe how the app gets the SecretID :-(

The only thing I can think of is IP address. But our servers are all running in the same virtualization environment, and so today, they all have random IP addresses from the same DHCP pool, making it hard to create ACLs based on IP address. We could change that. But even then, is request IP address/subnet sufficiently safe to use as a valid credential?

We can't be the first in the universe to hit this.
Are there alternatives to having a /etc/secretCredentials.yaml file or ACLs based on IP address, or is that the best we can do?
What is the relevant terminology and what are the best-practices, so we don't invent our own (insecure) solution?

(Reposting as answer instead of a comment)

It seems to me that the "Trusted Orchestrator" model bears further consideration. The Vault docs mention Terraform and Chef, but the role of an orchestrator is more general than those particuar tools. In almost any microservice environment, there will be a system that is responsible for creating and provisioning new application instances (containers, VMs, what have you.) This system is ipso facto the "orchestrator," and is therefore capable of providing credentials. E.g. (as mentioned in your comment) it could SSH into the instance immediately after creation and write a temporary Vault token which the application could then use to discover the rest of its credentials. Alternatively it could provide the token as an environment variable (this is common practice in container-based setups) or even via a network service a la AWS (which makes it easy to rotate periodically).

In point of fact, I think the "Platform Integration" model resolves to the "Trusted Orchestrator" model once you examine it. The difference is just that the orchestrator is managed by the platform operator (AWS, Azure, etc) rather than the application owner.


Testing shellshock with PHP I have been trying to test shellshock vulnerability on PHP similar to this answer. I am running Apache server with PHP running as mod_php. The PHP version is 5.3.10.

I have a phpfile (phptest.php):

<?php

  function getLang()
  {
    if (isset($_GET["lang"]) && !empty($_GET["lang"]))
    {
      $lang = $_GET["lang"];
    }
    return $lang;
  }
  $language = getLang();
  putenv("LANGUAGE=$language");

  system("env | grep LANGUAGE");

 ?>

I tried to access the page via the browser as follows:

localhost/phptest.php?lang=(){:;}; /bin/ping http://localhost

In the linked question, the wget is to the dev's IP, but I just decided to do a ping to see I can test it.

The browser shows the output as follows:

LANGUAGE=(){:;}; /bin/ping http://localhost

I tried to monitor the ping using the following (from this question):

 sudo tcpdump -i lo icmp and icmp[icmptype]=icmp-echo

I didn't see any request. Can someone tell what do I need correct in my test ?

Asuming that this injection basicly works:

localhost/phptest.php?lang=(){:;}; /bin/ping http://localhost

Your problem is related to the command you try to inject. Ping accepts a hostname as a parameter. But you injected http://localhost as a parameter which is a url and cant be accepted by the ping command. It must be ping localhost instead of ping http://localhost.


TLS or IPsec protocol for client-server communication? What is the best protocol for client-server communication? TLS or IPsec? I have a public channel where users communicate with each other using a digital certificate like X.509.

It depends on your use case which is not really clear from your question.

  What is the best protocol for client-server communication?

If you only care about securing data transfer between two applications (i.e. typical client and server scenario) SSL/TLS like used in the browsers is probably better because only changes on the applications are necessary.

IPSec on the other hand is more suitable for connecting networks with each other, i.e. VPN. In this case not only the traffic between two applications need to be secured but every traffic between two computers, independent of the application. This requires deeper changes on the systems which usually require administrative rights and thus is too complex if you just want two applications communicate securely with each other. You could also use SSL based VPN solutions instead of IPSec to create a VPN between various systems and it is more a question of usability and coexistence with other technologies (like traversing firewalls or NAT) if you choose IPSec or SSL VPN  if you need network level instead of application level secure connectivity. Both offer adequate security if properly set up.


Would using both SHA1 and MD5 hashes of files help reduce the risk of deleting non duplicates I'm making a program to compare all the files on a 3Tb drive by hash and delete duplicates. I was initially going to use MD5, but was worried that with 3Tb of files, there was a slight chance of a collision that would cause a non duplicate to be deleted.

To remedy this I thought I would switch to SHA1, but then had the thought that if I compared both, there would be even less chance of collision.

Does anyone here know both algorithms well enough to confirm or deny this?

I'm considering the possibility that a SHA1 hash collision would necessarily mean the MD5 hash would also collide, in which case comparing both would just be a waste of time.

First off, yes both MD5 and SHA1 have been retired from cryptographic use because because it's possible to construct pairs of messages which produce the same hash value (aka "collisions"). That said, the chance of hitting a collision at random is absurdly low.

MD5 has a 128-bit output, SHA1 is 160 bits. Let's assume that a file being hashed will hash to one of the 2128 / 2160 possible outputs with equal probability, then on average, you expect to find a collision after hashing 2127 / 2159 different files.

Say you filled a hard drive with 512-bit (64 byte) files. You would need 2133 bits = 1.3 x 1027 TB for MD5, or 2165 bits = 5.8 x 1036 TB to store these files. For comparison, it's estimated that by 2020 the human species will be producing 44 zetabytes (4.4×1010 TB) of data per year.

So even if you hashed every file on the planet with MD5, you only have a 1 in 1026 chance of getting a collision by random chance.

To answer your original question:

  To remedy this I thought I would switch to SHA1, but then had the thought that if I compared both, there would be even less chance of collision.
  Does anyone here know both algorithms well enough to confirm or deny this?

Yes, it's true that since they are different hash functions, the chances of there existing two messages which are collisions for both of them is minuscule. Whether it's less minuscule than the chance of collision in SHA-2/256 or SHA-2/512, I don't know. At this point we're debating astronomic probabilities (ie the chance of getting a collision is smaller than the number of atoms in the universe type thing) so /shrug ?

Now, if you are talking about malicious attacks (ie files specifically crafted to fool MD5 or SHA1), then maybe you have a point. ... In that case use SHA2 (which is 256 bits) and you're fine :)


Snort Unable to detect portscans in LAN Setup Information

I am doing experiment on portscan detection using snort 2.9.8.I have 10 systems in my lab with id:1,2,3,...,10.
i have installed snort in my lab-pc with id:1.Now i am using Pc with id:2 to scan the PC's in lab using nmap.

Doubt

When i scan the machine on which snort is installed(id:1),i get the portscan alerts,however when i scan other systems(ex: system with id:3),snort doesnot generate any alerts.

So,why is snort unable to generate portscan Alerts in this scenario?.

(I was assuming that snort monitors packets in HOME_NETWORK in promiscous mode,Kindly correct me if i am wrong.)

I was assuming that snort monitors packets in HOME_NETWORK in promiscous mode,Kindly correct me if i am wrong.

Snort can only monitor packets which can be seen at the network card, even in promiscuous mode. Usually the switch in a network will only send out packets on the port where the specific device is connected. This means that Snort has to be installed on the monitor port of the switch or similar.

See also http://openmaniak.com/snort_other.php


Multiple vulnerabilities scanners at the same target Is it safe/possible to run multiple vulnerabilities scanners on the same target simultaneously?

Yes, using dnmap, it is possible to split a workload.

If you read the URL here -- http://sourceforge.net/projects/dnmap/files/ -- the author gives examples of simultaneous scans that are ok and ones that should be avoided. The general opinion is that running more than one scanner is fine as long as the target ports and/or hosts vary. In other words, if a single target port and a single target host is targeted by each scanner, then the benefits of automation decrease.


XSS prevention by black-listing I have a reflected XSS vulnerability in my Web application.
I have decided to take the black-list approach instead of the popular white-list approach.
My question is can there exist a malicious javascript call without opening parenthesis(\u0028) and close paranthesis(\u0029)?
By malicious, I mean something that can impact the user.
If your answer is YES, then please give an example code that can be injected into an XML.

I found some weblinks which may give you an answer:

http://www.thespanner.co.uk/2012/05/01/xss-technique-without-parentheses/

http://blog.cinu.pl/2013/07/xss-parentheses-and-brackets-filter.html

Let me conclude the answers:

 >

or

 >

However, you can see that Blacklisting doesn't work. The XSS Filter Evasion List shows tons of possibilities how to trick a filter. You should rather escape the input proper.


What is the reason for iOS per-file key encryption? I know that apple provides per-file key encryption .i.e. a separate encryption key for each file exists on the apple device. The Hardware Key and the Passcode are required to generate these random keys.
But once the device is unlocked then all the files can be accessed irrespective of the file protection class which signifies that if I want to read the files from a locked device then I should be breaking the passcode rather than finding the individual keys for all files.
I want to understand what is the actual reason for creating separate encryption key for each file? As there are 4 file protection classes available in ios, is it not feasible to use a single key for all the files belonging to same protection level? With this methodology only 4 encryption keys are required.

File level encryption keys allow each file to be securely deleted instantly, regardless of the file’s size, simply by deleting its key.


Proof that client app is using the recipient's public encryption key I'm trying to implement a web app(lication), which allows to share data automatically with connected users. Data will be encrypted end-to-end asymmetrically on the clients.

My first plan was to share the public key through the app itself, but then I realized that users need some verification that the public key is really from that user. Now I tell them to share the public key via email addresses they already know from each other.

But there is still a security hole:

How could users be sure that my application uses the public key of the recipient? I still could encrypt the message with my own key, intercept it and forward it with the recipient's public key. To withstand tests by security experts, I could do that only on specific users or at specific times.

I'm at the point where I think that it's impossible to encrypt and share data securely in the same app. Thus users have to encrypt data in another app and copy it manually into the sharing app.

Is there a workaround or does it boil down to trust?

The small print

Question "Sharing encrypted data" is similar to this, but I cannot access user's machines and the answers don't question the security of the public key sharing mechanism.

For a user to be able to trust the system, she must be able to verify that the plaintext is handled securely on the client, i.e. that any data shared with another user is encrypted with that user's public key before being sent to the server, that no information about the plaintext is somehow leaked, etc.  This depends on the user (or someone she trusts) being able to inspect the source code of the client, and to be sure that the inspected version of the source code actually corresponds to the client that is running.

Whether a single program or multiple programs by different authors are involved doesn't affect the security in any significant way (a collusion between multiple parties is quite possible).  However, if the source code cannot be inspected, or the plaintext is sent to the server, all bets are off.  Even if the author did not maliciously intend to make the program insecure, there may well be bugs that make the program insecure.

A standard "web application" involves a user's browser running Javascript code downloaded automatically from the server.  While Javascript can perform cryptographic operations directly on the client, thereby avoiding the need to send the plaintext to the server, inspecting the source code is problematic.  The user would need to first download the HTML and Javascript and save it locally, inspect the code, and then run the local version, which is fairly inconvenient.  If the user runs the code directly from the web server (presumably using HTTPS), she must trust not only the operator of the web server, but also the operators of the hundreds of CAs stored in her browser.


How did a malicious website managed to serve me the app that is running on my local apache server? Today I accidentally miss-typed a popular's website domain, which led me to a malicious website. I realized immediately but before I had time to close the tab, I was surprised to be presented with the web app that I am running locally on apache. The webpage was identical to my webapp but all links were pointing to the malicious website.

I do not understand how this can happen. Here is some relevant info:

OS:

Ubuntu 16.04 LTS

Apache version:

Server version: Apache/2.4.18 (Ubuntu)
Server built:   2019-09-16T13:13:53

The web app is a PHP7.0 Symphony web application.

Netstat:

u@u:~$ sudo netstat -apn | grep apache
tcp6       0      0 :::80                   :::*                    LISTEN      9711/apache2

If I am understanding the netstat output correctly, apache is bound and listening to all ipv6 interfaces (I am not sure why IPv4 is missing?)

However I am behind a router which should block incoming connections (I have checked in my router that there are no port forwardings/open ports). I also tried accessing my public IP from a different network and getting connection refused (as expected).

I am very confused (and alarmed) by this. Anybody has some idea how this could happen?

I am happy to provide more info/clarification. I imagine it is not allowed so I will not post the link to the malicious site, although some security professionals might be interested in checking it out?

I was surprised to be presented with the web app that I am running locally on apache.

Likely the name of the domain you've typed resolved to 127.0.0.1, i.e. localhost, and thus access to the domain resulted in access to your webserver on localhost. Since you likely use relative URL's in your local site (i.e. only path but no domain given) all links now pointed to the new domain.

See also Why does localbattle.net point to localhost? and Weird DNS queries to messager.xicp.net for similar questions.


pci compliance and temporary files Does storing temporarily a non-encrypted file containing some PANs violate pci requirements? (for example because it is being processed by an application, or to open it on a file editor)

Yes, it's a violation of PCI-DSS Requirements, specifically requirement 3.4:

Render PAN unreadable anywhere it is stored (including on portable digital media, backup media, and in logs) by using any of the following approaches:

One-way hashes based on strong cryptography (hash must be of the entire PAN)
Truncation (hashing cannot be used to replace the truncated segment of PAN)
Index tokens and pads (pads must be securely stored)
Strong cryptography with associated key-management processes and procedures


Regarding SSL Pinning implementation I have doubt. For android application security which SSL pinning method is good?

Deploying HTTP Public key pinning
Deploying certificate validation using *.bks format along with hostname verifier.

Second one is recommended more for Critical Infrastructure such as Military according to some experts.

In HTTPPubliKeyPinning there is an advantage that I can give an array of numerous public key. So that if one of my certificate gets expires, app will automatically switch public key of other certificate on other domain.

Where in BKS, developer need to append new certificate in APK and have to give client using force update else application will not work.

However, exploit ability metrics has the same time frame. I can exploit flaw 1 as well as flaw 2 using Xposed framework using JustTrustMe application within it. It will require same amount of time and effort. Also in both scenario if hacker successfully repackages application using 1. our public key or using 2. certificate after reverse engineer, he/she will be able to bypass these restrictions. Any other benefit of using second method?. Is there any good method available than this?

So with the accordance of business continuity and security which one is best?

I think you are expecting a protection from certificate pinning which it can not offer. This means that the actual technique used for pinning does not matter at all in your case. Certificate pinning only changes how the certificate gets validated by checking if the public key of the certificate matches the expectation. This check is done either additionally to the normal validation or replaces it.

Certificate pinning does not make your app magically secure against reverse engineering, tampering or shipping of a modified version. It makes it a bit harder for some reverse engineer to sniff and modify the transferred data since one cannot simply add another trusted CA to the trust store in order to trust a man in the middle. But it is still possible to bypass the certificate validation by ripping it out of your application or changing it. Or a reverse engineer could grab the data from your application before they get encrypted and after decryption while keeping the validation in place.

In general TLS does not protect against modifications of client or server. It only protects the transport between client and server against a passive or active attacker trying in between client and server to sniff or modify the traffic. And certificate pinning only hardens this part.


Javascript file detection One common technique I use is xor bruteforcing on binary data. In this case, I would like a heuristic approach to determine whether or not any possible candidate plaintexts are javascript. This rules out the file command in unix like systems because it is merely recognized as ASCII text.

I am looking for suggestions on how to solve this problem (Tools, Techniques, Procedures).

Searching for script headers <script> is a pretty good giveaway, not really necessary, also searching for function-based language with the format ******(***) is helpful. The 'function' declaration is pretty obvious, as is 'var' As far as whether or not it is JavaScript per-se and not a similar language can be a challenging task. Really, though, looking for elements of javascript formatting and syntax that doesn't exist in other languages is going to be your dead giveaway. I have most of my experience with c++, and that's what I would be looking for.

Edit: Also, if it's not valid text it can't be a js, as suggested in the comments. Unless you are looking for compiled executables based on js... in which case... eek.


What does proxyexec + cagefs.server mean in the e-mail X-Source-Args? I've the following headers in the e-mail which I've received as spam:

X-Source:
X-Source-Args: /usr/sbin/proxyexec -q -d -s /var/run/proxyexec/cagefs.sock/socket /bin/cagefs.server
X-Source-Dir: silvianimberg.com:/public_html/wp-content/themes/ultimatum

Can you explain how and why proxyexec/cagefs.server is used?

Does it indicate that the server has been hacked for spam purposes using some loophole on the webserver? Or it's a standard way of sending the e-mails through some CMSes?

This header
X-Source-Args: /usr/sbin/proxyexec -q -d -s /var/run/proxyexec/cagefs.sock/socket /bin/cagefs.server

is standard header in email sent from shared hosting. When I search the keyword /var/run/proxyexec/cagefs.sock/socket via SE search , it pop up in several questions on SO and SF, indicating this header was normal.

I don't familiar with CageFS. But after lurking at some Google Result, CageFS appears to be some kind of container to separating user in multi user environment. It using proxyexec to proxying command invoked from a cage to command outside its cage. Snippet from this page and this page

CageFS is a virtualized file system and a set of tools to contain each user in its own 'cage'. Each customer will have its own fully functional CageFS, with all the system files, tools, etc...
Some software has to run outside of CageFS to be able to complete its job. This includes such programs as passwd, sendmail, etc. CloudLInux uses proxyexec technology to accomplish such goal. You can define any program to run outside CageFS, by specifying it in /etc/cagefs/proxy.commands


Is passlib cryptocontext verify method security for timing attacks? My question is pretty short: is passlib cryptocontext verify method vulnerable to timing attacks, which would an attacker allow to narrow down the real password?

In password hashing and verification the majority of time is done in the computation of the hash. Only a small fraction of time is spend during verification for comparing the computed hash value with the stored hash value. And even this comparison is on basically comparing "randomish" data since they are the output of hash functions. And even if one could just measure the timing of the final comparison from hashed entered password to hashed stored password, it would not help to reverse engineer the original password since the hashes used are non-reversible.
In other words: timing attacks against established password hashing algorithms can not be used to determine the original password, no matter how the actual implementation is done. Additional protection against timing attacks in the implementations is not needed.


Is my IP camera secure? I have recently bought a cheap £20GBP IP camera from an online store.
It is branded as "aobo" but the logo was just stuck on and it appears to be a generic model which I have seen for sale under several different brands.

The camera uses a default username and password and is accessed using an app called "iSmartViewerPro". There appears to be nowhere in that app where you can change the username or password and once the app is connected to the camera it is possible to view and control the camera from anywhere (even when not on the same network).

I have connected to my router to get the local IP address for the camera and I have tried to access that address in my browser, I am presented with a login box :

  The server ##.##.##.## is asking for your username and password, The server reports that this is from IPCamera Login.

I tried the default username on the camera but that is not accepted - so it appears that there would be a different login for the web interface.

So, my question - should I be sceptical about this camera? How am I meant to know that it is secure / or is there anything I can do to restrict access to it?

As you've identified it has unchangeable default credentials, this is the point i'd unplug and throw it away. Your alternative is to firewall it off, make it accessible only from your own private network and VPN in to your network to use it.

You may find this interesting https://www.exploitee.rs/index.php/AOBO_Hidden_Spy_Camera_720P

As well as default creds, it has open telnet and ftp and creates its own wireless access point. So to answer your question, no, this is not secure.