Skip to content

Instantly share code, notes, and snippets.

View aduzsardi's full-sized avatar
🛠️
d(0_0)b

Alexandru Duzsardi aduzsardi

🛠️
d(0_0)b
View GitHub Profile
@aduzsardi
aduzsardi / lcap_bonding_setup
Created July 25, 2017 07:48
configure LCAP bonding Linux - Cisco IOS
# ---- START Cisco IOS ----
interface Port-channel2
description LACP Channel for mk2
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,2
switchport mode trunk
spanning-tree portfast trunk
!
interface GigabitEthernet1/0/23
description mk2 eth0
@aduzsardi
aduzsardi / gist:08a56c035ff3478d98e3e25d58e0b044
Created July 25, 2017 07:56
Viewing Truncated PowerShell Output
# Column Width
PS > Get-CsAnalogDevice | ft Identity,RegistrarPool -> Get-CsAnalogDevice | ft Identity,RegistrarPool | out-string -Width 160
# Collections / Arrays
# It might be that the object you’re looking at is an array (a “collection”), and PowerShell is only showing the first few entries in that array, rather than the lot.
# Here, the fix is to change the $FormatEnumerationLimit value. If you type it on its own into PowerShell the current value – probably 3 – will be returned. If you set a new value of -1, it’ll output ALL entries in your collection.
PS > $FormatEnumerationLimit
3
PS > $FormatEnumerationLimit=-1
# https://www.rationallyparanoid.com/articles/tcpdump.html
# DHCP debugging with tcpdump
# filter to match DHCP packets including a specific Client MAC Address:
tcpdump -i br0 -vvv -s 1500 '((port 67 or port 68) and (udp[38:4] = 0x3e0ccf08))'
# filter to capture packets sent by the client (DISCOVER, REQUEST, INFORM):
tcpdump -i br0 -vvv -s 1500 '((port 67 or port 68) and (udp[8:1] = 0x1))'
# Monitoring on interface eth0
@aduzsardi
aduzsardi / hping_examples
Created July 25, 2017 08:22
Hping usage examples
https://www.rationallyparanoid.com/articles/hping.html
Hping usage examples
Often considered a complementary tool to Nmap, hping is used for network scanning, as well as crafting TCP/IP packets. Please note that given the packet crafting involved, if you are running as root yet you receive an error saying that the operation is not permitted it could be due to a host firewall.
Send TCP SYN packets to port 0 on host example.com (note that hping will increment the source port by 1 for each packet sent):
hping example.com -S -V
Send TCP SYN packets to port 443 on host example.com:
hping example.com -S -V -p 443
@aduzsardi
aduzsardi / netcat_examples
Created July 25, 2017 08:24
Netcat usage examples
https://www.rationallyparanoid.com/articles/netcat.html
Netcat usage examples
The following commands were done on the Linux version of Netcat.
Connect to TCP port 80 on host example.com:
nc -vv example.com 80
Port scan TCP ports 7 through 1023 on host example.com
nc -v -z example.com 7-1023
@aduzsardi
aduzsardi / wget_examples
Created July 25, 2017 08:26
Wget usage examples
https://www.rationallyparanoid.com/articles/wget.html
Wget is a command-line tool for retrieving files using HTTP, HTTPS or FTP.
Retrieve /images/pic01.jpg from host example.com:
wget http://example.com/images/pic01.jpg
Retrieve /images/pic01.jpg from host example.com, specifying the user agent for IE7 on a Windows XP SP2 system instead of "Wget/1.xx":
wget --user-agent="Mozilla/4.0 (Windows; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" http://example.com/images/pic01.jpg
Retrieve /images/pic01.jpg from host example.com, specifying "http://anothersite.example.com/search?hl=en&q=pictures" as the referer:
@aduzsardi
aduzsardi / Apple-Intel-Netboot
Created July 25, 2017 08:28
Getting *nix to Netboot Macs
http://brandon.penglase.net/index.php?title=Getting_*nix_to_Netboot_Macs
class "Apple-Intel-Netboot" {
2 # Limit this class to only Intel Apple machines
3 match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386";
4 option dhcp-parameter-request-list 1,3,17,43,60; # Send these options to the client (possibly forcing it, if the client didn't request it)
5 # From: http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml
6 # 1 - Subnet Mask
7 # 3 - Router
8 # 17 - Root Path
@aduzsardi
aduzsardi / remote-gsettings-change
Created July 25, 2017 08:30
How to change Gsettings via remote shell
https://askubuntu.com/questions/457016/how-to-change-gsettings-via-remote-shell
#!/bin/bash
# Remember to run this script using the command "source ./filename.sh"
# Search these processes for the session variable
# (they are run as the current user and have the DBUS session variable set)
compatiblePrograms=( nautilus kdeinit kded4 pulseaudio trackerd )
@aduzsardi
aduzsardi / gist:2e9f12846fd914cf05226c491c1e623e
Created July 25, 2017 08:34
Run AD Users & Computers As Another User
On a elevated command prompt run this....
runas /u:<domainB>\<username> /netonly mmc
On prompt.. type your domainB password.
Click File --> Add/Remove Snap-in
Choose Active Directory Users and Computers (from left side pane)
Click Add >
Click Ok
@aduzsardi
aduzsardi / cisco_port_fwd
Created July 25, 2017 08:39
cisco ios port forwaring
ip nat inside source static tcp 10.51.2.13 443 88.88.8.88 443 extendable