Answer:Remove empty array elements (PHP)
$emptyRemoved = array_filter($linksArray);
http://stackoverflow.com/a/3654335
ref: https://twitter.com/sornram9254/status/737673183155740672
การเขียน Program , การสร้าง website ฯลฯ
$emptyRemoved = array_filter($linksArray);
http://stackoverflow.com/a/3654335
ref: https://twitter.com/sornram9254/status/737673183155740672
$array = array_values($array);
http://stackoverflow.com/a/5943165
ref: https://twitter.com/sornram9254/status/737696350146437120
$_SERVER['REQUEST_METHOD']
http://stackoverflow.com/a/359050
ref: https://twitter.com/sornram9254/status/738063120422174720
There is a ByteViewer Control directly available in the .NET Framework. Here is how you can use it in a sample Winforms C# application (note: you need to reference the System.Design assembly):
Namespace: System.ComponentModel.Design
Assembly: System.Design (in System.Design.dll)
public Form1()
{
InitializeComponent();
…
ByteViewer bv = new ByteViewer();
bv.SetFile(@”c:\windows\notepad.exe”); // or SetBytes
Controls.Add(bv);
}
Answer:Recommendations for a Hex Viewer Control for Windows.Forms? https://t.co/iXEsLSxP09
— ศรรามไงจะใครล่ะ❤️ (@sornram9254) May 4, 2016
http://stackoverflow.com/a/23344431
$postdata = http_build_query(
array(
‘var1’ => ‘some content’,
‘var2’ => ‘doh’
)
);
$opts = array(‘http’ =>
array(
‘method’ => ‘POST’,
‘header’ => ‘Content-type: application/x-www-form-urlencoded’,
‘content’ => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents(‘http://example.com/submit.php’, false, $context);
Answer:How to post data in PHP using file_get_contents? https://t.co/lhxCPcsDv0
— ศรรามไงจะใครล่ะ❤️ (@sornram9254) April 29, 2016
http://stackoverflow.com/a/2445332
Position Value
——– ——
0 0x4D
1 0x5A
2 0x90
4 0x03
8 0x04
12 0xFF
13 0xFF
16 0xB8
24 0x40
using (var stream = new FileStream(path, FileMode.Open, FileAccess.ReadWrite)) {
stream.Position = 24;
stream.WriteByte(0x04);
}
ref: http://stackoverflow.com/a/3217953?stw=2
var numbers = new [] { 1, 2, 3, 4 };
var words = new [] { “one”, “two”, “three”, “four” };var numbersAndWords = numbers.Zip(words, (n, w) => new { Number = n, Word = w });
foreach(var nw in numbersAndWords)
{
Console.WriteLine(nw.Number + nw.Word);
}
ref: http://stackoverflow.com/a/1955780?stw=2
First you need to choose a platform and a piece of software to attack. To begin I would choose something that is open source. There are several advantages to this; the main one being that you can look at the source code. You then need to pick an aspect that you would like to attack. For example, maybe you want to attack the UDP implementation of the Linux networking stack.
Performing an analysis on a closed source piece of software means you’re disassembling the binary, rooting through instructions, and debugging the process. This is long and tedious. Better to get a grasp as to what breaks code with source code before you go looking for it in disassembly.
By being specific in your target allows you to systematically analyze a piece of software.
With your target in mind begin your analysis of the portion of the software you want to find vulnerabilities.
These are just a few of the things you can do to analyze the software. Build a list of possible coding errors.
Now with a list of possible coding flaws you need to determine if you can trigger them. Again, debug messages will help you. Go back to the source code and determine what exactly needs to happen for each coding flaw to break the software. You’re not looking for full exploitation, you just want the code to crash, or do something unexpected. You need to determine what could trigger a coding flaw. This could be anything from affecting a length variable, tricking a function to take a path to process data incorrectly, etc. Some coding flaws just aren’t triggerable, but that’s the nature of vulnerability analysis.
At this point you have a list of flaws, and a list of ideas for each flaw on what might trigger it to do something unexpected.
Now you write code. Using pretty much whatever programming language is convenient for the software you’re attacking. You could write Python code to throw specific packets at network devices to attempt to take down the UDP implementation of a Linux based device.
The goal is to implement your triggers, and hope that the code works the way you think. Your debug messages will be helpful here.
With any luck you’re able to cause something different to happen. Maybe that can lead to code execution, maybe not. That’s a horse of a different color.
Vulnerability analysis takes time. A lot of time. You’re not going to spend a day analyzing software and find 10 vulnerabilities. The unofficial average for vulnerability analysis is 1 vulnerability per 3 months of analysis. You can double that time if you’re analyzing a non-open source project.
via @RoraΖ : http://security.stackexchange.com/a/92003?stw=2
<= .NET 4.0
TimeSpan t = TimeSpan.FromSeconds( secs );
string answer = string.Format(“{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms”,
t.Hours,
t.Minutes,
t.Seconds,
t.Milliseconds);
NET > 4.0
TimeSpan time = TimeSpan.FromSeconds(seconds);
string str = time .ToString(@”hh\:mm\:ss\:fff”);
http://stackoverflow.com/a/463668
Answer:What is the best way to convert seconds into (Hour:Minutes:Seconds:Milliseconds) time? https://t.co/6umeNIWozr
— ศรรามไงจะใครล่ะ❤️ (@sornram9254) March 31, 2016
CMD
wmic process get commandline,processid /format:csv
PowerShell
Get-WmiObject win32_process | select CreationDate,ProcessId,CommandLine|ft -AutoSize
http://superuser.com/a/683052
Answer:How to get the command that invoked a task with tasklist? https://t.co/qVmJCTezYl
— ศรรามไงจะใครล่ะ❤️ (@sornram9254) March 28, 2016