Cannot write applicationHost.config - iis

I am trying to deploy an application and I get the following exception
System.Runtime.InteropServices.COMException (0x800719F3): Filename:
\?\C:\Windows\system32\inetsrv\config\applicationHost.config Error:
Cannot write configuration file
I have many applications already hosted on the same server and have never faced the same issue. I am unable to create AppPool manually as well.

Something that you could do is go to inetpub/history and try using an older file that is not corrupt (you can use notepad++ to compare both for example).
Take care with the modifications directly on the file and the encoding used when editing .. I would recommend doing the changes via GUI or APPCMD/PowerShell to prevent this.

Related

Amazon Echo Lambda Function ZIP issue

So, I'm trying to invoke a Google Could Messaging service from Amazon echo, using NodeJS (using mac os x).
Since my main.js file contains 3rd party libraries, I installed them with
"npm install" command. I'm using the following libraries for sure:
https://github.com/ToothlessGear/node-gcm for NodeJS Google Could Messaging
async
When I made my ZIP file and uploaded to amazon lambda, I got the following error message:
It looks like your Lambda function "oAa" is unable to be edited inline, so you need to re-upload any changes. This may be because your file is too large or your zip file contains more than one file to edit. However, you can still invoke your function right now.
The ZIP file isn't large, it's only 1.5 Mb. I assume I have this error, because the file contains all the libraries I need, with more than one js file.
I've attached the folder structure of my ZIP file. It contains from one file and one folder. I have one file in the main folder, and a tons of libraries next to it (inside the second folder).
UPDATE
this is the error message what I get:
{
"errorMessage": "Exception: TypeError: Cannot read property 'application' of undefined"
}
and this didn't work as a solution:
https://forums.developer.amazon.com/forums/message.jspa?messageID=18330
Did any of you met with the same issue in the past? May I kindly ask for your help, guys ?
Thanks,
Karoly
I got it to work by not zipping the directory (and contents) but by adding the contents of the directory to a zip archive. Basically, I removed the upper level directory. AWS Lambda's UI was able to locate my .js then.
It's hard to tell what exactly the problem is with Alexa, did you make sure you filled out the configuration and event sources tab correctly (this would be under the AWS part). Did you update your application ID? This is the biggest pain in the butt. Did you just upload your zip folder and click test? (which is incorrect).
I don't think this is an error, per se. I get this frequently and my skills still work without problem. I believe all this means is that "your Lambda function xxxx is unable to be edited inline". You will have to continue editing in an external editor and uploading the zip instead of being able to edit in Amazons lambda text editor.
I think the TypeError in your update is an unrelated issue.
I was receiving this error and solved it by looking at CloudWatch logs. You will see much more detailed error messages in there, and a log will be created each time you try to run your function.

executing a script uploaded through file upload in public folder

We have to fix some security vulnerability in our system, and one of the items is to: disable execution of uploaded scripts/exe's through file upload control.
We have excel upload facility. Lets say hypothetically hacker changes the .exe to .xls and uploads it (there are ways to block that, but ignore that for now). Also assume that
the upload folder is within pubilc directory from where the website is installed in IIS. OR
Someone can access that file by specifying a full path of file thru some api endpoint of which hacker is aware of
Now given that there is an exe or a script which is accessible to the hacker through above means, is it possible for hacker to run that script/exe in someway, so that it can cause harm to the server where the site is hosted?
I am not really security expert hence cant think ways how that can be possible? How a hacker can remotely run exe/script on server, given that they does not have any access to the server.
One of the things that you should definitely do is to remove IIS handlers permissions from running scripts, otherwise anybody can upload a ".asp" or a ".aspx" or any other script engine file and then execute it by requesting it. One simple way to test that is just create a "test.asp" file with "<%= Now() >" and if that returns you the date, then anybody can upload scripts and run them in your server.
The way to disable that in IIS 7+ would be to add a configuration file in a parent directory and edit the permission for handlers, for example assuming a child folder called "public" you can drop the following web.config to disable that:
<configuration>
<location path="public">
<system.webServer>
<handlers accessPolicy="Read" />
</system.webServer>
</location>
</configuration>
You can test then that it should no longer execute the file and instead block it. If you want to allow download of them, then you'll need to configure the static file handler (and request filtering) to handle everything instead, but make sure you do that for that folder only since you don't want people downloading your source code.
Running the script would require remote access to the server, either directly or by exploiting some bug in the website code (similar to SQL injection). The risk here is mostly in hosting malware, especially if you allow user uploads to be downloaded by other users. While getting malware onto a machine is not as simple as just renaming an executable to another file type (it still has to be run as an executable rather than an Excel spreadsheet, for instance, to be able to function), it is possible to embed malware in various types of files, such that the act of opening that file causes execution of the malware. In that sense, you really can't tell at a glance whether a file is malware or not. It could look like an Excel file even open up properly in Excel, but still wreck havoc. The only way to be safe is scan all user uploaded files with a good antimalware application.
As far as running something remotely goes, though, the access to the server required to run the script would provide a much better avenue for mischief that your upload form, anyways. So anyone who could manage that kind of access isn't going to be trying to exploit you through your upload form, and anyone who uploads something malicious without that access can't really do anything.

IIS7 File already in use

Recently I've installed IIS7, but when I try to edit ANY file inside my wwwroot and save it it keeps giving me an error 'can't save file, file is already in use'. Even if I make a new .txt file and try to save it I get the same error. It's really getting annoying.
Been trying alot but I really can't figure out.
Stop your website in IIS Manager if you want to edit the files.
A better approach in the long run is to use FTP to edit your files rather than working directly on your web server.

JFolder::create: Could not create directory Warning: Failed to move file! (Joomla + Windows Azure)

I installed Joomla on a website on Windows Azure. After trying to update the Joomla version or uploading a new template I get the following error
JFolder::create: Could not create directory
Warning: Failed to move file!
For me it's clear that the problem is regarding permissions, so the question is, how can it be solved?
Since the Azure architecture (basically the replication) makes you difficult to just change the permissions of the folders, and it is not possible to modify the folder permissions on a Windows server using FTP, I feel like I'm on a dead end.
It should definitely be possible. When installing a component JFolder::create is called several times.
I think that you are passing a wrong path or something to the actual call. Have you tried a simple test using the native mkdir()?

Win32: HtmlHelp doesn't work from a network share. What's the alternative?

Since 2005, when Microsoft prevented HtmlHelp functioning off a network share, e.g.:
\\appserver\tos\PointScanner.exe
\\appserver\tos\PointScanner.chm
What are we supposed to do instead?
(Given that the application is not installed locally.)
To rephrase: What is Microsoft's intended, supported, out-of-the-box, help solution?
You can allow access via the Registry setting described here:
http://support.microsoft.com/kb/896054/
If you don't want to open any security vulnerabilities by modifying Registry settings your application could also create a local copy of the .chm file, e.g. in the users temp folder (%TMP%) and open the help from there. You can remove the file again when your application exits (in case you don't want to leave anything behind on the user's workstation)
I started with the registry change mentioned by divo. Eventually I moved from network folder based chm files to actual "html help". This was easy for me since I use RoboHelp which can generate either format from the same source code.

Resources