Simple ASP.NET Web API to demonstrate acquiring logins from keylogger.

Simple ASP.NET Web API to demonstrate acquiring logins from keylogger.

How to USAGE StoleYourScribbles.Web.dll
Introduction
You have written functions in a DLL that you want to call through a webservice.
Here are the steps to follow:
+ Decide on the packaging
+ create empty Web Service Application Project.
+ Change Web Service Application Project to .NET 4
+ Add Web Service Classes
+ Reference your DLL’s from Web Service Application Project.
+ Write web methods to call your DLL’s functions.
+ Publish webservice application to file system.
+ Install the webservice project in IIS.

a. Decide on the packaging
Webservices are classes with methods so decide if you want to mirror how your current DLL’s are packaged or have something different. You can have a separate webservice for each method call or can group into like functions. You must also decide on the namespace that you want your webservices to have, but not to worry, if in doubt use the name of your company.org.

b. Create empty Web Service Application Project
+ Open the solution that contains the DLL that you want to convert into webservices.
+ Add a New Project by right clicking your solution selecting Add and then New Project. The Add New Project Dialog Box will appear.
+ Select Web as the Installed Templates list (Left Hand Side of screen). Web Project templates will now appear.
+ At the top of the screen change to .NET Framework 3.5. This will reveal extra templates.
+ Select “Asp .Net Web Service Application”. Name box will change.
+ Put a meaningful name into the Name box. The name of the project will not impact the webservice behaviour but you shouldn’t try to change it later as it impacts the assembly name which is referenced in each webservice you create so get it right the first time.
+ Click Ok Button. This will create the web service application project.
+ Delete Service1.asmx as this service name cannot be modified just by changing the name so it’s not worth bothering with it. You will now have an empty web services project.

c. Change Web Service Application Project to .NET 4
Your DLL will be written in Framework 4 but your Web Service project is currently Framework 3.5. You must change to .NET 4 else you cannot reference your DLL. We only changed to 3.5 so we could see the project template but now that we have it no more need to stay in .NET 3.5.
1. Double click on My Project in Web Service Project. MyProject window will appear
2. Click on Compile tab. Compile window will appear
3. Click on Advanced Compile Options button. The Advanced Compiler Settings window will appear.
4. Change the Target framework to .NET Framework 4 and click ok. The Target changed dialog box will appear.
5. Click Ok. You are now in Framework 4.getstarted01

d. Reference your DLL’s from Web Service Application Project
Just reference the projects from the Web Service application project. If you cannot do this without instruction then you shouldn’t be reading this. Hint is right click References and add from project.
+ Double Click on My Project. MyProject window appears.
+ Click References Tab. List of references appear.
+ Click Add Button. Add Reference dialog box appears.
+ Click on Projects Tab, select your projects and click Ok. Return back to MyProject window.
+ Check the checkbox in Imported Namespaces so that you can import the namespace.
+ Highlight the Web Service Project, right click and click Add New Item. The Add New Item dialog box will appear and should already have Web selected as a template list.
+ Select the Web Service template and enter a meaningful name. Remember this name cannot be easily changed without changing hidden files etc, so make the right choice from the beginning.
+ Click the Ok button. An empty file will appear with the HelloWorld webmethod and the tempura namespace.
+ Change namespace directive and also delete the Public Function Hello world leaving the <WebMethod()> _ attribute for use later.
+ Repeat this process until you have created all the webservices that you want.

e. Add Web Service Classes
+ Highlight the Web Service Project, right click and click Add New Item. The Add New Item dialog box will appear and should already have Web selected as a template list.
+ Select the Web Service template and enter a meaningful name. Remember this name cannot be easily changed without changing hidden files etc, so make the right choice from the beginning.
+ Click the Ok button. An empty file will appear with the HelloWorld webmethod and the tempura namespace.
+ Change namespace directive and also delete the Public Function Hello world leaving the <WebMethod()> _ attribute for use later.
+ Repeat this process until you have created all the webservices that you want.

f. Write Web Methods that call your DLL Functions
Each method that you want to reference in your DLL will have the same parameters in the Web Service class, as a web method. Just put the <WebMethod()> _ attribute above the method call and then inside that method New up an instance of the class that you want to call and then call the method that you want, passing the parameters that you have declared in your web method to the real method. In effect the web method is simply calling the DLL and returning back the same responses. I think it is best to keep this layer simple and if you want to change the parameters or logic then do that in the method itself rather than the web method.

g. Publish webservice application to file system
+ Right click Web Service Application and click publish. Publish Web screen appears.
+ Select FTP, Choose Publish method of File System, type in a Target Location, click Replace matching files with local copies and click Publish. This will build the project and then place the files into the Target Location.
+ Open directory in the Target Location and copy everything in that directory into your clipboard.

h. Publish in Internet Information Serve (IIS)
Create a web application, specify the virtual directory, copy the files into that directory, make sure the app pool is dot net 4.0 and you are finished.

build:

Download : StoleYourScribbles.zip
Source : https://github.com/hyndsite