Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 09:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Thema Sicherheit

Discussion on Thema Sicherheit within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
Legithos's Avatar
 
elite*gold: 95
Join Date: Nov 2009
Posts: 669
Received Thanks: 47
Thema Sicherheit

Hallo liebe Community,

ich hätte da noch ein paar Fragen zum Thema Sicherheit.
  1. SQL Injection


Reicht es wenn ich mit PDO und prepared statements arbeite, um SQL Injection komplett zu verhindern ?
  1. Session Hijacking

Reicht es aus, wenn ich lediglich für den Angreifer irrelevante Informationen wie zb die User ID oder den Username speicher ? Oder sollten selbst diese verschlüsselt werden ?

Dankeschön !
Legithos is offline  
Old 02/24/2020, 15:50   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 166

Session Hijacking

There are many ways to hijack a session, to list a few:
  1. Stealing cookie
  2. Guessing session ID
  3. Stealing credentials

Stealing cookie
An attacker can steal your session cookie if:
[SOLUTION]
-Use SSL
-Sanitize your urls, look for exploits in your own code
-Ask for a login when making something that could cost money.

Guessing cookie
As the name suggests, if your sessionID is not long enough or in the worst case scenario, uses weak RNG, it is likely that an attacker could just generate lots of sessions to check for patterns, then exploit your RNG and guess your next session, or if lazy, just generate a bunch of them and try.

[SOLUTION]
Use strong session ids, generating them manually is a bad idea, use generators that are already there.


Stealing credentials
There is not much you can do about that, people are stupid and will always open shitty emails that could compromise their credentials.
[SOLUTION]
Two factor autentication. If your user is stupid enough to get its credentials stolen, then using two factor autentication will prevent an attacker to login with those credentials. But if the password is the same as the one for the email, well ... Time to find new users
IP check. Your user always loggin from US, but two seconds ago it tried to login from CHINA, then block login and send email with steps to proceed if it was him.


Sorry for not knowing a lot of SQL injection to answer you question, maybe someone else could help.
I don't understand what you mean by storing userID, what type of session are you using, if it is JWT, don't store sensitive data, and make them expire in 1 or 2 days, or less if needed.
You can view the contents of your token in:
But don't worry unless they steal your secret you are okay.


[JWT]
-Steal from localstorage: cross-site script most common method.
-Steal from cookie: Same as explained above
-Steal your private secret: You are screwed, you secret is compromised an attacker could do whatever he want, go quick change your secret and restart your server now!
elmarcia is offline  
Thanks
2 Users
Old 02/26/2020, 04:57   #3


 
iMostLiked's Avatar
 
elite*gold: 1337
Join Date: Apr 2013
Posts: 6,487
Received Thanks: 3,186
Quote:
Reicht es wenn ich mit PDO und prepared statements arbeite, um SQL Injection komplett zu verhindern ?
Du solltest prepared statements und parameterized queries nutzen. Ob PDO oder MySQLi ist Wurst.

Beispiel mit PDO:
Code:
$query = $db->prepare('SELECT * FROM user WHERE username = :username');
$query->execute([
    'username' => $username
]);
Beispiel mit MySQLi:
Code:
$query = $db->prepare('SELECT * FROM user WHERE username = ?');
$query->bind_param('s', $username); // [s]tring

$query->execute();
Ich persönlich empfehle MySQLi. (implizierend du nutzt eine MySQL Datenbank)
iMostLiked is offline  
Reply


Similar Threads Similar Threads
[Suggestion] #Closed Thema sollen Gelöscht werden ! & Alta Thema
08/31/2014 - Suggestions & Feedback - 2 Replies
Hallo Epvp Members In Wolfteam Theard gibt es viele #Closed Thema (Alt,Spam oder Request) Was mich daran nervt das diese #Closed Thema ganz an der Top ist und da geht jeder mal rein und schaut um was handelt es sich aber dann findet es #Closed. Also wieso löschen die Mod oder Admin die #Closed Thema einfach nicht ? und das selber an die Alten Posts die von 3 Monate Inaktiv ist soll weg gelöscht bevor ein Idiot (Tut mir leid xD) es wieder nach oben auf Push und dann glaub noch jemand das...
Suche gute Filme | Thema 1: Drogen-Dealer'ei | Thema 2: Gefängnis oder Fight Movies
03/17/2014 - Movies & Series - 20 Replies
Topic Thema 1 Drogen-Dealer'ei Thema 2 Gefängnis oder Fight Movies || Fight zB wie : Never Back Down, Phil Kid; Danke schonmal (:
Thema Sicherheit
10/04/2010 - WoW Private Server - 2 Replies
Ich habe es nun doch mal geschafft etwas zu Dupen nun ist meine Frage kann man es nachvollziehen den ISF bzw kann ich drauflos dupen ohne große angst um meinen Account haben zu müssen? Greetz :>
Umfrage zum Thema:"Sollten alle ein neues Thema erstellen können?"
05/13/2010 - S4 League - 21 Replies
Wie gesagt:" Sollten alle ein neues Thema erstellen können?" -Denn ,viele erstellen ein dummes thema,das einfach alle aufregt und eh geschlossen wird. -Oder z.B Resource tool:Ein Leecher hat das Resource Tool und verbreitet das durch ein neues Thema,und alle Noob und Leecher haben den Tool. Die Idee: Die Elitepvpers-"Experten"-sollten das Thema erstmal überprüfen,bevor es "öffentlich"gemacht wird,so könnte man wie z.B Resource Tool,die Leecher-/Noobfragen verhindern.Und es würden...



All times are GMT +2. The time now is 09:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.