security

ssh packets sniffing from my router with scapy

本小妞迷上赌 提交于 2020-01-07 05:12:09
问题 I want to sniff ssh connection to any pc on my network. I have scapy on my router and I would like to get a sniff result whenever someone connect to any of my pc in my network using ssh. This what I did by I have no result. #!/usr/bin/python from scapy.all import * def sniffSSHRequest(): sniff(iface='eth0', filter="tcp and host 192.168.1.2 and port 22", count=1) sniffSSHRequest() Note that all my pc can ping the router and they can also ping each other. The question is why don't I get a sniff

Run Java code on my own JVM

Deadly 提交于 2020-01-07 04:56:06
问题 In another discussion, someone say something about run the java code on its own jvm, which ignores SecurityManager. Is it possible? (and as easy as saying?) 回答1: Yes it is possible. You can download a JVM open source implementation, modify it to ignore the security manager and build it. But I think this is not an easy task. This sun forum may help you 回答2: Google "java security policy" for directions on setting up the security policy for your own jvm. You can change the rules about which

asp.net MVC secure root folder only for authorized users

假如想象 提交于 2020-01-07 04:44:06
问题 I am having this small extranet service where users can log in, get all sorts of info and download few files. Is it possible to secure root folder in MVC asp.net project? I am having a project where users have to log in before using any material. How ever if I use for example "/material" folder for every pdf, jpg, etc. files, other unauthorized users can see those files also. For example everybody can see this file if they type www.example.com/material/pdf-file.pdf So I want only authorized /

How can I prevent SQL injection in PHP?

天大地大妈咪最大 提交于 2020-01-07 04:19:32
问题 This post is a Community Wiki . Edit existing answers to improve this post. It is not currently accepting new answers. If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the user can input something like value'); DROP TABLE table;-- , and the query becomes:

How to run PHP exec() as root?

泄露秘密 提交于 2020-01-07 02:48:11
问题 I'm trying to build a firewall manager in PHP, but when I execute, <?php exec('iptables -L'); ?> , the result array is empty. I have tried, <?php echo exec('whoami'); ?> , and the response is www-data (the user that Apache is using). What can I do to execute the exec function as root? (Preferably without changing the Apache user.) 回答1: Don't do it! You will leave yourself wide open to all sorts of malicious hackery. Have a look at the "sudo" documentation. You should be able to set up all the

what are the java* configuration for oauth2 to return token after authentication

余生长醉 提交于 2020-01-07 02:43:06
问题 Hi I am using spring boot for my project so I am not using xml for any of my configurations, only java. I am using this project on github as a reference https://github.com/techdev-solutions/jaxenter-showcase . When I make a request(http://localhost:8081/oauth/authorize?client_id=web&response_type=token with username and password in header) for the token it returns the redirect html site not the token.. How do I configure oauth2 to return the token in the response. If I send a request using

Security vulnerabilities in php fwrite?

让人想犯罪 __ 提交于 2020-01-07 02:31:17
问题 I recently transitioned my companies website over to our in-house servers (Apache) from a hosting companies (IIS). The group that originally built the site did a piss poor job and the entire thing was a mess to migrate. While the move went fairly smoothly, looking at the error_log there are still some missing pages. Rather than having to continually grep through the error_log for "File does not exist" errors relating to this domain - we have about 15 or so we host on these servers - I was

SSL connection in JavaScript

心已入冬 提交于 2020-01-07 02:22:08
问题 Is it possible to establish an SSL connection from a JavaScript? Or directly in Phonegap? I don't find any information about that. 回答1: Reading behind the lines, it sounds like you're having trouble making a request over SSL with Phonegap. Phonegap does not allow secure requests to a web service that has a self signed cert. 回答2: Not directly, at least not if you're talking about client-side Javascript (as opposed to something like node.js). However, as the otehr comment noted, HTTPS used SSL

Django sql injection protection

China☆狼群 提交于 2020-01-07 01:39:33
问题 Is it necessary to do custom cleaning of form data received from fields where the user is limited to selecting from pre-defined valid choices? For example radio buttons, choicefields, etc. I have a situation where a database select is performed but the columns used in that select are defined by the user. The user is presented with pre-defined valid choices (radio buttons, choicefields) which represent table columns. When that form is received do I need to do custom cleaning of that data to

Django sql injection protection

假如想象 提交于 2020-01-07 01:39:10
问题 Is it necessary to do custom cleaning of form data received from fields where the user is limited to selecting from pre-defined valid choices? For example radio buttons, choicefields, etc. I have a situation where a database select is performed but the columns used in that select are defined by the user. The user is presented with pre-defined valid choices (radio buttons, choicefields) which represent table columns. When that form is received do I need to do custom cleaning of that data to