All Projects → Arvanaghi → Sessiongopher

Arvanaghi / Sessiongopher

SessionGopher is a PowerShell tool that uses WMI to extract saved session information for remote access tools such as WinSCP, PuTTY, SuperPuTTY, FileZilla, and Microsoft Remote Desktop. It can be run remotely or locally.

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Sessiongopher

Red-Team-Essentials
This repo will contain some basic pentest/RT commands.
Stars: ✭ 22 (-97.36%)
Mutual labels:  pentesting, red-team
Dumpsterfire
"Security Incidents In A Box!" A modular, menu-driven, cross-platform tool for building customized, time-delayed, distributed security events. Easily create custom event chains for Blue- & Red Team drills and sensor / alert mapping. Red Teams can create decoy incidents, distractions, and lures to support and scale their operations. Build event sequences ("narratives") to simulate realistic scenarios and generate corresponding network and filesystem artifacts.
Stars: ✭ 775 (-6.96%)
Mutual labels:  pentesting, red-team
Pentmenu
A bash script for recon and DOS attacks
Stars: ✭ 288 (-65.43%)
Mutual labels:  pentesting, red-team
awesome-list-of-secrets-in-environment-variables
🦄🔒 Awesome list of secrets in environment variables 🖥️
Stars: ✭ 538 (-35.41%)
Mutual labels:  pentesting, red-team
Red Teaming Toolkit
This repository contains cutting-edge open-source security tools (OST) for a red teamer and threat hunter.
Stars: ✭ 5,615 (+574.07%)
Mutual labels:  pentesting, red-team
linux-rootkits-red-blue-teams
Linux Rootkits (4.x Kernel)
Stars: ✭ 56 (-93.28%)
Mutual labels:  pentesting, red-team
Aiodnsbrute
Python 3.5+ DNS asynchronous brute force utility
Stars: ✭ 370 (-55.58%)
Mutual labels:  pentesting, red-team
Hack Tools
The all-in-one Red Team extension for Web Pentester 🛠
Stars: ✭ 2,750 (+230.13%)
Mutual labels:  pentesting, red-team
Dref
DNS Rebinding Exploitation Framework
Stars: ✭ 423 (-49.22%)
Mutual labels:  pentesting, red-team
Packetwhisper
PacketWhisper: Stealthily exfiltrate data and defeat attribution using DNS queries and text-based steganography. Avoid the problems associated with typical DNS exfiltration methods. Transfer data between systems without the communicating devices directly connecting to each other or to a common endpoint. No need to control a DNS Name Server.
Stars: ✭ 405 (-51.38%)
Mutual labels:  pentesting, red-team
Red Team Infrastructure Wiki
Wiki to collect Red Team infrastructure hardening resources
Stars: ✭ 2,981 (+257.86%)
Mutual labels:  pentesting, red-team
Platypus
🔨 A modern multiple reverse shell sessions manager wrote in go
Stars: ✭ 559 (-32.89%)
Mutual labels:  pentesting, red-team
Physmem2profit
Physmem2profit can be used to create a minidump of a target hosts' LSASS process by analysing physical memory remotely
Stars: ✭ 244 (-70.71%)
Mutual labels:  pentesting, red-team
ShonyDanza
A customizable, easy-to-navigate tool for researching, pen testing, and defending with the power of Shodan.
Stars: ✭ 86 (-89.68%)
Mutual labels:  pentesting, red-team
Hrshell
HRShell is an HTTPS/HTTP reverse shell built with flask. It is an advanced C2 server with many features & capabilities.
Stars: ✭ 193 (-76.83%)
Mutual labels:  pentesting, red-team
Black Hat Rust
Applied offensive security with Rust - Early access - https://academy.kerkour.com/black-hat-rust?coupon=GITHUB
Stars: ✭ 331 (-60.26%)
Mutual labels:  pentesting, red-team
Aggressor scripts
A collection of useful scripts for Cobalt Strike
Stars: ✭ 126 (-84.87%)
Mutual labels:  pentesting, red-team
Airmaster
Use ExpiredDomains.net and BlueCoat to find useful domains for red team.
Stars: ✭ 150 (-81.99%)
Mutual labels:  pentesting, red-team
Infosec reference
An Information Security Reference That Doesn't Suck; https://rmusser.net/git/admin-2/Infosec_Reference for non-MS Git hosted version.
Stars: ✭ 4,162 (+399.64%)
Mutual labels:  pentesting, red-team
Bigbountyrecon
BigBountyRecon tool utilises 58 different techniques using various Google dorks and open source tools to expedite the process of initial reconnaissance on the target organisation.
Stars: ✭ 541 (-35.05%)
Mutual labels:  pentesting, red-team

Copyright 2017 FireEye, created by Brandon Arvanaghi (@arvanaghi)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


SessionGopher

Quietly digging up saved session information for PuTTY, WinSCP, FileZilla, SuperPuTTY, and RDP

SessionGopher is a PowerShell tool that finds and decrypts saved session information for remote access tools. It has WMI functionality built in so it can be run remotely. Its best use case is to identify systems that may connect to Unix systems, jump boxes, or point-of-sale terminals.

SessionGopher works by querying the HKEY_USERS hive for all users who have logged onto a domain-joined box at some point. It extracts PuTTY, WinSCP, SuperPuTTY, FileZilla, and RDP saved session information. It automatically extracts and decrypts WinSCP, FileZilla, and SuperPuTTY saved passwords. When run in Thorough mode, it also searches all drives for PuTTY private key files (.ppk) and extracts all relevant private key information, including the key itself, as well as for Remote Desktop (.rdp) and RSA (.sdtid) files.

Usage

-Thorough: searches all drives for PuTTY private key (.ppk), Remote Desktop Connecton (.rdp), and RSA (.sdtid) files.

-o: outputs the data to a folder of .csv files

-iL: provide a file with a list of hosts to run SessionGopher against, each host separated by a newline. Provide the path to the file after -iL.

-AllDomain: SessionGopher will query Active Directory for all domain-joined systems and run against all of them.

-Target: a specific host you want to target. Provide the target host after -Target.

To run locally

. .\SessionGopher.ps1
Invoke-SessionGopher -Thorough

To run remotely (-iL, -AllDomain, -Target)

To run remotely, you can either provide a privileged account's credentials for the remote system using the -u and -p flags. If you omit the -u and -p flags, SessionGopher will run under the security context of the account from which you run the script (e.g. if you are already logged in as DA account, or logged in as an account that is local admin for the target system, or doing a runas with either of the two, you won't need to supply credentials).

Import-Module path\to\SessionGopher.ps1;
Invoke-SessionGopher -AllDomain -u domain.com\adm-arvanaghi -p [email protected]

or

Import-Module path\to\SessionGopher.ps1;
Invoke-SessionGopher -iL computerlist.txt -u domain.com\adm-arvanaghi -p [email protected] -o

or

Import-Module path\to\SessionGopher.ps1;
Invoke-SessionGopher -Target brandonArvanaghi_win7 -Thorough

Any of these commands can be coupled with -Thorough, but note that it takes significantly longer as it queries the entire remote filesystem. It is not recommended you run in -Thorough mode when querying more than a small set of systems at a time.

Running remotely by adding -o (print to CSV) works nicely, as SessionGopher will accumulate all sessions it finds and tell you exactly where it found that saved session.

To write to CSV (whether remote or local)

To have SessionGopher create a folder to neatly contain .csvs of the extracted sessions:

Import-Module path\to\SessionGopher.ps1;
Invoke-SessionGopher -AllDomain -o

... that's it.

Accessing the saved session information for every user in HKEY_USERS requires local admin privileges. Without local admin privileges, you will still receive saved session information for that user.

Sample output (-Thorough):

[+] Digging on Win7-Arvanaghi ...
WinSCP Sessions

Session  : [email protected]
Hostname : 198.273.212.334
Username : admin-anthony
Password : Super*[email protected]

Session  : [email protected]
Hostname : 204.332.455.213
Username : Freddy
Password : angelico1892

FileZilla Sessions

Name     : BarrySite
Password : [email protected]
Host     : 10.8.30.21
User     : BarryAllen
Protocol : Use FTP over TLS if available
Account  : BarryAllenAccount
Port     : 22

PuTTY Sessions

Session  : PointOfSaleTerminal
Hostname : 10.8.0.10

PuTTY Private Key Files (.ppk)

Path                   : C:\Users\Brandon Arvanaghi\Documents\mykey.ppk
Protocol               : ssh-rsa
Comment                : rsa-key-20170116
Private Key Encryption : none
Private Key            : {AAABAEazxtDz6E9mDeONOmz07sG/n1eS1pjKI8fOCuuLnQC58LeCTlysOmZ1/iC4, g4HyRpmdKJGhIxj66/RQ135hVesyk02StleepK4+Tnvz3zmdr4Do5W99qKkrWI3D, T9GOxOIoR9Zc6j57D+fdesJq4ItEIxcQZlXC1F9KZcbXjSJ3iBmCsbG/aRJmMJNx, 
                         nCMaZkySr4R4Z/E+l1JOzXaHh5WQ2P0K4YM1/6XG6C4VzDjvXwcY67MYsobTeCR2...}
Private MAC            : b7e47819fee39a95eb374a97f939c3c868f880de


Microsoft Remote Desktop (RDP) Sessions

Hostname : us.greatsite.com
Username : Domain\tester 

Microsoft Remote Desktop .rdp Files

Path                    : C:\Users\Brandon Arvanaghi\Desktop\config\PenTestLab-Win.RDP
Hostname                : dc01.corp.hackerplaypen.com
Gateway                 : rds01.corp.hackerplaypen.com
Prompts for Credentials : No
Administrative Session  : Does not connect to admin session on remote host


Written by Brandon Arvanaghi (@arvanaghi)

This code was initially developed at FireEye. However, any subsequent update is done by the author outside of FireEye.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].