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
typedef struct chan_t | |
{ | |
pthread_mutex_t m_mu; | |
pthread_cond_t m_cond; | |
int closed; | |
void (* dispose)(struct chan_t * self); | |
... | |
} chan_t; |
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
nmap --script-updatedb | |
get https://svn.nmap.org/nmap/nselib/tls.lua and put it in /usr/share/nmap/nselib/ | |
get http://nmap.org/svn/scripts/ssl-heartbleed.nse and put it in /usr/share/nmap/scripts | |
nmap -d --script ssl-heartbleed --script-trace --script-args vulns.showall -sV 10.1.0.0/16 |
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
import nmap | |
nm=nmap.PortScanner() | |
nm.scan('10.1.0.0/16', '445', arguments='--script=/usr/local/share/nmap/scripts/smb-os-discovery.nse') |
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
import socket | |
from struct import * | |
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP) | |
#'!BBBHHHHHHBBBBH5s5s' | |
while True: | |
packet= s.recvfrom(65565) | |
print packet | |
packet =packet[0] | |
print "\n",packet |
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
import gobject | |
from scapy.all import * | |
loop = gobject.MainLoop() | |
ethernet1 = conf.L2listen(type=ETH_P_ALL, iface='eth0') | |
def ethernet1_handler(packet): | |
return packet.summary() | |
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
# Sending ICMP HOST UNREACHABLE USING SCAPY (PYTHON TOOLS) | |
# Will WORK for UDP/TCP, just give the "packet" (scapy's representation) | |
def send_icmp_unreachable (packet): | |
global MYMAC | |
global IPGATEWAY | |
global INTERFACE | |
p = Ether(src=MYMAC, dst=packet.src)/IP(src=IPGATEWAY, dst=packet.getlayer(IP).src) | |
# ICMP type=3 code=1 Host Unreachable |
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
from bitstring import ConstBitArray, BitStream | |
# Opening from a file means that it won't be all read into memory | |
s = ConstBitArray(filename='test.ts') | |
outfile = open('test_nonull.ts', 'wb') | |
# Cut the stream into 188 byte packets | |
for packet in s.cut(188*8): | |
# Take a 13 bit slice and interpret as an unsigned integer | |
PID = packet[11:24].uint |
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
with GNAT.Regexp; | |
with Ada.Text_IO; | |
procedure logs_to_process is | |
Filename : String := "logs_to_process.txt"; | |
File : Ada.Text_IO.File_Type; | |
Line_Count : Natural := 0; | |
ECD_Pattern : String := "*FILENAME*.ECD*"; | |
ETD_Pattern : String := "*FILENAME*.ETD*"; |
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
type Index is range 1 .. 3; | |
type Ada_Vector is array (Index) of Float; | |
type C_Vector is array (Index) of C_Float; | |
function To_C (Item : in Ada_Vector) return C_Vector is | |
begin | |
return Result : C_Vector do | |
for I in Index loop | |
Result (I) := C_Float (Item (I)); | |
end loop; |
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
with Ada.Text_IO; with ADA.IO_EXCEPTIONS; | |
with Ada.Command_Line; | |
with Ada.Directories; | |
with Ada.Strings.Bounded; | |
procedure FileInfo is | |
-- rename used packages | |
package IO renames Ada.Text_IO; | |
package FS renames Ada.Directories; | |
package Cmd renames Ada.Command_Line; |
NewerOlder