injection

Injecting Log4J loggers with Spring

Hi, I have a spring 2.5 webapp with the following web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>Spring ...

Conditional summarizing via inject

How to get the index of item in: my_array.inject {|rs,item| rs += item} I need to summarize all except the i-th element. ...

If I only sanitize GET and POST data, will I be safe from injection?

I'm just thinking about the best way to go about sanitizing my data to prevent injection attacks. Some people like to sanitize immediately before output, or immediately before insertion to the database... but the problem I see with this is twofold: (1) what if you miss a paramater/variable? (2) what if you're over-sanitizing? Not that it...

Problems on injecting into printf using LD_PRELOAD method

Hi Experts, I was hacking printf() of glibc in one of my project and encountered some problem. Could you please give some clues? And one of my concern is why the same solution for malloc/free works perfect! As attached, “PrintfHank.c” contains my own solution of printf() which will be preloaded before standard library; and “main.c” jus...

Mysterious url in our html website

Dear Community members, The home-page of our static html website http://www.iffort.com is transferring data from a mysterious website rawalrohi.com. You can check this by going to iffort.com and noticing the footer there. It says transferring data from rawalrohi.com. From our side we did the following things to rectify the issue a.)...

How does container injection of annotated private class attributes work in java?

I've started reading the Enterprise Java Beans 3.0 book by Bill Burke and Richard Monson-Haefel and in chapter 4 it has this code @PersistenceContext(unitName="titan") private EntityManager manager; The class then has methods that access this field (which is never set in the constructor and has no setter method). So how does the conta...

Java: What is the fastest way to inject fields using reflection?

Hello, everyone! Suppose, I have a lot of classes, which are constructed using Java reflection (for some reason). Now I need to post-inject values to fields, which are annotated with @PostInject. public class SomeClass { @PostInject private final String someString = null; public void someMethod() { // here, someString has a...

Sanitize Input for UniData

Can anyone provide a function to sanitize input for a UniData query? Or provide a list of things to remove? ...

strange markup in HTML (HTML_ATR HTML_ELM, SYN_ROW, JS_KEY, etc..)

I've build a website for a client and as we all know 'it works just fine on my machine' :-) as it does on several machines at my clients location. But they have (so far) 3 pc's on wich some errors occur, like cannot find ElementById. These machines are normal up-to-date windows machines running IE8. When comparing the html-source of th...

Parse out javascript injection during JSON deserialization.

I need to scan inbound string properties sent to a C# coded web server. The scan should strip out any JavaScript injection threat before my web server stores client supplied data in a database server-side. All of these inbound strings will be properties within json data structs. It occurs to me that the ideal and most reliable place to...

Iframe Injections in Websites

My website has been compromised. Some one have injected some iframe markup in my website. How they have done this? Only on my index.html, index.php page. But I have blocked write permissions for this page, then how they able to write in my pages. Will it effect other pages on my server? Is there any other solutions to block this? ...

Constructor injection with other, non-dependency, constructor arguments

I'm new to IOC containers, and I'm getting started with NInject. What do you if you want your constructor to have parameters that are not services and don't need to be instantiated by the IOC container? For example: public class Person { private readonly string _name; private readonly IPersonRepository _repository; public...

Position An Injected DIV Using JQuery's "Load" Function

I'm pulling some info from a database then putting it into a DIV and injecting all that in to my page. The problem I have is positioning the newly injected DIV after it has finished loading. Here's my jQuery: $j(document).ready(function() { $('a#load-content').click(function(event) { event.preventDefault(); var productId...

C++ Dll Injection

Hello everyone, I would really appreciate your help in this. I have been trying to get a Dll injected into a remote process and do a few changes inside it, the problem I'm encountering right now is i don't know how to get this going. So first, here is my piece of code that I have developed so far: dllmain.cpp #include <windows.h> #inc...

Detecting Process Creation

I need to detect process creation of a third-party .NET application. My goal is to inject a plugin DLL to enhance functionality of this application. I would prefer to inject this as early as possible so I can catch the application's initialization events. Is there any way to detect when this process is created and inject the DLL before M...

secure email form, header injection query

I'm using the following to clean up input from my contact form: <?php $name = strip_tags(stripslashes($_POST['name'])); //this is repeated for several other fields, then: if(isInjected($name)) { die(); } /* see isInjected function below */ // send the mail ?> I'm using this function: <?php /* function from http://phpsense.com/p...

Manipulate .NET bytecode - JIT regeneration?

Is it possible to manipulate the bytecode of a (signed) .NET program at runtime? E.g. by forcing the JIT to re-evalutate the IL? ...

SEAM: Component "disinjected" "too soon" in interceptor?

Hello, Let's say I have the following interceptor in a SEAM app: public class MyInterceptor { @In private Monitor myMonitor; @AroundInvoke public Object aroundInvoke(InvocationContext ctx) throws Exception { try { myMonitor.a(); return ctx.proceed(); } finally { myMonitor.b(); } } } myMoni...

My Joomla site got hacked. Is database also corrupted?

The only php page that I see with the code is the index.php, so I replace it with a backup and everyday I see it change to: Parse error: syntax error, unexpected '<' in /nfs/c05/h02/mnt/73056/domains/essinteractive.com/html/index.php on line 93 I am in the process of deleting the site and reinstalling Joomla with all its plugins. Wil...

What's the best way in Ruby to clean up a user-provided url string so that it's safe to interpolate into a shell command?

I want to let a user of a web app enter a URL and then pass that URL onto curl. I'd rather use curl than Net::HTTP or open-uri. But this poses a security risk. What's the best way to check the URL string and prevent any injection attacks? I'm thinking of just using a regular expression like this to check for an injection attack: raise...