Tor hidden service - programmatically add a service without using the torrc file - tor

I know how to setup a hidden service in the torrc file and it works, I am very new to this. if anyone could point me in the right direction I don't mind the hard work to learn something.

To programmatically create a hidden service, send the ADD_ONION command to the Tor controller. This requires that ControlPort is set in the torrc file and that you have set up some form of authentication.
For details, see ADD_ONION from Section 3 (Commands) of the Tor control-spec document.
The Python stem library supports this and has examples: https://stem.torproject.org/tutorials/over_the_river.html#running-a-hidden-service
In PHP the torutils library has an example here: https://github.com/dapphp/TorUtils/blob/master/examples/tc_CreateHiddenService.php

Related

How To ADD Firefox Default Applications

So I'm trying to find a way to add default file extensions options to Firefox. Since for whatever reason it doesn't give you the option?
Example: Settings > General > Applications
I want to add new content types and then be able to select my default application of choice.
The current issue is, that I use an MSP client that when necessary allows us to remote into a client's workstation for troubleshooting. Normally one would just click on the "Start Remote Session," button, and it brings up the application to do so. However, since it operates in some form of Javascript (I think....?), it doesn't technically download a file for me to save and then execute through the app. It just opens the app automatically. It never gives me the option to save the a file or anything like that, that it would use for the Remote Session app.
So I want to figure out how to bypass this issue by just adding the extension needed for this process in Firefox's default content types.
Works on Windows, I'm currently on Linux. (So please don't tell me to not use linux or any form there of. That or to use wine or playonlinux. I already am)

Python 3 SharePoint CSV Retrieval

I'm relatively new to Python and have been left scratching my head now for a few days whilst trying to resolve what I feel should be a relatively straightforward task.
The aim is to connect to a corporate SharePoint site (i.e. xxxxx.sharepoint.com) and download a CSV file that's stored there to somewhere on the network (or even local system).
The file can be found in the following location. If I copy and paste it in to a the web address field it downloads the file perfectly:
https://xxxxxx.sharepoint.com/sites/MSS/im/pa/ReportData/DirectorMap.csv
However, try as I might, I cannot seem to download it via a Python script. I believe we are behind a proxy server (no credentials required):
https://example.proxy.com:8080
I've tried using requests, requests_ntlm, sharepoint, urllib3 etc etc but constantly get a "403: Forbidden" error. I have tried passing it my own credentials (and given the file was created by myself on SharePoint I can't see that it would be down to me genuinely not having access).
Is anyone able to post a script that will achieve my aims, based on the proxy and url I've posted above?
Sounds like your python isn't picking up the assumed Windows proxy environment (presumably you are behind something like a corporate firewall).
The solution is to use cntlm which will allow you to tunnel your existing connections through a local proxy.
See this Q&A for more info on setting CNTLM up

Opening a website automatically using secure code

I want to open a website(say www.google.com) automatically whenever I am logon. This can be achieved through batch script and VBA macros but it can not be implemented on organisational level due to security concerns.
Is there any secure way to open a particular website using some piece of code.
Please let me know. Thanks in advance.
Regards,
Shrikant Salunke
There are lots of ways to do this, but I'm not sure exactly when you mean by "whenever I am logon".
Basically, if you want the most portable, multilingual way to open a web page with a program you are going to be passing a shell command that looks like this (following your example)
open https://www.google.com
This will open the specified URL (I think it must be a complete URL - including scheme) on the default browser.
Now the "when I am logon" part is what could make things complicated.
If by "when I am logon" you mean whenever you open your browser, then you don't even need to do this you can just reset your browser's homepage.
If you mean whenever you logon to your proxy, you just have to make sure that the first proxy request you send contains the correct request URI. In the case of google the correct URI would be google.com:443. The URI will have the format <hostname>:<portnumber>. The default HTTPS port number is 443. The default HTTP port number is 80.
If you mean whenever you logon to your system then you just need to execute the command open https://www.google.com within a login shell script. Login scripts are system dependent but you may refer to this post if you use a Unix-like or Posix compliant OS. If you use Windows I don't know how to help you but I'm sure there's a way to do it.
If you mean whenever you log into some program you wrote then things get really easy. You just have to make a call to that open command. Almost every language has a built in method for interacting with a shell. You just have to find that method in whatever platform you're using.
I honestly don't know if this will be helpful but good luck!
Edit
How to Run a Batch Shell Script Securely
What you need to do is run the script with a different trustlevel. Since you're using Batch you can do this by executing your script using the runas command (docs). This command allows you to adjust the trustlevel under which the script is executed without changing users. By changing the privileges of the executable, you can prevent it doing anything malicious. All it needs is enough "trust" to execute the open command.
If you need this fully automated throughout your organization, you can wrap your Batch file in a second Batch file that will call the runas command. This wrapper script will not run with reduced privileges but it also won't interact with the internet so you don't have to worry about it as much. You would be able to execute the wrapper script as a login script, and then everything should work.
Honestly I'm not a Windows person but I hope this helps!

Wix Webapplication: How do I add an extension without replacing all existing mappings?

I'm trying to add a .plan extension to our IIS 6.0 website through WiX. I'm using
<iis:WebApplicationExtension CheckPath="no" Script="yes" Executable="[FRAMEWORKROOT]v4.0.30319\aspnet_isapi.dll" Verbs="GET,HEAD,POST,DEBUG" Extension="plan"/>
Although this is replacing all of the existing application extensions, which is not the behaviour that we want. Is there a way to simply add .plan? We would like to avoid using the Wildcard if possible as we're not sure how it will affect the rest of the site. I don't think that APPCMD is available on our 2003 server either.
Any suggestions would be greatly appreciated :)
Unfortunately we didn't find a way to do this cleanly using the iis:WebApplicationExtension in WiX.
We found this post http://blogs.msdn.com/b/david.wang/archive/2004/12/02/273681.aspx that provides a VBScript for adding ScriptMaps. We edited the script to only execute the HandleListOps function (with the relevant params) so that we didn't get any issues with WScript. We then call this from a CustomAction in WiX, with the vbs file added as a Binary file.
We're aware that running vbscript custom actions from within an installer isn't ideal, but luckily we're not distributing the application externally and is only going to be used on an internal website, so the target server environment is reasonably well known.

How to turn off Internet Explorer enhanced security settings in Azure

My site is hosted on Azure. I need to programmatically turn off Internet Explorer's default enhanced security configuration settings whenever I repave or redeploy a new box on Azure.
How do I do this?
I found this article on another site http://jetlounge.net/blogs/teched/archive/2009/10/25/fix-ie-esc-won-t-turn-off-internet-explorer-enhanced-security.aspx. It included the following command line syntax, but on my local box I couldn't find the IEHARDEN.INF file it referred to. I also don't think this solution is Azure-specific.
rundll32.exe setupapi.dll,InstallHinfSection IESoftenAdmin 128 %windir%\inf\IEHARDEN.INF
I need to turn off these default hardening settings under Azure because I have a 3rd party IE screen capture DLL that needs to execute Javascript on webpages.
I think that this approach, shaped in a Windows Azure StartupTask running in Elevated execution context will help you.
Just remember that the .bat or .cmd file you create needs to be UTF8 encoded. There used to be some issues with the batch files if they are not UTF8.
UPDATE
I decided to update the answer, because it would have been too long for a second comment. I want to first make clear that I do not intend to offend anyone and the next is just mine personal view and thoughts.
Well, I mine vision might be (is) distorted through mine prism. But, I think that these specifics has nothing to do with Windows Azure itself.
These are OS related configuration specifics and the approach would be one and the same (with some variations) regardless of a (hosting/cloud) provider. If you had to deploy your solution to a dedicated (or virtual) server, you would had to create some kind of scheduled task, or startup task to make these configuration changes. Or even interactively login to make these changes.
Since Windows Azure offers the StartUp Task, it is up to us (developers) to decide what to do and how to shape the OS according to our needs.
The OS configuration changes that one can possibly need are only limited by the total ammount of all available Windows Server 2008/R2 configuration options. I personally do not believe that these needs to be reflected in Windows Azure documentation by any means. They have their place in Windows Server documentation. It is arguable which are "commonly used", because what might be common for one, might also be "never needed" for others ...

Resources