top
netstat --inet
ps -a --forest
rkhunter
chrootkit
logcheck
tiger
Filter
2008-04-13
Säkert Linux
Security
2008-03-24
Safe escaping input for mysql
Php
// Any data run through this function
// should be safe to use in a query...
function escape_data($data) {
global $conn; // db connection
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data); // don´t over-escape
}
return mysqli_real_escape_string($conn, trim($data));
} 2008-03-14
Meta Tags Optimisation
SEO
<meta name= "description" content="Short desciption of my site" />
This tag is used to give a short description of the contents of your web page, and is often used
by search engines in the search results as a description of what your page contains. However,
many search engines will only display the first 20 characters, so be as short and descriptive as possible.
<meta name="keywords" content="unique, specialized, search words" />
To help get your web site up in the ratings you can supplement the title and description with
a list of keywords, separated by commas, that some one might type into a search engine when
looking for a site like yours. Most search engines will index the first 64 characters in this Meta tag.
<meta name="rating" content="general" />
This is used to give the web page a rating for the appropriateness for kids. The ratings are
general, mature, restricted, and 14 years.
<meta name="author" content="My name" />
This is used to identify the author of the web page.
<meta name="copyright" content="2008, My Company" />
This one identifies any copyright information there is for the web page.
<meta name="revisit-after" content="31 Days" />
The revisit-after meta tag is useful for sites where the content changes often and tells the search
engine how often to revisit your site. The example below will tell the search engine to revisit your site ever 31 days.
<meta name="expires" content="never"/>
This meta tag is used by responsible web masters to let the search engine know when the page expires
and can be removed from the search engines directory. It can either be set to never, or a date in
the format day, month, year, eg. 28 June 2003.
<meta name="distribution" content="global" />
Tells the search engine who the page is meant for and can be set to:
global for everyone, local for regional sites, and UI for Internal Use.
<meta name="robots" content="noindex, nofollow" />
This meta tag is used is used to tell the search engine whether you want the web page indexed or not.
You only really need to use this meta tag if you don't want your web page indexed. The values for this tag are:
index(default): Index the page
noindex: Don't index the page
nofollow: Don't index any pages hyper-linked to this page
none: Same as "noindex, nofollow"
You can have a robots.txt file instead of this meta tag.
2008-03-01
Autostart i Windows
Windows
Nycklar som kontrollerar autostarten i Windows:
1) HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
2) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
3) HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
4) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
5) HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices
6) HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
7) HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce\Setup
Samtliga dessa nycklar gäller för Windows 95, 98, och Me, medan Windows NT 4.0, 2000, XP och Vista bara använder de fyra första.
Under systemstarten utförs kommandona i dessa nycklar i följande ordning:
6
5
Inloggning
3
1
2
Program i Autostart-mappen körs
4
Nyckel 7 utnyttjas enbart vid installation av Windows, samt efter användning av "Lägg till/ta bort program".
När program i denna nyckel körs visas en framstegsdialogruta, vilket inte är fallet för övriga nycklar.
Alla nycklar i 5 och 6 körs asynkront, oberoende av varandra och tar de tid på sig kan inloggningen starta
innan programmen körts klart.
Alla program under 3 körs däremot efter varandra, om än i en obestämd ordning, vilket också betyder att
de väntar på 5 och 6 innan de startar. Efter detta körs sedan även 1 och 2 asynkront.
Nycklarna 1 till och med 4 körs varje gång en ny användare loggar in.
Allt detta leder till att det inte går att vara säker på i vilken ordning program i Windows startar
och att det kan fungera lite olika beroende på exempelvis om automatisk inloggning är vald.
Nycklarna 3 och 4 körs normalt inte alls i Felsäkert läge, men kan tvingas att göra det genom att
namnet på aktuellt värde i nyckeln föregås av en asterisk. Detta gäller alla system utom Windows 95 och NT4 före Service Pack 3.
För nycklarna 3,4 och 6 raderas värdet ur registret innan kommandot körs. Resultatet av detta blir
att om en RunOnce-körning misslyckas kommer den ändå inte att köras på nytt. Detta kan kringgås
genom att värdenamnet föregås av ett utropstecken. Värdet raderas då inte förrän efter att kommandot har genomförts.
