Command Line Kung Fu

14 March 2017

source: http://blog.commandlinekungfu.com/p/index-of-tips-and-tricks.html

Auditing

The Advantage of "sort" to View Passwords
Avoiding LANMAN False Positives
"chage" to Get/Set Password Security Parameters
Change a User's Password to Blank
Find Accounts With Superuser Privileges
Finding Duplicate User IDs
Finding Null Passwords
Lock Out Users Remotely While Preserving Session
Lock Screen With "tsdiscon"
"net use" and The Blank Passwords
Show Account Security Settings
Show Domain-Wide Settings For Accounts
Suspicious Password Entries
Why "wmic" Remote Lock Fails?
"wmic" to Display Users' SID
Workaround to View Windows Password Hashes


Forensics

Better "find" with touch
Determine where a USB device was plugged into
Display File Creation Time
Listing Files by Inode as a Proxy for Creation Time
Remotely Pull USB info
Show USB vendor/serial number 
USB History
Watch File Count in a Directory

Network Troubleshooting

Hack to Pull Out a Specific Protocol From "netstat" Output (Linux)
Kill Process by TCP/UDP port number
Learn About Network Traffic
"netstat" vs "lsof"
Protocol Stats
"watch" vs "netstat -c" 

Penetration Testing

The Broadcast Ping
Command-Line Ping Sweeper
Detecting when a scan reaches a given target
Firewall Chains
Look at Firewall Configs
Reverse DNS Records
See the Number of Times a Firewall Rule Was Triggered
Show Ports Allowed Through Firewall
Show Programs Allowed Through Firewall
Speed Up Ping


System Administration


Aborting a System Shutdown
Browsing the Registry with Powershell  
Careful with iptables "INPUT"
Converting Unix timestamps to human-readable form 
Disable The Guest Account 
Dropping Firewall Dead
Execute a Command En Mass
"find ...| xargs ..." vs "find ... -exec ..."
"findstr /m" to Print Only File Name
Find Files That Only Contain Printable ASCII With "findstr /p" (But be Aware)
Finding Names of Files Matching a String
Having Fun with Firewall
The Importance of Putting Your System's Hostname
IPTables or The Simplified Firewall Configuration
Linking Files
Listing Files and Their Sizes
Listing the largest 100 files
Poke Holes Through The Firewall
Reboot in [N] Seconds
Remote Command Execution
Simplify Your Life With "ufw"
SSH: Using "user@host" vs "-l" 
Symlink to an Entire Directory
What is hogging up the space?
WScript to Create Link For Files and Folders

Text Manipulation

Backup Before You Change With "sed"
Build Your Own "uniq" Command on Windows
Convert Multiple-Line Output into a Single Line Using "tr"
Convert Text Formats - Dos to Unix
Extra Little File to Help
"for" loops to parse text
Have "sed" Use Extended Regular Expressions
Replacing Strings in Multiple Files
Replacing Text Powershell Way
The Single Quote, The Double Quote, and The "FOR" Loop
When "sed" is better than "awk"

 

Metasploit Joseph McCray

20 March 2016

decompile / bug bounty of manufacturer firmware

13 March 2016

GIAC - GREM

6 March 2016

default dll used by powerpoint

4 March 2016

Check DROWN of attack possibility

3 March 2016

openssl s_client -ssl2 -connect wodzinski.waw.pl:443

https://drownattack.com/

Blind SQL injections

16 February 2016

Internet Explorer Exploit

12 February 2016

CVE-2016-0061:

 

<meta http-equiv=X-UA-Compatible content=IE=7><form id="&;&;"><body onload=opener?opener["\u4141\u4141"]():open("?")>

Vulnerability Severity Ratings and Impact

CVE number

Vulnerability title

Internet Explorer 9

Internet Explorer 10

Internet Explorer 11

Internet Explorer 11
on Windows 10

CVE-2016-0061

Microsoft Browser Memory Corruption Vulnerability

Windows Clients
Critical / RCE

Windows Servers:
Moderate / RCE

Windows Clients
Critical / RCE

Windows Servers:
Moderate / RCE

Windows Clients
Critical / RCE

Windows Servers:
Moderate / RCE

Windows Clients
Critical / RCE

Windows Servers:
Moderate / RCE

 

CVE-2016-0062

https://technet.microsoft.com/en-us/library/security/ms16-009.aspx

<body onload=open("2.html")>

Vulnerability Severity Ratings and Impact

Vulnerability title

Internet Explorer 9

Internet Explorer 10

Internet Explorer 11

Internet Explorer 11
on Windows 10

CVE-2016-0062

Microsoft Browser Memory Corruption Vulnerability

Not applicable

Not applicable

Windows Clients
Critical / RCE

Windows Servers:
Moderate / RCE

 

Protection of system security

3 November 2015