CSS lab manual printout
CSS lab manual printout
import java.security.MessageDigest;
import
java.security.NoSuchAlgorithmExceptio
n; import java.security.SecureRandom;
public class SimpleMD5Exarnple
String passwordToHash =
"password"; String
generatedPassword = null; try
{
// Create MessageDigest instance for MD5
// for hashing using MD5 can be replaced by SHAI in following line
MessageDigest md = MessageDigest.getInstance("MD5");
//Add password bytes to digest
md.update(passwordToHash.getByt
es()); //Get the hash's
catch (NoSuchAlgorithmException e)
e.printStackTrace();
System.out.println(generatedPassword);
Output
The message digest produced as output is A, B, C, D. That is, we begin with the low order byte of A, and
End with the highorder byte of D.
1. Configure Response Wait Time
The -w option expects a value which the utility will take as the response time to
wait for.
In this example, the wait time is 0.1 seconds and the traceroute utility was
traceroute unable to waitfor any and it printed all the *'s.
google.com -w 0.1 traceroute to google.com
(74.125.236.101), 30 hops max, 60 byte
***
29 * * *
The traceroute utility sends 3 packets per hop to provide 3 round trip times. This default value of 3 is
configurable using the option _-q'. This option expects an integer which itsets as new value of number of
probes per hop.
2. nslookup :
The nslookup command is used to query internet name servers interactively forinformation.
nslookup, which stands for "name server lookup", is a useful tool for finding outinformation about
a named domain.By default, nslookup will translate a domain name to an IP address (or vice versa).
Forinstance, to find out what the IP address of microsoft.com is, you could run the command:
nslookup Inicrosott.com
...and you would receive a response like this:
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name:
microsoft.com Address:
134.170.185.46
Name: microsoft.com Address:
134.170.188.221
Installation ofNmap:
tsuool Tor
try arrv. try
Sudoi paas•rd Tar
eed to gee te
Uttei•thli
t.ar» tn (Zee
cuetantiv roe"'tng
-O (Enable OS detection)
Enables OS detection, as discussed above. Alternatively, you can use -A to enable
OS detection along with other things.
starttnø S.2t at Zøü.02-Ü.i6:zo Nnap sc.n
report for 192.
,Htst Is up (e.eODb16s lateney)J
1660 seamed ports on 'are eloSed
co nany fingerprints natch this host to glye"$peetfié OS details
Otstamce; e bops os detection Frfornede "pore ony tnnap done: i XP
(1 sudo up) scanned •A tn 2.1? seeoås
Starting 5.21 ( http:/lnnap.orø ) at .2DiT-D2;n
'Imp report ton 192.168-4,144 ost ts OD
te.6#917s tatency).•
'±catltæd ports nany fingerprints match thts host to
specific OS details
"*tugrk Discarwev hops
OS and servtee detectton perrorned. Ptea" repen any Incorrect resuLts at tittpt
nnøp oddress (i host up) seanned seconds
The above script is a simple example of authenticating a user with a username and a password against a database
with a table named users, and a username and password column.
The above script is vulnerable to SQL injection because an attacker could submit malicious input in such a way
that would alter the SQL statement being executed by the database server.
A simple example of an SQL injection payload could be something as simple as setting the password field to
password' OR 1=1.
This would result in the following SQL query being run against the database server.
- MySQL
1=8 1'
#
' OR '1
-- Access (using null characters)
OR '1'='1' 0/000' OR '1'='1' 0/016