powershell.exe -ExecutionPolicy Bypass -File path\to\script.ps1
Yes, it really is that easy.
powershell.exe -ExecutionPolicy Bypass -File path\to\script.ps1
>>> import requests
>>> r = requests.get('https://fullyqualifiedurl.com')
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
>>> import requests
>>> r = requests.get('https://fullyqualifiedurl.com', verify=False)
/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:843: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
>>> import requests
>>> import urllib3
>>> urllib3.disable_warnings()
>>> r = requests.get('https://fullyqualifiedurl.com', verify=False)
>>> r.status_code
200
>>> import requests
>>> from requests.packages import urllib3
>>> urllib3.disable_warnings()
>>> r = requests.get('https://fullyqualifiedurl.com', verify=False)
>>> r.status_code
200
try:
import urllib3
except ImportError:
from requests.packages import urllib3
powercfg.exe -H off
# yum -y install net-tools
> Get-ADDomainController -Filter * -server <domain> | Select-Object name, domain
> Get-ChildItem | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item
> Get-ChildItem -Recurse | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item
> Get-ChildItem -Recurse | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item -Recurse
> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 122
> (get-host).version Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 122
$ hdiutil convert ~/dban-2.3.0_i586.iso -format UDRW -o ~/dban-2.3.0_i586.dmg Reading DBAN (Apple_ISO : 0)… ............................................................................. Elapsed Time: 1.172s Speed: 13.6Mbytes/sec Savings: 0.0% created: /Users/myaccount/src/os/dban-2.3.0_i586.dmg
$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *250.1 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS OS X 249.7 GB disk0s2 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: Apple_partition_scheme *17.4 MB disk1 1: Apple_partition_map 32.3 KB disk1s1 2: Apple_HFS Flash Player 17.4 MB disk1s2 /dev/disk2 #: TYPE NAME SIZE IDENTIFIER 0: Apple_partition_scheme *18.1 MB disk2 1: Apple_partition_map 32.3 KB disk2s1 2: Apple_HFS Flash Player 18.1 MB disk2s2 /dev/disk3 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *8.0 GB disk3 1: DOS_FAT_32 UNTITLED 1 8.0 GB disk3s1
$ diskutil unmountDisk /dev/disk3 Unmount of all volumes on disk3 was successful
$ sudo dd if=dban-2.3.0_i586.dmg of=/dev/disk3 bs=1m Password: 15+1 records in 15+1 records out 16719872 bytes transferred in 6.551918 secs (2551905 bytes/sec)
$ diskutil eject /dev/disk3 Disk /dev/disk3 ejected
> Get-NetConnectionProfile Name : Network 2 InterfaceAlias : Integrated InterfaceIndex : 8 NetworkCategory : Public IPv4Connectivity : Internet IPv6Connectivity : NoTraffic
> Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
$ echo "Hello world!" > ~/output.txt $ cat ~/output.txt Hello world!
$ echo "Hello again world!" >> ~/output.txt $ cat ~/output.txt Hello world! Helo again world!
$ echo "Hello world!" | tee ~/output.txt Hello world! $ cat ~/output.txt Hello world!
$ echo "Hello again world!" | tee -a ~/output.txt Hello again world! $ cat ~/output.txt Hello world! Helo again world!
>sc delete <service name>
$ wget https://ftp.mozilla.org/pub/firefox/releases/44.0.2/linux-x86_64/en-US/firefox-44.0.2.tar.bz2
$ curl icanhazip.com
$ ssh myaccount@server $ cat /etc/ssh/sshd_config | grep AuthenticationMethods
$ ssh-keygen -b 521 -E sha256 -o -t ecdsa
$ ls -l ~/.ssh/ total 16 -rw------- 1 myaccount myaccount 736 Feb 6 15:33 id_ecdsa -rw-r--r-- 1 myaccount myaccount 268 Feb 6 15:33 id_ecdsa.pub -rw------- 1 myaccount myaccount 1386 Feb 8 20:46 known_hosts
$ scp ~/.ssh/id_ecdsa.pub myaccount@server:~/
$ ssh myaccount@server
$ cat id_ecdsa.pub >> ~/.ssh/authorized_keys
$ ssh -l bandit0 bandit.labs.overthewire.org
$ cat readme boJ9jbbUNNfktd78OOpsqOltutMc3MY1
$ cat ./- CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9
$ cat spaces\ in\ this\ filename UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK
$ ls inhere $ ls -a inhere/ . .. .hidden $ cat inhere/.hidden pIwrPrtPN36QITSp3EQaw936yaFoFgAB
$ file inhere/* ./-file00: data ./-file01: data ./-file02: data ./-file03: data ./-file04: data ./-file05: data ./-file06: data ./-file07: ASCII text ./-file08: data ./-file09: data $ cat inhere/-file07 koReBOKuIDDepwhWk7jZC0RTdopnAYKh
$ ls /etc/ssh | grep .pub ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_ecdsa_key ssh_host_ecdsa_key.pub ssh_host_ed25519_key ssh_host_ed25519_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub
$ cat ssh_host_ecdsa_key.pub | cut -d" " -f1 ecdsa-sha2-nistp256
# ssh-keygen -b 521 -o -t ecdsa -f /etc/ssh/ssh_host_ecdsa_p521_key
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
$ cat sshd_config | grep HostKey # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key HostKey /etc/ssh/ssh_host_ed25519_key
# echo HostKey /etc/ssh/ssh_host_ecdsa_p521_key >> /etc/ssh/sshd_config
# /etc/init.d/ssh restart
# usermod -a -G sudo <username>
# adduser <username> sudo
# deluser <username> sudo
/etc/network/interfaces
$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp
$ sudo cp /etc/network/interfaces /etc/network/interfaces.bak
iface eth0 inet dhcp
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.5
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255$ sudo /etc/init.d/networking restart
$ /sbin/ifconfig eth0